@wix/auto-patterns 1.43.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.js +19 -5
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
- 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/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +29 -74
- package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.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/AutoPatternsGrid/AutoPatternsGrid.js +147 -25
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +68 -30
- 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 +141 -41
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +169 -9
- package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.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/getCommonCollectionFeaturesAsync.js +11 -0
- package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/getFilterComponent.js +52 -0
- package/dist/cjs/hooks/getFilterComponent.js.map +1 -0
- package/dist/cjs/hooks/index.js +4 -11
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/pluginsDynamicImports.js +25 -0
- package/dist/cjs/hooks/pluginsDynamicImports.js.map +1 -0
- package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js +30 -0
- package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
- package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js +62 -0
- package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
- package/dist/cjs/hooks/useBasePatternsStateParams.js +36 -0
- package/dist/cjs/hooks/useBasePatternsStateParams.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/useCollectionInitAsyncDeps.js +15 -0
- package/dist/cjs/hooks/useCollectionInitAsyncDeps.js.map +1 -0
- package/dist/cjs/hooks/useCommonCollectionFeatures.js +14 -4
- package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +17 -103
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useFiltersState.js +112 -0
- package/dist/cjs/hooks/useFiltersState.js.map +1 -0
- package/dist/cjs/hooks/useGridFeaturesAsync.js +42 -0
- package/dist/cjs/hooks/useGridFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useGridVisibleFieldIds.js +17 -0
- package/dist/cjs/hooks/useGridVisibleFieldIds.js.map +1 -0
- 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/hooks/useSyncCollectionStateToAppContext.js +22 -0
- package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
- package/dist/cjs/hooks/useTableFeaturesAsync.js +51 -0
- package/dist/cjs/hooks/useTableFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js +52 -0
- package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
- package/dist/cjs/hooks/useTableSections.js +18 -0
- package/dist/cjs/hooks/useTableSections.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/cjs/utils/filterCreators.js +16 -31
- package/dist/cjs/utils/filterCreators.js.map +1 -1
- package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js +18 -0
- package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
- package/dist/cjs/utils/minimalRequiredRuntimeCheck.js +21 -0
- package/dist/cjs/utils/minimalRequiredRuntimeCheck.js.map +1 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +14 -1
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.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/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +23 -31
- package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.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/AutoPatternsGrid/AutoPatternsGrid.js +134 -28
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +34 -13
- 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 +126 -42
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +155 -10
- package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.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/getCommonCollectionFeaturesAsync.js +7 -0
- package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/getFilterComponent.js +48 -0
- package/dist/esm/hooks/getFilterComponent.js.map +1 -0
- package/dist/esm/hooks/index.js +1 -2
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/pluginsDynamicImports.js +13 -0
- package/dist/esm/hooks/pluginsDynamicImports.js.map +1 -0
- package/dist/esm/hooks/useAsyncFeaturesPromiseState.js +28 -0
- package/dist/esm/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
- package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js +58 -0
- package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
- package/dist/esm/hooks/useBasePatternsStateParams.js +32 -0
- package/dist/esm/hooks/useBasePatternsStateParams.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/useCollectionInitAsyncDeps.js +11 -0
- package/dist/esm/hooks/useCollectionInitAsyncDeps.js.map +1 -0
- package/dist/esm/hooks/useCommonCollectionFeatures.js +1 -0
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +14 -100
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useFiltersState.js +107 -0
- package/dist/esm/hooks/useFiltersState.js.map +1 -0
- package/dist/esm/hooks/useGridFeaturesAsync.js +37 -0
- package/dist/esm/hooks/useGridFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useGridVisibleFieldIds.js +13 -0
- package/dist/esm/hooks/useGridVisibleFieldIds.js.map +1 -0
- 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/hooks/useSyncCollectionStateToAppContext.js +18 -0
- package/dist/esm/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
- package/dist/esm/hooks/useTableFeaturesAsync.js +46 -0
- package/dist/esm/hooks/useTableFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js +47 -0
- package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
- package/dist/esm/hooks/useTableSections.js +14 -0
- package/dist/esm/hooks/useTableSections.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/esm/utils/filterCreators.js +17 -32
- package/dist/esm/utils/filterCreators.js.map +1 -1
- package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js +14 -0
- package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
- package/dist/esm/utils/minimalRequiredRuntimeCheck.js +17 -0
- package/dist/esm/utils/minimalRequiredRuntimeCheck.js.map +1 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.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/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +6 -0
- package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.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/AutoPatternsGrid/AutoPatternsGrid.d.ts +17 -2
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.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 +17 -2
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts +18 -2
- package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.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/getCommonCollectionFeaturesAsync.d.ts +4 -0
- package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/getFilterComponent.d.ts +4 -0
- package/dist/types/hooks/getFilterComponent.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +1 -2
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/pluginsDynamicImports.d.ts +7 -0
- package/dist/types/hooks/pluginsDynamicImports.d.ts.map +1 -0
- package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts +6 -0
- package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts.map +1 -0
- package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts +36 -0
- package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts.map +1 -0
- package/dist/types/hooks/useBasePatternsStateParams.d.ts +31 -0
- package/dist/types/hooks/useBasePatternsStateParams.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/useCollectionInitAsyncDeps.d.ts +4 -0
- package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts.map +1 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts +1 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useFilters.d.ts +9 -21
- package/dist/types/hooks/useFilters.d.ts.map +1 -1
- package/dist/types/hooks/useFiltersState.d.ts +26 -0
- package/dist/types/hooks/useFiltersState.d.ts.map +1 -0
- package/dist/types/hooks/useGridDragAndDrop.d.ts +1 -1
- package/dist/types/hooks/useGridFeaturesAsync.d.ts +26 -0
- package/dist/types/hooks/useGridFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useGridVisibleFieldIds.d.ts +3 -0
- package/dist/types/hooks/useGridVisibleFieldIds.d.ts.map +1 -0
- 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/hooks/useSyncCollectionStateToAppContext.d.ts +6 -0
- package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts.map +1 -0
- package/dist/types/hooks/useTableFeaturesAsync.d.ts +29 -0
- package/dist/types/hooks/useTableFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useTableGridSwitchDragAndDrop.d.ts +1 -1
- package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts +29 -0
- package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts.map +1 -0
- package/dist/types/hooks/useTableSections.d.ts +8 -0
- package/dist/types/hooks/useTableSections.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/dist/types/utils/filterCreators.d.ts +10 -19
- package/dist/types/utils/filterCreators.d.ts.map +1 -1
- package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts +5 -0
- package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts.map +1 -0
- package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts +9 -0
- package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts.map +1 -0
- 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 +14 -13
- 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/cjs/hooks/useGridFeatures.js +0 -63
- package/dist/cjs/hooks/useGridFeatures.js.map +0 -1
- package/dist/cjs/hooks/useTableFeatures.js +0 -79
- package/dist/cjs/hooks/useTableFeatures.js.map +0 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +0 -83
- package/dist/cjs/hooks/useTableGridSwitchFeatures.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/esm/hooks/useGridFeatures.js +0 -58
- package/dist/esm/hooks/useGridFeatures.js.map +0 -1
- package/dist/esm/hooks/useTableFeatures.js +0 -74
- package/dist/esm/hooks/useTableFeatures.js.map +0 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +0 -78
- package/dist/esm/hooks/useTableGridSwitchFeatures.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/types/hooks/useGridFeatures.d.ts +0 -43
- package/dist/types/hooks/useGridFeatures.d.ts.map +0 -1
- package/dist/types/hooks/useTableFeatures.d.ts +0 -27
- package/dist/types/hooks/useTableFeatures.d.ts.map +0 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +0 -52
- package/dist/types/hooks/useTableGridSwitchFeatures.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,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.__esModule = true;
|
|
4
|
-
exports.useTableGridSwitchFeatures = void 0;
|
|
5
|
-
var _useFetchData = require("./useFetchData");
|
|
6
|
-
var _patterns = require("@wix/patterns");
|
|
7
|
-
var _useCommonCollectionFeatures = require("./useCommonCollectionFeatures");
|
|
8
|
-
var _useFilters = require("./useFilters");
|
|
9
|
-
var _useBaseGridFeatures = require("./useBaseGridFeatures");
|
|
10
|
-
var _useBaseTableFeatures = require("./useBaseTableFeatures");
|
|
11
|
-
var _useBaseCollectionParams = require("./useBaseCollectionParams");
|
|
12
|
-
var _useAppContextSync = require("./useAppContextSync");
|
|
13
|
-
var _react = require("react");
|
|
14
|
-
var _useTableGridSwitchDragAndDrop = require("./useTableGridSwitchDragAndDrop");
|
|
15
|
-
const useTableGridSwitchFeatures = config => {
|
|
16
|
-
const {
|
|
17
|
-
filterComponent,
|
|
18
|
-
filtersObject,
|
|
19
|
-
filterFieldMapping
|
|
20
|
-
} = (0, _useFilters.useFilters)(config.filters);
|
|
21
|
-
const {
|
|
22
|
-
preset,
|
|
23
|
-
imagePlacement,
|
|
24
|
-
visibleFieldIds: gridVisibleFieldIds,
|
|
25
|
-
renderItem
|
|
26
|
-
} = (0, _useBaseGridFeatures.useBaseGridFeatures)(config);
|
|
27
|
-
const {
|
|
28
|
-
customColumns,
|
|
29
|
-
visibleFieldIds: tableVisibleFieldIds,
|
|
30
|
-
columns: tableColumns,
|
|
31
|
-
onRowClick,
|
|
32
|
-
stickyColumns,
|
|
33
|
-
stickySelectionColumn,
|
|
34
|
-
showTitleBar,
|
|
35
|
-
dataExtension
|
|
36
|
-
} = (0, _useBaseTableFeatures.useBaseTableFeatures)(config);
|
|
37
|
-
const {
|
|
38
|
-
fetchData
|
|
39
|
-
} = (0, _useFetchData.useFetchData)({
|
|
40
|
-
searchableFieldIds: Array.from(new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds])),
|
|
41
|
-
filterFieldMapping
|
|
42
|
-
});
|
|
43
|
-
const params = (0, _useBaseCollectionParams.useBaseCollectionParams)({
|
|
44
|
-
config: config.collection,
|
|
45
|
-
fetchData,
|
|
46
|
-
filters: filtersObject
|
|
47
|
-
});
|
|
48
|
-
const dragAndDropProps = (0, _useTableGridSwitchDragAndDrop.useTableGridSwitchDragAndDrop)(config);
|
|
49
|
-
const state = (0, _patterns.useTableGridSwitchCollection)(params);
|
|
50
|
-
const items = (0, _patterns.useSelector)(() => state.collection.result.items);
|
|
51
|
-
const refreshCollection = (0, _react.useCallback)(() => {
|
|
52
|
-
return () => {
|
|
53
|
-
return state.collection.clearResultAndMoveToStart({
|
|
54
|
-
force: true
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
}, [state.collection]);
|
|
58
|
-
(0, _useAppContextSync.useAppContextSync)(items, refreshCollection);
|
|
59
|
-
const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
|
|
60
|
-
...config,
|
|
61
|
-
collectionState: state.collection
|
|
62
|
-
});
|
|
63
|
-
return {
|
|
64
|
-
...commonFeatures,
|
|
65
|
-
state,
|
|
66
|
-
columns: tableColumns,
|
|
67
|
-
filters: filterComponent,
|
|
68
|
-
customColumns,
|
|
69
|
-
onRowClick,
|
|
70
|
-
stickyColumns,
|
|
71
|
-
stickySelectionColumn,
|
|
72
|
-
horizontalScroll: true,
|
|
73
|
-
// Grid specific features
|
|
74
|
-
imagePlacement,
|
|
75
|
-
preset,
|
|
76
|
-
renderItem,
|
|
77
|
-
showTitleBar,
|
|
78
|
-
dataExtension,
|
|
79
|
-
...dragAndDropProps
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
exports.useTableGridSwitchFeatures = useTableGridSwitchFeatures;
|
|
83
|
-
//# sourceMappingURL=useTableGridSwitchFeatures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseGridFeatures","_useBaseTableFeatures","_useBaseCollectionParams","_useAppContextSync","_react","_useTableGridSwitchDragAndDrop","useTableGridSwitchFeatures","config","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","dataExtension","useBaseTableFeatures","fetchData","useFetchData","searchableFieldIds","Array","from","Set","params","useBaseCollectionParams","collection","dragAndDropProps","useTableGridSwitchDragAndDrop","state","useTableGridSwitchCollection","items","useSelector","result","refreshCollection","useCallback","clearResultAndMoveToStart","force","useAppContextSync","commonFeatures","useCommonCollectionFeatures","collectionState","horizontalScroll","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useSelector, useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\nimport { useTableGridSwitchDragAndDrop } from './useTableGridSwitchDragAndDrop';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n dataExtension,\n } = useBaseTableFeatures(config);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: config.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const dragAndDropProps = useTableGridSwitchDragAndDrop(config);\n\n const state = useTableGridSwitchCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n showTitleBar,\n dataExtension,\n ...dragAndDropProps,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,8BAAA,GAAAT,OAAA;AAEO,MAAMU,0BAA0B,GAAIC,MAA6B,IAAK;EAC3E,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAG,IAAAC,sBAAU,EACvEJ,MAAM,CAACK,OACT,CAAC;EAED,MAAM;IACJC,MAAM;IACNC,c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EZ,KAAK,CAACH;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGa,cAAc;IACjBV,KAAK;IACLnB,OAAO,EAAEC,YAAY;IACrBV,OAAO,EAAEJ,eAAe;IACxBW,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrB4B,gBAAgB,EAAE,IAAI;IACtB;IACAvC,cAAc;IACdD,MAAM;IACNI,UAAU;IACVS,YAAY;IACZC,aAAa;IACb,GAAGW;EACL,CAAC;AACH,CAAC;AAACgB,OAAA,CAAAhD,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Checkbox","CheckboxWSR","props","field","onChange","value","createElement","checked","e","target","dataHook","id","displayName"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './types';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, onChange, value } = props;\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,IAAIC,WAAW,QAAQ,oBAAoB;AAK5D,OAAO,MAAMD,QAAQ,GAAIE,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAM,CAAC,GAAGH,KAAK;EAExC,oBACEH,KAAA,CAAAO,aAAA,CAACL,WAAW;IACVM,OAAO,EAAEF,KAAM;IACfD,QAAQ,EAAGI,CAAC,IAAK;MACfJ,QAAQ,CAACI,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;IAC5B,CAAE;IACFG,QAAQ,EAAE,YAAYP,KAAK,CAACQ,EAAE;EAAG,GAEhCR,KAAK,CAACS,WACI,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","useRef","FormField","DatePicker","getDateWithoutTimezone","getISODateStringWithFixedTimezone","useSelector","useWixPatternsContainer","useEntityPageContext","useController","validateDateField","value","validation","t","format","validationType","required","undefined","dateFormat","DateInput","props","_pageState$entity","_field$validation","field","dataHook","inputRef","translate","container","initTask","status","pageState","controller","name","id","control","form","defaultValue","entity","rules","validate","error","date","setDate","ref","errorMessage","setErrorMessage","createElement","label","displayName","internalRef","current","focus","_internalRef$state","state","width","onChange","newValue","formattedDate","split","onValidate","_ref","invalid","statusMessage"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateInput.tsx"],"sourcesContent":["import React, { useState, useRef } from 'react';\nimport { FormField, DatePicker } from '@wix/design-system';\nimport {\n getDateWithoutTimezone,\n getISODateStringWithFixedTimezone,\n} from './utils/dates';\nimport { BaseInputProps, BaseInputRef } from './types';\nimport {\n useSelector,\n useWixPatternsContainer,\n useEntityPageContext,\n} from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Translate } from '@wix/patterns/core';\n\nexport interface DateProps extends BaseInputProps<string | null> {}\n\nfunction validateDateField(\n value: string | null | undefined,\n validation: DateProps['field']['validation'],\n t: Translate,\n format?: string,\n validationType?: 'outOfBoundsError' | 'formatError' | 'valid',\n) {\n if (\n validation?.required &&\n (value === null || value === undefined || value === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n } else if (validationType === 'formatError' && format) {\n return t('cairo.customFields.fieldType.date.invalid.value', {\n dateFormat: format,\n });\n }\n\n return '';\n}\n\nexport const DateInput = (props: DateProps) => {\n const { field, dataHook, inputRef } = props;\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n const pageState = useEntityPageContext();\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n rules: {\n validate: (value) => {\n const error = validateDateField(value, field.validation, t);\n return error || true;\n },\n },\n });\n\n const [date, setDate] = useState<Date | undefined>(() => {\n if (controller.field.value) {\n return getDateWithoutTimezone(\n getISODateStringWithFixedTimezone(controller.field.value),\n );\n }\n return undefined;\n });\n\n const ref = useRef<BaseInputRef>({});\n const [errorMessage, setErrorMessage] = useState<string>('');\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n dataHook={dataHook}\n >\n <DatePicker\n ref={(internalRef) => {\n inputRef?.(ref.current);\n // @ts-expect-error: WSR internal API hack for focusing\n ref.current.focus = () => internalRef?.state?.inputRef?.focus?.();\n }}\n dataHook={`date-${field.id}`}\n width=\"100%\"\n value={date}\n onChange={(newValue: Date) => {\n setDate(newValue);\n if (newValue) {\n const formattedDate = getISODateStringWithFixedTimezone(newValue);\n controller.field.onChange(formattedDate.split('T')[0]);\n } else {\n controller.field.onChange(null);\n }\n }}\n onValidate={({ validationType, value: newValue, format }) => {\n const error = validateDateField(\n newValue,\n field.validation,\n t,\n format,\n validationType,\n );\n setErrorMessage(error);\n ref.current.invalid = !!error;\n\n if (validationType === 'formatError' && newValue === '') {\n setDate(undefined);\n controller.field.onChange(null);\n }\n }}\n status={errorMessage ? 'error' : undefined}\n statusMessage={errorMessage}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,MAAM,QAAQ,OAAO;AAC/C,SAASC,SAAS,EAAEC,UAAU,QAAQ,oBAAoB;AAC1D,SACEC,sBAAsB,EACtBC,iCAAiC,QAC5B,eAAe;AAEtB,SACEC,WAAW,EACXC,uBAAuB,EACvBC,oBAAoB,QACf,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAKlD,SAASC,iBAAiBA,CACxBC,KAAgC,EAChCC,UAA4C,EAC5CC,CAAY,EACZC,MAAe,EACfC,cAA6D,EAC7D;EACA,IACEH,UAAU,YAAVA,UA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AAU,CAACR,KAAK,CAACgC,QAAQ,CAACE,aAAa,CAACC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;MACxD,CAAC,MAAM;QACL3B,UAAU,CAACR,KAAK,CAACgC,QAAQ,CAAC,IAAI,CAAC;MACjC;IACF,CAAE;IACFI,UAAU,EAAEC,IAAA,IAAiD;MAAA,IAAhD;QAAE7C,cAAc;QAAEJ,KAAK,EAAE6C,QAAQ;QAAE1C;MAAO,CAAC,GAAA8C,IAAA;MACtD,MAAMpB,KAAK,GAAG9B,iBAAiB,CAC7B8C,QAAQ,EACRjC,KAAK,CAACX,UAAU,EAChBC,CAAC,EACDC,MAAM,EACNC,cACF,CAAC;MACD8B,eAAe,CAACL,KAAK,CAAC;MACtBG,GAAG,CAACO,OAAO,CAACW,OAAO,GAAG,CAAC,CAACrB,KAAK;MAE7B,IAAIzB,cAAc,KAAK,aAAa,IAAIyC,QAAQ,KAAK,EAAE,EAAE;QACvDd,OAAO,CAACzB,SAAS,CAAC;QAClBc,UAAU,CAACR,KAAK,CAACgC,QAAQ,CAAC,IAAI,CAAC;MACjC;IACF,CAAE;IACF1B,MAAM,EAAEe,YAAY,GAAG,OAAO,GAAG3B,SAAU;IAC3C6C,aAAa,EAAElB;EAAa,CAC7B,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","useMemo","useState","useEffect","Cell","DatePicker","FormField","Layout","TimeInput","useWixPatternsContainer","useSelector","useEntityPageContext","useController","DateTime","props","_pageState$entity","_field$validation2","field","dataHook","inputRef","translate","t","container","initTask","status","pageState","controller","name","id","control","form","defaultValue","entity","rules","validate","v","_field$validation","validation","required","undefined","date","value","d","Date","isNaN","getTime","dateStatusMessage","setDateStatusMessage","timeStatusMessage","setTimeStatusMessage","ref","dateRef","timeRef","dateValue","setDateValue","getDate","timeValue","setTimeValue","current","focus","invalid","createElement","label","displayName","span","internalRef","_internalRef$state","state","width","onChange","onValidate","_ref","validationType","newValue","format","dateWithNewDate","_value","setFullYear","getFullYear","setMonth","getMonth","setDate","toISOString","_field$validation3","dateFormat","fieldState","error","statusMessage","onInvalid","_ref2","dateWithNewTime","setHours","getHours","setMinutes","getMinutes","setSeconds","getSeconds","setMilliseconds","getMilliseconds","_field$validation4"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/DateTime.tsx"],"sourcesContent":["import React, { useRef, useMemo, useState, useEffect } from 'react';\nimport {\n Cell,\n DatePicker,\n FormField,\n Layout,\n TimeInput,\n} from '@wix/design-system';\nimport { BaseInputProps, BaseInputRef } from './types';\nimport {\n useWixPatternsContainer,\n useSelector,\n useEntityPageContext,\n} from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\n\nexport interface DateTimeProps extends BaseInputProps<string | null> {}\n\nexport const DateTime = (props: DateTimeProps) => {\n const { field, dataHook, inputRef } = props;\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n const pageState = useEntityPageContext();\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n rules: {\n validate: (v) => {\n if (\n field?.validation?.required &&\n (v === null || v === undefined || v === '')\n ) {\n return t('cairo.fieldValidation.requiredField');\n }\n return true;\n },\n },\n });\n\n const date = useMemo(() => {\n if (!controller.field.value) {\n return undefined;\n }\n const d = new Date(controller.field.value);\n return isNaN(d.getTime()) ? undefined : d;\n }, [controller.field.value]);\n\n const [dateStatusMessage, setDateStatusMessage] = useState('');\n const [timeStatusMessage, setTimeStatusMessage] = useState('');\n\n const ref = useRef<BaseInputRef>({});\n const dateRef = useRef<BaseInputRef>({});\n const timeRef = useRef<BaseInputRef>({});\n const [dateValue, setDateValue] = useState<number | string | undefined>(\n date?.getDate(),\n );\n const [timeValue, setTimeValue] = useState<number | string | undefined>(\n date?.getTime(),\n );\n\n useEffect(() => {\n ref.current.focus = () => {\n if (dateRef.current.invalid) {\n return dateRef.current.focus?.();\n }\n\n return timeRef.current.focus?.();\n };\n\n inputRef?.(ref.current);\n }, [inputRef]);\n\n return (\n <FormField\n label={field.displayName}\n required={field.validation?.required}\n dataHook={dataHook}\n >\n <Layout>\n <Cell span={6}>\n <DatePicker\n ref={(internalRef) => {\n dateRef.current.focus = () =>\n // TODO: PR to WSR needed to expose as public API\n // @ts-expect-error\n internalRef?.state?.inputRef?.focus?.();\n }}\n width=\"100%\"\n value={date}\n // onChange is triggered only when you have valid, non-empty value. and onValidate is triggered on every change so we use onValidate\n onChange={() => {}}\n onValidate={({ validationType, value: newValue, format }) => {\n if (validationType === 'valid') {\n const dateWithNewDate = date\n ? new Date(date)\n : new Date(newValue);\n const _value = new Date(newValue);\n dateWithNewDate.setFullYear(_value.getFullYear());\n dateWithNewDate.setMonth(_value.getMonth());\n dateWithNewDate.setDate(_value.getDate());\n controller.field.onChange(dateWithNewDate.toISOString());\n setDateValue(new Date(newValue).getDate());\n setDateStatusMessage('');\n dateRef.current.invalid = false;\n } else if (validationType === 'formatError' && newValue === '') {\n if (field.validation?.required) {\n setDateStatusMessage(\n t('cairo.fieldValidation.requiredField'),\n );\n dateRef.current.invalid = true;\n } else {\n setDateStatusMessage('');\n dateRef.current.invalid = false;\n }\n setDateValue(newValue);\n if (!timeValue) {\n controller.field.onChange(null);\n }\n } else {\n setDateStatusMessage(\n t('cairo.customFields.fieldType.date.invalid.value', {\n dateFormat: format ?? '',\n }),\n );\n dateRef.current.invalid = true;\n }\n\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n }}\n status={\n controller.fieldState.error || dateStatusMessage\n ? 'error'\n : undefined\n }\n statusMessage={controller.fieldState.error || dateStatusMessage}\n dataHook={`datetime-date-${field.id}`}\n />\n </Cell>\n <Cell span={6}>\n <TimeInput\n ref={(internalRef) => {\n timeRef.current.focus = () => internalRef?.focus();\n }}\n dataHook={`datetime-time-${field.id}`}\n value={date ?? null}\n status={\n controller.fieldState.error || timeStatusMessage\n ? 'error'\n : undefined\n }\n statusMessage={controller.fieldState.error || timeStatusMessage}\n onInvalid={() => {\n timeRef.current.invalid = true;\n setTimeStatusMessage(\n t('cairo.customFields.fieldType.dateAndTime.invalid.value'),\n );\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n }}\n onChange={({ date: newValue }) => {\n timeRef.current.invalid = false;\n ref.current.invalid =\n dateRef.current.invalid || timeRef.current.invalid;\n\n if (newValue) {\n const dateWithNewTime = date ? new Date(date) : newValue;\n dateWithNewTime.setHours(newValue.getHours());\n dateWithNewTime.setMinutes(newValue.getMinutes());\n dateWithNewTime.setSeconds(newValue.getSeconds());\n dateWithNewTime.setMilliseconds(newValue.getMilliseconds());\n controller.field.onChange(dateWithNewTime.toISOString());\n setTimeStatusMessage('');\n setDateStatusMessage('');\n } else {\n if (!newValue) {\n setTimeValue('');\n if (field.validation?.required) {\n setTimeStatusMessage(\n t('cairo.fieldValidation.requiredField'),\n );\n timeRef.current.invalid = true;\n } else {\n setTimeStatusMessage('');\n timeRef.current.invalid = false;\n }\n if (!ref.current.invalid) {\n if (!dateValue) {\n controller.field.onChange(null);\n }\n }\n }\n }\n }}\n />\n </Cell>\n </Layout>\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AACnE,SACEC,IAAI,EACJC,UAAU,EACVC,SAAS,EACTC,MAAM,EACNC,SAAS,QACJ,oBAAoB;AAE3B,SACEC,uBAAuB,EACvBC,WAAW,EACXC,oBAAoB,QACf,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,QAAQ,GAAIC,KAAoB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,kBAAA;EAChD,MAAM;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGL,KAAK;EAC3C,MAAM;IAAEM,SAAS,EAAEC,CAA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AAU,CAACtB,QAAQ,CAACuB,UAAU,CAAC,CAAC,CAAC;QACjDN,eAAe,CAACO,eAAe,CAACxB,QAAQ,CAACyB,eAAe,CAAC,CAAC,CAAC;QAC3DxE,UAAU,CAACT,KAAK,CAACoD,QAAQ,CAACqB,eAAe,CAACR,WAAW,CAAC,CAAC,CAAC;QACxDjC,oBAAoB,CAAC,EAAE,CAAC;QACxBF,oBAAoB,CAAC,EAAE,CAAC;MAC1B,CAAC,MAAM;QACL,IAAI,CAAC0B,QAAQ,EAAE;UAAA,IAAA0B,kBAAA;UACb1C,YAAY,CAAC,EAAE,CAAC;UAChB,KAAA0C,kBAAA,GAAIlF,KAAK,CAACoB,UAAU,aAAhB8D,kBAAA,CAAkB7D,QAAQ,EAAE;YAC9BW,oBAAoB,CAClB5B,CAAC,CAAC,qCAAqC,CACzC,CAAC;YACD+B,OAAO,CAACM,OAAO,CAACE,OAAO,GAAG,IAAI;UAChC,CAAC,MAAM;YACLX,oBAAoB,CAAC,EAAE,CAAC;YACxBG,OAAO,CAACM,OAAO,CAACE,OAAO,GAAG,KAAK;UACjC;UACA,IAAI,CAACV,GAAG,CAACQ,OAAO,CAACE,OAAO,EAAE;YACxB,IAAI,CAACP,SAAS,EAAE;cACd3B,UAAU,CAACT,KAAK,CAACoD,QAAQ,CAAC,IAAI,CAAC;YACjC;UACF;QACF;MACF;IACF;EAAE,CACH,CACG,CACA,CACC,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ShortText } from './ShortText';
|
|
3
|
-
import { useEntityPageContext } from '@wix/patterns';
|
|
4
|
-
import { useController } from '@wix/patterns/form';
|
|
5
|
-
import { Checkbox } from './Checkbox';
|
|
6
|
-
import { DateInput } from './DateInput';
|
|
7
|
-
import { DateTime } from './DateTime';
|
|
8
|
-
import { Number } from './Number';
|
|
9
|
-
import { LongText } from './LongText';
|
|
10
|
-
import { Url } from './Url';
|
|
11
|
-
import { ImageInput } from './ImageInput';
|
|
12
|
-
export const EDITABLE_INPUT_ELEMENTS = {
|
|
13
|
-
SHORT_TEXT: ShortText,
|
|
14
|
-
LONG_TEXT: LongText,
|
|
15
|
-
BOOLEAN: Checkbox,
|
|
16
|
-
DATE: DateInput,
|
|
17
|
-
DATETIME: DateTime,
|
|
18
|
-
NUMBER: Number,
|
|
19
|
-
URL: Url,
|
|
20
|
-
IMAGE: ImageInput
|
|
21
|
-
};
|
|
22
|
-
export const FormFieldInput = props => {
|
|
23
|
-
var _pageState$entity;
|
|
24
|
-
const {
|
|
25
|
-
field,
|
|
26
|
-
inputRef
|
|
27
|
-
} = props;
|
|
28
|
-
const pageState = useEntityPageContext();
|
|
29
|
-
const controller = useController({
|
|
30
|
-
name: (field == null ? void 0 : field.id) ?? '',
|
|
31
|
-
control: pageState.form.control,
|
|
32
|
-
defaultValue: (_pageState$entity = pageState.entity) == null ? void 0 : _pageState$entity[(field == null ? void 0 : field.id) ?? '']
|
|
33
|
-
});
|
|
34
|
-
if (!EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type) || !pageState) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
const FieldInput = EDITABLE_INPUT_ELEMENTS[field.type];
|
|
38
|
-
return /*#__PURE__*/React.createElement(FieldInput, {
|
|
39
|
-
field: field,
|
|
40
|
-
value: controller.field.value,
|
|
41
|
-
onChange: controller.field.onChange,
|
|
42
|
-
dataHook: `form-field-${field.id}`,
|
|
43
|
-
inputRef: inputRef
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=FormFieldInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","ShortText","useEntityPageContext","useController","Checkbox","DateInput","DateTime","Number","LongText","Url","ImageInput","EDITABLE_INPUT_ELEMENTS","SHORT_TEXT","LONG_TEXT","BOOLEAN","DATE","DATETIME","NUMBER","URL","IMAGE","FormFieldInput","props","_pageState$entity","field","inputRef","pageState","controller","name","id","control","form","defaultValue","entity","hasOwnProperty","type","FieldInput","createElement","value","onChange","dataHook"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx"],"sourcesContent":["import React from 'react';\nimport { ShortText } from './ShortText';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Field, PatternsFieldType } from '../../../types';\nimport { Checkbox } from './Checkbox';\nimport { DateInput } from './DateInput';\nimport { DateTime } from './DateTime';\nimport { Number } from './Number';\nimport { LongText } from './LongText';\nimport { Url } from './Url';\nimport { BaseInputProps } from './types';\nimport { ImageInput } from './ImageInput';\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 FormFieldInputProps {\n field: Field;\n inputRef?: BaseInputProps<any>['inputRef'];\n}\n\nexport const FormFieldInput = (props: FormFieldInputProps) => {\n const { field, inputRef } = props;\n\n const pageState = useEntityPageContext();\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n });\n\n if (!EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.type) || !pageState) {\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 />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,aAAa,QAAQ,oBAAoB;AAElD,SAASC,QAAQ,QAAQ,YAAY;AACrC,S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AC9BC,QAAQ,EAAEZ,UAAU,CAACH,KAAK,CAACe,QAAS;IACpCC,QAAQ,EAAE,cAAchB,KAAK,CAACK,EAAE,EAAG;IACnCJ,QAAQ,EAAEA;EAAS,CACpB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormField","ImageViewer","useEntityPageContext","useIsMobile","useSelector","useWixPatternsContainer","useController","getImageUrl","dashboard","ImageInput","props","_pageState$entity","_field$validation2","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","isMobile","pageState","openMedia","_chosenMediaItems$ite","chosenMediaItems","openMediaManager","multiSelect","category","newImage","items","media","image","controller","onChange","error","console","name","id","control","form","defaultValue","entity","rules","validate","value","_field$validation","validation","required","undefined","imageUrl","createElement","label","displayName","fieldState","statusMessage","message","onAddImage","onUpdateImage","updateImageInfo","removeImageInfo","addImageInfo","height","width","fit","onRemoveImage"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ImageInput.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, ImageViewer } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useIsMobile,\n useSelector,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { getImageUrl } from '../../../utils/media/getImageUrl';\nimport { dashboard } from '@wix/dashboard';\n\nexport interface ImageInputProps extends BaseInputProps<string> {}\n\nexport const ImageInput = (props: ImageInputProps) => {\n const { field, dataHook } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n const isMobile = useIsMobile();\n const pageState = useEntityPageContext();\n\n async function openMedia() {\n try {\n const chosenMediaItems = await dashboard.openMediaManager({\n multiSelect: false,\n category: 'IMAGE',\n });\n\n const newImage = chosenMediaItems?.items[0]?.media?.image?.image;\n\n controller.field.onChange(newImage);\n } catch (error) {\n console.error('Error opening Media Manager or no files selected:', error);\n }\n }\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[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 const imageUrl =\n controller.field.value && getImageUrl(controller.field.value);\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 <ImageViewer\n imageUrl={imageUrl}\n dataHook={`image-${field.id}`}\n onAddImage={isMobile ? undefined : () => openMedia()}\n onUpdateImage={isMobile ? undefined : () => openMedia()}\n updateImageInfo={t('cairo.replace-image.tooltip')}\n removeImageInfo={t('cairo.remove-image.tooltip')}\n addImageInfo={t('cairo.add-image.tooltip')}\n height=\"120px\"\n width=\"25%\"\n fit=\"cover\"\n onRemoveImage={() => controller.field.onChange(null)}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAE3D,SACEC,oBAAoB,EACpBC,WAAW,EACXC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,WAAW,QAAQ,kCAAkC;AAC9D,SAASC,SAAS,QAAQ,gBAAgB;AAI1C,OAAO,MAAMC,UAAU,GAAIC,KAAsB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,kBAAA,EAAAC,qBAAA;EACpD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGL,KAAK;EAEjC,MAAM;IAAEM,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGb,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMc,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;EAC5C,MAAMC,QAAQ,GAAG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,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormField","InputArea","useEntityPageContext","useSelector","useWixPatternsContainer","useController","LongText","props","_pageState$entity","_field$validation2","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","pageState","controller","name","id","control","form","defaultValue","entity","rules","validate","value","_field$validation","validation","required","undefined","createElement","label","displayName","fieldState","error","statusMessage","message","onChange","e","target","onBlur","ref"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/LongText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, InputArea } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useSelector,\n useWixPatternsContainer,\n} 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 } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const pageState = useEntityPageContext();\n\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[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,SACEC,oBAAoB,EACpBC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAIlD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AO,GAAGL,SAAU;IAC1DM,aAAa,GAAA5B,qBAAA,GAAES,UAAU,CAACiB,UAAU,CAACC,KAAK,qBAA3B3B,qBAAA,CAA6B6B,OAAQ;IACpD3B,QAAQ,EAAEA;EAAS,gBAEnBb,KAAA,CAAAkC,aAAA,CAAChC,SAAS;IACR2B,KAAK,EAAET,UAAU,CAACR,KAAK,CAACiB,KAAM;IAC9BY,QAAQ,EAAGC,CAAC,IAAKtB,UAAU,CAACR,KAAK,CAAC6B,QAAQ,oBAAzBrB,UAAU,CAACR,KAAK,CAAC6B,QAAQ,CAAGC,CAAC,CAACC,MAAM,CAACd,KAAK,CAAE;IAC7De,MAAM,EAAExB,UAAU,CAACR,KAAK,CAACgC,MAAO;IAChCC,GAAG,EAAEzB,UAAU,CAACR,KAAK,CAACiC,GAAI;IAC1BhC,QAAQ,EAAE,aAAaD,KAAK,CAACU,EAAE;EAAG,CACnC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormField","NumberInput","useEntityPageContext","useSelector","useWixPatternsContainer","useController","Number","props","_field$validation","_pageState$entity","_field$validation3","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","pageState","numberRange","validation","min","max","controller","name","id","control","form","defaultValue","entity","rules","validate","value","_field$validation2","required","undefined","minAmount","maxAmount","createElement","label","displayName","fieldState","error","statusMessage","message","onChange","e","onBlur","inputRef","ref"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Number.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, NumberInput } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useSelector,\n useWixPatternsContainer,\n} 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 } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const pageState = useEntityPageContext();\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: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[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,SACEC,oBAAoB,EACpBC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,MAAM,GAAIC,KAAkB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,iBAAA,EAAAC,kBAAA,EAAAC,qBAAA;EAC5C,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGN,KAAK;EAEjC,MAAM;IAAEO,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGZ,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMa,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;EAE5C,MAAMC,SAAS,GAAGjB,oBAAoB,CAAC,CA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B,KAAA,CAAAwC,aAAA,CAACvC,SAAS;IACRwC,KAAK,EAAE5B,KAAK,CAAC6B,WAAY;IACzBN,QAAQ,GAAAzB,kBAAA,GAAEE,KAAK,CAACS,UAAU,qBAAhBX,kBAAA,CAAkByB,QAAS;IACrCjB,MAAM,EAAEM,UAAU,CAACkB,UAAU,CAACC,KAAK,GAAG,OAAO,GAAGP,SAAU;IAC1DQ,aAAa,GAAAjC,qBAAA,GAAEa,UAAU,CAACkB,UAAU,CAACC,KAAK,qBAA3BhC,qBAAA,CAA6BkC,OAAQ;IACpDhC,QAAQ,EAAEA;EAAS,gBAEnBd,KAAA,CAAAwC,aAAA,CAACtC,WAAW;IACVgC,KAAK,EAAET,UAAU,CAACZ,KAAK,CAACqB,KAAK,IAAIG,SAAU;IAC3CU,QAAQ,EAAGC,CAAC,IAAKvB,UAAU,CAACZ,KAAK,CAACkC,QAAQ,CAACC,CAAC,CAAE;IAC9CC,MAAM,EAAExB,UAAU,CAACZ,KAAK,CAACoC,MAAO;IAChCC,QAAQ,EAAEzB,UAAU,CAACZ,KAAK,CAACsC,GAAI;IAC/BrC,QAAQ,EAAE,UAAUD,KAAK,CAACc,EAAE;EAAG,CAChC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormField","Input","useEntityPageContext","useSelector","useWixPatternsContainer","useController","ShortText","props","_field$validation","_pageState$entity","_controller$field$val","_field$validation3","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","pageState","stringLengthRange","validation","minLength","maxLength","controller","name","id","control","form","defaultValue","entity","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/AutoPatternsEntityPage/Fields/ShortText.tsx"],"sourcesContent":["import React from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './types';\nimport {\n useEntityPageContext,\n useSelector,\n useWixPatternsContainer,\n} 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 } = props;\n\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n\n const pageState = useEntityPageContext();\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: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[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,SACEC,oBAAoB,EACpBC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,SAAS,GAAIC,KAAqB,IAAK;EAAA,IAAAC,iBAAA,EAAAC,iBAAA,EAAAC,qBAAA,EAAAC,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EAAI,CAC3B,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","FormField","Input","Link","useEntityPageContext","useSelector","useWixPatternsContainer","useController","Url","props","_pageState$entity","_field$validation2","_controller$fieldStat","field","dataHook","translate","t","container","initTask","status","pageState","uriPattern","controller","name","id","control","form","defaultValue","entity","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/AutoPatternsEntityPage/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 {\n useEntityPageContext,\n useSelector,\n useWixPatternsContainer,\n} 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 } = props;\n const { translate: t, ...container } = useWixPatternsContainer();\n useSelector(() => container.initTask.status);\n const pageState = useEntityPageContext();\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: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[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,SACEC,oBAAoB,EACpBC,WAAW,EACXC,uBAAuB,QAClB,eAAe;AACtB,SAASC,aAAa,QAAQ,oBAAoB;AAIlD,OAAO,MAAMC,GAAG,GAAIC,KAAe,IAAK;EAAA,IAAAC,iBAAA,EAAAC,kBAAA,EAAAC,qBAAA;EACtC,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGL,KAAK;EACjC,MAAM;IAAEM,SAAS,EAAEC,CAAC;IAAE,GAAGC;EAAU,CAAC,GAAGX,uBAAuB,CAAC,CAAC;EAChED,WAAW,CAAC,MAAMY,SAAS,CAACC,QAAQ,CAACC,MAAM,CAAC;EAC5C,MAAMC,SAAS,GAAGhB,oBAAoB,CAAC,CAAC;;EAExC;EACA,MAAMiB,UAAU;EACd;EACA,kOAAkO;EAEpO,MAAMC,UAAU,GAAGf,aAAa,CAAC;IAC/BgB,IAAI,EAAE,CAAAV,KAAK,oBAALA,KAAK,CAAEW,EAAE,KAAI,EAAE;IAC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CAAC,CAAC,0CAA0C,CAAE;IAC3DF,QAAQ,EAAE,OAAOD,KAAK,CAACW,EAAE,EAAG;IAC5BO,KAAK,EAAET,UAAU,CAACT,KAAK,CAACkB,KAAM;IAC9BgB,QAAQ,EAAGC,CAAC,IAAK1B,UAAU,CAACT,KAAK,CAACkC,QAAQ,oBAAzBzB,UAAU,CAACT,KAAK,CAACkC,QAAQ,CAAGC,CAAC,CAACC,MAAM,CAAClB,KAAK,CAAE;IAC7DmB,MAAM,EAAE5B,UAAU,CAACT,KAAK,CAACqC,MAAO;IAChCC,GAAG,EAAE7B,UAAU,CAACT,KAAK,CAACsC;EAAI,CAC3B,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/types.ts"],"sourcesContent":["import { 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}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getDateWithoutTimezone","date","Date","toISOString","slice","getISODateStringWithFixedTimezone","_date","userTimezoneOffset","getTimezoneOffset","getTime"],"sources":["../../../../../../src/components/AutoPatternsEntityPage/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Card","Layout","EntityPage","RenderLayoutContent","RenderLayoutCard","_ref","_layout$card$subtitle","layout","sectionId","cardIndex","setInputRef","type","createElement","minHeight","Header","title","card","text","subtitle","Divider","Content","children","map","child","index","key","content","level","contentIndex"],"sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutCard.tsx"],"sourcesContent":["import React from 'react';\nimport { Card, Layout } from '@wix/design-system';\nimport { EntityPage } from '@wix/patterns';\nimport { RenderLayoutContent } from './RenderLayoutContent';\nimport { CardLayout } from '../../../types';\nimport { BaseInputRef } from '../Fields/types';\n\nexport interface RenderLayoutCardProps {\n layout: CardLayout;\n sectionId: string;\n cardIndex: number;\n setInputRef: (id: string, input: BaseInputRef) => void;\n}\n\nexport const RenderLayoutCard: React.FC<RenderLayoutCardProps> = ({\n layout,\n sectionId,\n cardIndex,\n setInputRef,\n}) => {\n switch (layout.type) {\n case 'card':\n return (\n <EntityPage.Card 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 <RenderLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${index}`}\n content={child}\n level={0}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n setInputRef={setInputRef}\n />\n ))}\n </Layout>\n </Card.Content>\n </EntityPage.Card>\n );\n default:\n return null;\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,mBAAmB,QAAQ,uBAAuB;AAW3D,OAAO,MAAMC,gBAAiD,GAAGC,IAAA,IAK3D;EAAA,IAAAC,qBAAA;EAAA,IAL4D;IAChEC,MAAM;IACNC,SAAS;IACTC,SAAS;IACTC;EACF,CAAC,GAAAL,IAAA;EACC,QAAQE,MAAM,CAACI,IAAI;IACjB,KAAK,MAAM;MACT,oBACEZ,KAAA,CAAAa,aAAA,CAACV,UAAU,CAACF,IAAI;QAACa,SAAS,EAAC;MAAM,gBAC/Bd,KAAA,CAAAa,aAAA,CAACZ,IAAI,CAACc,MAAM;QACVC,KAAK,EAAER,MAAM,CAACS,IAAI,CAACD,KAAK,CAACE,IAAK;QAC9BC,QAAQ,GAAAZ,qBAAA,GAAEC,MAAM,CAACS,IAAI,CAACE,QAAQ,qBAApBZ,qBAAA,CAAsBW;MAAK,CACtC,CAAC,eACFlB,KAAA,CAAAa,aAAA,CAACZ,IAAI,CAACmB,OAAO,MAAE,CAAC,eAChBpB,KAAA,CAAAa,aAAA,CAACZ,IAAI,CAACoB,OAAO,qBACXrB,KAAA,CAAAa,aAAA,CAACX,MAAM,QACJM,MAAM,CAACS,IAAI,CAACK,QAAQ,CAACC,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAa,kBAC7CzB,KAAA,CAAAa,aAAA,CAACT,mBAAmB;QAClBsB,GAAG,EAAE,GAAGjB,SAAS,SAASC,SAAS,YAAYe,KAAK,EAAG;QACvDE,OAAO,EAAEH,KAAM;QACfI,KAAK,EAAE,CAAE;QACTnB,SAAS,EAAEA,SAAU;QACrBC,SAAS,EAAEA,SAAU;QACrBmB,YAAY,EAAEJ,KAAM;QACpBd,WAAW,EAAEA;MAAY,CAC1B,CACF,CACK,CACI,CACC,CAAC;IAEtB;MACE,OAAO,IAAI;EACf;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Cell","Layout","useSchema","useAutoPatternsOverridesContext","useEntityPageContext","FormFieldInput","RenderLayoutContent","_ref","_content$container$ch","_overrides$components","content","level","sectionId","cardIndex","contentIndex","setInputRef","schema","overrides","pageState","entity","type","field","fieldId","fields","createElement","span","key","inputRef","ref","container","children","length","map","child","index","component","componentId","Component","components","form"],"sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderLayoutContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell, Layout } from '@wix/design-system';\nimport { useSchema } from '../../../providers/SchemaContext';\nimport { useAutoPatternsOverridesContext } from '../../../providers';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { FormFieldInput } from '../Fields/FormFieldInput';\nimport { LayoutContent } from '../../../types';\nimport { BaseInputRef } from '../Fields/types';\n\nexport interface RenderLayoutContentProps {\n content: LayoutContent;\n level: number;\n sectionId: string;\n cardIndex: number;\n contentIndex: number;\n setInputRef: (id: string, input: BaseInputRef) => void;\n}\n\nexport const RenderLayoutContent: React.FC<RenderLayoutContentProps> = ({\n content,\n level,\n sectionId,\n cardIndex,\n contentIndex,\n setInputRef,\n}) => {\n const schema = useSchema();\n const overrides = useAutoPatternsOverridesContext();\n const pageState = useEntityPageContext();\n\n const entity = pageState.entity;\n\n switch (content.type) {\n case 'field':\n if (!content.field.fieldId) {\n return null;\n }\n\n const field = schema.fields[content.field.fieldId];\n if (!field) {\n return null;\n }\n\n return (\n <Cell span={content.field.span}>\n <FormFieldInput\n key={content.field.fieldId}\n field={field}\n inputRef={(ref) => setInputRef(content.field.fieldId, ref)}\n />\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 <RenderLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`}\n content={child}\n level={level + 1}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n setInputRef={setInputRef}\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\n form={pageState?.form as any}\n entity={entity as Record<string, any>}\n />\n </Cell>\n );\n\n default:\n return null;\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SAASC,SAAS,QAAQ,kCAAkC;AAC5D,SAASC,+BAA+B,QAAQ,oBAAoB;AACpE,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,cAAc,QAAQ,0BAA0B;AAazD,OAAO,MAAMC,mBAAuD,GAAGC,IAAA,IAOjE;EAAA,IAAAC,qBAAA,EAAAC,qBAAA;EAAA,IAPkE;IACtEC,OAAO;IACPC,KAAK;IACLC,SAAS;IACTC,SAAS;IACTC,YAAY;IACZC;EACF,CAAC,GAAAR,IAAA;EACC,MAAMS,MAAM,GAAGd,SAAS,CAAC,CAAC;EAC1B,MAAMe,SAAS,GAAGd,+BAA+B,CAAC,CAAC;EACnD,MAAMe,SAAS,GAAGd,oBAAoB,CAAC,CAAC;EAExC,MAAMe,MAAM,GAAGD,SAAS,CAACC,MAAM;EAE/B,QAAQT,OAAO,CAACU,IAAI;IAClB,KAAK,OAAO;MACV,IAAI,CAACV,OAAO,CAACW,KAAK,CAACC,OAAO,EAAE;QAC1B,OAAO,IAAI;MACb;M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yB,SAAS,CAACC,WAAW,EAAE;QAClC,OAAO,IAAI;MACb;MAEA,MAAMC,SAAS,GAAGpB,SAAS,aAAAR,qBAAA,GAATQ,SAAS,CAAEqB,UAAU,qBAArB7B,qBAAA,CAAwBC,OAAO,CAACyB,SAAS,CAACC,WAAW,CAAC;MACxE,IAAI,CAACC,SAAS,EAAE;QACd,OAAO,IAAI;MACb;MAEA,oBACEtC,KAAA,CAAAyB,aAAA,CAACxB,IAAI;QAACyB,IAAI,EAAEf,OAAO,CAACyB,SAAS,CAACV;MAAK,gBACjC1B,KAAA,CAAAyB,aAAA,CAACa,SAAS;QACRE,IAAI,EAAErB,SAAS,oBAATA,SAAS,CAAEqB,IAAY;QAC7BpB,MAAM,EAAEA;MAA8B,CACvC,CACG,CAAC;IAGX;MACE,OAAO,IAAI;EACf;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Cell, Box, Text } from '@wix/design-system';
|
|
3
|
-
export const RenderViewField = _ref => {
|
|
4
|
-
let {
|
|
5
|
-
field,
|
|
6
|
-
fieldId,
|
|
7
|
-
entity,
|
|
8
|
-
span
|
|
9
|
-
} = _ref;
|
|
10
|
-
const fieldValue = entity == null ? void 0 : entity[fieldId];
|
|
11
|
-
|
|
12
|
-
// Safe display value conversion for all field types
|
|
13
|
-
const getDisplayValue = value => {
|
|
14
|
-
if (value === null || value === undefined) {
|
|
15
|
-
return '-';
|
|
16
|
-
}
|
|
17
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
18
|
-
return String(value);
|
|
19
|
-
}
|
|
20
|
-
if (Array.isArray(value)) {
|
|
21
|
-
return value.length > 0 ? value.join(', ') : '-';
|
|
22
|
-
}
|
|
23
|
-
if (typeof value === 'object') {
|
|
24
|
-
// Handle dates
|
|
25
|
-
if (value instanceof Date) {
|
|
26
|
-
return value.toLocaleDateString();
|
|
27
|
-
}
|
|
28
|
-
// Handle objects with display properties
|
|
29
|
-
if (value.toString && value.toString !== Object.prototype.toString) {
|
|
30
|
-
return value.toString();
|
|
31
|
-
}
|
|
32
|
-
// Fallback for complex objects
|
|
33
|
-
return JSON.stringify(value);
|
|
34
|
-
}
|
|
35
|
-
return String(value);
|
|
36
|
-
};
|
|
37
|
-
const displayValue = getDisplayValue(fieldValue);
|
|
38
|
-
return /*#__PURE__*/React.createElement(Cell, {
|
|
39
|
-
span: span
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
41
|
-
direction: "vertical",
|
|
42
|
-
gap: "4px"
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
44
|
-
size: "small",
|
|
45
|
-
secondary: true
|
|
46
|
-
}, field.displayName || fieldId), /*#__PURE__*/React.createElement(Text, null, displayValue)));
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=RenderViewField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Cell","Box","Text","RenderViewField","_ref","field","fieldId","entity","span","fieldValue","getDisplayValue","value","undefined","String","Array","isArray","length","join","Date","toLocaleDateString","toString","Object","prototype","JSON","stringify","displayValue","createElement","direction","gap","size","secondary","displayName"],"sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/RenderViewField.tsx"],"sourcesContent":["import React from 'react';\nimport { Cell, Box, Text } from '@wix/design-system';\n\nexport const RenderViewField: React.FC<{\n field: any;\n fieldId: string;\n entity: any;\n span?: number;\n}> = ({ field, fieldId, entity, span }) => {\n const fieldValue = entity?.[fieldId];\n\n // Safe display value conversion for all field types\n const 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\n const displayValue = getDisplayValue(fieldValue);\n\n return (\n <Cell span={span}>\n <Box direction=\"vertical\" gap=\"4px\">\n <Text size=\"small\" secondary>\n {field.displayName || fieldId}\n </Text>\n <Text>{displayValue}</Text>\n </Box>\n </Cell>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,QAAQ,oBAAoB;AAEpD,OAAO,MAAMC,eAKX,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,KAAK;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAK,CAAC,GAAAJ,IAAA;EACpC,MAAMK,UAAU,GAAGF,MAAM,oBAANA,MAAM,CAAGD,OAAO,CAAC;;EAEpC;EACA,MAAMI,eAAe,GAAIC,KAAU,IAAa;IAC9C,IAAIA,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAKC,SAAS,EAAE;MACzC,OAAO,GAAG;IACZ;IACA,IACE,OAAOD,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,QAAQ,IACzB,OAAOA,KAAK,KAAK,SAAS,EAC1B;MACA,OAAOE,MAAM,CAACF,KAAK,CAAC;IACtB;IACA,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,EAAE;MACxB,OAAOA,KAAK,CAACK,MAAM,GAAG,CAAC,GAAGL,KAAK,CAACM,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG;IAClD;IACA,IAAI,OAAON,KAAK,KAAK,QAAQ,EAAE;MAC7B;MACA,IAAIA,KAAK,YAAYO,IAAI,EAAE;QACzB,OAAOP,KAAK,CAACQ,kBAAkB,CAAC,CAAC;MACnC;MACA;MACA,IAAIR,KAAK,CAACS,QAAQ,IAAIT,KAAK,CAACS,QAAQ,KAAKC,MAAM,CAACC,SAAS,CAACF,QAAQ,EAAE;QAClE,OAAOT,KAAK,CAACS,QAAQ,CAAC,CAAC;MACzB;MACA;MACA,OAAOG,IAAI,CAACC,SAAS,CAACb,KAAK,CAAC;IAC9B;IACA,OAAOE,MAAM,CAACF,KAAK,CAAC;EACtB,CAAC;EAED,MAAMc,YAAY,GAAGf,eAAe,CAACD,UAAU,CAAC;EAEhD,oBACEV,KAAA,CAAA2B,aAAA,CAAC1B,IAAI;IAACQ,IAAI,EAAEA;EAAK,gBACfT,KAAA,CAAA2B,aAAA,CAACzB,GAAG;IAAC0B,SAAS,EAAC,UAAU;IAACC,GAAG,EAAC;EAAK,gBACjC7B,KAAA,CAAA2B,aAAA,CAACxB,IAAI;IAAC2B,IAAI,EAAC,OAAO;IAACC,SAAS;EAAA,GACzBzB,KAAK,CAAC0B,WAAW,IAAIzB,OAClB,CAAC,eACPP,KAAA,CAAA2B,aAAA,CAACxB,IAAI,QAAEuB,YAAmB,CACvB,CACD,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../../src/components/AutoPatternsEntityPage/RenderLayout/index.ts"],"sourcesContent":["export * from './RenderLayoutCard';\nexport * from './RenderLayoutContent';\n"],"mappings":"AAAA,cAAc,oBAAoB;AAClC,cAAc,uBAAuB","ignoreList":[]}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { EntityPage, useEntityPage } from '@wix/patterns';
|
|
2
|
-
import { useForm } from '../../exports/form';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Card, Cell, Layout } from '@wix/design-system';
|
|
5
|
-
const RenderLayoutContent = _ref => {
|
|
6
|
-
var _content$container$ch;
|
|
7
|
-
let {
|
|
8
|
-
content,
|
|
9
|
-
level,
|
|
10
|
-
sectionId,
|
|
11
|
-
cardIndex,
|
|
12
|
-
contentIndex
|
|
13
|
-
} = _ref;
|
|
14
|
-
switch (content.type) {
|
|
15
|
-
case 'container':
|
|
16
|
-
if (!((_content$container$ch = content.container.children) != null && _content$container$ch.length)) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /*#__PURE__*/React.createElement(Cell, {
|
|
20
|
-
span: content.container.span
|
|
21
|
-
}, /*#__PURE__*/React.createElement(Layout, null, content.container.children.map((child, index) => /*#__PURE__*/React.createElement(RenderLayoutContent, {
|
|
22
|
-
key: `${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`,
|
|
23
|
-
content: child,
|
|
24
|
-
level: level + 1,
|
|
25
|
-
sectionId: sectionId,
|
|
26
|
-
cardIndex: cardIndex,
|
|
27
|
-
contentIndex: index
|
|
28
|
-
}))));
|
|
29
|
-
default:
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const RenderLayoutCard = _ref2 => {
|
|
34
|
-
var _layout$card$subtitle;
|
|
35
|
-
let {
|
|
36
|
-
layout,
|
|
37
|
-
sectionId,
|
|
38
|
-
cardIndex
|
|
39
|
-
} = _ref2;
|
|
40
|
-
switch (layout.type) {
|
|
41
|
-
case 'card':
|
|
42
|
-
return /*#__PURE__*/React.createElement(EntityPage.Card, {
|
|
43
|
-
minHeight: "50px"
|
|
44
|
-
}, /*#__PURE__*/React.createElement(Card.Header, {
|
|
45
|
-
title: layout.card.title.text,
|
|
46
|
-
subtitle: (_layout$card$subtitle = layout.card.subtitle) == null ? void 0 : _layout$card$subtitle.text
|
|
47
|
-
}), /*#__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(RenderLayoutContent, {
|
|
48
|
-
key: `${sectionId}-card-${cardIndex}-content-${index}`,
|
|
49
|
-
content: child,
|
|
50
|
-
level: 0,
|
|
51
|
-
sectionId: sectionId,
|
|
52
|
-
cardIndex: cardIndex,
|
|
53
|
-
contentIndex: index
|
|
54
|
-
})))));
|
|
55
|
-
default:
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
export const SkeletonEntity = _ref3 => {
|
|
60
|
-
var _entityPage$layout, _entityPage$layout2, _entityPage$layout$si;
|
|
61
|
-
let {
|
|
62
|
-
entityPage
|
|
63
|
-
} = _ref3;
|
|
64
|
-
const form = useForm();
|
|
65
|
-
const state = useEntityPage({
|
|
66
|
-
parentPath: '',
|
|
67
|
-
form,
|
|
68
|
-
onSave: async () => ({
|
|
69
|
-
updatedEntity: {}
|
|
70
|
-
}),
|
|
71
|
-
fetch: async () => new Promise(() => {})
|
|
72
|
-
});
|
|
73
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EntityPage, {
|
|
74
|
-
state: state
|
|
75
|
-
}, /*#__PURE__*/React.createElement(EntityPage.Header, {
|
|
76
|
-
title: {
|
|
77
|
-
text: ''
|
|
78
|
-
}
|
|
79
|
-
}), /*#__PURE__*/React.createElement(EntityPage.Content, null, /*#__PURE__*/React.createElement(EntityPage.MainContent, null, (_entityPage$layout = entityPage.layout) == null || (_entityPage$layout = _entityPage$layout.main) == null ? void 0 : _entityPage$layout.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(RenderLayoutCard, {
|
|
80
|
-
key: `main-section-card-${layoutIndex}`,
|
|
81
|
-
layout: layout,
|
|
82
|
-
sectionId: "main",
|
|
83
|
-
cardIndex: layoutIndex
|
|
84
|
-
}))), (_entityPage$layout2 = entityPage.layout) != null && _entityPage$layout2.sidebar ? /*#__PURE__*/React.createElement(EntityPage.AdditionalContent, null, (_entityPage$layout$si = entityPage.layout.sidebar) == null ? void 0 : _entityPage$layout$si.map((layout, layoutIndex) => /*#__PURE__*/React.createElement(RenderLayoutCard, {
|
|
85
|
-
key: `sidebar-section-card-${layoutIndex}`,
|
|
86
|
-
layout: layout,
|
|
87
|
-
sectionId: "sidebar",
|
|
88
|
-
cardIndex: layoutIndex
|
|
89
|
-
}))) : null)));
|
|
90
|
-
};
|
|
91
|
-
//# sourceMappingURL=SkeletonEntity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["EntityPage","useEntityPage","useForm","React","Card","Cell","Layout","RenderLayoutContent","_ref","_content$container$ch","content","level","sectionId","cardIndex","contentIndex","type","container","children","length","createElement","span","map","child","index","key","RenderLayoutCard","_ref2","_layout$card$subtitle","layout","minHeight","Header","title","card","text","subtitle","Divider","Content","SkeletonEntity","_ref3","_entityPage$layout","_entityPage$layout2","_entityPage$layout$si","entityPage","form","state","parentPath","onSave","updatedEntity","fetch","Promise","Fragment","MainContent","main","layoutIndex","sidebar","AdditionalContent"],"sources":["../../../../src/components/AutoPatternsEntityPage/SkeletonEntity.tsx"],"sourcesContent":["import { EntityPage, EntityPageState, useEntityPage } from '@wix/patterns';\nimport { useForm } from '../../exports/form';\nimport React from 'react';\nimport { EntityPageConfig, CardLayout, LayoutContent } from '../../types';\n\nexport interface SkeletonEntityProps {\n entityPage: EntityPageConfig;\n}\nimport { Card, Cell, Layout } from '@wix/design-system';\n\nconst RenderLayoutContent: React.FC<{\n content: LayoutContent;\n level: number;\n sectionId: string;\n cardIndex: number;\n contentIndex: number;\n}> = ({ content, level, sectionId, cardIndex, contentIndex }) => {\n switch (content.type) {\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 <RenderLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${contentIndex}-level-${level}-child-${index}`}\n content={child}\n level={level + 1}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n />\n ))}\n </Layout>\n </Cell>\n );\n\n default:\n return null;\n }\n};\n\nconst RenderLayoutCard: React.FC<{\n layout: CardLayout;\n sectionId: string;\n cardIndex: number;\n}> = ({ layout, sectionId, cardIndex }) => {\n switch (layout.type) {\n case 'card':\n return (\n <EntityPage.Card 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 <RenderLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${index}`}\n content={child}\n level={0}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n />\n ))}\n </Layout>\n </Card.Content>\n </EntityPage.Card>\n );\n default:\n return null;\n }\n};\n\nexport const SkeletonEntity = ({ entityPage }: SkeletonEntityProps) => {\n const form = useForm();\n\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath: '',\n form,\n onSave: async () => ({ updatedEntity: {} }),\n fetch: async () => new Promise(() => {}),\n });\n\n return (\n <>\n <EntityPage state={state}>\n <EntityPage.Header title={{ text: '' }} />\n <EntityPage.Content>\n <EntityPage.MainContent>\n {entityPage.layout?.main?.map((layout, layoutIndex) => (\n <RenderLayoutCard\n key={`main-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"main\"\n cardIndex={layoutIndex}\n />\n ))}\n </EntityPage.MainContent>\n {entityPage.layout?.sidebar ? (\n <EntityPage.AdditionalContent>\n {entityPage.layout.sidebar?.map((layout, layoutIndex) => (\n <RenderLayoutCard\n key={`sidebar-section-card-${layoutIndex}`}\n layout={layout}\n sectionId=\"sidebar\"\n cardIndex={layoutIndex}\n />\n ))}\n </EntityPage.AdditionalContent>\n ) : null}\n </EntityPage.Content>\n </EntityPage>\n </>\n );\n};\n"],"mappings":"AAAA,SAASA,UAAU,EAAmBC,aAAa,QAAQ,eAAe;AAC1E,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAMzB,SAASC,IAAI,EAAEC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AAEvD,MAAMC,mBAMJ,GAAGC,IAAA,IAA4D;EAAA,IAAAC,qBAAA;EAAA,IAA3D;IAAEC,OAAO;IAAEC,KAAK;IAAEC,SAAS;IAAEC,SAAS;IAAEC;EAAa,CAAC,GAAAN,IAAA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E;IAAG;EAAE,CAAE,CAAC,eAC1C9B,KAAA,CAAAgB,aAAA,CAACnB,UAAU,CAACoC,OAAO,qBACjBjC,KAAA,CAAAgB,aAAA,CAACnB,UAAU,CAACmD,WAAW,SAAAZ,kBAAA,GACpBG,UAAU,CAACd,MAAM,cAAAW,kBAAA,GAAjBA,kBAAA,CAAmBa,IAAI,qBAAvBb,kBAAA,CAAyBlB,GAAG,CAAC,CAACO,MAAM,EAAEyB,WAAW,kBAChDlD,KAAA,CAAAgB,aAAA,CAACM,gBAAgB;IACfD,GAAG,EAAE,qBAAqB6B,WAAW,EAAG;IACxCzB,MAAM,EAAEA,MAAO;IACfhB,SAAS,EAAC,MAAM;IAChBC,SAAS,EAAEwC;EAAY,CACxB,CACF,CACqB,CAAC,EACxB,CAAAb,mBAAA,GAAAE,UAAU,CAACd,MAAM,aAAjBY,mBAAA,CAAmBc,OAAO,gBACzBnD,KAAA,CAAAgB,aAAA,CAACnB,UAAU,CAACuD,iBAAiB,SAAAd,qBAAA,GAC1BC,UAAU,CAACd,MAAM,CAAC0B,OAAO,qBAAzBb,qBAAA,CAA2BpB,GAAG,CAAC,CAACO,MAAM,EAAEyB,WAAW,kBAClDlD,KAAA,CAAAgB,aAAA,CAACM,gBAAgB;IACfD,GAAG,EAAE,wBAAwB6B,WAAW,EAAG;IAC3CzB,MAAM,EAAEA,MAAO;IACfhB,SAAS,EAAC,SAAS;IACnBC,SAAS,EAAEwC;EAAY,CACxB,CACF,CAC2B,CAAC,GAC7B,IACc,CACV,CACZ,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Card, Layout } from '@wix/design-system';
|
|
3
|
-
import { RenderViewLayoutContent } from './RenderViewLayoutContent';
|
|
4
|
-
// TODO: remove this component and use RenderLayoutCard instead
|
|
5
|
-
export const RenderViewLayoutCard = _ref => {
|
|
6
|
-
var _layout$card$subtitle;
|
|
7
|
-
let {
|
|
8
|
-
entity,
|
|
9
|
-
layout,
|
|
10
|
-
sectionId,
|
|
11
|
-
cardIndex
|
|
12
|
-
} = _ref;
|
|
13
|
-
switch (layout.type) {
|
|
14
|
-
case 'card':
|
|
15
|
-
return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Card.Header, {
|
|
16
|
-
title: layout.card.title.text,
|
|
17
|
-
subtitle: (_layout$card$subtitle = layout.card.subtitle) == null ? void 0 : _layout$card$subtitle.text
|
|
18
|
-
}), /*#__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(RenderViewLayoutContent, {
|
|
19
|
-
key: `${sectionId}-card-${cardIndex}-content-${index}`,
|
|
20
|
-
entity: entity,
|
|
21
|
-
content: child,
|
|
22
|
-
level: 0,
|
|
23
|
-
sectionId: sectionId,
|
|
24
|
-
cardIndex: cardIndex,
|
|
25
|
-
contentIndex: index
|
|
26
|
-
})))));
|
|
27
|
-
default:
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
//# sourceMappingURL=RenderViewLayoutCard.js.map
|
package/dist/esm/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Card","Layout","RenderViewLayoutContent","RenderViewLayoutCard","_ref","_layout$card$subtitle","entity","layout","sectionId","cardIndex","type","createElement","Header","title","card","text","subtitle","Divider","Content","children","map","child","index","key","content","level","contentIndex"],"sources":["../../../../../src/components/AutoPatternsEntityPage/ViewEntityPage/RenderViewLayoutCard.tsx"],"sourcesContent":["import React from 'react';\nimport { Card, Layout } from '@wix/design-system';\nimport { RenderViewLayoutContent } from './RenderViewLayoutContent';\nimport { RenderLayoutCardProps } from '../RenderLayout';\n\ninterface RenderViewLayoutCardProps\n extends Omit<RenderLayoutCardProps, 'setInputRef'> {\n entity: Record<string, any>;\n}\n\n// TODO: remove this component and use RenderLayoutCard instead\nexport const RenderViewLayoutCard: React.FC<RenderViewLayoutCardProps> = ({\n entity,\n layout,\n sectionId,\n cardIndex,\n}) => {\n switch (layout.type) {\n case 'card':\n return (\n <Card>\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 <RenderViewLayoutContent\n key={`${sectionId}-card-${cardIndex}-content-${index}`}\n entity={entity}\n content={child}\n level={0}\n sectionId={sectionId}\n cardIndex={cardIndex}\n contentIndex={index}\n />\n ))}\n </Layout>\n </Card.Content>\n </Card>\n );\n default:\n return null;\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAQnE;AACA,OAAO,MAAMC,oBAAyD,GAAGC,IAAA,IAKnE;EAAA,IAAAC,qBAAA;EAAA,IALoE;IACxEC,MAAM;IACNC,MAAM;IACNC,SAAS;IACTC;EACF,CAAC,GAAAL,IAAA;EACC,QAAQG,MAAM,CAACG,IAAI;IACjB,KAAK,MAAM;MACT,oBACEX,KAAA,CAAAY,aAAA,CAACX,IAAI,qBACHD,KAAA,CAAAY,aAAA,CAACX,IAAI,CAACY,MAAM;QACVC,KAAK,EAAEN,MAAM,CAACO,IAAI,CAACD,KAAK,CAACE,IAAK;QAC9BC,QAAQ,GAAAX,qBAAA,GAAEE,MAAM,CAACO,IAAI,CAACE,QAAQ,qBAApBX,qBAAA,CAAsBU;MAAK,CACtC,CAAC,eACFhB,KAAA,CAAAY,aAAA,CAACX,IAAI,CAACiB,OAAO,MAAE,CAAC,eAChBlB,KAAA,CAAAY,aAAA,CAACX,IAAI,CAACkB,OAAO,qBACXnB,KAAA,CAAAY,aAAA,CAACV,MAAM,QACJM,MAAM,CAACO,IAAI,CAACK,QAAQ,CAACC,GAAG,CAAC,CAACC,KAAK,EAAEC,KAAa,kBAC7CvB,KAAA,CAAAY,aAAA,CAACT,uBAAuB;QACtBqB,GAAG,EAAE,GAAGf,SAAS,SAASC,SAAS,YAAYa,KAAK,EAAG;QACvDhB,MAAM,EAAEA,MAAO;QACfkB,OAAO,EAAEH,KAAM;QACfI,KAAK,EAAE,CAAE;QACTjB,SAAS,EAAEA,SAAU;QACrBC,SAAS,EAAEA,SAAU;QACrBiB,YAAY,EAAEJ;MAAM,CACrB,CACF,CACK,CACI,CACV,CAAC;IAEX;MACE,OAAO,IAAI;EACf;AACF,CAAC","ignoreList":[]}
|