@wix/auto-patterns 1.44.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +3 -0
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js +26 -14
- package/dist/cjs/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js +38 -29
- package/dist/cjs/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/index.js +0 -6
- package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +67 -12
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js +8 -7
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +165 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +15 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/index.js +10 -0
- package/dist/cjs/components/AutoPatternsSettingsPage/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +2 -3
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +1 -1
- package/dist/cjs/components/fields/Checkbox.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +9 -8
- package/dist/cjs/components/fields/DateInput.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +13 -12
- package/dist/cjs/components/fields/DateTime.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +11 -10
- package/dist/cjs/components/fields/ImageInput.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +9 -8
- package/dist/cjs/components/fields/LongText.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +9 -8
- package/dist/cjs/components/fields/Number.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +9 -8
- package/dist/cjs/components/fields/ShortText.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +11 -10
- package/dist/cjs/components/fields/Url.js.map +1 -0
- package/dist/cjs/components/fields/index.js +38 -0
- package/dist/cjs/components/fields/index.js.map +1 -0
- package/dist/cjs/components/fields/types.js.map +1 -0
- package/dist/cjs/components/fields/utils/dates.js.map +1 -0
- package/dist/cjs/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +26 -15
- package/dist/cjs/components/layouts/ContentCard.js.map +1 -0
- package/dist/cjs/components/layouts/ContentCardLayout.js +157 -0
- package/dist/cjs/components/layouts/ContentCardLayout.js.map +1 -0
- package/dist/cjs/components/layouts/ContentSkeleton.js +98 -0
- package/dist/cjs/components/layouts/ContentSkeleton.js.map +1 -0
- package/dist/cjs/components/layouts/FormField.js +52 -0
- package/dist/cjs/components/layouts/FormField.js.map +1 -0
- package/dist/cjs/components/layouts/ViewField.js +68 -0
- package/dist/cjs/components/layouts/ViewField.js.map +1 -0
- package/dist/cjs/components/layouts/types.js +4 -0
- package/dist/cjs/components/layouts/types.js.map +1 -0
- package/dist/cjs/hooks/useBaseTableFeatures.js +2 -1
- package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/usePagePath.js +4 -1
- package/dist/cjs/hooks/usePagePath.js.map +1 -1
- package/dist/cjs/hooks/useSettingsPageMoreActions.js +36 -0
- package/dist/cjs/hooks/useSettingsPageMoreActions.js.map +1 -0
- package/dist/cjs/providers/AutoPatternsOverridesContext.js +1 -1
- package/dist/cjs/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/cjs/types/SettingsPageConfig.js +4 -0
- package/dist/cjs/types/SettingsPageConfig.js.map +1 -0
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
- package/dist/cjs/types/actions/formPageActions.js +4 -0
- package/dist/cjs/types/actions/formPageActions.js.map +1 -0
- package/dist/cjs/types/actions/index.js +6 -0
- package/dist/cjs/types/actions/index.js.map +1 -1
- package/dist/cjs/types/index.js +6 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/types.js.map +1 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js +4 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.uni.driver.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +3 -3
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js +21 -8
- package/dist/esm/components/AutoPatternsEntityPage/EditModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js +21 -12
- package/dist/esm/components/AutoPatternsEntityPage/ViewModeEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/index.js +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +31 -6
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js +2 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsRoutes.js.map +1 -1
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js +108 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js +10 -0
- package/dist/esm/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.js.map +1 -0
- package/dist/esm/components/AutoPatternsSettingsPage/index.js +2 -0
- package/dist/esm/components/AutoPatternsSettingsPage/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +0 -1
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/esm/components/fields/Checkbox.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.js +7 -6
- package/dist/esm/components/fields/DateInput.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.js +7 -6
- package/dist/esm/components/fields/DateTime.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.js +9 -8
- package/dist/esm/components/fields/ImageInput.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/LongText.js +7 -6
- package/dist/esm/components/fields/LongText.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Number.js +7 -6
- package/dist/esm/components/fields/Number.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.js +7 -6
- package/dist/esm/components/fields/ShortText.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Url.js +7 -6
- package/dist/esm/components/fields/Url.js.map +1 -0
- package/dist/esm/components/fields/index.js +10 -0
- package/dist/esm/components/fields/index.js.map +1 -0
- package/dist/esm/components/fields/types.js.map +1 -0
- package/dist/esm/components/fields/utils/dates.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js → layouts/ContentCard.js} +19 -8
- package/dist/esm/components/layouts/ContentCard.js.map +1 -0
- package/dist/esm/components/{AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js → layouts/ContentCardLayout.js} +38 -19
- package/dist/esm/components/layouts/ContentCardLayout.js.map +1 -0
- package/dist/esm/components/layouts/ContentSkeleton.js +47 -0
- package/dist/esm/components/layouts/ContentSkeleton.js.map +1 -0
- package/dist/esm/components/layouts/FormField.js +40 -0
- package/dist/esm/components/layouts/FormField.js.map +1 -0
- package/dist/esm/components/layouts/ViewField.js +43 -0
- package/dist/esm/components/layouts/ViewField.js.map +1 -0
- package/dist/esm/components/layouts/types.js +2 -0
- package/dist/esm/components/layouts/types.js.map +1 -0
- package/dist/esm/hooks/useBaseTableFeatures.js +1 -0
- package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/esm/hooks/usePagePath.js +4 -1
- package/dist/esm/hooks/usePagePath.js.map +1 -1
- package/dist/esm/hooks/useSettingsPageMoreActions.js +32 -0
- package/dist/esm/hooks/useSettingsPageMoreActions.js.map +1 -0
- package/dist/esm/providers/AutoPatternsOverridesContext.js.map +1 -1
- package/dist/esm/types/SettingsPageConfig.js +2 -0
- package/dist/esm/types/SettingsPageConfig.js.map +1 -0
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js.map +1 -1
- package/dist/esm/types/actions/formPageActions.js +2 -0
- package/dist/esm/types/actions/formPageActions.js.map +1 -0
- package/dist/esm/types/actions/index.js +1 -0
- package/dist/esm/types/actions/index.js.map +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/types.js.map +1 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts +4 -1
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.uni.driver.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/EditModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewModeEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts +0 -1
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsRoute/AutoPatternsRoutes.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts +6 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts +145 -0
- package/dist/types/components/AutoPatternsSettingsPage/AutoPatternsSettingsPage.uni.driver.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsSettingsPage/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsSettingsPage/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- package/dist/types/components/fields/Checkbox.d.ts.map +1 -0
- package/dist/types/components/fields/DateInput.d.ts.map +1 -0
- package/dist/types/components/fields/DateTime.d.ts.map +1 -0
- package/dist/types/components/fields/ImageInput.d.ts.map +1 -0
- package/dist/types/components/fields/LongText.d.ts.map +1 -0
- package/dist/types/components/fields/Number.d.ts.map +1 -0
- package/dist/types/components/fields/ShortText.d.ts.map +1 -0
- package/dist/types/components/fields/Url.d.ts.map +1 -0
- package/dist/types/components/fields/index.d.ts +10 -0
- package/dist/types/components/fields/index.d.ts.map +1 -0
- package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/types.d.ts +4 -1
- package/dist/types/components/fields/types.d.ts.map +1 -0
- package/dist/types/components/fields/utils/dates.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentCard.d.ts +17 -0
- package/dist/types/components/layouts/ContentCard.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentCardLayout.d.ts +18 -0
- package/dist/types/components/layouts/ContentCardLayout.d.ts.map +1 -0
- package/dist/types/components/layouts/ContentSkeleton.d.ts +9 -0
- package/dist/types/components/layouts/ContentSkeleton.d.ts.map +1 -0
- package/dist/types/components/layouts/FormField.d.ts +13 -0
- package/dist/types/components/layouts/FormField.d.ts.map +1 -0
- package/dist/types/components/layouts/ViewField.d.ts +8 -0
- package/dist/types/components/layouts/ViewField.d.ts.map +1 -0
- package/dist/types/components/layouts/types.d.ts +3 -0
- package/dist/types/components/layouts/types.d.ts.map +1 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts +2 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/usePagePath.d.ts.map +1 -1
- package/dist/types/hooks/useSettingsPageMoreActions.d.ts +5 -0
- package/dist/types/hooks/useSettingsPageMoreActions.d.ts.map +1 -0
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts +2 -2
- package/dist/types/providers/AutoPatternsOverridesContext.d.ts.map +1 -1
- package/dist/types/testkit/enzyme.d.ts +1 -0
- package/dist/types/testkit/enzyme.d.ts.map +1 -1
- package/dist/types/testkit/jsdom.d.ts +1 -0
- package/dist/types/testkit/jsdom.d.ts.map +1 -1
- package/dist/types/testkit/playwright.d.ts +1 -0
- package/dist/types/testkit/playwright.d.ts.map +1 -1
- package/dist/types/testkit/puppeteer.d.ts +1 -0
- package/dist/types/testkit/puppeteer.d.ts.map +1 -1
- package/dist/types/types/SettingsPageConfig.d.ts +140 -0
- package/dist/types/types/SettingsPageConfig.d.ts.map +1 -0
- package/dist/types/types/actions/base.d.ts +1 -0
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +2 -7
- package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/formPageActions.d.ts +8 -0
- package/dist/types/types/actions/formPageActions.d.ts.map +1 -0
- package/dist/types/types/actions/index.d.ts +1 -0
- package/dist/types/types/actions/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/types.d.ts +20 -1
- package/dist/types/types/types.d.ts.map +1 -1
- package/docs/GETTING_STARTED.md +73 -18
- package/mcp-docs/app_config_structure.md +66 -3
- package/mcp-docs/auto-patterns-guide.md +86 -6
- package/mcp-docs/index.md +4 -0
- package/mcp-docs/pages_configuration.md +20 -3
- package/mcp-docs/settings_page.md +599 -0
- package/package.json +3 -3
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -59
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js +0 -119
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -79
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -16
- package/dist/cjs/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -198
- package/dist/cjs/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -77
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -109
- package/dist/cjs/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/DateTime.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +0 -46
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/LongText.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Number.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Url.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/types.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/utils/dates.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js +0 -48
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js +0 -3
- package/dist/esm/components/AutoPatternsEntityPage/RenderLayout/index.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js +0 -91
- package/dist/esm/components/AutoPatternsEntityPage/SkeletonEntity.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js +0 -31
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map +0 -1
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js +0 -66
- package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.js.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/DateInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/DateTime.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +0 -10
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/LongText.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Number.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/Url.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/types.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/utils/dates.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts +0 -11
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts +0 -13
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts +0 -3
- package/dist/types/components/AutoPatternsEntityPage/RenderLayout/index.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts +0 -7
- package/dist/types/components/AutoPatternsEntityPage/SkeletonEntity.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.d.ts.map +0 -1
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts +0 -8
- package/dist/types/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutContent.d.ts.map +0 -1
- /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
- /package/dist/cjs/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/types.js +0 -0
- /package/dist/esm/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.js +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Checkbox.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateInput.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/DateTime.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ImageInput.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/LongText.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Number.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/ShortText.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/Url.d.ts +0 -0
- /package/dist/types/components/{AutoPatternsEntityPage/Fields → fields}/utils/dates.d.ts +0 -0
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormField, InputArea } from '@wix/design-system';
|
|
3
|
-
import {
|
|
3
|
+
import { useSelector, useWixPatternsContainer } from '@wix/patterns';
|
|
4
4
|
import { useController } from '@wix/patterns/form';
|
|
5
5
|
export const LongText = props => {
|
|
6
|
-
var
|
|
6
|
+
var _field$validation2, _controller$fieldStat;
|
|
7
7
|
const {
|
|
8
8
|
field,
|
|
9
|
-
dataHook
|
|
9
|
+
dataHook,
|
|
10
|
+
formControl,
|
|
11
|
+
data
|
|
10
12
|
} = props;
|
|
11
13
|
const {
|
|
12
14
|
translate: t,
|
|
13
15
|
...container
|
|
14
16
|
} = useWixPatternsContainer();
|
|
15
17
|
useSelector(() => container.initTask.status);
|
|
16
|
-
const pageState = useEntityPageContext();
|
|
17
18
|
const controller = useController({
|
|
18
19
|
name: (field == null ? void 0 : field.id) ?? '',
|
|
19
|
-
control:
|
|
20
|
-
defaultValue:
|
|
20
|
+
control: formControl,
|
|
21
|
+
defaultValue: data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? ''],
|
|
21
22
|
rules: {
|
|
22
23
|
validate: value => {
|
|
23
24
|
var _field$validation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FormField","InputArea","useSelector","useWixPatternsContainer","useController","LongText","props","_field$validation2","_controller$fieldStat","field","dataHook","formControl","data","translate","t","container","initTask","status","controller","name","id","control","defaultValue","rules","validate","value","_field$validation","validation","required","undefined","createElement","label","displayName","fieldState","error","statusMessage","message","onChange","e","target","onBlur","ref"],"sources":["../../../../src/components/fields/LongText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, InputArea } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport { useSelector, useWixPatternsContainer } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\n\nexport interface LongTextProps extends BaseInputProps<string> {}\n\nexport const LongText = (props: LongTextProps) => {\n const { field, dataHook, formControl, data } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const controller = useController({\n name: field?.id ?? '',\n control: formControl,\n defaultValue: data?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n\n return true;\n },\n },\n });\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n dataHook={dataHook}\n >\n <InputArea\n value={controller.field.value}\n onChange={(e) => controller.field.onChange?.(e.target.value)}\n onBlur={controller.field.onBlur}\n ref={controller.field.ref}\n dataHook={`long-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,SAAS,QAAQ,oBAAoB;AAEzD,SAASC,WAAW,EAAEC,uBAAuB,QAAQ,eAAe;AACpE,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,QAAQ,GAAIC,KAAoB,IAAK;EAAA,IAAAC,kB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BX,KAAA,CAAA+B,aAAA,CAAC7B,SAAS;IACRwB,KAAK,EAAEP,UAAU,CAACT,KAAK,CAACgB,KAAM;IAC9BY,QAAQ,EAAGC,CAAC,IAAKpB,UAAU,CAACT,KAAK,CAAC4B,QAAQ,oBAAzBnB,UAAU,CAACT,KAAK,CAAC4B,QAAQ,CAAGC,CAAC,CAACC,MAAM,CAACd,KAAK,CAAE;IAC7De,MAAM,EAAEtB,UAAU,CAACT,KAAK,CAAC+B,MAAO;IAChCC,GAAG,EAAEvB,UAAU,CAACT,KAAK,CAACgC,GAAI;IAC1B/B,QAAQ,EAAE,aAAaD,KAAK,CAACW,EAAE;EAAG,CACnC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormField, NumberInput } from '@wix/design-system';
|
|
3
|
-
import {
|
|
3
|
+
import { useSelector, useWixPatternsContainer } from '@wix/patterns';
|
|
4
4
|
import { useController } from '@wix/patterns/form';
|
|
5
5
|
export const Number = props => {
|
|
6
|
-
var _field$validation,
|
|
6
|
+
var _field$validation, _field$validation3, _controller$fieldStat;
|
|
7
7
|
const {
|
|
8
8
|
field,
|
|
9
|
-
dataHook
|
|
9
|
+
dataHook,
|
|
10
|
+
formControl,
|
|
11
|
+
data
|
|
10
12
|
} = props;
|
|
11
13
|
const {
|
|
12
14
|
translate: t,
|
|
13
15
|
...container
|
|
14
16
|
} = useWixPatternsContainer();
|
|
15
17
|
useSelector(() => container.initTask.status);
|
|
16
|
-
const pageState = useEntityPageContext();
|
|
17
18
|
const numberRange = (_field$validation = field.validation) == null ? void 0 : _field$validation.numberRange;
|
|
18
19
|
const min = numberRange == null ? void 0 : numberRange.min;
|
|
19
20
|
const max = numberRange == null ? void 0 : numberRange.max;
|
|
20
21
|
const controller = useController({
|
|
21
22
|
name: (field == null ? void 0 : field.id) ?? '',
|
|
22
|
-
control:
|
|
23
|
-
defaultValue:
|
|
23
|
+
control: formControl,
|
|
24
|
+
defaultValue: data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? ''],
|
|
24
25
|
rules: {
|
|
25
26
|
validate: value => {
|
|
26
27
|
var _field$validation2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FormField","NumberInput","useSelector","useWixPatternsContainer","useController","Number","props","_field$validation","_field$validation3","_controller$fieldStat","field","dataHook","formControl","data","translate","t","container","initTask","status","numberRange","validation","min","max","controller","name","id","control","defaultValue","rules","validate","value","_field$validation2","required","undefined","minAmount","maxAmount","createElement","label","displayName","fieldState","error","statusMessage","message","onChange","e","onBlur","inputRef","ref"],"sources":["../../../../src/components/fields/Number.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, NumberInput } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport { useSelector, useWixPatternsContainer } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\n\nexport interface NumberProps extends BaseInputProps<number | null> {}\n\nexport const Number = (props: NumberProps) => {\n const { field, dataHook, formControl, data } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const numberRange = field.validation?.numberRange;\n const min = numberRange?.min;\n const max = numberRange?.max;\n\n const controller = useController({\n name: field?.id ?? '',\n control: formControl,\n defaultValue: data?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n\n if (value !== null && value !== undefined) {\n if (min !== undefined && value < min) {\n return t('cairo.fieldValidation.minNumber', {\n minAmount: min,\n });\n }\n if (max !== undefined && value > max) {\n return t('cairo.fieldValidation.maxNumber', {\n maxAmount: max,\n });\n }\n }\n\n return true;\n },\n },\n });\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n dataHook={dataHook}\n >\n <NumberInput\n value={controller.field.value ?? undefined}\n onChange={(e) => controller.field.onChange(e)}\n onBlur={controller.field.onBlur}\n inputRef={controller.field.ref}\n dataHook={`number-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAE3D,SAASC,WAAW,EAAEC,uBAAuB,QAAQ,eAAe;AACpE,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,kBAAA,EAAAC,qBAAA;EAC5C,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;IAAEC;EAAK,CAAC,GAAGP,KAAK;EAEpD,MAAM;IAAEQ,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGb,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMc,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;EAE5C,MAAMC,WAAW,IAAAZ,iBAAA,GAAGG,KAAK,CAACU,UAAU,qBAAhBb,iBAAA,CAAkBY,WAAW;EACjD,MAAME,GAAG,GAAGF,WAAW,oBAAXA,WAAW,CAAEE,GAAG;EAC5B,MAAMC,GAAG,GAAGH,WAAW,oBAAXA,WAAW,CAAEG,GAAG;EAE5B,MAAMC,UAAU,GAAGnB,aAAa,CAAC;IAC/BoB,IAAI,EAAE,CAAAd,KAAK,oBAALA,KAAK,CAAEe,EAAE,KAAI,EAAE;IACrBC,OAAO,EAAEd,WAAW;IACpBe,YAAY,EAAEd,IAAI,oBAAJA,IAAI,CAAG,CAAAH,KAAK,oBAALA,KAAK,CAAEe,EAAE,KAAI,EAAE,CAAC;IACrCG,KAAK,EAAE;MACLC,QAAQ,EAAGC,KAAK,IAAK;QAAA,IAAAC,kBAAA;QACnB,IACE,CAAAA,kBAAA,GAAArB,KAAK,CAACU,UAAU,aAAhBW,kBAAA,CAAkBC,QAAQ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AACqC,GAAI;IAC/BpC,QAAQ,EAAE,UAAUD,KAAK,CAACe,EAAE;EAAG,CAChC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormField, Input } from '@wix/design-system';
|
|
3
|
-
import {
|
|
3
|
+
import { useSelector, useWixPatternsContainer } from '@wix/patterns';
|
|
4
4
|
import { useController } from '@wix/patterns/form';
|
|
5
5
|
export const ShortText = props => {
|
|
6
|
-
var _field$validation,
|
|
6
|
+
var _field$validation, _controller$field$val, _field$validation3, _controller$fieldStat;
|
|
7
7
|
const {
|
|
8
8
|
field,
|
|
9
|
-
dataHook
|
|
9
|
+
dataHook,
|
|
10
|
+
formControl,
|
|
11
|
+
data
|
|
10
12
|
} = props;
|
|
11
13
|
const {
|
|
12
14
|
translate: t,
|
|
13
15
|
...container
|
|
14
16
|
} = useWixPatternsContainer();
|
|
15
17
|
useSelector(() => container.initTask.status);
|
|
16
|
-
const pageState = useEntityPageContext();
|
|
17
18
|
const stringLengthRange = (_field$validation = field.validation) == null ? void 0 : _field$validation.stringLengthRange;
|
|
18
19
|
const minLength = stringLengthRange == null ? void 0 : stringLengthRange.minLength;
|
|
19
20
|
const maxLength = stringLengthRange == null ? void 0 : stringLengthRange.maxLength;
|
|
20
21
|
const controller = useController({
|
|
21
22
|
name: (field == null ? void 0 : field.id) ?? '',
|
|
22
|
-
control:
|
|
23
|
-
defaultValue:
|
|
23
|
+
control: formControl,
|
|
24
|
+
defaultValue: data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? ''],
|
|
24
25
|
rules: {
|
|
25
26
|
validate: value => {
|
|
26
27
|
var _field$validation2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FormField","Input","useSelector","useWixPatternsContainer","useController","ShortText","props","_field$validation","_controller$field$val","_field$validation3","_controller$fieldStat","field","dataHook","formControl","data","translate","t","container","initTask","status","stringLengthRange","validation","minLength","maxLength","controller","name","id","control","defaultValue","rules","validate","value","_field$validation2","required","undefined","length","charMin","charMax","charCount","createElement","label","displayName","fieldState","error","statusMessage","message","onChange","e","target","onBlur","ref"],"sources":["../../../../src/components/fields/ShortText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport { useSelector, useWixPatternsContainer } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\n\nexport interface ShortTextProps extends BaseInputProps<string> {}\n\nexport const ShortText = (props: ShortTextProps) => {\n const { field, dataHook, formControl, data } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const stringLengthRange = field.validation?.stringLengthRange;\n const minLength = stringLengthRange?.minLength;\n const maxLength = stringLengthRange?.maxLength;\n\n const controller = useController({\n name: field?.id ?? '',\n control: formControl,\n defaultValue: data?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n\n if (minLength && value && value.length < minLength) {\n return t('cairo.fieldValidation.minCharacter', {\n charMin: minLength,\n });\n } else if (maxLength && value && value.length > maxLength) {\n return t('cairo.fieldValidation.maxCharacter', {\n charMax: maxLength,\n });\n }\n\n return true;\n },\n },\n });\n\n const charCount = maxLength\n ? maxLength - controller.field.value?.length\n : undefined;\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n charCount={charCount}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n dataHook={dataHook}\n >\n <Input\n value={controller.field.value}\n onChange={(e) => controller.field.onChange?.(e.target.value)}\n onBlur={controller.field.onBlur}\n dataHook={`short-text-${field.id}`}\n ref={controller.field.ref}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAErD,SAAS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AAK,CAACe,EAAE,EAAG;IACnCwB,GAAG,EAAE1B,UAAU,CAACb,KAAK,CAACuC;EAAI,CAC3B,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormField, Input } from '@wix/design-system';
|
|
3
3
|
import { Link } from '@wix/wix-ui-icons-common';
|
|
4
|
-
import {
|
|
4
|
+
import { useSelector, useWixPatternsContainer } from '@wix/patterns';
|
|
5
5
|
import { useController } from '@wix/patterns/form';
|
|
6
6
|
export const Url = props => {
|
|
7
|
-
var
|
|
7
|
+
var _field$validation2, _controller$fieldStat;
|
|
8
8
|
const {
|
|
9
9
|
field,
|
|
10
|
-
dataHook
|
|
10
|
+
dataHook,
|
|
11
|
+
formControl,
|
|
12
|
+
data
|
|
11
13
|
} = props;
|
|
12
14
|
const {
|
|
13
15
|
translate: t,
|
|
14
16
|
...container
|
|
15
17
|
} = useWixPatternsContainer();
|
|
16
18
|
useSelector(() => container.initTask.status);
|
|
17
|
-
const pageState = useEntityPageContext();
|
|
18
19
|
|
|
19
20
|
// Same regex as data-extensions https://github.com/wix-private/server-infra/blob/a6c3009d39bbb0312c929f68ee81c559e1eb5b4e/iptf/dataextensions/src/main/scala/com/wixpress/infra/dataextensions/runtime/validator/Formats.scala#L31
|
|
20
21
|
const uriPattern =
|
|
@@ -22,8 +23,8 @@ export const Url = props => {
|
|
|
22
23
|
/^[A-Za-z][A-Za-z0-9+.-]*:(\/\/([A-Za-z0-9._~\-%!$&'()*+,;=:]*@)?[A-Za-z0-9._~\-!$&'()*+,;=%:\[\]]*(:[0-9]*)?)?[A-Za-z0-9._~\-%!$&'()*+,;=:@\/]*([?][A-Za-z0-9._~\-%!$&'()*+,;=:@\/?]*)?([#][A-Za-z0-9._~\-%!$&'()*+,;=:@\/?]*)?$/;
|
|
23
24
|
const controller = useController({
|
|
24
25
|
name: (field == null ? void 0 : field.id) ?? '',
|
|
25
|
-
control:
|
|
26
|
-
defaultValue:
|
|
26
|
+
control: formControl,
|
|
27
|
+
defaultValue: data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? ''],
|
|
27
28
|
rules: {
|
|
28
29
|
validate: value => {
|
|
29
30
|
var _field$validation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FormField","Input","Link","useSelector","useWixPatternsContainer","useController","Url","props","_field$validation2","_controller$fieldStat","field","dataHook","formControl","data","translate","t","container","initTask","status","uriPattern","controller","name","id","control","defaultValue","rules","validate","value","_field$validation","validation","required","undefined","test","createElement","label","displayName","fieldState","error","statusMessage","message","prefix","IconAffix","placeholder","onChange","e","target","onBlur","ref"],"sources":["../../../../src/components/fields/Url.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport { Link } from '@wix/wix-ui-icons-common';\nimport { useSelector, useWixPatternsContainer } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\n\nexport interface UrlProps extends BaseInputProps<string> {}\n\nexport const Url = (props: UrlProps) => {\n const { field, dataHook, formControl, data } = props;\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n // Same regex as data-extensions https://github.com/wix-private/server-infra/blob/a6c3009d39bbb0312c929f68ee81c559e1eb5b4e/iptf/dataextensions/src/main/scala/com/wixpress/infra/dataextensions/runtime/validator/Formats.scala#L31\n const uriPattern =\n // eslint-disable-next-line no-useless-escape\n /^[A-Za-z][A-Za-z0-9+.-]*:(\\/\\/([A-Za-z0-9._~\\-%!$&'()*+,;=:]*@)?[A-Za-z0-9._~\\-!$&'()*+,;=%:\\[\\]]*(:[0-9]*)?)?[A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/]*([?][A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/?]*)?([#][A-Za-z0-9._~\\-%!$&'()*+,;=:@\\/?]*)?$/;\n\n const controller = useController({\n name: field?.id ?? '',\n control: formControl,\n defaultValue: data?.[field?.id ?? ''],\n rules: {\n validate: (value: string | null | undefined) => {\n if (\n field.validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n } else if (value) {\n return (\n uriPattern.test(value) || t('cairo.customFields.url-input.error')\n );\n }\n return true;\n },\n },\n });\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n dataHook={dataHook}\n status={controller.fieldState.error ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n >\n <Input\n prefix={\n <Input.IconAffix>\n <Link />\n </Input.IconAffix>\n }\n placeholder={t('cairo.customFields.url-input.placeholder')}\n dataHook={`url-${field.id}`}\n value={controller.field.value}\n onChange={(e) => controller.field.onChange?.(e.target.value)}\n onBlur={controller.field.onBlur}\n ref={controller.field.ref}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAErD,SAASC,IAAI,QAAQ,0BAA0B;AAC/C,SAASC,WAAW,EAAEC,uBAAuB,QAAQ,eAAe;AACpE,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,GAAG,GAAIC,KAAe,IAAK;EAAA,IAAAC,kBAAA,EAAAC,qBAAA;EACtC,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC,WAAW;IAAEC;EAAK,CAAC,GAAGN,KAAK;EACpD,MAAM;IAAEO,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGZ,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMa,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;;EAE5C;EACA,MAAMC,UAAU;EACd;EACA,kOAAkO;EAEpO,MAAMC,UAAU,GAAGf,aAAa,CAAC;IAC/BgB,IAAI,EAAE,CAAAX,KAAK,oBAALA,KAAK,CAAEY,EAAE,KAAI,EAAE;IACrBC,OAAO,EAAEX,WAAW;IACp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AK,EAAEP,UAAU,CAACV,KAAK,CAACiB,KAAM;IAC9BgB,QAAQ,EAAGC,CAAC,IAAKxB,UAAU,CAACV,KAAK,CAACiC,QAAQ,oBAAzBvB,UAAU,CAACV,KAAK,CAACiC,QAAQ,CAAGC,CAAC,CAACC,MAAM,CAAClB,KAAK,CAAE;IAC7DmB,MAAM,EAAE1B,UAAU,CAACV,KAAK,CAACoC,MAAO;IAChCC,GAAG,EAAE3B,UAAU,CAACV,KAAK,CAACqC;EAAI,CAC3B,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Checkbox } from './Checkbox';
|
|
2
|
+
export { DateInput } from './DateInput';
|
|
3
|
+
export { DateTime } from './DateTime';
|
|
4
|
+
export { ImageInput } from './ImageInput';
|
|
5
|
+
export { LongText } from './LongText';
|
|
6
|
+
export { Number } from './Number';
|
|
7
|
+
export { ShortText } from './ShortText';
|
|
8
|
+
export { Url } from './Url';
|
|
9
|
+
export * from './types';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Checkbox","DateInput","DateTime","ImageInput","LongText","Number","ShortText","Url"],"sources":["../../../../src/components/fields/index.ts"],"sourcesContent":["export { Checkbox } from './Checkbox';\nexport { DateInput } from './DateInput';\nexport { DateTime } from './DateTime';\nexport { ImageInput } from './ImageInput';\nexport { LongText } from './LongText';\nexport { Number } from './Number';\nexport { ShortText } from './ShortText';\nexport { Url } from './Url';\nexport * from './types';\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,QAAQ,QAAQ,YAAY;AACrC,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,GAAG,QAAQ,OAAO;AAC3B,cAAc,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/fields/types.ts"],"sourcesContent":["import { Control } from '@wix/patterns/form';\nimport { Field } from '../../types';\n\nexport interface BaseInputRef {\n focus?: () => void;\n invalid?: boolean;\n}\n\nexport interface BaseInputProps<T> {\n field: Field;\n value: T;\n onChange: (newValue: T) => void;\n dataHook?: string;\n inputRef?: (ref: BaseInputRef) => void;\n formControl: Control<any>;\n data: Record<string, any>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getDateWithoutTimezone","date","Date","toISOString","slice","getISODateStringWithFixedTimezone","_date","userTimezoneOffset","getTimezoneOffset","getTime"],"sources":["../../../../../src/components/fields/utils/dates.ts"],"sourcesContent":["// this function is used to get the date without timezone\nexport const getDateWithoutTimezone = (date: Date | string) =>\n new Date(new Date(date).toISOString().slice(0, -1));\n\n// this function is used to get the date with fixed timezone\nexport const getISODateStringWithFixedTimezone = (date: Date | string) => {\n const _date = new Date(date);\n const userTimezoneOffset = _date.getTimezoneOffset() * 60000;\n return new Date(_date.getTime() - userTimezoneOffset)\n .toISOString()\n .slice(0, -1);\n};\n"],"mappings":"AAAA;AACA,OAAO,MAAMA,sBAAsB,GAAIC,IAAmB,IACxD,IAAIC,IAAI,CAAC,IAAIA,IAAI,CAACD,IAAI,CAAC,CAACE,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;;AAErD;AACA,OAAO,MAAMC,iCAAiC,GAAIJ,IAAmB,IAAK;EACxE,MAAMK,KAAK,GAAG,IAAIJ,IAAI,CAACD,IAAI,CAAC;EAC5B,MAAMM,kBAAkB,GAAGD,KAAK,CAACE,iBAAiB,CAAC,CAAC,GAAG,KAAK;EAC5D,OAAO,IAAIN,IAAI,CAACI,KAAK,CAACG,OAAO,CAAC,CAAC,GAAGF,kBAAkB,CAAC,CAClDJ,WAAW,CAAC,CAAC,CACbC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1,33 +1,44 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Card, Layout } from '@wix/design-system';
|
|
3
|
-
import { EntityPage } from '@wix/patterns';
|
|
4
|
-
import {
|
|
5
|
-
export const
|
|
3
|
+
import { SettingsPage, EntityPage } from '@wix/patterns';
|
|
4
|
+
import { ContentCardLayout } from './ContentCardLayout';
|
|
5
|
+
export const ContentCard = _ref => {
|
|
6
6
|
var _layout$card$subtitle;
|
|
7
7
|
let {
|
|
8
|
+
type = 'entity',
|
|
9
|
+
mode = 'edit',
|
|
8
10
|
layout,
|
|
9
11
|
sectionId,
|
|
10
12
|
cardIndex,
|
|
11
|
-
setInputRef
|
|
13
|
+
setInputRef,
|
|
14
|
+
fields,
|
|
15
|
+
form,
|
|
16
|
+
data
|
|
12
17
|
} = _ref;
|
|
18
|
+
const Component = type === 'settings' ? SettingsPage : EntityPage;
|
|
19
|
+
const CardWrapper = mode === 'view' ? Card : Component.Card;
|
|
13
20
|
switch (layout.type) {
|
|
14
21
|
case 'card':
|
|
15
|
-
return /*#__PURE__*/React.createElement(
|
|
22
|
+
return /*#__PURE__*/React.createElement(CardWrapper, {
|
|
16
23
|
minHeight: "50px"
|
|
17
24
|
}, /*#__PURE__*/React.createElement(Card.Header, {
|
|
18
25
|
title: layout.card.title.text,
|
|
19
26
|
subtitle: (_layout$card$subtitle = layout.card.subtitle) == null ? void 0 : _layout$card$subtitle.text
|
|
20
|
-
}), /*#__PURE__*/React.createElement(Card.Divider, null), /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Layout, null, layout.card.children.map((child, index) => /*#__PURE__*/React.createElement(
|
|
27
|
+
}), /*#__PURE__*/React.createElement(Card.Divider, null), /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Layout, null, layout.card.children.map((child, index) => /*#__PURE__*/React.createElement(ContentCardLayout, {
|
|
21
28
|
key: `${sectionId}-card-${cardIndex}-content-${index}`,
|
|
29
|
+
mode: mode,
|
|
22
30
|
content: child,
|
|
23
31
|
level: 0,
|
|
24
32
|
sectionId: sectionId,
|
|
25
33
|
cardIndex: cardIndex,
|
|
26
34
|
contentIndex: index,
|
|
27
|
-
setInputRef: setInputRef
|
|
35
|
+
setInputRef: setInputRef,
|
|
36
|
+
fields: fields,
|
|
37
|
+
form: form,
|
|
38
|
+
data: data
|
|
28
39
|
})))));
|
|
29
40
|
default:
|
|
30
41
|
return null;
|
|
31
42
|
}
|
|
32
43
|
};
|
|
33
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=ContentCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Card","Layout","SettingsPage","EntityPage","ContentCardLayout","ContentCard","_ref","_layout$card$subtitle","type","mode","layout","sectionId","cardIndex","setInputRef","fields","form","data","Component","CardWrapper","createElement","minHeight","Header","title","card","text","subtitle","Divider","Content","children","map","child","index","key","content","level","contentIndex"],"sources":["../../../../src/components/layouts/ContentCard.tsx"],"sourcesContent":["import React from 'react';\nimport { Card, Layout } from '@wix/design-system';\nimport { SettingsPage, EntityPage } from '@wix/patterns';\nimport { UseFormReturn } from '@wix/patterns/form';\nimport { CardLayout, BaseInputRef, Field } from '../../types';\nimport { ContentCardType, ContentCardMode } from './types';\nimport { ContentCardLayout } from './ContentCardLayout';\n\nexport interface ContentCardProps {\n type?: ContentCardType;\n mode?: ContentCardMode;\n layout: CardLayout;\n sectionId: string;\n cardIndex: number;\n setInputRef?: (id: string, input: BaseInputRef) => void;\n fields?: Record<string, Field | undefined>;\n form?: UseFormReturn<any>;\n data?: Record<string, any>;\n}\n\nexport const ContentCard: React.FC<ContentCardProps> = ({\n type = 'entity',\n mode = 'edit',\n layout,\n sectionId,\n cardIndex,\n setInputRef,\n fields,\n form,\n data,\n}) => {\n const Component = type === 'settings' ? SettingsPage : EntityPage;\n const CardWrapper = mode === 'view' ? Card : Component.Card;\n\n switch (layout.type) {\n case 'card':\n return (\n <CardWrapper minHeight=\"50px\">\n <Card.Header\n title={layout.card.title.text}\n subtitle={layout.card.subtitle?.text}\n />\n <Card.Divider />\n <Card.Content>\n <Layout>\n {layout.card.children.map((child, index: number) => (\n <ContentCardLayout\n key={`${sectionId}-card-${cardIndex}-content-${index}`}\n mode={mode}\n content={child}\n level={0}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={data}\n />\n ))}\n </Layout>\n </Card.Content>\n </CardWrapper>\n );\n default:\n return null;\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SAASC,YAAY,EAAEC,UAAU,QAAQ,eAAe;AAIxD,SAASC,iBAAiB,QAAQ,qBAAqB;AAcvD,OAAO,MAAMC,WAAuC,GAAGC,IAAA,IAUjD;EAAA,IAAAC,qBAAA;EAAA,IAVkD;IACtDC,IAAI,GAAG,QAAQ;IACfC,IAAI,GAAG,MAAM;IACbC,MAAM;IACNC,SAAS;IACTC,SAAS;IACTC,WAAW;IACXC,MAAM;IACNC,IAAI;IACJC;EACF,CAAC,GAAAV,IAAA;EACC,MAAMW,SAAS,GAAGT,IAAI,KAAK,UAAU,GAAGN,YAAY,GAAGC,UAAU;EACjE,MAAMe,WAAW,GAAGT,IAAI,KAAK,MAAM,GAAGT,IAAI,GAAGiB,SAAS,CAACjB,IAAI;EAE3D,QAAQU,MAAM,CAACF,IAAI;IACjB,KAAK,MAAM;MACT,oBACET,KAAA,CAAAoB,aAAA,CAACD,WAAW;QAACE,SAAS,EAAC;MAAM,gBAC3BrB,KAAA,CAAAoB,aAAA,CAACnB,IAAI,CAACqB,MAAM;QACVC,KAAK,EAAEZ,MAAM,CAACa,IAAI,CAACD,KAAK,CAACE,IAAK;QAC9BC,QAAQ,GAAAlB,qBAAA,GAAEG,MAAM,CAACa,IAAI,CAACE,QAAQ,qBAApBlB,qBAAA,CAAsBiB;MAAK,CACtC,CAAC,eACFzB,KAAA,CAAAoB,aAAA,CAACnB,IAAI,CAAC0B,OAAO,MAAE,CAAC,eAChB3B,KAAA,CAAAoB,aAAA,CAACnB,IAAI,CAAC2B,OAAO,qBACX5B,KAAA,CAAAoB,aAAA,CAAClB,MAAM,QACJS,MAAM,CAACa,IAAI,CAACK,QAAQ,CAACC,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAa,kBAC7ChC,KAAA,CAAAoB,aAAA,CAACf,iBAAiB;QAChB4B,GAAG,EAAE,GAAGrB,SAAS,SAASC,SAAS,YAAYmB,KAAK,EAAG;QACvDtB,IAAI,EAAEA,IAAK;QACXwB,OAAO,EAAEH,KAAM;QACfI,KAAK,EAAE,CAAE;QACTvB,SAAS,EAAEA,SAAU;QACrBC,SAAS,EAAEA,SAAU;QACrBuB,YAAY,EAAEJ,KAAM;QACpBlB,WAAW,EAAEA,WAAY;QACzBC,MAAM,EAAEA,MAAO;QACfC,IAAI,EAAEA,IAAK;QACXC,IAAI,EAAEA;MAAK,CACZ,CACF,CACK,CACI,CACH,CAAC;IAElB;MACE,OAAO,IAAI;EACf;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,53 +1,72 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { lazy, Suspense } from 'react';
|
|
2
2
|
import { Cell, Layout } from '@wix/design-system';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { useAutoPatternsOverridesContext } from '../../providers';
|
|
4
|
+
import { ViewField } from './ViewField';
|
|
5
|
+
// Lazy load FormField to avoid bundling heavy field components in view mode
|
|
6
|
+
const FormField = /*#__PURE__*/lazy(() => import('./FormField').then(m => ({
|
|
7
|
+
default: m.FormField
|
|
8
|
+
})));
|
|
9
|
+
export const ContentCardLayout = _ref => {
|
|
8
10
|
var _content$container$ch, _overrides$components;
|
|
9
11
|
let {
|
|
12
|
+
mode = 'edit',
|
|
10
13
|
content,
|
|
11
14
|
level,
|
|
12
15
|
sectionId,
|
|
13
16
|
cardIndex,
|
|
14
17
|
contentIndex,
|
|
15
|
-
setInputRef
|
|
18
|
+
setInputRef,
|
|
19
|
+
fields,
|
|
20
|
+
form,
|
|
21
|
+
data
|
|
16
22
|
} = _ref;
|
|
17
|
-
const schema = useSchema();
|
|
18
23
|
const overrides = useAutoPatternsOverridesContext();
|
|
19
|
-
const pageState = useEntityPageContext();
|
|
20
|
-
const entity = pageState.entity;
|
|
21
24
|
switch (content.type) {
|
|
22
25
|
case 'field':
|
|
23
26
|
if (!content.field.fieldId) {
|
|
24
27
|
return null;
|
|
25
28
|
}
|
|
26
|
-
const field =
|
|
29
|
+
const field = fields == null ? void 0 : fields[content.field.fieldId];
|
|
27
30
|
if (!field) {
|
|
28
31
|
return null;
|
|
29
32
|
}
|
|
33
|
+
if (mode === 'view') {
|
|
34
|
+
return /*#__PURE__*/React.createElement(Cell, {
|
|
35
|
+
span: content.field.span
|
|
36
|
+
}, /*#__PURE__*/React.createElement(ViewField, {
|
|
37
|
+
field: field,
|
|
38
|
+
data: data
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
30
41
|
return /*#__PURE__*/React.createElement(Cell, {
|
|
31
42
|
span: content.field.span
|
|
32
|
-
}, /*#__PURE__*/React.createElement(
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Suspense, {
|
|
44
|
+
fallback: null
|
|
45
|
+
}, /*#__PURE__*/React.createElement(FormField, {
|
|
33
46
|
key: content.field.fieldId,
|
|
34
47
|
field: field,
|
|
35
|
-
inputRef: ref => setInputRef(content.field.fieldId, ref)
|
|
36
|
-
|
|
48
|
+
inputRef: ref => setInputRef == null ? void 0 : setInputRef(content.field.fieldId, ref),
|
|
49
|
+
formControl: form == null ? void 0 : form.control,
|
|
50
|
+
data: data
|
|
51
|
+
})));
|
|
37
52
|
case 'container':
|
|
38
53
|
if (!((_content$container$ch = content.container.children) != null && _content$container$ch.length)) {
|
|
39
54
|
return null;
|
|
40
55
|
}
|
|
41
56
|
return /*#__PURE__*/React.createElement(Cell, {
|
|
42
57
|
span: content.container.span
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Layout, null, content.container.children.map((child, index) => /*#__PURE__*/React.createElement(
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Layout, null, content.container.children.map((child, index) => /*#__PURE__*/React.createElement(ContentCardLayout, {
|
|
44
59
|
key: `${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`,
|
|
60
|
+
mode: mode,
|
|
45
61
|
content: child,
|
|
46
62
|
level: level + 1,
|
|
47
63
|
sectionId: sectionId,
|
|
48
64
|
cardIndex: cardIndex,
|
|
49
65
|
contentIndex: index,
|
|
50
|
-
setInputRef: setInputRef
|
|
66
|
+
setInputRef: setInputRef,
|
|
67
|
+
fields: fields,
|
|
68
|
+
form: form,
|
|
69
|
+
data: data
|
|
51
70
|
}))));
|
|
52
71
|
case 'component':
|
|
53
72
|
if (!content.component.componentId) {
|
|
@@ -60,11 +79,11 @@ export const RenderLayoutContent = _ref => {
|
|
|
60
79
|
return /*#__PURE__*/React.createElement(Cell, {
|
|
61
80
|
span: content.component.span
|
|
62
81
|
}, /*#__PURE__*/React.createElement(Component, {
|
|
63
|
-
form:
|
|
64
|
-
entity:
|
|
82
|
+
form: form,
|
|
83
|
+
entity: data
|
|
65
84
|
}));
|
|
66
85
|
default:
|
|
67
86
|
return null;
|
|
68
87
|
}
|
|
69
88
|
};
|
|
70
|
-
//# sourceMappingURL=
|
|
89
|
+
//# sourceMappingURL=ContentCardLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","lazy","Suspense","Cell","Layout","useAutoPatternsOverridesContext","ViewField","FormField","then","m","default","ContentCardLayout","_ref","_content$container$ch","_overrides$components","mode","content","level","sectionId","cardIndex","contentIndex","setInputRef","fields","form","data","overrides","type","field","fieldId","createElement","span","fallback","key","inputRef","ref","formControl","control","container","children","length","map","child","index","component","componentId","Component","components","entity"],"sources":["../../../../src/components/layouts/ContentCardLayout.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { Cell, Layout } from '@wix/design-system';\nimport { UseFormReturn } from '@wix/patterns/form';\nimport { useAutoPatternsOverridesContext } from '../../providers';\nimport { LayoutContent, BaseInputRef, Field } from '../../types';\nimport { ViewField } from './ViewField';\nimport { ContentCardMode } from './types';\n\n// Lazy load FormField to avoid bundling heavy field components in view mode\nconst FormField = lazy(() =>\n import('./FormField').then((m) => ({ default: m.FormField })),\n);\n\nexport interface ContentCardLayoutProps {\n mode?: ContentCardMode;\n content: LayoutContent;\n level: number;\n sectionId: string;\n cardIndex: number;\n contentIndex: number;\n setInputRef?: (id: string, input: BaseInputRef) => void;\n fields?: Record<string, Field | undefined>;\n form?: UseFormReturn<any>;\n data?: Record<string, any>;\n}\n\nexport const ContentCardLayout: React.FC<ContentCardLayoutProps> = ({\n mode = 'edit',\n content,\n level,\n sectionId,\n cardIndex,\n contentIndex,\n setInputRef,\n fields,\n form,\n data,\n}) => {\n const overrides = useAutoPatternsOverridesContext();\n\n switch (content.type) {\n case 'field':\n if (!content.field.fieldId) {\n return null;\n }\n\n const field = fields?.[content.field.fieldId];\n if (!field) {\n return null;\n }\n\n if (mode === 'view') {\n return (\n <Cell span={content.field.span}>\n <ViewField field={field} data={data} />\n </Cell>\n );\n }\n\n return (\n <Cell span={content.field.span}>\n <Suspense fallback={null}>\n <FormField\n key={content.field.fieldId}\n field={field}\n inputRef={(ref: BaseInputRef) =>\n setInputRef?.(content.field.fieldId, ref)\n }\n formControl={form?.control}\n data={data}\n />\n </Suspense>\n </Cell>\n );\n\n case 'container':\n if (!content.container.children?.length) {\n return null;\n }\n\n return (\n <Cell span={content.container.span}>\n <Layout>\n {content.container.children.map((child, index) => (\n <ContentCardLayout\n key={`${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`}\n mode={mode}\n content={child}\n level={level + 1}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n setInputRef={setInputRef}\n fields={fields}\n form={form}\n data={data}\n />\n ))}\n </Layout>\n </Cell>\n );\n\n case 'component':\n if (!content.component.componentId) {\n return null;\n }\n\n const Component = overrides?.components?.[content.component.componentId];\n if (!Component) {\n return null;\n }\n\n return (\n <Cell span={content.component.span}>\n <Component form={form} entity={data as Record<string, any>} />\n </Cell>\n );\n\n default:\n return null;\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AAEjD,SAASC,+BAA+B,QAAQ,iBAAiB;AAEjE,SAASC,SAAS,QAAQ,aAAa;AAGvC;AACA,MAAMC,SAAS,gBAAGN,IAAI,CAAC,MACrB,MAAM,CAAC,aAAa,CAAC,CAACO,IAAI,CAAEC,CAAC,KAAM;EAAEC,OAAO,EAAED,CAAC,CAACF;AAAU,CAAC,CAAC,CAC9D,CAAC;AAeD,OAAO,MAAMI,iBAAmD,GAAGC,IAAA,IAW7D;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EAAA,IAX8D;IAClEC,IAAI,GAAG,MAAM;IACbC,OAAO;IACPC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,YAAY;IACZC,WAAW;IACXC,MAAM;IACNC,IAAI;IACJC;EACF,CAAC,GAAAZ,IAAA;EACC,MAAMa,SAAS,GAAGpB,+BAA+B,CAAC,CAAC;EAEnD,QAAQW,OAAO,CAACU,IAAI;IAClB,KAAK,OAAO;MACV,IAAI,CAACV,OAAO,CAACW,KAAK,CAACC,OAAO,EAAE;QAC1B,OAAO,IAAI;MACb;MAEA,MAAMD,KAAK,GAAGL,MAAM,oBAANA,MAAM,CAAGN,OAAO,CAACW,KAAK,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AA,CAAA6B,aAAA,CAAClB,iBAAiB;QAChBqB,GAAG,EAAE,GAAGd,SAAS,SAASC,SAAS,YAAYC,YAAY,UAAUH,KAAK,UAAUyB,KAAK,EAAG;QAC5F3B,IAAI,EAAEA,IAAK;QACXC,OAAO,EAAEyB,KAAM;QACfxB,KAAK,EAAEA,KAAK,GAAG,CAAE;QACjBC,SAAS,EAAEA,SAAU;QACrBC,SAAS,EAAEA,SAAU;QACrBC,YAAY,EAAEsB,KAAM;QACpBrB,WAAW,EAAEA,WAAY;QACzBC,MAAM,EAAEA,MAAO;QACfC,IAAI,EAAEA,IAAK;QACXC,IAAI,EAAEA;MAAK,CACZ,CACF,CACK,CACJ,CAAC;IAGX,KAAK,WAAW;MACd,IAAI,CAACR,OAAO,CAAC2B,SAAS,CAACC,WAAW,EAAE;QAClC,OAAO,IAAI;MACb;MAEA,MAAMC,SAAS,GAAGpB,SAAS,aAAAX,qBAAA,GAATW,SAAS,CAAEqB,UAAU,qBAArBhC,qBAAA,CAAwBE,OAAO,CAAC2B,SAAS,CAACC,WAAW,CAAC;MACxE,IAAI,CAACC,SAAS,EAAE;QACd,OAAO,IAAI;MACb;MAEA,oBACE7C,KAAA,CAAA6B,aAAA,CAAC1B,IAAI;QAAC2B,IAAI,EAAEd,OAAO,CAAC2B,SAAS,CAACb;MAAK,gBACjC9B,KAAA,CAAA6B,aAAA,CAACgB,SAAS;QAACtB,IAAI,EAAEA,IAAK;QAACwB,MAAM,EAAEvB;MAA4B,CAAE,CACzD,CAAC;IAGX;MACE,OAAO,IAAI;EACf;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SettingsPage, EntityPage, useSettingsPage, useEntityPage } from '@wix/patterns';
|
|
3
|
+
import { useForm } from '@wix/patterns/form';
|
|
4
|
+
import { ContentCard } from './ContentCard';
|
|
5
|
+
export const ContentSkeleton = _ref => {
|
|
6
|
+
var _pageConfig$layout, _pageConfig$layout2, _pageConfig$layout$si;
|
|
7
|
+
let {
|
|
8
|
+
type = 'entity',
|
|
9
|
+
pageConfig
|
|
10
|
+
} = _ref;
|
|
11
|
+
const Component = type === 'settings' ? SettingsPage : EntityPage;
|
|
12
|
+
const form = useForm();
|
|
13
|
+
const settingsState = useSettingsPage({
|
|
14
|
+
form,
|
|
15
|
+
onSave: async () => {},
|
|
16
|
+
onCancel: async () => {},
|
|
17
|
+
fetch: async () => new Promise(() => {})
|
|
18
|
+
});
|
|
19
|
+
const entityState = useEntityPage({
|
|
20
|
+
parentPath: '',
|
|
21
|
+
form,
|
|
22
|
+
onSave: async () => ({
|
|
23
|
+
updatedEntity: {}
|
|
24
|
+
}),
|
|
25
|
+
fetch: async () => new Promise(() => {})
|
|
26
|
+
});
|
|
27
|
+
return /*#__PURE__*/React.createElement(Component, {
|
|
28
|
+
state: type === 'settings' ? settingsState : entityState
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Component.Header, {
|
|
30
|
+
title: {
|
|
31
|
+
text: ''
|
|
32
|
+
}
|
|
33
|
+
}), /*#__PURE__*/React.createElement(Component.Content, null, /*#__PURE__*/React.createElement(Component.MainContent, null, (_pageConfig$layout = pageConfig.layout) == null || (_pageConfig$layout = _pageConfig$layout.main) == null ? void 0 : _pageConfig$layout.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
34
|
+
key: `main-section-card-${layoutIndex}`,
|
|
35
|
+
type: type,
|
|
36
|
+
layout: layout,
|
|
37
|
+
sectionId: "main",
|
|
38
|
+
cardIndex: layoutIndex
|
|
39
|
+
}))), (_pageConfig$layout2 = pageConfig.layout) != null && _pageConfig$layout2.sidebar ? /*#__PURE__*/React.createElement(Component.AdditionalContent, null, (_pageConfig$layout$si = pageConfig.layout.sidebar) == null ? void 0 : _pageConfig$layout$si.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(ContentCard, {
|
|
40
|
+
key: `sidebar-section-card-${layoutIndex}`,
|
|
41
|
+
type: type,
|
|
42
|
+
layout: layout,
|
|
43
|
+
sectionId: "sidebar",
|
|
44
|
+
cardIndex: layoutIndex
|
|
45
|
+
}))) : null));
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=ContentSkeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","SettingsPage","EntityPage","useSettingsPage","useEntityPage","useForm","ContentCard","ContentSkeleton","_ref","_pageConfig$layout","_pageConfig$layout2","_pageConfig$layout$si","type","pageConfig","Component","form","settingsState","onSave","onCancel","fetch","Promise","entityState","parentPath","updatedEntity","createElement","state","Header","title","text","Content","MainContent","layout","main","map","layoutIndex","key","sectionId","cardIndex","sidebar","AdditionalContent"],"sources":["../../../../src/components/layouts/ContentSkeleton.tsx"],"sourcesContent":["import React from 'react';\nimport {\n SettingsPage,\n EntityPage,\n useSettingsPage,\n useEntityPage,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { EntityPageConfig, SettingsPageConfig } from '../../types';\nimport { ContentCard } from './ContentCard';\nimport { ContentCardType } from './types';\n\nexport interface ContentSkeletonProps {\n type?: ContentCardType;\n pageConfig: SettingsPageConfig | EntityPageConfig;\n}\n\nexport const ContentSkeleton = ({\n type = 'entity',\n pageConfig,\n}: ContentSkeletonProps) => {\n const Component = type === 'settings' ? SettingsPage : EntityPage;\n const form = useForm();\n\n const settingsState = useSettingsPage<any, any>({\n form,\n onSave: async () => {},\n onCancel: async () => {},\n fetch: async () => new Promise(() => {}),\n });\n\n const entityState = useEntityPage<any, any>({\n parentPath: '',\n form,\n onSave: async () => ({ updatedEntity: {} }),\n fetch: async () => new Promise(() => {}),\n });\n\n return (\n <Component\n state={type === 'settings' ? settingsState : (entityState as any)}\n >\n <Component.Header title={{ text: '' }} />\n <Component.Content>\n <Component.MainContent>\n {pageConfig.layout?.main?.map((layout, layoutIndex) => (\n <ContentCard\n key={`main-section-card-${layoutIndex}`}\n type={type}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n />\n ))}\n </Component.MainContent>\n {pageConfig.layout?.sidebar ? (\n <Component.AdditionalContent>\n {pageConfig.layout.sidebar?.map((layout, layoutIndex) => (\n <ContentCard\n key={`sidebar-section-card-${layoutIndex}`}\n type={type}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n />\n ))}\n </Component.AdditionalContent>\n ) : null}\n </Component.Content>\n </Component>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,YAAY,EACZC,UAAU,EACVC,eAAe,EACfC,aAAa,QACR,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAE5C,SAASC,WAAW,QAAQ,eAAe;AAQ3C,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAGH;EAAA,IAAAC,kBAAA,EAAAC,mBAAA,EAAAC,qBAAA;EAAA,IAHI;IAC9BC,IAAI,GAAG,QAAQ;IACfC;EACoB,CAAC,GAAAL,IAAA;EACrB,MAAMM,SAAS,GAAGF,IAAI,KAAK,UAAU,GAAGX,YAAY,GAAGC,UAAU;EACjE,MAAMa,IAAI,GAAGV,OAAO,CAAC,CAAC;EAEtB,MAAMW,aAAa,GAAGb,eAAe,CAAW;IAC9CY,IAAI;IACJE,MAAM,EAAE,MAAAA,CAAA,KAAY,CAAC,CAAC;IACtBC,QAAQ,EAAE,MAAAA,CAAA,KAAY,CAAC,CAAC;IACxBC,KAAK,EAAE,MAAAA,CAAA,KAAY,IAAIC,OAAO,CAAC,MAAM,CAAC,CAAC;EACzC,CAAC,CAAC;EAEF,MAAMC,WAAW,GAAGjB,aAAa,CAAW;IAC1CkB,UAAU,EAAE,EAAE;IACdP,IAAI;IACJE,MAAM,EAAE,MAAAA,CAAA,MAAa;MAAEM,aAAa,EAAE,CAAC;IAAE,CAAC,CAAC;IAC3CJ,KAAK,EAAE,MAAAA,CAAA,KAAY,IAAIC,OAAO,CAAC,MAAM,CAAC,CAAC;EACzC,CAAC,CAAC;EAEF,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 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useController } from '@wix/patterns/form';
|
|
3
|
+
import { ShortText, LongText, Checkbox, DateInput, DateTime, Number, Url, ImageInput } from '../fields';
|
|
4
|
+
export const EDITABLE_INPUT_ELEMENTS = {
|
|
5
|
+
SHORT_TEXT: ShortText,
|
|
6
|
+
LONG_TEXT: LongText,
|
|
7
|
+
BOOLEAN: Checkbox,
|
|
8
|
+
DATE: DateInput,
|
|
9
|
+
DATETIME: DateTime,
|
|
10
|
+
NUMBER: Number,
|
|
11
|
+
URL: Url,
|
|
12
|
+
IMAGE: ImageInput
|
|
13
|
+
};
|
|
14
|
+
export const FormField = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
field,
|
|
17
|
+
inputRef,
|
|
18
|
+
formControl,
|
|
19
|
+
data
|
|
20
|
+
} = _ref;
|
|
21
|
+
const controller = useController({
|
|
22
|
+
name: (field == null ? void 0 : field.id) ?? '',
|
|
23
|
+
control: formControl,
|
|
24
|
+
defaultValue: data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? '']
|
|
25
|
+
});
|
|
26
|
+
if (!EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type)) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const FieldInput = EDITABLE_INPUT_ELEMENTS[field.type];
|
|
30
|
+
return /*#__PURE__*/React.createElement(FieldInput, {
|
|
31
|
+
field: field,
|
|
32
|
+
value: controller.field.value,
|
|
33
|
+
onChange: controller.field.onChange,
|
|
34
|
+
dataHook: `form-field-${field.id}`,
|
|
35
|
+
inputRef: inputRef,
|
|
36
|
+
formControl: formControl,
|
|
37
|
+
data: data ?? {}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=FormField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useController","ShortText","LongText","Checkbox","DateInput","DateTime","Number","Url","ImageInput","EDITABLE_INPUT_ELEMENTS","SHORT_TEXT","LONG_TEXT","BOOLEAN","DATE","DATETIME","NUMBER","URL","IMAGE","FormField","_ref","field","inputRef","formControl","data","controller","name","id","control","defaultValue","hasOwnProperty","type","FieldInput","createElement","value","onChange","dataHook"],"sources":["../../../../src/components/layouts/FormField.tsx"],"sourcesContent":["import React from 'react';\nimport { useController, Control } from '@wix/patterns/form';\nimport { Field, PatternsFieldType } from '../../types';\nimport {\n ShortText,\n LongText,\n Checkbox,\n DateInput,\n DateTime,\n Number,\n Url,\n ImageInput,\n BaseInputProps,\n} from '../fields';\n\nexport const EDITABLE_INPUT_ELEMENTS: Partial<\n Record<PatternsFieldType, React.ComponentType<any>>\n> = {\n SHORT_TEXT: ShortText,\n LONG_TEXT: LongText,\n BOOLEAN: Checkbox,\n DATE: DateInput,\n DATETIME: DateTime,\n NUMBER: Number,\n URL: Url,\n IMAGE: ImageInput,\n};\n\nexport interface FormFieldProps {\n field: Field;\n inputRef?: BaseInputProps<any>['inputRef'];\n formControl?: Control<any>;\n data?: Record<string, any>;\n}\n\nexport const FormField: React.FC<FormFieldProps> = ({\n field,\n inputRef,\n formControl,\n data,\n}) => {\n const controller = useController({\n name: field?.id ?? '',\n control: formControl,\n defaultValue: data?.[field?.id ?? ''],\n });\n\n if (!EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type)) {\n return null;\n }\n\n const FieldInput = EDITABLE_INPUT_ELEMENTS[field.type]!;\n\n return (\n <FieldInput\n field={field}\n value={controller.field.value}\n onChange={controller.field.onChange}\n dataHook={`form-field-${field.id}`}\n inputRef={inputRef}\n formControl={formControl}\n data={data ?? {}}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAiB,oBAAoB;AAE3D,SACEC,SAAS,EACTC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,GAAG,EACHC,UAAU,QAEL,WAAW;AAElB,OAAO,MAAMC,uBAEZ,GAAG;EACFC,UAAU,EAAET,SAAS;EACrBU,SAAS,EAAET,QAAQ;EACnBU,OAAO,EAAET,QAAQ;EACjBU,IAAI,EAAET,SAAS;EACfU,QAAQ,EAAET,QAAQ;EAClBU,MAAM,EAAET,MAAM;EACdU,GAAG,EAAET,GAAG;EACRU,KAAK,EAAET;AACT,CAAC;AASD,OAAO,MAAMU,SAAmC,GAAGC,IAAA,IAK7C;EAAA,IAL8C;IAClDC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC;EACF,CAAC,GAAAJ,IAAA;EACC,MAAMK,UAAU,GAAGxB,aAAa,CAAC;IAC/ByB,IAAI,EAAE,CAAAL,KAAK,oBAALA,KAAK,CAAEM,EAAE,KAAI,EAAE;IACrBC,OAAO,EAAEL,WAAW;IACpBM,YAAY,EAAEL,IAAI,oBAAJA,IAAI,CAAG,CAAAH,KAAK,oBAALA,KAAK,CAAEM,EAAE,KAAI,EAAE;EACtC,CAAC,CAAC;EAEF,IAAI,CAACjB,uBAAuB,CAACoB,cAAc,CAACT,KAAK,CAACU,IAAI,CAAC,EAAE;IACvD,OAAO,IAAI;EACb;EAEA,MAAMC,UAAU,GAAGtB,uBAAuB,CAACW,KAAK,CAACU,IAAI,CAAE;EAEvD,oBACE/B,KAAA,CAAAiC,aAAA,CAACD,UAAU;IACTX,KAAK,EAAEA,KAAM;IACba,KAAK,EAAET,UAAU,CAACJ,KAAK,CAACa,KAAM;IAC9BC,QAAQ,EAAEV,UAAU,CAACJ,KAAK,CAACc,QAAS;IACpCC,QAAQ,EAAE,cAAcf,KAAK,CAACM,EAAE,EAAG;IACnCL,QAAQ,EAAEA,QAAS;IACnBC,WAAW,EAAEA,WAAY;IACzBC,IAAI,EAAEA,IAAI,IAAI,CAAC;EAAE,CAClB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box, Text } from '@wix/design-system';
|
|
3
|
+
// Safe display value conversion for all field types
|
|
4
|
+
const getDisplayValue = value => {
|
|
5
|
+
if (value === null || value === undefined) {
|
|
6
|
+
return '-';
|
|
7
|
+
}
|
|
8
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
9
|
+
return String(value);
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(value)) {
|
|
12
|
+
return value.length > 0 ? value.join(', ') : '-';
|
|
13
|
+
}
|
|
14
|
+
if (typeof value === 'object') {
|
|
15
|
+
// Handle dates
|
|
16
|
+
if (value instanceof Date) {
|
|
17
|
+
return value.toLocaleDateString();
|
|
18
|
+
}
|
|
19
|
+
// Handle objects with display properties
|
|
20
|
+
if (value.toString && value.toString !== Object.prototype.toString) {
|
|
21
|
+
return value.toString();
|
|
22
|
+
}
|
|
23
|
+
// Fallback for complex objects
|
|
24
|
+
return JSON.stringify(value);
|
|
25
|
+
}
|
|
26
|
+
return String(value);
|
|
27
|
+
};
|
|
28
|
+
export const ViewField = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
field,
|
|
31
|
+
data
|
|
32
|
+
} = _ref;
|
|
33
|
+
const fieldValue = data == null ? void 0 : data[(field == null ? void 0 : field.id) ?? ''];
|
|
34
|
+
const displayValue = getDisplayValue(fieldValue);
|
|
35
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
36
|
+
direction: "vertical",
|
|
37
|
+
gap: "4px"
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
39
|
+
size: "small",
|
|
40
|
+
secondary: true
|
|
41
|
+
}, field.displayName || field.id), /*#__PURE__*/React.createElement(Text, null, displayValue));
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=ViewField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Box","Text","getDisplayValue","value","undefined","String","Array","isArray","length","join","Date","toLocaleDateString","toString","Object","prototype","JSON","stringify","ViewField","_ref","field","data","fieldValue","id","displayValue","createElement","direction","gap","size","secondary","displayName"],"sources":["../../../../src/components/layouts/ViewField.tsx"],"sourcesContent":["import React from 'react';\nimport { Box, Text } from '@wix/design-system';\nimport { Field } from '../../types';\n\n// Safe display value conversion for all field types\nconst getDisplayValue = (value: any): string => {\n if (value === null || value === undefined) {\n return '-';\n }\n if (\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ) {\n return String(value);\n }\n if (Array.isArray(value)) {\n return value.length > 0 ? value.join(', ') : '-';\n }\n if (typeof value === 'object') {\n // Handle dates\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n // Handle objects with display properties\n if (value.toString && value.toString !== Object.prototype.toString) {\n return value.toString();\n }\n // Fallback for complex objects\n return JSON.stringify(value);\n }\n return String(value);\n};\n\nexport interface ViewFieldProps {\n field: Field;\n data?: Record<string, any>;\n}\n\nexport const ViewField: React.FC<ViewFieldProps> = ({ field, data }) => {\n const fieldValue = data?.[field?.id ?? ''];\n const displayValue = getDisplayValue(fieldValue);\n\n return (\n <Box direction=\"vertical\" gap=\"4px\">\n <Text size=\"small\" secondary>\n {field.displayName || field.id}\n </Text>\n <Text>{displayValue}</Text>\n </Box>\n );\n};\n\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,GAAG,EAAEC,IAAI,QAAQ,oBAAoB;AAG9C;AACA,MAAMC,eAAe,GAAIC,KAAU,IAAa;EAC9C,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS,EAAE;IACzC,OAAO,GAAG;EACZ;EACA,IACE,OAAOD,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,SAAS,EAC1B;IACA,OAAOE,MAAM,CAACF,KAAK,CAAC;EACtB;EACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK,CAACK,MAAM,GAAG,CAAC,GAAGL,KAAK,CAACM,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG;EAClD;EACA,IAAI,OAAON,KAAK,KAAK,QAAQ,EAAE;IAC7B;IACA,IAAIA,KAAK,YAAYO,IAAI,EAAE;MACzB,OAAOP,KAAK,CAACQ,kBAAkB,CAAC,CAAC;IACnC;IACA;IACA,IAAIR,KAAK,CAACS,QAAQ,IAAIT,KAAK,CAACS,QAAQ,KAAKC,MAAM,CAACC,SAAS,CAACF,QAAQ,EAAE;MAClE,OAAOT,KAAK,CAACS,QAAQ,CAAC,CAAC;IACzB;IACA;IACA,OAAOG,IAAI,CAACC,SAAS,CAACb,KAAK,CAAC;EAC9B;EACA,OAAOE,MAAM,CAACF,KAAK,CAAC;AACtB,CAAC;AAOD,OAAO,MAAMc,SAAmC,GAAGC,IAAA,IAAqB;EAAA,IAApB;IAAEC,KAAK;IAAEC;EAAK,CAAC,GAAAF,IAAA;EACjE,MAAMG,UAAU,GAAGD,IAAI,oBAAJA,IAAI,CAAG,CAAAD,KAAK,oBAALA,KAAK,CAAEG,EAAE,KAAI,EAAE,CAAC;EAC1C,MAAMC,YAAY,GAAGrB,eAAe,CAACmB,UAAU,CAAC;EAEhD,oBACEtB,KAAA,CAAAyB,aAAA,CAACxB,GAAG;IAACyB,SAAS,EAAC,UAAU;IAACC,GAAG,EAAC;EAAK,gBACjC3B,KAAA,CAAAyB,aAAA,CAACvB,IAAI;IAAC0B,IAAI,EAAC,OAAO;IAACC,SAAS;EAAA,GACzBT,KAAK,CAACU,WAAW,IAAIV,KAAK,CAACG,EACxB,CAAC,eACPvB,KAAA,CAAAyB,aAAA,CAACvB,IAAI,QAAEsB,YAAmB,CACvB,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/layouts/types.ts"],"sourcesContent":["export type ContentCardType = 'entity' | 'settings';\nexport type ContentCardMode = 'edit' | 'view';\n"],"mappings":"","ignoreList":[]}
|
|
@@ -28,6 +28,7 @@ export const useBaseTableFeatures = configuration => {
|
|
|
28
28
|
columns,
|
|
29
29
|
visibleFieldIds,
|
|
30
30
|
onRowClick,
|
|
31
|
+
horizontalScroll: true,
|
|
31
32
|
customColumns: (_configuration$custom = configuration.customColumns) != null && _configuration$custom.enabled ? /*#__PURE__*/React.createElement(CustomColumns, null) : undefined,
|
|
32
33
|
stickyColumns,
|
|
33
34
|
stickySelectionColumn,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","useColumns","CustomColumns","useCollectionPageOnRowClickActions","useNavigation","useDataExtensionProps","useBaseTableFeatures","configuration","_configuration$custom","navigateToEntityPage","columns","visibleFieldIds","map","column","id","entityPageId","onRowClickOverride","collectionPageOnRowClickActions","onRowClick","collectionId","collection","item","stickyColumns","stickySelectionColumn","showTitleBar","dataExtensionProps","customColumns","enabled","createElement","undefined"],"sources":["../../../src/hooks/useBaseTableFeatures.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { TableConfig } from '../types';\nimport { useColumns } from './useColumns';\nimport { CustomColumns } from '@wix/patterns';\nimport { useCollectionPageOnRowClickActions } from './useCollectionPageOnRowClickActions';\nimport { useNavigation } from './useNavigationUtils';\nimport { useDataExtensionProps } from './useDataExtensionProps';\n\nexport const useBaseTableFeatures = (configuration: TableConfig) => {\n const { navigateToEntityPage } = useNavigation();\n const columns = useColumns(configuration.columns);\n const visibleFieldIds = useMemo(\n () => configuration.columns.map((column) => column.id),\n [configuration],\n );\n\n const entityPageId = configuration.entityPageId;\n\n const onRowClickOverride = useCollectionPageOnRowClickActions({\n collectionPageOnRowClickActions: configuration.onRowClick,\n collectionId: configuration.collection.collectionId,\n });\n\n const onRowClick = configuration.onRowClick\n ? onRowClickOverride\n : (item: any) =>\n navigateToEntityPage({\n item,\n entityPageId,\n });\n\n const stickyColumns = configuration.stickyColumns;\n const stickySelectionColumn = !!stickyColumns; // Sticky selection column is true if stickyColumns is positive number\n const showTitleBar = configuration.showTitleBar ?? true;\n const dataExtensionProps = useDataExtensionProps(configuration);\n\n return {\n columns,\n visibleFieldIds,\n onRowClick,\n customColumns: configuration.customColumns?.enabled ? (\n <CustomColumns />\n ) : undefined,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n ...dataExtensionProps,\n };\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,aAAa,QAAQ,eAAe;AAC7C,SAASC,kCAAkC,QAAQ,sCAAsC;AACzF,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,qBAAqB,QAAQ,yBAAyB;AAE/D,OAAO,MAAMC,oBAAoB,GAAIC,aAA0B,IAAK;EAAA,IAAAC,qBAAA;EAClE,MAAM;IAAEC;EAAqB,CAAC,GAAGL,aAAa,CAAC,CAAC;EAChD,MAAMM,OAAO,GAAGT,UAAU,CAACM,aAAa,CAACG,OAAO,CAAC;EACjD,MAAMC,eAAe,GAAGX,OAAO,CAC7B,MAAMO,aAAa,CAACG,OAAO,CAACE,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,EAAE,CAAC,EACtD,CAACP,aAAa,CAChB,CAAC;EAED,MAAMQ,YAAY,GAAGR,aAAa,CAACQ,YAAY;EAE/C,MAAMC,kBAAkB,GAAGb,kCAAkC,CAAC;IAC5Dc,+BAA+B,EAAEV,aAAa,CAACW,UAAU;IACzDC,YAAY,EAAEZ,aAAa,CAACa,UAAU,CAACD;EACzC,CAAC,CAAC;EAEF,MAAMD,UAAU,GAAGX,aAAa,CAACW,UAAU,GACvCF,kBAAkB,GACjBK,IAAS,IACRZ,oBAAoB,CAAC;IACnBY,IAAI;IACJN;EACF,CAAC,CAAC;EAER,MAAMO,aAAa,GAAGf,aAAa,CAACe,aAAa;EACjD,MAAMC,qBAAqB,GAAG,CAAC,CAACD,aAAa,CAAC,CAAC;EAC/C,MAAME,YAAY,GAAGjB,aAAa,CAACiB,YAAY,IAAI,IAAI;EACvD,MAAMC,kBAAkB,GAAGpB,qBAAqB,CAACE,aAAa,CAAC;EAE/D,OAAO;IACLG,OAAO;IACPC,eAAe;IACfO,UAAU;IACVQ,aAAa,EAAE,
|
|
1
|
+
{"version":3,"names":["React","useMemo","useColumns","CustomColumns","useCollectionPageOnRowClickActions","useNavigation","useDataExtensionProps","useBaseTableFeatures","configuration","_configuration$custom","navigateToEntityPage","columns","visibleFieldIds","map","column","id","entityPageId","onRowClickOverride","collectionPageOnRowClickActions","onRowClick","collectionId","collection","item","stickyColumns","stickySelectionColumn","showTitleBar","dataExtensionProps","horizontalScroll","customColumns","enabled","createElement","undefined"],"sources":["../../../src/hooks/useBaseTableFeatures.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { TableConfig } from '../types';\nimport { useColumns } from './useColumns';\nimport { CustomColumns } from '@wix/patterns';\nimport { useCollectionPageOnRowClickActions } from './useCollectionPageOnRowClickActions';\nimport { useNavigation } from './useNavigationUtils';\nimport { useDataExtensionProps } from './useDataExtensionProps';\n\nexport const useBaseTableFeatures = (configuration: TableConfig) => {\n const { navigateToEntityPage } = useNavigation();\n const columns = useColumns(configuration.columns);\n const visibleFieldIds = useMemo(\n () => configuration.columns.map((column) => column.id),\n [configuration],\n );\n\n const entityPageId = configuration.entityPageId;\n\n const onRowClickOverride = useCollectionPageOnRowClickActions({\n collectionPageOnRowClickActions: configuration.onRowClick,\n collectionId: configuration.collection.collectionId,\n });\n\n const onRowClick = configuration.onRowClick\n ? onRowClickOverride\n : (item: any) =>\n navigateToEntityPage({\n item,\n entityPageId,\n });\n\n const stickyColumns = configuration.stickyColumns;\n const stickySelectionColumn = !!stickyColumns; // Sticky selection column is true if stickyColumns is positive number\n const showTitleBar = configuration.showTitleBar ?? true;\n const dataExtensionProps = useDataExtensionProps(configuration);\n\n return {\n columns,\n visibleFieldIds,\n onRowClick,\n horizontalScroll: true,\n customColumns: configuration.customColumns?.enabled ? (\n <CustomColumns />\n ) : undefined,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n ...data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