import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__ from "@tachybase/test/e2e";
import * as __WEBPACK_EXTERNAL_MODULE__templatesOfBug_mjs__ from "./templatesOfBug.mjs";
const clickOption = async (page, optionName)=>{
    await page.getByLabel('block-item-CardItem-general-form').hover();
    await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
    await page.getByRole('menuitem', {
        name: optionName
    }).click();
};
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('creation form block schema settings', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('edit block title', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithActionsAndFormBlocks).goto();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await clickOption(page, 'Edit block title');
        await page.getByRole('textbox').click();
        await page.getByRole('textbox').fill('Block title 123');
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        const runExpect = async ()=>{
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-form').getByText('Block title 123', {
                exact: true
            })).toBeVisible();
            await clickOption(page, 'Edit block title');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('textbox')).toHaveValue('Block title 123');
        };
        await runExpect();
        await page.reload();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await runExpect();
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('linkage rules', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('basic usage', async (param)=>{
            let { page, mockPage } = param;
            const openLinkageRules = async ()=>{
                await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
                await page.getByRole('menuitem', {
                    name: 'Linkage rules'
                }).click();
            };
            await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithAddNewAndViewAndEditAndBasicFields).goto();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await page.getByLabel('block-item-CardItem-general-form').hover();
            await openLinkageRules();
            await page.getByRole('button', {
                name: 'plus Add linkage rule'
            }).click();
            await page.getByText('Add condition', {
                exact: true
            }).click();
            await page.getByTestId('select-filter-field').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'singleLineText'
            }).click();
            await page.getByLabel('Linkage rules').locator('input[type="text"]').click();
            await page.getByLabel('Linkage rules').locator('input[type="text"]').fill('123');
            await page.getByText('Add property').click();
            await page.getByTestId('select-linkage-property-field').click();
            await page.getByRole('tree').getByText('longText').click();
            await page.getByTestId('select-linkage-action-field').click();
            await page.getByRole('option', {
                name: 'Disabled'
            }).click();
            await page.getByRole('button', {
                name: 'OK'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeEditable();
            await page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox').click();
            await page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox').fill('123');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeDisabled();
            await page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox').clear();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeEditable();
            await openLinkageRules();
            await page.getByLabel('variable-button').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Current form'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'longText'
            }).click();
            await page.getByRole('button', {
                name: 'OK'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeEditable();
            await page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox').fill('123');
            await page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox').fill('1');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeEditable();
            await page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox').click();
            await page.keyboard.press('Backspace');
            await page.keyboard.press('Backspace');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeDisabled();
            await openLinkageRules();
            await page.getByRole('button', {
                name: 'plus Add linkage rule'
            }).click();
            await page.locator('.ant-collapse-header').nth(1).getByRole('img', {
                name: 'right'
            }).click();
            await page.getByLabel('Linkage rules').getByRole('tabpanel').getByText('Add condition', {
                exact: true
            }).click();
            await page.getByRole('button', {
                name: 'Select field'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'number'
            }).click();
            await page.getByLabel('Linkage rules').getByRole('spinbutton').click();
            await page.getByLabel('Linkage rules').getByRole('spinbutton').fill('123');
            await page.getByLabel('Linkage rules').getByRole('tabpanel').getByText('Add property').click();
            await page.getByRole('button', {
                name: 'Select field'
            }).click();
            await page.getByRole('tree').getByText('longText').click();
            await page.getByRole('button', {
                name: 'action',
                exact: true
            }).click();
            await page.getByRole('option', {
                name: 'Editable'
            }).click();
            await page.getByLabel('Linkage rules').getByRole('tabpanel').getByText('Add property').click();
            await page.getByRole('button', {
                name: 'Select field'
            }).click();
            await page.getByRole('tree').getByText('longText').click();
            await page.getByRole('button', {
                name: 'action',
                exact: true
            }).click();
            await page.getByRole('option', {
                name: 'Value',
                exact: true
            }).click();
            await page.getByLabel('dynamic-component-linkage-rules').getByRole('textbox').fill('456');
            await page.getByLabel('Linkage rules').getByRole('tabpanel').getByText('Add property').click();
            await page.getByRole('button', {
                name: 'Select field'
            }).click();
            await page.getByRole('tree').getByText('integer').click();
            await page.getByRole('button', {
                name: 'action',
                exact: true
            }).click();
            await page.getByRole('option', {
                name: 'Value',
                exact: true
            }).click();
            await page.getByTestId('select-linkage-value-type').nth(1).click();
            await page.getByText('Expression').click();
            await page.getByText('xSelect a variable').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Current form right'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'number'
            }).click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.number-number').getByRole('spinbutton').fill('123');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toBeEditable();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toHaveValue('456');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.integer-integer').getByRole('spinbutton')).toHaveValue('123');
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('variable labels should be displayed normally', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__templatesOfBug_mjs__.T2165).goto();
            await page.getByLabel('block-item-CardItem-users-form').hover();
            await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-users').hover();
            await page.getByRole('menuitem', {
                name: 'Linkage rules'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Current form / Nickname')).toBeVisible();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Current form / Phone')).toBeVisible();
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('nested conditions', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__templatesOfBug_mjs__.T3251).goto();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.email-Email').getByRole('textbox')).toBeEditable();
            await page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox').fill('nickname');
            await page.getByLabel('block-item-CollectionField-users-form-users.username-Username').getByRole('textbox').fill('username');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.email-Email').getByRole('textbox')).toBeDisabled();
            await page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox').clear();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.email-Email').getByRole('textbox')).toBeEditable();
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('after save as block template', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__templatesOfBug_mjs__.T3806).goto();
            await page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox').fill('123');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.username-Username').getByRole('textbox')).toHaveValue('123');
            try {
                await page.getByLabel('block-item-CardItem-users-form').hover();
                await page.getByLabel('designer-schema-settings-CardItem-blockSettings:createForm-users').hover();
                await page.getByRole('menuitem', {
                    name: 'Save as block template'
                }).click();
                await page.getByRole('button', {
                    name: 'OK',
                    exact: true
                }).click();
                await page.waitForTimeout(1000);
                await page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox').fill('456');
                await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.username-Username').getByRole('textbox')).toHaveValue('456');
            } catch (err) {
                throw err;
            } finally{
                await page.goto('/admin/settings/ui-schema-storage');
                await page.getByLabel('Select all').check();
                await page.getByLabel('action-Action-Delete-destroy-').click();
                await page.getByRole('button', {
                    name: 'OK',
                    exact: true
                }).click();
                await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('row', {
                    name: 'Users_Form'
                }).first()).toBeHidden();
            }
        });
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('Save as block template & convert reference to duplicate', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithActionsAndFormBlocks).goto();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await clickOption(page, 'Save as block template');
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await page.getByLabel('block-item-CardItem-general-form').hover();
        await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Save as block template'
        })).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Convert reference to duplicate'
        })).toBeVisible();
        await page.reload();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await page.getByLabel('block-item-CardItem-general-form').hover();
        await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Save as block template'
        })).not.toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Convert reference to duplicate'
        })).toBeVisible();
        await clickOption(page, 'Convert reference to duplicate');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Save as block template'
        })).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Convert reference to duplicate'
        })).not.toBeVisible();
        await page.reload();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await page.getByLabel('block-item-CardItem-general-form').hover();
        await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Save as block template'
        })).toBeVisible();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Convert reference to duplicate'
        })).not.toBeVisible();
        await page.goto('/admin/settings/ui-schema-storage');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('row', {
            name: 'General_Form'
        }).first()).toBeVisible();
        await page.getByLabel('Select all').check();
        await page.getByLabel('action-Action-Delete-destroy-').click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('row', {
            name: 'General_Form'
        }).first()).toBeHidden();
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('delete', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithActionsAndFormBlocks).goto();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await page.getByLabel('block-item-CardItem-general-form').hover();
        await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
        await page.getByRole('menuitem', {
            name: 'Delete'
        }).click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-form')).not.toBeVisible();
        await page.reload();
        await page.getByRole('button', {
            name: 'Add new'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-form')).not.toBeVisible();
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('save as block Template', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyForm).goto();
        await showSettingsMenu(page);
        await page.getByRole('menuitem', {
            name: 'Save as block template'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('dialog').getByRole('textbox')).toHaveValue('General_Form');
        await page.getByRole('dialog').getByRole('textbox').click();
        await page.getByRole('dialog').getByRole('textbox').fill('new_form_template');
        await page.getByRole('dialog').getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await page.getByLabel('block-item-CardItem-general-form').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-form').getByText('Reference template: new_form_template (Fields only)')).toBeVisible();
        await showSettingsMenu(page);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Save as block template'
        })).toBeHidden();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
            name: 'Convert reference to duplicate'
        })).toBeVisible();
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await page.getByRole('menuitem', {
            name: 'form Form right'
        }).first().hover();
        await page.getByRole('menuitem', {
            name: 'General right'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Duplicate template right'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'new_form_template (Fields only)'
        }).click();
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await page.getByRole('menuitem', {
            name: 'form Form right'
        }).first().hover();
        await page.getByRole('menuitem', {
            name: 'General right'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'General right'
        }).click();
        await page.getByRole('menuitem', {
            name: 'Reference template right'
        }).click();
        await page.getByRole('menuitem', {
            name: 'new_form_template (Fields only)'
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-general-form')).toHaveCount(3);
        await page.goto('/admin/settings/ui-schema-storage');
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('row', {
            name: 'new_form_template'
        }).first()).toBeVisible();
        await page.getByLabel('Select all').check();
        await page.getByLabel('action-Action-Delete-destroy-').click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('row', {
            name: 'new_form_template'
        }).first()).toBeHidden();
        async function showSettingsMenu(page) {
            await page.getByLabel('block-item-CardItem-general-form').hover();
            await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
        }
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('form data templates', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('basic usage', async (param)=>{
            let { page, mockPage, mockRecords } = param;
            const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithAddNewAndViewAndEditAndBasicFields).waitForInit();
            const records = await mockRecords('general', 3);
            await nocoPage.goto();
            const record = records.find((item)=>2 === item.id);
            const openDialog = async ()=>{
                await page.getByLabel('block-item-CardItem-general-form').hover();
                await page.getByLabel('designer-schema-settings-CardItem-FormV2.Designer-general').hover();
                await page.getByRole('menuitem', {
                    name: 'Form data templates'
                }).click();
            };
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await openDialog();
            await page.getByRole('button', {
                name: 'plus Add template'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Collection:')).toBeHidden();
            await page.getByText('Add condition', {
                exact: true
            }).click();
            await page.getByTestId('select-filter-field').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'ID',
                exact: true
            }).click();
            await page.getByLabel('Form data templates').getByRole('spinbutton').click();
            await page.getByLabel('Form data templates').getByRole('spinbutton').fill('2');
            await page.getByTestId('select-single').click();
            await page.getByRole('option', {
                name: 'ID',
                exact: true
            }).click();
            await page.getByRole('button', {
                name: 'singleLineText (Duplicate)'
            }).click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Data template:')).toBeVisible();
            await page.getByTestId('select-form-data-template').click();
            await page.getByRole('option', {
                name: 'Template name 1'
            }).click();
            await page.getByTestId('select-object-single').click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('option')).toHaveCount(1);
            await page.getByRole('option', {
                name: '2'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox')).toHaveValue(record.singleLineText);
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.integer-integer').getByRole('spinbutton')).toBeEmpty();
            await openDialog();
            await page.getByLabel('action-Action.Link-Sync from form fields-general').click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('icon-close-select').click();
            await page.getByTestId('select-object-single').click();
            await page.getByRole('option', {
                name: '2'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.email-email').getByRole('textbox')).toHaveValue(record.email);
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.integer-integer').getByRole('spinbutton')).toHaveValue(String(record.integer));
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.number-number').getByRole('spinbutton')).toHaveValue(String(record.number));
            await openDialog();
            await page.getByLabel('Display data template selector').click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByText('Data template:')).toBeHidden();
        });
    });
    __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('set default value', ()=>{
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('basic fields', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithAddNewAndViewAndEditAndBasicFields).goto();
            const openDialog = async (fieldName)=>{
                await page.getByLabel("block-item-CollectionField-general-form-general.".concat(fieldName, "-").concat(fieldName)).hover();
                await page.getByLabel("designer-schema-settings-CollectionField-FormItem.Designer-general-general.".concat(fieldName)).hover();
                await page.getByRole('menuitem', {
                    name: 'Set default value',
                    exact: true
                }).click();
            };
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await openDialog('singleLineText');
            await page.getByLabel('Set default value').getByRole('textbox').click();
            await page.getByLabel('Set default value').getByRole('textbox').fill('test default value');
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('drawer-Action.Container-general-Add record-mask').click();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox')).toHaveValue('test default value');
            await openDialog('longText');
            await page.getByLabel('variable-button').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Current form'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'singleLineText'
            }).click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('drawer-Action.Container-general-Add record-mask').click();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toHaveValue('test default value');
            await page.getByLabel('block-item-CollectionField-general-form-general.singleLineText-singleLineText').getByRole('textbox').fill('new value');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-general-form-general.longText-longText').getByRole('textbox')).toHaveValue('new value');
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('subform: basic fields', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithAddNewAndViewAndEditAndAssociationFields).goto();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.manyToOne-manyToOne').hover();
            await page.getByLabel('designer-schema-settings-CollectionField-FormItem.Designer-general-general.manyToOne').hover();
            await page.getByRole('menuitem', {
                name: 'Field component'
            }).click();
            await page.getByRole('option', {
                name: 'Sub-form',
                exact: true
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.manyToOne-manyToOne').hover();
            await page.getByLabel('designer-schema-settings-CollectionField-FormItem.Designer-general-general.manyToOne').hover();
            await page.mouse.move(100, 0);
            await page.getByLabel('schema-initializer-Grid-form:configureFields-users').hover();
            await page.getByRole('menuitem', {
                name: 'Nickname'
            }).click();
            await page.getByRole('menuitem', {
                name: 'Username'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.manyToOne-manyToOne').hover();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
                name: 'Set default value'
            })).not.toBeVisible();
            await page.getByLabel("block-item-CollectionField-users-form-users.nickname-Nickname").hover();
            await page.getByLabel("designer-schema-settings-CollectionField-fieldSettings:FormItem-users-users.Nickname").hover();
            await page.getByRole('menuitem', {
                name: 'Set default value',
                exact: true
            }).click();
            await page.getByLabel('Set default value').getByRole('textbox').click();
            await page.getByLabel('Set default value').getByRole('textbox').fill('test default value');
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('drawer-Action.Container-general-Add record-mask').click();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox')).toHaveValue('test default value');
            await page.getByLabel("block-item-CollectionField-users-form-users.username-Username").hover();
            await page.getByLabel("designer-schema-settings-CollectionField-fieldSettings:FormItem-users-users.Username").hover();
            await page.getByRole('menuitem', {
                name: 'Set default value',
                exact: true
            }).click();
            await page.getByLabel('variable-button').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Current object'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Nickname'
            }).click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByLabel('drawer-Action.Container-general-Add record-mask').click();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.username-Username').getByRole('textbox')).toHaveValue('test default value');
            await page.getByLabel('block-item-CollectionField-users-form-users.nickname-Nickname').getByRole('textbox').fill('new value');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.username-Username').getByRole('textbox')).toHaveValue('new value');
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('subtable: basic fields', async (param)=>{
            let { page, mockPage } = param;
            await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneTableBlockWithAddNewAndViewAndEditAndAssociationFields).goto();
            await page.getByRole('button', {
                name: 'Add new'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.oneToMany-oneToMany').hover();
            await page.getByLabel('designer-schema-settings-CollectionField-FormItem.Designer-general-general.oneToMany').hover();
            await page.getByRole('menuitem', {
                name: 'Field component'
            }).click();
            await page.getByRole('option', {
                name: 'Sub-table'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.oneToMany-oneToMany').hover();
            await page.getByLabel('designer-schema-settings-CollectionField-FormItem.Designer-general-general.oneToMany').hover();
            await page.mouse.move(100, 0);
            await page.getByLabel('schema-initializer-AssociationField.SubTable-table:configureColumns-users').hover();
            await page.getByRole('menuitem', {
                name: 'Nickname'
            }).click();
            await page.getByRole('menuitem', {
                name: 'Username'
            }).click();
            await page.getByLabel('block-item-CollectionField-general-form-general.oneToMany-oneToMany').hover();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
                name: 'Set default value'
            })).not.toBeVisible();
            await page.getByRole('button', {
                name: 'Nickname',
                exact: true
            }).hover();
            await page.getByRole('button', {
                name: 'designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users'
            }).hover();
            await page.getByRole('menuitem', {
                name: 'Set default value',
                exact: true
            }).click();
            await page.mouse.move(300, 0);
            await page.getByLabel('Set default value').getByRole('textbox').click();
            await page.getByLabel('Set default value').getByRole('textbox').fill('test default value');
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await page.getByRole('button', {
                name: 'Nickname',
                exact: true
            }).hover();
            await page.getByRole('button', {
                name: 'designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users'
            }).hover();
            await page.mouse.move(300, 0);
            await page.getByTestId('drawer-Action.Container-general-Add record').getByRole('button', {
                name: 'Add new'
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('cell', {
                name: 'block-item-CollectionField-users-form-users.nickname-Nickname'
            }).getByRole('textbox')).toHaveValue('test default value');
            await page.getByRole('button', {
                name: 'Username',
                exact: true
            }).hover();
            await page.getByRole('button', {
                name: 'designer-schema-settings-TableV2.Column-fieldSettings:TableColumn-users'
            }).hover();
            await page.getByRole('menuitem', {
                name: 'Set default value',
                exact: true
            }).click();
            await page.mouse.move(300, 0);
            await page.getByLabel('variable-button').click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Current object'
            }).click();
            await page.getByRole('menuitemcheckbox', {
                name: 'Nickname'
            }).click();
            await page.getByRole('button', {
                name: 'OK',
                exact: true
            }).click();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('cell', {
                name: 'block-item-CollectionField-users-form-users.username-Username'
            }).getByRole('textbox')).toHaveValue('test default value');
            await page.getByRole('cell', {
                name: 'block-item-CollectionField-users-form-users.username-Username'
            }).getByRole('textbox').fill('new value');
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('cell', {
                name: 'block-item-CollectionField-users-form-users.username-Username'
            }).getByRole('textbox')).toHaveValue('new value');
        });
        (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('should show default value option', async (param)=>{
            let { page, mockPage, mockRecord } = param;
            const nocoPage = await mockPage(__WEBPACK_EXTERNAL_MODULE__templatesOfBug_mjs__.T2174).waitForInit();
            await mockRecord('test2174');
            await nocoPage.goto();
            await page.getByLabel('action-Action.Link-View details-view-test2174-table-0').click();
            await page.getByLabel('block-item-CollectionField-test2174-form-test2174.singleSelect-Single select').hover();
            await page.getByLabel('designer-schema-settings-CollectionField-FormItem.Designer-test2174-test2174.singleSelect').hover();
            await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByRole('menuitem', {
                name: 'Set default value'
            })).toBeVisible();
        });
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('save block template & using block template', async (param)=>{
        let { page, mockPage } = param;
        await mockPage({
            pageSchema: {
                _isJSONSchemaObject: true,
                version: '2.0',
                type: 'void',
                'x-component': 'Page',
                properties: {
                    bg76x03o9f2: {
                        _isJSONSchemaObject: true,
                        version: '2.0',
                        type: 'void',
                        'x-component': 'Grid',
                        'x-initializer': 'page:addBlock',
                        properties: {
                            gdj0ceke8ac: {
                                _isJSONSchemaObject: true,
                                version: '2.0',
                                type: 'void',
                                'x-component': 'Grid.Row',
                                properties: {
                                    ftx8xnesvev: {
                                        _isJSONSchemaObject: true,
                                        version: '2.0',
                                        type: 'void',
                                        'x-component': 'Grid.Col',
                                        properties: {
                                            tu0dxua38tw: {
                                                _isJSONSchemaObject: true,
                                                version: '2.0',
                                                type: 'void',
                                                'x-acl-action-props': {
                                                    skipScopeCheck: true
                                                },
                                                'x-acl-action': 'users:create',
                                                'x-decorator': 'FormBlockProvider',
                                                'x-decorator-props': {
                                                    resource: 'users',
                                                    collection: 'users'
                                                },
                                                'x-designer': 'FormV2.Designer',
                                                'x-component': 'CardItem',
                                                'x-component-props': {},
                                                properties: {
                                                    avv3vpk0nlv: {
                                                        _isJSONSchemaObject: true,
                                                        version: '2.0',
                                                        type: 'void',
                                                        'x-component': 'FormV2',
                                                        'x-component-props': {
                                                            useProps: '{{ useFormBlockProps }}'
                                                        },
                                                        properties: {
                                                            grid: {
                                                                _isJSONSchemaObject: true,
                                                                version: '2.0',
                                                                type: 'void',
                                                                'x-component': 'Grid',
                                                                'x-initializer': 'form:configureFields',
                                                                properties: {
                                                                    gnw25oyqe56: {
                                                                        _isJSONSchemaObject: true,
                                                                        version: '2.0',
                                                                        type: 'void',
                                                                        'x-component': 'Grid.Row',
                                                                        properties: {
                                                                            rdbe3gg1qv5: {
                                                                                _isJSONSchemaObject: true,
                                                                                version: '2.0',
                                                                                type: 'void',
                                                                                'x-component': 'Grid.Col',
                                                                                properties: {
                                                                                    nickname: {
                                                                                        _isJSONSchemaObject: true,
                                                                                        version: '2.0',
                                                                                        type: 'string',
                                                                                        'x-designer': 'FormItem.Designer',
                                                                                        'x-component': 'CollectionField',
                                                                                        'x-decorator': 'FormItem',
                                                                                        'x-collection-field': 'users.nickname',
                                                                                        'x-component-props': {},
                                                                                        'x-uid': 'okrljzl6j7s',
                                                                                        'x-async': false,
                                                                                        'x-index': 1
                                                                                    }
                                                                                },
                                                                                'x-uid': '1zjdduck27k',
                                                                                'x-async': false,
                                                                                'x-index': 1
                                                                            }
                                                                        },
                                                                        'x-uid': 'l0cyy3gzz86',
                                                                        'x-async': false,
                                                                        'x-index': 1
                                                                    }
                                                                },
                                                                'x-uid': '4wrgwkyyf81',
                                                                'x-async': false,
                                                                'x-index': 1
                                                            },
                                                            actions: {
                                                                _isJSONSchemaObject: true,
                                                                version: '2.0',
                                                                type: 'void',
                                                                'x-initializer': 'createForm:configureActions',
                                                                'x-component': 'ActionBar',
                                                                'x-component-props': {
                                                                    layout: 'one-column',
                                                                    style: {
                                                                        marginTop: 24
                                                                    }
                                                                },
                                                                'x-uid': '2apymtcq35d',
                                                                'x-async': false,
                                                                'x-index': 2
                                                            }
                                                        },
                                                        'x-uid': '1tnmbrvb9ad',
                                                        'x-async': false,
                                                        'x-index': 1
                                                    }
                                                },
                                                'x-uid': 'vo1pyqmoe28',
                                                'x-async': false,
                                                'x-index': 1
                                            }
                                        },
                                        'x-uid': 'z59pkpc8uhq',
                                        'x-async': false,
                                        'x-index': 1
                                    }
                                },
                                'x-uid': 'vsfafj9qcx9',
                                'x-async': false,
                                'x-index': 1
                            }
                        },
                        'x-uid': 'sdj6iw5b0gs',
                        'x-async': false,
                        'x-index': 1
                    }
                },
                'x-uid': 'uz4dyz41vt1',
                'x-async': true,
                'x-index': 1
            }
        }).goto();
        await page.getByLabel('block-item-CardItem-users-form').hover();
        await page.getByLabel('block-item-CardItem-users-form').getByLabel('designer-schema-settings-CardItem-FormV2.Designer-users').hover();
        await page.getByRole('menuitem', {
            name: 'Save as block template'
        }).click();
        await page.getByLabel('Save as template').getByRole('textbox').fill('Users_Form');
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
        await page.getByLabel('block-item-CardItem-users-form').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-users-form')).toHaveText(/Reference template/);
        await mockPage({
            pageSchema: {
                _isJSONSchemaObject: true,
                version: '2.0',
                type: 'void',
                'x-component': 'Page',
                properties: {
                    mwxaaxb9y9v: {
                        _isJSONSchemaObject: true,
                        version: '2.0',
                        type: 'void',
                        'x-component': 'Grid',
                        'x-initializer': 'page:addBlock',
                        properties: {
                            ibb0kjq3kyl: {
                                _isJSONSchemaObject: true,
                                version: '2.0',
                                type: 'void',
                                'x-component': 'Grid.Row',
                                properties: {
                                    p39cigcjpij: {
                                        _isJSONSchemaObject: true,
                                        version: '2.0',
                                        type: 'void',
                                        'x-component': 'Grid.Col',
                                        properties: {
                                            '237ec1x538e': {
                                                _isJSONSchemaObject: true,
                                                version: '2.0',
                                                type: 'void',
                                                'x-decorator': 'TableBlockProvider',
                                                'x-acl-action': 'users:list',
                                                'x-decorator-props': {
                                                    collection: 'users',
                                                    resource: 'users',
                                                    action: 'list',
                                                    params: {
                                                        pageSize: 20
                                                    },
                                                    rowKey: 'id',
                                                    showIndex: true,
                                                    dragSort: false,
                                                    disableTemplate: false
                                                },
                                                'x-designer': 'TableBlockDesigner',
                                                'x-component': 'CardItem',
                                                'x-filter-targets': [],
                                                properties: {
                                                    actions: {
                                                        _isJSONSchemaObject: true,
                                                        version: '2.0',
                                                        type: 'void',
                                                        'x-initializer': 'table:configureActions',
                                                        'x-component': 'ActionBar',
                                                        'x-component-props': {
                                                            style: {
                                                                marginBottom: 'var(--tb-spacing)'
                                                            }
                                                        },
                                                        properties: {
                                                            lmeom75gry5: {
                                                                _isJSONSchemaObject: true,
                                                                version: '2.0',
                                                                type: 'void',
                                                                'x-action': 'create',
                                                                'x-acl-action': 'create',
                                                                title: "{{t('Add new')}}",
                                                                'x-designer': 'Action.Designer',
                                                                'x-component': 'Action',
                                                                'x-decorator': 'ACLActionProvider',
                                                                'x-component-props': {
                                                                    openMode: 'drawer',
                                                                    type: 'primary',
                                                                    component: 'CreateRecordAction',
                                                                    icon: 'PlusOutlined'
                                                                },
                                                                'x-align': 'right',
                                                                'x-acl-action-props': {
                                                                    skipScopeCheck: true
                                                                },
                                                                properties: {
                                                                    drawer: {
                                                                        _isJSONSchemaObject: true,
                                                                        version: '2.0',
                                                                        type: 'void',
                                                                        title: '{{ t("Add record") }}',
                                                                        'x-component': 'Action.Container',
                                                                        'x-component-props': {
                                                                            className: 'nb-action-popup'
                                                                        },
                                                                        properties: {
                                                                            tabs: {
                                                                                _isJSONSchemaObject: true,
                                                                                version: '2.0',
                                                                                type: 'void',
                                                                                'x-component': 'Tabs',
                                                                                'x-component-props': {},
                                                                                'x-initializer': 'TabPaneInitializersForCreateFormBlock',
                                                                                properties: {
                                                                                    tab1: {
                                                                                        _isJSONSchemaObject: true,
                                                                                        version: '2.0',
                                                                                        type: 'void',
                                                                                        title: '{{t("Add new")}}',
                                                                                        'x-component': 'Tabs.TabPane',
                                                                                        'x-designer': 'Tabs.Designer',
                                                                                        'x-component-props': {},
                                                                                        properties: {
                                                                                            grid: {
                                                                                                _isJSONSchemaObject: true,
                                                                                                version: '2.0',
                                                                                                type: 'void',
                                                                                                'x-component': 'Grid',
                                                                                                'x-initializer': 'popup:addNew:addBlock',
                                                                                                'x-uid': 'w224zhqyair',
                                                                                                'x-async': false,
                                                                                                'x-index': 1
                                                                                            }
                                                                                        },
                                                                                        'x-uid': 'lll44vre1t6',
                                                                                        'x-async': false,
                                                                                        'x-index': 1
                                                                                    }
                                                                                },
                                                                                'x-uid': 'c025dgp5tyk',
                                                                                'x-async': false,
                                                                                'x-index': 1
                                                                            }
                                                                        },
                                                                        'x-uid': 'og2z02rfxhx',
                                                                        'x-async': false,
                                                                        'x-index': 1
                                                                    }
                                                                },
                                                                'x-uid': 'vn9wxzx83y3',
                                                                'x-async': false,
                                                                'x-index': 1
                                                            }
                                                        },
                                                        'x-uid': '7s3fcxfjc0y',
                                                        'x-async': false,
                                                        'x-index': 1
                                                    },
                                                    zqdtqsjqgc1: {
                                                        _isJSONSchemaObject: true,
                                                        version: '2.0',
                                                        type: 'array',
                                                        'x-initializer': 'table:configureColumns',
                                                        'x-component': 'TableV2',
                                                        'x-component-props': {
                                                            rowKey: 'id',
                                                            rowSelection: {
                                                                type: 'checkbox'
                                                            },
                                                            useProps: '{{ useTableBlockProps }}'
                                                        },
                                                        properties: {
                                                            actions: {
                                                                _isJSONSchemaObject: true,
                                                                version: '2.0',
                                                                type: 'void',
                                                                title: '{{ t("Actions") }}',
                                                                'x-action-column': 'actions',
                                                                'x-decorator': 'TableV2.Column.ActionBar',
                                                                'x-component': 'TableV2.Column',
                                                                'x-designer': 'TableV2.ActionColumnDesigner',
                                                                'x-initializer': 'table:configureItemActions',
                                                                properties: {
                                                                    actions: {
                                                                        _isJSONSchemaObject: true,
                                                                        version: '2.0',
                                                                        type: 'void',
                                                                        'x-decorator': 'DndContext',
                                                                        'x-component': 'Space',
                                                                        'x-component-props': {
                                                                            split: '|'
                                                                        },
                                                                        properties: {
                                                                            kdcs236lihl: {
                                                                                _isJSONSchemaObject: true,
                                                                                version: '2.0',
                                                                                type: 'void',
                                                                                title: '{{ t("Edit") }}',
                                                                                'x-action': 'update',
                                                                                'x-designer': 'Action.Designer',
                                                                                'x-component': 'Action.Link',
                                                                                'x-component-props': {
                                                                                    openMode: 'drawer',
                                                                                    icon: 'EditOutlined'
                                                                                },
                                                                                'x-decorator': 'ACLActionProvider',
                                                                                'x-designer-props': {
                                                                                    linkageAction: true
                                                                                },
                                                                                properties: {
                                                                                    drawer: {
                                                                                        _isJSONSchemaObject: true,
                                                                                        version: '2.0',
                                                                                        type: 'void',
                                                                                        title: '{{ t("Edit record") }}',
                                                                                        'x-component': 'Action.Container',
                                                                                        'x-component-props': {
                                                                                            className: 'nb-action-popup'
                                                                                        },
                                                                                        properties: {
                                                                                            tabs: {
                                                                                                _isJSONSchemaObject: true,
                                                                                                version: '2.0',
                                                                                                type: 'void',
                                                                                                'x-component': 'Tabs',
                                                                                                'x-component-props': {},
                                                                                                'x-initializer': 'popup:addTab',
                                                                                                properties: {
                                                                                                    tab1: {
                                                                                                        _isJSONSchemaObject: true,
                                                                                                        version: '2.0',
                                                                                                        type: 'void',
                                                                                                        title: '{{t("Edit")}}',
                                                                                                        'x-component': 'Tabs.TabPane',
                                                                                                        'x-designer': 'Tabs.Designer',
                                                                                                        'x-component-props': {},
                                                                                                        properties: {
                                                                                                            grid: {
                                                                                                                _isJSONSchemaObject: true,
                                                                                                                version: '2.0',
                                                                                                                type: 'void',
                                                                                                                'x-component': 'Grid',
                                                                                                                'x-initializer': 'popup:common:addBlock',
                                                                                                                'x-uid': 's49vs6v3qs0',
                                                                                                                'x-async': false,
                                                                                                                'x-index': 1
                                                                                                            }
                                                                                                        },
                                                                                                        'x-uid': '33qff1grgqn',
                                                                                                        'x-async': false,
                                                                                                        'x-index': 1
                                                                                                    }
                                                                                                },
                                                                                                'x-uid': '3z1hbrs3bre',
                                                                                                'x-async': false,
                                                                                                'x-index': 1
                                                                                            }
                                                                                        },
                                                                                        'x-uid': '09vwzm2det2',
                                                                                        'x-async': false,
                                                                                        'x-index': 1
                                                                                    }
                                                                                },
                                                                                'x-uid': 'bgdfnken9ua',
                                                                                'x-async': false,
                                                                                'x-index': 1
                                                                            }
                                                                        },
                                                                        'x-uid': 'tn98i5lgydw',
                                                                        'x-async': false,
                                                                        'x-index': 1
                                                                    }
                                                                },
                                                                'x-uid': 'ubmt489cxzn',
                                                                'x-async': false,
                                                                'x-index': 1
                                                            }
                                                        },
                                                        'x-uid': 't6eg1ye4wf4',
                                                        'x-async': false,
                                                        'x-index': 2
                                                    }
                                                },
                                                'x-uid': 'h4yvac2sy2g',
                                                'x-async': false,
                                                'x-index': 1
                                            }
                                        },
                                        'x-uid': '3xei2593vgu',
                                        'x-async': false,
                                        'x-index': 1
                                    }
                                },
                                'x-uid': 'm67du7wrojo',
                                'x-async': false,
                                'x-index': 1
                            }
                        },
                        'x-uid': '7aige8a5w3q',
                        'x-async': false,
                        'x-index': 1
                    }
                },
                'x-uid': 'qpbgsjdsgaq',
                'x-async': true,
                'x-index': 1
            }
        }).goto();
        await page.getByLabel('schema-initializer-Grid-page:addBlock').hover();
        await page.getByRole('menuitem', {
            name: 'form Form'
        }).first().hover();
        await page.getByRole('menuitem', {
            name: 'Users'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Duplicate template'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Users_Form (Fields only)'
        }).first().click();
        await page.mouse.move(300, 0);
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-users-form')).toBeVisible();
        await page.getByLabel('action-Action-Add new-create-users-table').click();
        await page.getByLabel('schema-initializer-Grid-popup:addNew:addBlock-users').hover();
        await page.getByRole('menuitem', {
            name: 'form Form'
        }).first().hover();
        await page.getByRole('menuitem', {
            name: 'Reference template'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Users_Form (Fields only)'
        }).first().click();
        await page.mouse.move(300, 0);
        await page.getByLabel('schema-initializer-Grid-popup:addNew:addBlock-users').hover();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.locator('.ant-drawer').getByLabel('block-item-CardItem-users-form')).toBeVisible();
        await page.locator('.ant-drawer-mask').click();
        await page.getByLabel('action-Action.Link-Edit-update-users-table-0').click();
        await page.getByLabel('schema-initializer-Grid-popup:common:addBlock-users').click();
        await page.getByRole('menuitem', {
            name: 'form Form (Edit)'
        }).first().hover();
        await page.getByRole('menuitem', {
            name: 'Reference template'
        }).hover();
        await page.getByRole('menuitem', {
            name: 'Users_Form (Fields only)'
        }).first().click();
        await page.mouse.move(300, 0);
        await page.locator('.ant-drawer').getByLabel('schema-initializer-Grid-form:configureFields-users').hover();
        await page.getByRole('menuitem', {
            name: 'Phone'
        }).click();
        await page.locator('.ant-drawer-mask').click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CardItem-users-form').getByLabel('block-item-CollectionField-users-form-users.phone')).not.toBeVisible();
        await page.getByLabel('block-item-CardItem-users-table').getByLabel('action-Action-Add').click();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expect)(page.getByLabel('block-item-CollectionField-users-form-users.phone')).toBeVisible();
        await page.locator('.ant-drawer-mask').click();
        await page.getByTestId('plugin-settings-button').click();
        await page.getByRole('link', {
            name: 'Block templates'
        }).click();
        await page.getByRole('menuitem', {
            name: 'layout Block templates'
        }).click();
        await page.getByLabel('Select all').check();
        await page.getByLabel('action-Action-Delete-destroy-').click();
        await page.getByRole('button', {
            name: 'OK',
            exact: true
        }).click();
    });
});
__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test.describe('actions schema settings', ()=>{
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('submit', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyFormWithActions).goto();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByRole('button', {
                    name: 'Submit'
                }).hover();
                await page.getByRole('button', {
                    name: 'designer-schema-settings-Action-Action.Designer-users'
                }).hover();
            },
            supportedOptions: [
                'Edit button',
                'Secondary confirmation',
                'Bind workflows',
                'Delete'
            ]
        });
    });
    (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.test)('customize: save record', async (param)=>{
        let { page, mockPage } = param;
        await mockPage(__WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.oneEmptyFormWithActions).goto();
        await (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_e2e__.expectSettingsMenu)({
            page,
            showMenu: async ()=>{
                await page.getByRole('button', {
                    name: 'Save record'
                }).hover();
                await page.getByRole('button', {
                    name: 'designer-schema-settings-Action-Action.Designer-users'
                }).hover();
            },
            supportedOptions: [
                'Edit button',
                'Assign field values',
                'Skip required validation',
                'After successful submission',
                'Bind workflows',
                'Delete'
            ]
        });
    });
});
