@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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.useFiltersState = useFiltersState;
|
|
6
|
+
var _providers = require("../providers");
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _filterCreators = require("../utils/filterCreators");
|
|
9
|
+
function useFiltersState(config) {
|
|
10
|
+
const schema = (0, _providers.useSchema)();
|
|
11
|
+
const schemaRegistry = (0, _providers.useSchemaRegistry)();
|
|
12
|
+
const [filters] = _react.default.useState(() => {
|
|
13
|
+
const currFilters = [];
|
|
14
|
+
config == null || config.items.forEach(filter => {
|
|
15
|
+
const {
|
|
16
|
+
id,
|
|
17
|
+
fieldId
|
|
18
|
+
} = filter;
|
|
19
|
+
const fieldDefinition = schema.fields[fieldId];
|
|
20
|
+
if (!fieldDefinition) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const label = filter.displayName || fieldDefinition.displayName;
|
|
24
|
+
const {
|
|
25
|
+
openByDefault,
|
|
26
|
+
tagLabel,
|
|
27
|
+
sectionTitle
|
|
28
|
+
} = filter;
|
|
29
|
+
const baseParams = {
|
|
30
|
+
id,
|
|
31
|
+
fieldId,
|
|
32
|
+
fieldDefinition,
|
|
33
|
+
commonFilterProps: {
|
|
34
|
+
sectionTitle,
|
|
35
|
+
initiallyOpen: openByDefault,
|
|
36
|
+
accordionItemProps: {
|
|
37
|
+
label
|
|
38
|
+
},
|
|
39
|
+
toolbarItemProps: {
|
|
40
|
+
label
|
|
41
|
+
},
|
|
42
|
+
toolbarTagProps: {
|
|
43
|
+
label: tagLabel
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
switch (fieldDefinition.type) {
|
|
48
|
+
case 'DATE':
|
|
49
|
+
case 'DATETIME':
|
|
50
|
+
currFilters.push((0, _filterCreators.createDateTimeFilter)({
|
|
51
|
+
...baseParams,
|
|
52
|
+
config: filter.dateConfig
|
|
53
|
+
}));
|
|
54
|
+
break;
|
|
55
|
+
case 'BOOLEAN':
|
|
56
|
+
currFilters.push((0, _filterCreators.createBooleanFilter)({
|
|
57
|
+
...baseParams,
|
|
58
|
+
config: filter.booleanConfig
|
|
59
|
+
}));
|
|
60
|
+
break;
|
|
61
|
+
case 'NUMBER':
|
|
62
|
+
currFilters.push((0, _filterCreators.createNumberFilter)({
|
|
63
|
+
...baseParams,
|
|
64
|
+
config: filter.numberConfig
|
|
65
|
+
}));
|
|
66
|
+
break;
|
|
67
|
+
case 'REFERENCE':
|
|
68
|
+
{
|
|
69
|
+
const {
|
|
70
|
+
referencedCollectionId
|
|
71
|
+
} = fieldDefinition.referenceMetadata;
|
|
72
|
+
const referencedSchema = schemaRegistry.getSchema(referencedCollectionId);
|
|
73
|
+
if (referencedSchema) {
|
|
74
|
+
currFilters.push((0, _filterCreators.createReferenceFilter)({
|
|
75
|
+
...baseParams,
|
|
76
|
+
config: filter.dynamicOptionsConfig,
|
|
77
|
+
additionalParams: {
|
|
78
|
+
referencedSchema
|
|
79
|
+
}
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
default:
|
|
85
|
+
if (filter != null && filter.enumConfig) {
|
|
86
|
+
currFilters.push((0, _filterCreators.createEnumFilter)({
|
|
87
|
+
...baseParams,
|
|
88
|
+
config: filter.enumConfig
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return currFilters;
|
|
95
|
+
});
|
|
96
|
+
const filterFieldMapping = _react.default.useMemo(() => {
|
|
97
|
+
return config == null ? void 0 : config.items.reduce((acc, filter) => {
|
|
98
|
+
acc[filter.id] = filter;
|
|
99
|
+
return acc;
|
|
100
|
+
}, {});
|
|
101
|
+
}, [config == null ? void 0 : config.items]);
|
|
102
|
+
const filtersObject = filters.reduce((acc, filter) => {
|
|
103
|
+
acc[filter.key] = filter.filter;
|
|
104
|
+
return acc;
|
|
105
|
+
}, {});
|
|
106
|
+
return {
|
|
107
|
+
filters,
|
|
108
|
+
filterFieldMapping,
|
|
109
|
+
filtersObject
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=useFiltersState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_providers","require","_react","_interopRequireDefault","_filterCreators","useFiltersState","config","schema","useSchema","schemaRegistry","useSchemaRegistry","filters","React","useState","currFilters","items","forEach","filter","id","fieldId","fieldDefinition","fields","label","displayName","openByDefault","tagLabel","sectionTitle","baseParams","commonFilterProps","initiallyOpen","accordionItemProps","toolbarItemProps","toolbarTagProps","type","push","createDateTimeFilter","dateConfig","createBooleanFilter","booleanConfig","createNumberFilter","numberConfig","referencedCollectionId","referenceMetadata","referencedSchema","getSchema","createReferenceFilter","dynamicOptionsConfig","additionalParams","enumConfig","createEnumFilter","filterFieldMapping","useMemo","reduce","acc","filtersObject","key"],"sources":["../../../src/hooks/useFiltersState.ts"],"sourcesContent":["import { useSchema, useSchemaRegistry } from '../providers';\nimport React from 'react';\nimport {\n createBooleanFilter,\n createDateTimeFilter,\n createEnumFilter,\n createNumberFilter,\n createReferenceFilter,\n} from '../utils/filterCreators';\nimport {\n DateFilterConfig,\n DynamicOptionsFilterConfig,\n EnumFilterConfig,\n Field,\n Filter as SchemaFilterType,\n FiltersConfig,\n} from '../types';\nimport { Filter } from '@wix/patterns';\n\nexport interface FilterOptions {\n key: string;\n fieldId: string;\n fieldDefinition: Field;\n filter: Filter<any>;\n collectionData?: { id: string; name: string }[];\n collectionId?: string;\n componentName?: string;\n props: Record<string, any>;\n dateConfig?: DateFilterConfig;\n enumConfig?: EnumFilterConfig;\n dynamicOptionsFilterConfig?: DynamicOptionsFilterConfig;\n}\n\nexport function useFiltersState(config?: FiltersConfig) {\n const schema = useSchema();\n const schemaRegistry = useSchemaRegistry();\n const [filters] = React.useState(() => {\n const currFilters: FilterOptions[] = [];\n config?.items.forEach((filter) => {\n const { id, fieldId } = filter;\n const fieldDefinition = schema.fields[fieldId];\n if (!fieldDefinition) {\n return;\n }\n\n const label = filter.displayName || fieldDefinition.displayName;\n const { openByDefault, tagLabel, sectionTitle } = filter;\n\n const baseParams = {\n id,\n fieldId,\n fieldDefinition,\n commonFilterProps: {\n sectionTitle,\n initiallyOpen: openByDefault,\n accordionItemProps: { label },\n toolbarItemProps: { label },\n toolbarTagProps: { label: tagLabel },\n },\n };\n\n switch (fieldDefinition.type) {\n case 'DATE':\n case 'DATETIME':\n currFilters.push(\n createDateTimeFilter({\n ...baseParams,\n config: filter.dateConfig,\n }),\n );\n break;\n\n case 'BOOLEAN':\n currFilters.push(\n createBooleanFilter({\n ...baseParams,\n config: filter.booleanConfig,\n }),\n );\n break;\n\n case 'NUMBER':\n currFilters.push(\n createNumberFilter({\n ...baseParams,\n config: filter.numberConfig,\n }),\n );\n break;\n\n case 'REFERENCE': {\n const { referencedCollectionId } = fieldDefinition.referenceMetadata;\n const referencedSchema = schemaRegistry.getSchema(\n referencedCollectionId,\n );\n\n if (referencedSchema) {\n currFilters.push(\n createReferenceFilter({\n ...baseParams,\n config: filter.dynamicOptionsConfig,\n additionalParams: {\n referencedSchema,\n },\n }),\n );\n }\n break;\n }\n\n default:\n if (filter?.enumConfig) {\n currFilters.push(\n createEnumFilter({\n ...baseParams,\n config: filter.enumConfig,\n }),\n );\n }\n break;\n }\n });\n return currFilters;\n });\n\n const filterFieldMapping = React.useMemo(() => {\n return config?.items.reduce((acc, filter) => {\n acc[filter.id] = filter;\n return acc;\n }, {} as Record<string, SchemaFilterType>);\n }, [config?.items]);\n\n const filtersObject = filters.reduce((acc, filter) => {\n acc[filter.key] = filter.filter;\n return acc;\n }, {} as { [key: string]: Filter<any> });\n\n return { filters, filterFieldMapping, filtersObject };\n}\n"],"mappings":";;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AA+BO,SAASI,eAAeA,CAACC,MAAsB,EAAE;EACtD,MAAMC,MAAM,GAAG,IAAAC,oBAAS,EAAC,CAAC;EAC1B,MAAMC,cAAc,GAAG,IAAAC,4BAAiB,EAAC,CAAC;EAC1C,MAAM,CAACC,OAAO,CAAC,GAAGC,cAAK,CAACC,QAAQ,CAAC,MAAM;IACrC,MAAMC,WAA4B,GAAG,EAAE;IACvCR,MAAM,YAANA,MAAM,CAAES,KAAK,CAACC,OAAO,CAAEC,MAAM,IAAK;MAChC,MAAM;QAAEC,EAAE;QAAEC;MAAQ,CAAC,GAAGF,MAAM;MAC9B,MAAMG,eAAe,GAAGb,MAAM,CAACc,MAAM,CAACF,OAAO,CAAC;MAC9C,IAAI,CAACC,eAAe,EAAE;QACpB;MACF;MAEA,MAAME,KAAK,GAAGL,MAAM,CAACM,WAAW,IAAIH,eAAe,CAACG,WAAW;MAC/D,MAAM;QAAEC,aAAa;QAAEC,QAAQ;QAAEC;MAAa,CAAC,GAAGT,MAAM;MAExD,MAAMU,UAAU,GAAG;QACjBT,EAAE;QACFC,OAAO;QACPC,eAAe;QACfQ,iBAAiB,EAAE;UACjBF,YAAY;UACZG,aAAa,EAAEL,aAAa;UAC5BM,kBAAkB,EAAE;YAAER;UAAM,CAAC;UAC7BS,gBAAgB,EAAE;YAAET;UAAM,CAAC;UAC3BU,eAAe,EAAE;YAAEV,KAAK,EAAEG;UAAS;QACrC;MACF,CAAC;MAED,QAAQL,eAAe,CAACa,IAAI;QAC1B,KAAK,MAAM;QACX,KAAK,UAAU;UACbnB,WAAW,CAACoB,IAAI,CACd,IAAAC,oCAAoB,EAAC;YACnB,GAAGR,UAAU;YACbrB,MAAM,EAAEW,MAAM,CAACmB;UACjB,CAAC,CACH,CAAC;UACD;QAEF,KAAK,SAAS;UACZtB,WAAW,CAACoB,IAAI,CACd,IAAAG,mCAAmB,EAAC;YAClB,GAAGV,UAAU;YACbrB,MAAM,EAAEW,MAAM,CAACqB;UACjB,CAAC,CACH,CAAC;UACD;QAEF,KAAK,QAAQ;UACXxB,WAAW,CAACoB,IAAI,CACd,IAAAK,kCAAkB,EAAC;YACjB,GAAGZ,UAAU;YACbrB,MAAM,EAAEW,MAAM,CAACuB;UACjB,CAAC,CACH,CAAC;UACD;QAEF,KAAK,WAAW;UAAE;YAChB,MAAM;cAAEC;YAAuB,CAAC,GAAGrB,eAAe,CAACsB,iBAAiB;YACpE,MAAMC,gBAAgB,GAAGlC,cAAc,CAACmC,SAAS,CAC/CH,sBACF,CAAC;YAED,IAAIE,gBAAgB,EAAE;cACpB7B,WAAW,CAACoB,IAAI,CACd,IAAAW,qCAAqB,EAAC;gBACpB,GAAGlB,UAAU;gBACbrB,MAAM,EAAEW,MAAM,CAAC6B,oBAAoB;gBACnCC,gBAAgB,EAAE;kBAChBJ;gBACF;cACF,CAAC,CACH,CAAC;YACH;YACA;UACF;QAEA;UACE,IAAI1B,MAAM,YAANA,MAAM,CAAE+B,UAAU,EAAE;YACtBlC,WAAW,CAACoB,IAAI,CACd,IAAAe,gCAAgB,EAAC;cACf,GAAGtB,UAAU;cACbrB,MAAM,EAAEW,MAAM,CAAC+B;YACjB,CAAC,CACH,CAAC;UACH;UACA;MACJ;IACF,CAAC,CAAC;IACF,OAAOlC,WAAW;EACpB,CAAC,CAAC;EAEF,MAAMoC,kBAAkB,GAAGtC,cAAK,CAACuC,OAAO,CAAC,MAAM;IAC7C,OAAO7C,MAAM,oBAANA,MAAM,CAAES,KAAK,CAACqC,MAAM,CAAC,CAACC,GAAG,EAAEpC,MAAM,KAAK;MAC3CoC,GAAG,CAACpC,MAAM,CAACC,EAAE,CAAC,GAAGD,MAAM;MACvB,OAAOoC,GAAG;IACZ,CAAC,EAAE,CAAC,CAAqC,CAAC;EAC5C,CAAC,EAAE,CAAC/C,MAAM,oBAANA,MAAM,CAAES,KAAK,CAAC,CAAC;EAEnB,MAAMuC,aAAa,GAAG3C,OAAO,CAACyC,MAAM,CAAC,CAACC,GAAG,EAAEpC,MAAM,KAAK;IACpDoC,GAAG,CAACpC,MAAM,CAACsC,GAAG,CAAC,GAAGtC,MAAM,CAACA,MAAM;IAC/B,OAAOoC,GAAG;EACZ,CAAC,EAAE,CAAC,CAAmC,CAAC;EAExC,OAAO;IAAE1C,OAAO;IAAEuC,kBAAkB;IAAEI;EAAc,CAAC;AACvD","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useGridFeaturesAsync = void 0;
|
|
5
|
+
var _useAsyncFeaturesPromiseState = require("./useAsyncFeaturesPromiseState");
|
|
6
|
+
var _pluginsDynamicImports = require("./pluginsDynamicImports");
|
|
7
|
+
var _getCommonCollectionFeaturesAsync = require("./getCommonCollectionFeaturesAsync");
|
|
8
|
+
/**
|
|
9
|
+
* useGridFeaturesAsync - Step 3 in Grid Flow
|
|
10
|
+
*
|
|
11
|
+
* FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → [useGridFeaturesAsync] → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid
|
|
12
|
+
*
|
|
13
|
+
* This hook is responsible for loading all grid-specific async features and plugins.
|
|
14
|
+
* It dynamically imports features based on configuration to optimize bundle size.
|
|
15
|
+
* Grid flow is simpler than table flow since grids have fewer optional features.
|
|
16
|
+
*
|
|
17
|
+
* Key Responsibilities:
|
|
18
|
+
* - Loads common collection features (shared across all flows)
|
|
19
|
+
* - Conditionally loads grid-specific dragAndDrop if enabled
|
|
20
|
+
* - Returns promise state that tracks loading status of all features
|
|
21
|
+
* - Enables AutoPatternsGrid to know when all features are ready
|
|
22
|
+
*/
|
|
23
|
+
const useGridFeaturesAsync = props => {
|
|
24
|
+
const {
|
|
25
|
+
config
|
|
26
|
+
} = props;
|
|
27
|
+
const asyncFeaturesState = (0, _useAsyncFeaturesPromiseState.useAsyncFeaturesPromiseState)({
|
|
28
|
+
// Load common features shared by all collection components (filters, common actions, etc.)
|
|
29
|
+
...(0, _getCommonCollectionFeaturesAsync.getCommonCollectionFeaturesAsync)(),
|
|
30
|
+
// Grid-specific drag and drop functionality - only load if enabled in config
|
|
31
|
+
// Note: Grid has fewer async features compared to Table (no sections, no baseTableFeatures)
|
|
32
|
+
dragAndDrop: () => {
|
|
33
|
+
var _config$dragAndDrop;
|
|
34
|
+
return (_config$dragAndDrop = config.dragAndDrop) != null && _config$dragAndDrop.enabled ? (0, _pluginsDynamicImports.importGridDragAndDrop)() : null;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
asyncFeaturesState
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
exports.useGridFeaturesAsync = useGridFeaturesAsync;
|
|
42
|
+
//# sourceMappingURL=useGridFeaturesAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useAsyncFeaturesPromiseState","require","_pluginsDynamicImports","_getCommonCollectionFeaturesAsync","useGridFeaturesAsync","props","config","asyncFeaturesState","useAsyncFeaturesPromiseState","getCommonCollectionFeaturesAsync","dragAndDrop","_config$dragAndDrop","enabled","importGridDragAndDrop","exports"],"sources":["../../../src/hooks/useGridFeaturesAsync.tsx"],"sourcesContent":["import { GridConfig } from '../types';\nimport { useAsyncFeaturesPromiseState } from './useAsyncFeaturesPromiseState';\nimport { importGridDragAndDrop } from './pluginsDynamicImports';\nimport { getCommonCollectionFeaturesAsync } from './getCommonCollectionFeaturesAsync';\n\nexport interface UseGridFeaturesAsyncProps {\n config: GridConfig;\n}\n\n/**\n * useGridFeaturesAsync - Step 3 in Grid Flow\n *\n * FLOW 2: AutoPatternsCollectionComponent → AutoPatternsGrid → [useGridFeaturesAsync] → AutoPatternsGridLoaded → useBaseCollectionComponentReadyFeatures → Grid\n *\n * This hook is responsible for loading all grid-specific async features and plugins.\n * It dynamically imports features based on configuration to optimize bundle size.\n * Grid flow is simpler than table flow since grids have fewer optional features.\n *\n * Key Responsibilities:\n * - Loads common collection features (shared across all flows)\n * - Conditionally loads grid-specific dragAndDrop if enabled\n * - Returns promise state that tracks loading status of all features\n * - Enables AutoPatternsGrid to know when all features are ready\n */\nexport const useGridFeaturesAsync = (props: UseGridFeaturesAsyncProps) => {\n const { config } = props;\n\n const asyncFeaturesState = useAsyncFeaturesPromiseState({\n // Load common features shared by all collection components (filters, common actions, etc.)\n ...getCommonCollectionFeaturesAsync(),\n\n // Grid-specific drag and drop functionality - only load if enabled in config\n // Note: Grid has fewer async features compared to Table (no sections, no baseTableFeatures)\n dragAndDrop: () =>\n config.dragAndDrop?.enabled ? importGridDragAndDrop() : null,\n });\n\n return {\n asyncFeaturesState,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,iCAAA,GAAAF,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,oBAAoB,GAAIC,KAAgC,IAAK;EACxE,MAAM;IAAEC;EAAO,CAAC,GAAGD,KAAK;EAExB,MAAME,kBAAkB,GAAG,IAAAC,0DAA4B,EAAC;IACtD;IACA,GAAG,IAAAC,kEAAgC,EAAC,CAAC;IAErC;IACA;IACAC,WAAW,EAAEA,CAAA;MAAA,IAAAC,mBAAA;MAAA,OACX,CAAAA,mBAAA,GAAAL,MAAM,CAACI,WAAW,aAAlBC,mBAAA,CAAoBC,OAAO,GAAG,IAAAC,4CAAqB,EAAC,CAAC,GAAG,IAAI;IAAA;EAChE,CAAC,CAAC;EAEF,OAAO;IACLN;EACF,CAAC;AACH,CAAC;AAACO,OAAA,CAAAV,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useGridVisibleFieldIds = useGridVisibleFieldIds;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
function useGridVisibleFieldIds(config) {
|
|
7
|
+
const {
|
|
8
|
+
item
|
|
9
|
+
} = config;
|
|
10
|
+
const {
|
|
11
|
+
titleFieldId,
|
|
12
|
+
subtitleFieldId,
|
|
13
|
+
imageFieldId
|
|
14
|
+
} = item;
|
|
15
|
+
return (0, _react.useMemo)(() => [titleFieldId, subtitleFieldId, imageFieldId].filter(Boolean), [titleFieldId, subtitleFieldId, imageFieldId]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=useGridVisibleFieldIds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","useGridVisibleFieldIds","config","item","titleFieldId","subtitleFieldId","imageFieldId","useMemo","filter","Boolean"],"sources":["../../../src/hooks/useGridVisibleFieldIds.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { GridSpecificConfig } from '../types';\n\nexport function useGridVisibleFieldIds(config: GridSpecificConfig) {\n const { item } = config;\n\n const { titleFieldId, subtitleFieldId, imageFieldId } = item;\n return useMemo(\n () =>\n [titleFieldId, subtitleFieldId, imageFieldId].filter(Boolean) as string[],\n [titleFieldId, subtitleFieldId, imageFieldId],\n );\n}\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,SAASC,sBAAsBA,CAACC,MAA0B,EAAE;EACjE,MAAM;IAAEC;EAAK,CAAC,GAAGD,MAAM;EAEvB,MAAM;IAAEE,YAAY;IAAEC,eAAe;IAAEC;EAAa,CAAC,GAAGH,IAAI;EAC5D,OAAO,IAAAI,cAAO,EACZ,MACE,CAACH,YAAY,EAAEC,eAAe,EAAEC,YAAY,CAAC,CAACE,MAAM,CAACC,OAAO,CAAa,EAC3E,CAACL,YAAY,EAAEC,eAAe,EAAEC,YAAY,CAC9C,CAAC;AACH","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ exports.usePagePath = void 0;
|
|
|
5
5
|
var _react = require("react");
|
|
6
6
|
const usePagePath = configuration => {
|
|
7
7
|
const getPagePath = (0, _react.useCallback)(pageId => {
|
|
8
|
-
var _currentPage$collecti, _currentPage$entityPa;
|
|
8
|
+
var _currentPage$collecti, _currentPage$entityPa, _currentPage$settings;
|
|
9
9
|
if (!pageId) {
|
|
10
10
|
return '/';
|
|
11
11
|
}
|
|
@@ -18,6 +18,9 @@ const usePagePath = configuration => {
|
|
|
18
18
|
case 'entityPage':
|
|
19
19
|
path = `${(_currentPage$entityPa = currentPage.entityPage) == null ? void 0 : _currentPage$entityPa.route.path}?`;
|
|
20
20
|
break;
|
|
21
|
+
case 'settingsPage':
|
|
22
|
+
path = (_currentPage$settings = currentPage.settingsPage) == null ? void 0 : _currentPage$settings.route.path;
|
|
23
|
+
break;
|
|
21
24
|
default:
|
|
22
25
|
path = undefined;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","usePagePath","configuration","getPagePath","useCallback","pageId","_currentPage$collecti","_currentPage$entityPa","currentPage","pages","find","page","id","path","type","collectionPage","route","entityPage","undefined","process","env","NODE_ENV","exports"],"sources":["../../../src/hooks/usePagePath.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { AppConfig } from '../types';\n\nexport const usePagePath = (configuration: AppConfig) => {\n const getPagePath = useCallback(\n (pageId?: string) => {\n if (!pageId) {\n return '/';\n }\n\n const currentPage = configuration.pages.find(\n (page) => page.id === pageId,\n );\n\n let path;\n switch (currentPage?.type) {\n case 'collectionPage':\n path = currentPage.collectionPage?.route.path;\n break;\n case 'entityPage':\n path = `${currentPage.entityPage?.route.path}?`;\n break;\n default:\n path = undefined;\n }\n\n if (process.env.NODE_ENV === 'test') {\n // in test mode we sometime override pages so we need to return the path or '/'\n return path || '/';\n }\n\n return path;\n },\n [configuration],\n );\n\n return { getPagePath };\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,GAAIC,aAAwB,IAAK;EACvD,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAC5BC,MAAe,IAAK;IAAA,IAAAC,qBAAA,EAAAC,qBAAA;IACnB,IAAI,
|
|
1
|
+
{"version":3,"names":["_react","require","usePagePath","configuration","getPagePath","useCallback","pageId","_currentPage$collecti","_currentPage$entityPa","_currentPage$settings","currentPage","pages","find","page","id","path","type","collectionPage","route","entityPage","settingsPage","undefined","process","env","NODE_ENV","exports"],"sources":["../../../src/hooks/usePagePath.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { AppConfig } from '../types';\n\nexport const usePagePath = (configuration: AppConfig) => {\n const getPagePath = useCallback(\n (pageId?: string) => {\n if (!pageId) {\n return '/';\n }\n\n const currentPage = configuration.pages.find(\n (page) => page.id === pageId,\n );\n\n let path;\n switch (currentPage?.type) {\n case 'collectionPage':\n path = currentPage.collectionPage?.route.path;\n break;\n case 'entityPage':\n path = `${currentPage.entityPage?.route.path}?`;\n break;\n case 'settingsPage':\n path = currentPage.settingsPage?.route.path;\n break;\n default:\n path = undefined;\n }\n\n if (process.env.NODE_ENV === 'test') {\n // in test mode we sometime override pages so we need to return the path or '/'\n return path || '/';\n }\n\n return path;\n },\n [configuration],\n );\n\n return { getPagePath };\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,WAAW,GAAIC,aAAwB,IAAK;EACvD,MAAMC,WAAW,GAAG,IAAAC,kBAAW,EAC5BC,MAAe,IAAK;IAAA,IAAAC,qBAAA,EAAAC,qBAAA,EAAAC,qBAAA;IACnB,IAAI,CAACH,MAAM,EAAE;MACX,OAAO,GAAG;IACZ;IAEA,MAAMI,WAAW,GAAGP,aAAa,CAACQ,KAAK,CAACC,IAAI,CACzCC,IAAI,IAAKA,IAAI,CAACC,EAAE,KAAKR,MACxB,CAAC;IAED,IAAIS,IAAI;IACR,QAAQL,WAAW,oBAAXA,WAAW,CAAEM,IAAI;MACvB,KAAK,gBAAgB;QACnBD,IAAI,IAAAR,qBAAA,GAAGG,WAAW,CAACO,cAAc,qBAA1BV,qBAAA,CAA4BW,KAAK,CAACH,IAAI;QAC7C;MACF,KAAK,YAAY;QACfA,IAAI,GAAG,IAAAP,qBAAA,GAAGE,WAAW,CAACS,UAAU,qBAAtBX,qBAAA,CAAwBU,KAAK,CAACH,IAAI,GAAG;QAC/C;MACF,KAAK,cAAc;QACjBA,IAAI,IAAAN,qBAAA,GAAGC,WAAW,CAACU,YAAY,qBAAxBX,qBAAA,CAA0BS,KAAK,CAACH,IAAI;QAC3C;MACF;QACEA,IAAI,GAAGM,SAAS;IACpB;IAEA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,EAAE;MACnC;MACA,OAAOT,IAAI,IAAI,GAAG;IACpB;IAEA,OAAOA,IAAI;EACb,CAAC,EACD,CAACZ,aAAa,CAChB,CAAC;EAED,OAAO;IAAEC;EAAY,CAAC;AACxB,CAAC;AAACqB,OAAA,CAAAvB,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useSettingsPageMoreActions = useSettingsPageMoreActions;
|
|
5
|
+
var _react = require("react");
|
|
6
|
+
var _actions = require("../utils/actions");
|
|
7
|
+
function useSettingsPageMoreActions(moreActions, baseSDK) {
|
|
8
|
+
const buildSettingsPageActions = (0, _react.useCallback)(() => {
|
|
9
|
+
if (!moreActions) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const buildAction = actionConfig => {
|
|
13
|
+
// Settings page doesn't have collection context, so we cast to ActionsSDK
|
|
14
|
+
// The customAction function only uses sdk.overrides which is available in BaseSDK
|
|
15
|
+
const actionToResolve = (0, _actions.customAction)({
|
|
16
|
+
action: actionConfig,
|
|
17
|
+
actionParams: {},
|
|
18
|
+
sdk: baseSDK
|
|
19
|
+
});
|
|
20
|
+
if (!actionToResolve || actionToResolve.hidden) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const resolved = (0, _actions.resolveAction)(actionConfig, actionToResolve);
|
|
24
|
+
return {
|
|
25
|
+
onClick: resolved.onClick,
|
|
26
|
+
text: resolved.label,
|
|
27
|
+
prefixIcon: resolved.icon,
|
|
28
|
+
disabled: resolved.disabled
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const actionGroups = (0, _actions.groupActions)(moreActions);
|
|
32
|
+
return actionGroups.map(group => group.map(buildAction).filter(action => Boolean(action))).filter(group => group.length > 0);
|
|
33
|
+
}, [moreActions, baseSDK]);
|
|
34
|
+
return buildSettingsPageActions() ?? [];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=useSettingsPageMoreActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_actions","useSettingsPageMoreActions","moreActions","baseSDK","buildSettingsPageActions","useCallback","buildAction","actionConfig","actionToResolve","customAction","action","actionParams","sdk","hidden","resolved","resolveAction","onClick","text","label","prefixIcon","icon","disabled","actionGroups","groupActions","map","group","filter","Boolean","length"],"sources":["../../../src/hooks/useSettingsPageMoreActions.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport { MoreActionsItem } from '@wix/patterns';\nimport { ActionsSDK, BaseSDK, ResolvedAction } from '../types';\nimport { MoreActionsType, CustomActionConfig } from '../types/actions/base';\nimport { customAction, resolveAction, groupActions } from '../utils/actions';\n\nexport function useSettingsPageMoreActions(\n moreActions?: MoreActionsType,\n baseSDK?: BaseSDK,\n) {\n const buildSettingsPageActions = useCallback(() => {\n if (!moreActions) {\n return;\n }\n\n const buildAction = (\n actionConfig: CustomActionConfig,\n ): MoreActionsItem | null => {\n // Settings page doesn't have collection context, so we cast to ActionsSDK\n // The customAction function only uses sdk.overrides which is available in BaseSDK\n const actionToResolve = customAction({\n action: actionConfig,\n actionParams: {},\n sdk: baseSDK as ActionsSDK,\n });\n\n if (!actionToResolve || actionToResolve.hidden) {\n return null;\n }\n\n const resolved = resolveAction(\n actionConfig,\n actionToResolve,\n ) as ResolvedAction;\n\n return {\n onClick: resolved.onClick,\n text: resolved.label,\n prefixIcon: resolved.icon,\n disabled: resolved.disabled,\n };\n };\n\n const actionGroups = groupActions(moreActions);\n return actionGroups\n .map((group) =>\n group\n .map(buildAction)\n .filter((action): action is MoreActionsItem => Boolean(action)),\n )\n .filter((group) => group.length > 0);\n }, [moreActions, baseSDK]);\n\n return buildSettingsPageActions() ?? [];\n}\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AAEO,SAASE,0BAA0BA,CACxCC,WAA6B,EAC7BC,OAAiB,EACjB;EACA,MAAMC,wBAAwB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACjD,IAAI,CAACH,WAAW,EAAE;MAChB;IACF;IAEA,MAAMI,WAAW,GACfC,YAAgC,IACL;MAC3B;MACA;MACA,MAAMC,eAAe,GAAG,IAAAC,qBAAY,EAAC;QACnCC,MAAM,EAAEH,YAAY;QACpBI,YAAY,EAAE,CAAC,CAAC;QAChBC,GAAG,EAAET;MACP,CAAC,CAAC;MAEF,IAAI,CAACK,eAAe,IAAIA,eAAe,CAACK,MAAM,EAAE;QAC9C,OAAO,IAAI;MACb;MAEA,MAAMC,QAAQ,GAAG,IAAAC,sBAAa,EAC5BR,YAAY,EACZC,eACF,CAAmB;MAEnB,OAAO;QACLQ,OAAO,EAAEF,QAAQ,CAACE,OAAO;QACzBC,IAAI,EAAEH,QAAQ,CAACI,KAAK;QACpBC,UAAU,EAAEL,QAAQ,CAACM,IAAI;QACzBC,QAAQ,EAAEP,QAAQ,CAACO;MACrB,CAAC;IACH,CAAC;IAED,MAAMC,YAAY,GAAG,IAAAC,qBAAY,EAACrB,WAAW,CAAC;IAC9C,OAAOoB,YAAY,CAChBE,GAAG,CAAEC,KAAK,IACTA,KAAK,CACFD,GAAG,CAAClB,WAAW,CAAC,CAChBoB,MAAM,CAAEhB,MAAM,IAAgCiB,OAAO,CAACjB,MAAM,CAAC,CAClE,CAAC,CACAgB,MAAM,CAAED,KAAK,IAAKA,KAAK,CAACG,MAAM,GAAG,CAAC,CAAC;EACxC,CAAC,EAAE,CAAC1B,WAAW,EAAEC,OAAO,CAAC,CAAC;EAE1B,OAAOC,wBAAwB,CAAC,CAAC,IAAI,EAAE;AACzC","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useSyncCollectionStateToAppContext = useSyncCollectionStateToAppContext;
|
|
5
|
+
var _patterns = require("@wix/patterns");
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
var _useAppContextSync = require("./useAppContextSync");
|
|
8
|
+
function useSyncCollectionStateToAppContext(props) {
|
|
9
|
+
const {
|
|
10
|
+
collection
|
|
11
|
+
} = props;
|
|
12
|
+
const items = (0, _patterns.useSelector)(() => collection.result.items);
|
|
13
|
+
const refreshCollection = (0, _react.useCallback)(() => {
|
|
14
|
+
return () => {
|
|
15
|
+
return collection.clearResultAndMoveToStart({
|
|
16
|
+
force: true
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}, [collection]);
|
|
20
|
+
(0, _useAppContextSync.useAppContextSync)(items, refreshCollection);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=useSyncCollectionStateToAppContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_patterns","require","_react","_useAppContextSync","useSyncCollectionStateToAppContext","props","collection","items","useSelector","result","refreshCollection","useCallback","clearResultAndMoveToStart","force","useAppContextSync"],"sources":["../../../src/hooks/useSyncCollectionStateToAppContext.ts"],"sourcesContent":["import { CollectionState, useSelector } from '@wix/patterns';\nimport { useCallback } from 'react';\nimport { useAppContextSync } from './useAppContextSync';\n\nexport interface UseSyncCollectionStateToAppContextProps {\n collection: CollectionState<any, {}>;\n}\n\nexport function useSyncCollectionStateToAppContext(\n props: UseSyncCollectionStateToAppContextProps,\n) {\n const { collection } = props;\n const items = useSelector(() => collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return collection.clearResultAndMoveToStart({ force: true });\n };\n }, [collection]);\n\n useAppContextSync(items, refreshCollection);\n}\n"],"mappings":";;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAMO,SAASG,kCAAkCA,CAChDC,KAA8C,EAC9C;EACA,MAAM;IAAEC;EAAW,CAAC,GAAGD,KAAK;EAC5B,MAAME,KAAK,GAAG,IAAAC,qBAAW,EAAC,MAAMF,UAAU,CAACG,MAAM,CAACF,KAAK,CAAC;EAExD,MAAMG,iBAAiB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC1C,OAAO,MAAM;MACX,OAAOL,UAAU,CAACM,yBAAyB,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IAC9D,CAAC;EACH,CAAC,EAAE,CAACP,UAAU,CAAC,CAAC;EAEhB,IAAAQ,oCAAiB,EAACP,KAAK,EAAEG,iBAAiB,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useTableFeaturesAsync = void 0;
|
|
5
|
+
var _AutoPatternsOverridesContext = require("../providers/AutoPatternsOverridesContext");
|
|
6
|
+
var _pluginsDynamicImports = require("./pluginsDynamicImports");
|
|
7
|
+
var _useAsyncFeaturesPromiseState = require("./useAsyncFeaturesPromiseState");
|
|
8
|
+
var _getCommonCollectionFeaturesAsync = require("./getCommonCollectionFeaturesAsync");
|
|
9
|
+
/**
|
|
10
|
+
* useTableFeaturesAsync - Step 3 in Table Flow
|
|
11
|
+
*
|
|
12
|
+
* FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → [useTableFeaturesAsync] → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table
|
|
13
|
+
*
|
|
14
|
+
* This hook is responsible for loading all table-specific async features and plugins.
|
|
15
|
+
* It dynamically imports features based on configuration to optimize bundle size.
|
|
16
|
+
*
|
|
17
|
+
* Key Responsibilities:
|
|
18
|
+
* - Loads common collection features (shared across all flows)
|
|
19
|
+
* - Conditionally loads table-specific dragAndDrop if enabled
|
|
20
|
+
* - Always loads baseTableFeatures for core table functionality
|
|
21
|
+
* - Conditionally loads table sections if configured with overrides
|
|
22
|
+
* - Returns promise state that tracks loading status of all features
|
|
23
|
+
* - Enables AutoPatternsTable to know when all features are ready
|
|
24
|
+
*/
|
|
25
|
+
const useTableFeaturesAsync = props => {
|
|
26
|
+
const {
|
|
27
|
+
config
|
|
28
|
+
} = props;
|
|
29
|
+
const overrides = (0, _AutoPatternsOverridesContext.useAutoPatternsOverridesContext)();
|
|
30
|
+
const asyncFeaturesState = (0, _useAsyncFeaturesPromiseState.useAsyncFeaturesPromiseState)({
|
|
31
|
+
// Load common features shared by all collection components (filters, common actions, etc.)
|
|
32
|
+
...(0, _getCommonCollectionFeaturesAsync.getCommonCollectionFeaturesAsync)(),
|
|
33
|
+
// Table-specific drag and drop functionality - only load if enabled in config
|
|
34
|
+
dragAndDrop: () => {
|
|
35
|
+
var _config$dragAndDrop;
|
|
36
|
+
return (_config$dragAndDrop = config.dragAndDrop) != null && _config$dragAndDrop.enabled ? (0, _pluginsDynamicImports.importTableDragAndDrop)() : null;
|
|
37
|
+
},
|
|
38
|
+
// Core table features (columns, custom columns, row clicks, etc.) - always required
|
|
39
|
+
baseTableFeatures: () => (0, _pluginsDynamicImports.importBaseTableFeatures)(),
|
|
40
|
+
// Table sections feature - only load if sections are configured AND overrides exist
|
|
41
|
+
sections: () => {
|
|
42
|
+
var _config$sections, _overrides$sections;
|
|
43
|
+
return !!((_config$sections = config.sections) != null && _config$sections.id) && (overrides == null || (_overrides$sections = overrides.sections) == null ? void 0 : _overrides$sections[config.sections.id]) != null ? (0, _pluginsDynamicImports.importTableSections)() : null;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
asyncFeaturesState
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
exports.useTableFeaturesAsync = useTableFeaturesAsync;
|
|
51
|
+
//# sourceMappingURL=useTableFeaturesAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_AutoPatternsOverridesContext","require","_pluginsDynamicImports","_useAsyncFeaturesPromiseState","_getCommonCollectionFeaturesAsync","useTableFeaturesAsync","props","config","overrides","useAutoPatternsOverridesContext","asyncFeaturesState","useAsyncFeaturesPromiseState","getCommonCollectionFeaturesAsync","dragAndDrop","_config$dragAndDrop","enabled","importTableDragAndDrop","baseTableFeatures","importBaseTableFeatures","sections","_config$sections","_overrides$sections","id","importTableSections","exports"],"sources":["../../../src/hooks/useTableFeaturesAsync.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useAutoPatternsOverridesContext } from '../providers/AutoPatternsOverridesContext';\nimport {\n importBaseTableFeatures,\n importTableDragAndDrop,\n importTableSections,\n} from './pluginsDynamicImports';\nimport { useAsyncFeaturesPromiseState } from './useAsyncFeaturesPromiseState';\nimport { getCommonCollectionFeaturesAsync } from './getCommonCollectionFeaturesAsync';\n\nexport interface UseTableFeaturesAsyncProps {\n config: TableConfig;\n}\n\n/**\n * useTableFeaturesAsync - Step 3 in Table Flow\n *\n * FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → [useTableFeaturesAsync] → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table\n *\n * This hook is responsible for loading all table-specific async features and plugins.\n * It dynamically imports features based on configuration to optimize bundle size.\n *\n * Key Responsibilities:\n * - Loads common collection features (shared across all flows)\n * - Conditionally loads table-specific dragAndDrop if enabled\n * - Always loads baseTableFeatures for core table functionality\n * - Conditionally loads table sections if configured with overrides\n * - Returns promise state that tracks loading status of all features\n * - Enables AutoPatternsTable to know when all features are ready\n */\nexport const useTableFeaturesAsync = (props: UseTableFeaturesAsyncProps) => {\n const { config } = props;\n\n const overrides = useAutoPatternsOverridesContext();\n\n const asyncFeaturesState = useAsyncFeaturesPromiseState({\n // Load common features shared by all collection components (filters, common actions, etc.)\n ...getCommonCollectionFeaturesAsync(),\n\n // Table-specific drag and drop functionality - only load if enabled in config\n dragAndDrop: () =>\n config.dragAndDrop?.enabled ? importTableDragAndDrop() : null,\n\n // Core table features (columns, custom columns, row clicks, etc.) - always required\n baseTableFeatures: () => importBaseTableFeatures(),\n\n // Table sections feature - only load if sections are configured AND overrides exist\n sections: () =>\n !!config.sections?.id && overrides?.sections?.[config.sections.id] != null\n ? importTableSections()\n : null,\n });\n\n return { asyncFeaturesState };\n};\n"],"mappings":";;;;AACA,IAAAA,6BAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAKA,IAAAE,6BAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAH,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,qBAAqB,GAAIC,KAAiC,IAAK;EAC1E,MAAM;IAAEC;EAAO,CAAC,GAAGD,KAAK;EAExB,MAAME,SAAS,GAAG,IAAAC,6DAA+B,EAAC,CAAC;EAEnD,MAAMC,kBAAkB,GAAG,IAAAC,0DAA4B,EAAC;IACtD;IACA,GAAG,IAAAC,kEAAgC,EAAC,CAAC;IAErC;IACAC,WAAW,EAAEA,CAAA;MAAA,IAAAC,mBAAA;MAAA,OACX,CAAAA,mBAAA,GAAAP,MAAM,CAACM,WAAW,aAAlBC,mBAAA,CAAoBC,OAAO,GAAG,IAAAC,6CAAsB,EAAC,CAAC,GAAG,IAAI;IAAA;IAE/D;IACAC,iBAAiB,EAAEA,CAAA,KAAM,IAAAC,8CAAuB,EAAC,CAAC;IAElD;IACAC,QAAQ,EAAEA,CAAA;MAAA,IAAAC,gBAAA,EAAAC,mBAAA;MAAA,OACR,CAAC,GAAAD,gBAAA,GAACb,MAAM,CAACY,QAAQ,aAAfC,gBAAA,CAAiBE,EAAE,KAAI,CAAAd,SAAS,aAAAa,mBAAA,GAATb,SAAS,CAAEW,QAAQ,qBAAnBE,mBAAA,CAAsBd,MAAM,CAACY,QAAQ,CAACG,EAAE,CAAC,KAAI,IAAI,GACtE,IAAAC,0CAAmB,EAAC,CAAC,GACrB,IAAI;IAAA;EACZ,CAAC,CAAC;EAEF,OAAO;IAAEb;EAAmB,CAAC;AAC/B,CAAC;AAACc,OAAA,CAAAnB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useTableGridSwitchFeaturesAsync = void 0;
|
|
5
|
+
var _providers = require("../providers");
|
|
6
|
+
var _useAsyncFeaturesPromiseState = require("./useAsyncFeaturesPromiseState");
|
|
7
|
+
var _pluginsDynamicImports = require("./pluginsDynamicImports");
|
|
8
|
+
var _getCommonCollectionFeaturesAsync = require("./getCommonCollectionFeaturesAsync");
|
|
9
|
+
/**
|
|
10
|
+
* useTableGridSwitchFeaturesAsync - Step 3 in TableGridSwitch Flow
|
|
11
|
+
*
|
|
12
|
+
* FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → [useTableGridSwitchFeaturesAsync] → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch
|
|
13
|
+
*
|
|
14
|
+
* This hook is responsible for loading all table-grid-switch specific async features and plugins.
|
|
15
|
+
* It combines features from both table and grid flows to support runtime switching between views.
|
|
16
|
+
*
|
|
17
|
+
* Key Responsibilities:
|
|
18
|
+
* - Loads common collection features (shared across all flows)
|
|
19
|
+
* - Conditionally loads table-grid-switch specific dragAndDrop if enabled
|
|
20
|
+
* - Always loads baseTableFeatures for core table functionality (needed for table mode)
|
|
21
|
+
* - Conditionally loads table sections if configured with overrides (table mode feature)
|
|
22
|
+
* - Note: Grid-specific features are handled synchronously via useBaseGridFeatures
|
|
23
|
+
* - Returns promise state that tracks loading status of all features
|
|
24
|
+
*/
|
|
25
|
+
const useTableGridSwitchFeaturesAsync = props => {
|
|
26
|
+
const {
|
|
27
|
+
config
|
|
28
|
+
} = props;
|
|
29
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
30
|
+
const asyncFeaturesState = (0, _useAsyncFeaturesPromiseState.useAsyncFeaturesPromiseState)({
|
|
31
|
+
// Load common features shared by all collection components (filters, common actions, etc.)
|
|
32
|
+
...(0, _getCommonCollectionFeaturesAsync.getCommonCollectionFeaturesAsync)(),
|
|
33
|
+
// Table-grid-switch specific drag and drop functionality - handles both table AND grid drag&drop
|
|
34
|
+
dragAndDrop: () => {
|
|
35
|
+
var _config$dragAndDrop;
|
|
36
|
+
return (_config$dragAndDrop = config.dragAndDrop) != null && _config$dragAndDrop.enabled ? (0, _pluginsDynamicImports.importTableGridSwitchDragAndDrop)() : null;
|
|
37
|
+
},
|
|
38
|
+
// Core table features (columns, custom columns, row clicks, etc.) - required for table mode
|
|
39
|
+
baseTableFeatures: () => (0, _pluginsDynamicImports.importBaseTableFeatures)(),
|
|
40
|
+
// Table sections feature - only load if sections are configured AND overrides exist
|
|
41
|
+
// This is table-specific functionality not used in grid mode
|
|
42
|
+
sections: () => {
|
|
43
|
+
var _config$sections, _overrides$sections;
|
|
44
|
+
return !!((_config$sections = config.sections) != null && _config$sections.id) && (overrides == null || (_overrides$sections = overrides.sections) == null ? void 0 : _overrides$sections[config.sections.id]) != null ? (0, _pluginsDynamicImports.importTableSections)() : null;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
asyncFeaturesState
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
exports.useTableGridSwitchFeaturesAsync = useTableGridSwitchFeaturesAsync;
|
|
52
|
+
//# sourceMappingURL=useTableGridSwitchFeaturesAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_providers","require","_useAsyncFeaturesPromiseState","_pluginsDynamicImports","_getCommonCollectionFeaturesAsync","useTableGridSwitchFeaturesAsync","props","config","overrides","useAutoPatternsOverridesContext","asyncFeaturesState","useAsyncFeaturesPromiseState","getCommonCollectionFeaturesAsync","dragAndDrop","_config$dragAndDrop","enabled","importTableGridSwitchDragAndDrop","baseTableFeatures","importBaseTableFeatures","sections","_config$sections","_overrides$sections","id","importTableSections","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeaturesAsync.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useAutoPatternsOverridesContext } from '../providers';\nimport { useAsyncFeaturesPromiseState } from './useAsyncFeaturesPromiseState';\nimport {\n importBaseTableFeatures,\n importTableGridSwitchDragAndDrop,\n importTableSections,\n} from './pluginsDynamicImports';\nimport { getCommonCollectionFeaturesAsync } from './getCommonCollectionFeaturesAsync';\n\nexport interface UseTableGridSwitchFeaturesAsyncProps {\n config: TableGridSwitchConfig;\n}\n\n/**\n * useTableGridSwitchFeaturesAsync - Step 3 in TableGridSwitch Flow\n *\n * FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → [useTableGridSwitchFeaturesAsync] → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch\n *\n * This hook is responsible for loading all table-grid-switch specific async features and plugins.\n * It combines features from both table and grid flows to support runtime switching between views.\n *\n * Key Responsibilities:\n * - Loads common collection features (shared across all flows)\n * - Conditionally loads table-grid-switch specific dragAndDrop if enabled\n * - Always loads baseTableFeatures for core table functionality (needed for table mode)\n * - Conditionally loads table sections if configured with overrides (table mode feature)\n * - Note: Grid-specific features are handled synchronously via useBaseGridFeatures\n * - Returns promise state that tracks loading status of all features\n */\nexport const useTableGridSwitchFeaturesAsync = (\n props: UseTableGridSwitchFeaturesAsyncProps,\n) => {\n const { config } = props;\n\n const overrides = useAutoPatternsOverridesContext();\n\n const asyncFeaturesState = useAsyncFeaturesPromiseState({\n // Load common features shared by all collection components (filters, common actions, etc.)\n ...getCommonCollectionFeaturesAsync(),\n\n // Table-grid-switch specific drag and drop functionality - handles both table AND grid drag&drop\n dragAndDrop: () =>\n config.dragAndDrop?.enabled ? importTableGridSwitchDragAndDrop() : null,\n\n // Core table features (columns, custom columns, row clicks, etc.) - required for table mode\n baseTableFeatures: () => importBaseTableFeatures(),\n\n // Table sections feature - only load if sections are configured AND overrides exist\n // This is table-specific functionality not used in grid mode\n sections: () =>\n !!config.sections?.id && overrides?.sections?.[config.sections.id] != null\n ? importTableSections()\n : null,\n });\n\n return { asyncFeaturesState };\n};\n"],"mappings":";;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAKA,IAAAG,iCAAA,GAAAH,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,+BAA+B,GAC1CC,KAA2C,IACxC;EACH,MAAM;IAAEC;EAAO,CAAC,GAAGD,KAAK;EAExB,MAAME,SAAS,GAAG,IAAAC,0CAA+B,EAAC,CAAC;EAEnD,MAAMC,kBAAkB,GAAG,IAAAC,0DAA4B,EAAC;IACtD;IACA,GAAG,IAAAC,kEAAgC,EAAC,CAAC;IAErC;IACAC,WAAW,EAAEA,CAAA;MAAA,IAAAC,mBAAA;MAAA,OACX,CAAAA,mBAAA,GAAAP,MAAM,CAACM,WAAW,aAAlBC,mBAAA,CAAoBC,OAAO,GAAG,IAAAC,uDAAgC,EAAC,CAAC,GAAG,IAAI;IAAA;IAEzE;IACAC,iBAAiB,EAAEA,CAAA,KAAM,IAAAC,8CAAuB,EAAC,CAAC;IAElD;IACA;IACAC,QAAQ,EAAEA,CAAA;MAAA,IAAAC,gBAAA,EAAAC,mBAAA;MAAA,OACR,CAAC,GAAAD,gBAAA,GAACb,MAAM,CAACY,QAAQ,aAAfC,gBAAA,CAAiBE,EAAE,KAAI,CAAAd,SAAS,aAAAa,mBAAA,GAATb,SAAS,CAAEW,QAAQ,qBAAnBE,mBAAA,CAAsBd,MAAM,CAACY,QAAQ,CAACG,EAAE,CAAC,KAAI,IAAI,GACtE,IAAAC,0CAAmB,EAAC,CAAC,GACrB,IAAI;IAAA;EACZ,CAAC,CAAC;EAEF,OAAO;IAAEb;EAAmB,CAAC;AAC/B,CAAC;AAACc,OAAA,CAAAnB,+BAAA,GAAAA,+BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useTableSections = useTableSections;
|
|
5
|
+
var _patterns = require("@wix/patterns");
|
|
6
|
+
var _providers = require("../providers");
|
|
7
|
+
function useTableSections(config) {
|
|
8
|
+
var _config$sections, _overrides$sections, _overrides$sections2;
|
|
9
|
+
const overrides = (0, _providers.useAutoPatternsOverridesContext)();
|
|
10
|
+
if (!((_config$sections = config.sections) != null && _config$sections.id) || !(overrides != null && (_overrides$sections = overrides.sections) != null && _overrides$sections[config.sections.id])) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
renderSection: (_overrides$sections2 = overrides.sections) == null ? void 0 : _overrides$sections2[config.sections.id],
|
|
15
|
+
TableSections: _patterns.TableSections
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=useTableSections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_patterns","require","_providers","useTableSections","config","_config$sections","_overrides$sections","_overrides$sections2","overrides","useAutoPatternsOverridesContext","sections","id","undefined","renderSection","TableSections"],"sources":["../../../src/hooks/useTableSections.ts"],"sourcesContent":["import { TableSections } from '@wix/patterns';\nimport { useAutoPatternsOverridesContext } from '../providers';\nimport { TableConfig } from '../types';\n\nexport function useTableSections(config: TableConfig) {\n const overrides = useAutoPatternsOverridesContext();\n\n if (!config.sections?.id || !overrides?.sections?.[config.sections.id]) {\n return undefined;\n }\n\n return {\n renderSection: overrides.sections?.[config.sections.id],\n TableSections,\n };\n}\n"],"mappings":";;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGO,SAASE,gBAAgBA,CAACC,MAAmB,EAAE;EAAA,IAAAC,gBAAA,EAAAC,mBAAA,EAAAC,oBAAA;EACpD,MAAMC,SAAS,GAAG,IAAAC,0CAA+B,EAAC,CAAC;EAEnD,IAAI,GAAAJ,gBAAA,GAACD,MAAM,CAACM,QAAQ,aAAfL,gBAAA,CAAiBM,EAAE,KAAI,EAACH,SAAS,aAAAF,mBAAA,GAATE,SAAS,CAAEE,QAAQ,aAAnBJ,mBAAA,CAAsBF,MAAM,CAACM,QAAQ,CAACC,EAAE,CAAC,GAAE;IACtE,OAAOC,SAAS;EAClB;EAEA,OAAO;IACLC,aAAa,GAAAN,oBAAA,GAAEC,SAAS,CAACE,QAAQ,qBAAlBH,oBAAA,CAAqBH,MAAM,CAACM,QAAQ,CAACC,EAAE,CAAC;IACvDG,aAAa,EAAbA;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsOverridesContext","createContext","undefined","AutoPatternsOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","useAutoPatternsOverridesContext","useContext","PatternsWizardOverridesProvider"],"sources":["../../../src/providers/AutoPatternsOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section, useOptimisticActions } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\nimport { collections } from '@wix/data';\n\nexport interface AutoPatternsOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n cmsSchema?: Record<string, collections.DataCollection>;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n bulkDeleteModalTitle?: Record<\n string,\n (params: { selectedCount: number; selectedValues: any[] }) => {\n text: string;\n }\n >;\n dragAndDrop?: Record<string, () => void>;\n}\n\nconst AutoPatternsOverridesContext = createContext<\n AutoPatternsOverridesContextProps | undefined\n>(undefined);\n\nexport const AutoPatternsOverridesProvider: React.FC<{\n children: ReactNode;\n value: AutoPatternsOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <AutoPatternsOverridesContext.Provider value={value}>\n {children}\n </AutoPatternsOverridesContext.Provider>\n );\n};\n\nexport const useAutoPatternsOverridesContext = ():\n | AutoPatternsOverridesContextProps\n | undefined => {\n return useContext(AutoPatternsOverridesContext);\n};\n\n// For backwards compatibility\nexport interface PatternsWizardOverridesContextProps\n extends AutoPatternsOverridesContextProps {}\nexport const PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsOverridesContext","createContext","undefined","AutoPatternsOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","useAutoPatternsOverridesContext","useContext","PatternsWizardOverridesProvider"],"sources":["../../../src/providers/AutoPatternsOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n CustomActionCellPrimaryActionResolver,\n CustomActionCellSecondaryActionResolver,\n CustomEntityPageActionResolver,\n CustomFormPageActionResolver,\n CustomBulkActionsActionResolver,\n CustomActionCollectionPageActionResolver,\n CustomActionCollectionPageActionOnRowClickResolver,\n IColumnValue,\n SchemaConfig,\n} from '../types';\n\nimport { Section, useOptimisticActions } from '@wix/patterns';\nimport { BadgeSkin, IconElement } from '@wix/design-system';\nimport { collections } from '@wix/data';\n\nexport interface AutoPatternsOverridesContextProps {\n actions?: Record<\n string,\n | CustomActionCellPrimaryActionResolver\n | CustomActionCellSecondaryActionResolver\n | CustomBulkActionsActionResolver\n | CustomEntityPageActionResolver\n | CustomFormPageActionResolver\n | CustomActionCollectionPageActionResolver\n | CustomActionCollectionPageActionOnRowClickResolver\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n emptyState?: Record<string, () => void>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n slots?: Record<string, React.FC>;\n entityPageHeaderSubtitle?: Record<\n string,\n (entity: Record<string, any>) => { text: string }\n >;\n entityPageHeaderBadges?: Record<\n string,\n (entity: Record<string, any>) => {\n text: string;\n skin?: BadgeSkin;\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n }[]\n >;\n customDataSources?: Record<\n string,\n (collectionId: string, context: any) => Promise<SchemaConfig>\n >;\n cmsSchema?: Record<string, collections.DataCollection>;\n sections?: Record<string, (item: any) => Section>;\n optimisticActions?: Record<\n string,\n Parameters<typeof useOptimisticActions>[1]\n >;\n bulkDeleteModalTitle?: Record<\n string,\n (params: { selectedCount: number; selectedValues: any[] }) => {\n text: string;\n }\n >;\n dragAndDrop?: Record<string, () => void>;\n}\n\nconst AutoPatternsOverridesContext = createContext<\n AutoPatternsOverridesContextProps | undefined\n>(undefined);\n\nexport const AutoPatternsOverridesProvider: React.FC<{\n children: ReactNode;\n value: AutoPatternsOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <AutoPatternsOverridesContext.Provider value={value}>\n {children}\n </AutoPatternsOverridesContext.Provider>\n );\n};\n\nexport const useAutoPatternsOverridesContext = ():\n | AutoPatternsOverridesContextProps\n | undefined => {\n return useContext(AutoPatternsOverridesContext);\n};\n\n// For backwards compatibility\nexport interface PatternsWizardOverridesContextProps\n extends AutoPatternsOverridesContextProps {}\nexport const PatternsWizardOverridesProvider = AutoPatternsOverridesProvider;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAoE,IAAAC,YAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAkEpE,MAAMW,4BAA4B,gBAAG,IAAAC,oBAAa,EAEhDC,SAAS,CAAC;AAEL,MAAMC,6BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,4BAA4B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDR,QACoC,CAAC;AAE5C,CAAC;AAACS,OAAA,CAAAV,6BAAA,GAAAA,6BAAA;AAEK,MAAMW,+BAA+B,GAAGA,CAAA,KAE9B;EACf,OAAO,IAAAC,iBAAU,EAACf,4BAA4B,CAAC;AACjD,CAAC;;AAED;AAAAa,OAAA,CAAAC,+BAAA,GAAAA,+BAAA;AAGO,MAAME,+BAA+B,GAAAH,OAAA,CAAAG,+BAAA,GAAGb,6BAA6B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/SettingsPageConfig.ts"],"sourcesContent":["import type { MoreActionsType } from './actions/base';\n\nexport type SettingsPageConfig = {\n /**\n * Route configuration for the settings page.\n */\n route: {\n /**\n * Route path (e.g. '/settings').\n */\n path: string;\n };\n /**\n * Data source type.\n */\n entityTypeSource: 'custom'; // 'cms'\n /**\n * REQUIRED when entityTypeSource is 'custom'\n */\n custom: {\n id: string; // ID matching the custom data source identifier\n };\n\n // HEADER\n /**\n * Title configuration.\n */\n title?: {\n /**\n * Title text.\n */\n text: string;\n };\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text: string;\n /**\n * \"Learn more\" link near the subtitle.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Page actions.\n */\n actions?: {\n primaryActions?: never;\n secondaryActions?: never;\n /**\n * Contextual actions (e.g., custom actions).\n */\n moreActions?: MoreActionsType;\n };\n\n // CONTENT\n /**\n * Page layout: main content cards and optional sidebar cards.\n */\n layout?: {\n /**\n * Main column card layout.\n */\n main: CardLayout[];\n /**\n * Sidebar column card layout.\n */\n sidebar?: CardLayout[];\n };\n};\n\ninterface CardLayout {\n type: 'card';\n card: {\n /**\n * Card header title.\n */\n title: {\n text: string;\n };\n /**\n * Optional card subtitle.\n */\n subtitle?: {\n text: string;\n };\n /**\n * Card content items (fields, containers, or custom components).\n */\n children: LayoutContent[];\n };\n}\n\ntype LayoutContent = ContainerContent | FieldContent | ComponentItemContent;\n\ninterface ContainerContent {\n type: 'container';\n container: {\n /**\n * Number of columns (out of 12) that this container should span in the layout grid.\n */\n span?: number;\n /**\n * Nested layout items inside the container.\n */\n children: LayoutContent[];\n };\n}\n\ninterface FieldContent {\n type: 'field';\n field: {\n /**\n * Number of columns (out of 12) that this field should span in the layout grid.\n */\n span?: number;\n /**\n * FieldId from the schema to render in this position.\n */\n fieldId: string;\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n /**\n * Number of columns (out of 12) that this component should span in the layout grid.\n */\n span?: number;\n /**\n * Identifier mapping to a custom component provided via overrides.\n */\n componentId: string;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n /**\n * Unique identifier for the action.\n */\n id: string;\n /**\n * Display text for the action button/menu item.\n */\n label?: string;\n /**\n * Visual appearance of the action button (e.g., 'standard', 'destructive', 'primary').\n */\n skin?: string;\n /**\n * BI tracking name.\n */\n biName?: string;\n};\n\nexport interface Feedback {\n /**\n * Success message displayed in a toast notification.\n */\n successToast?: { text: string };\n /**\n * Error message displayed in a toast notification.\n */\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n /**\n * Modal header title.\n * Either a static title (text required, id never) or a dynamic title (id required, text never)\n */\n title?: { text: string; id?: never } | { id: string; text?: never };\n /**\n * Modal action buttons configuration.\n */\n actions?: {\n /**\n * Submit/confirm button text.\n */\n submit?: { text: string };\n /**\n * Cancel button text.\n */\n cancel?: { text: string };\n };\n /**\n * Toast notifications for action completion.\n */\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n /**\n * Field identifier.\n */\n id: string;\n /**\n * Field display label.\n */\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n /**\n * Optional description text explaining the delete operation.\n */\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n /**\n * Show a confirmation modal.\n */\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n /**\n * Unique identifier.\n */\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n /**\n * Form fields to display in the modal.\n */\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n /**\n * Navigate to a page for the update operation.\n */\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n /**\n * Navigate to a page for the create operation.\n */\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'create';\n /**\n * Create action implementation configuration.\n */\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'update';\n /**\n * Update action implementation configuration.\n */\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'delete';\n /**\n * Delete action implementation configuration.\n */\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'bulkDelete';\n /**\n * Bulk delete action implementation configuration.\n */\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'custom';\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type DividerActionConfig = { type: 'divider' };\n\nexport type BaseActionItemConfig = {\n /**\n * Unique identifier for the action.\n */\n id: string;\n /**\n * Display text for the action button/menu item.\n */\n label?: string;\n /**\n * Visual appearance of the action button (e.g., 'standard', 'destructive', 'primary').\n */\n skin?: string;\n /**\n * BI tracking name.\n */\n biName?: string;\n};\n\nexport interface Feedback {\n /**\n * Success message displayed in a toast notification.\n */\n successToast?: { text: string };\n /**\n * Error message displayed in a toast notification.\n */\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n /**\n * Modal header title.\n * Either a static title (text required, id never) or a dynamic title (id required, text never)\n */\n title?: { text: string; id?: never } | { id: string; text?: never };\n /**\n * Modal action buttons configuration.\n */\n actions?: {\n /**\n * Submit/confirm button text.\n */\n submit?: { text: string };\n /**\n * Cancel button text.\n */\n cancel?: { text: string };\n };\n /**\n * Toast notifications for action completion.\n */\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n /**\n * Field identifier.\n */\n id: string;\n /**\n * Field display label.\n */\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n /**\n * Optional description text explaining the delete operation.\n */\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n }\n | {\n mode: 'custom';\n modal?: never;\n };\n\nexport type DeleteAction = {\n /**\n * Show a confirmation modal.\n */\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n /**\n * Unique identifier.\n */\n id: string;\n}\n\nexport interface ActionModalWithFields extends BaseActionModal {\n /**\n * Form fields to display in the modal.\n */\n fields: ActionModalField[];\n}\n\nexport interface UpdateActionModal extends ActionModalWithFields {}\n\nexport interface CreateActionModal extends ActionModalWithFields {}\n\nexport interface UpdateActionPage extends BaseActionPage {}\n\nexport interface CreateActionPage extends BaseActionPage {}\n\nexport type UpdateAction = {\n /**\n * Navigate to a page for the update operation.\n */\n mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n /**\n * Navigate to a page for the create operation.\n */\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'create';\n /**\n * Create action implementation configuration.\n */\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'update';\n /**\n * Update action implementation configuration.\n */\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'delete';\n /**\n * Delete action implementation configuration.\n */\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'bulkDelete';\n /**\n * Bulk delete action implementation configuration.\n */\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n /**\n * Action type discriminator.\n */\n type: 'custom';\n};\n\nexport type MoreActionsType = (CustomActionConfig | DividerActionConfig)[];\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { CustomActionParams, ResolvedAction } from '../..';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n DividerActionConfig,\n} from './base';\nimport { FormPageActionParams } from './formPageActions';\n\nexport type EntityPageMoreActions = (\n | CustomActionConfig\n | DividerActionConfig\n)[];\n\nexport type EntityPageActionConfig = CreateActionConfig | CustomActionConfig;\n\ntype EntityPageAction = {\n /**\n * Layout type discriminator.\n */\n type: 'action';\n /**\n * Single action configuration.\n */\n action: {\n item: EntityPageActionConfig;\n };\n menu?: never;\n};\n\ntype EntityPageMenu = {\n /**\n * Layout type discriminator.\n */\n type: 'menu';\n /**\n * Menu configuration with multiple actions.\n */\n menu: {\n /**\n * Menu group label displayed in the UI.\n */\n label: string;\n /**\n * List of actions and dividers in the menu.\n */\n items: (EntityPageActionConfig | DividerActionConfig)[];\n };\n action?: never;\n};\n\nexport type EntityPagePrimaryActions = EntityPageAction | EntityPageMenu;\n\nexport type EntityPageSecondaryActions = EntityPageAction | EntityPageMenu;\n\nexport interface EntityPageActionParams extends FormPageActionParams {\n /**\n * The current entity data being viewed/edited.\n */\n entity: any;\n}\n\nexport type CustomEntityPageActionParams =\n CustomActionParams<EntityPageActionParams>;\n\nexport type CustomEntityPageActionResolver = (\n params: CustomEntityPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/formPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\n\nexport interface FormPageActionParams {\n form?: UseFormReturn<FieldValues, any, undefined>;\n}\nexport type CustomFormPageActionParams =\n CustomActionParams<FormPageActionParams>;\n\nexport type CustomFormPageActionResolver = (\n params: CustomFormPageActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -19,6 +19,12 @@ Object.keys(_bulkActions).forEach(function (key) {
|
|
|
19
19
|
if (key in exports && exports[key] === _bulkActions[key]) return;
|
|
20
20
|
exports[key] = _bulkActions[key];
|
|
21
21
|
});
|
|
22
|
+
var _formPageActions = require("./formPageActions");
|
|
23
|
+
Object.keys(_formPageActions).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (key in exports && exports[key] === _formPageActions[key]) return;
|
|
26
|
+
exports[key] = _formPageActions[key];
|
|
27
|
+
});
|
|
22
28
|
var _collectionPageActions = require("./collectionPageActions");
|
|
23
29
|
Object.keys(_collectionPageActions).forEach(function (key) {
|
|
24
30
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_base","require","Object","keys","forEach","key","exports","_actionCell","_bulkActions","_collectionPageActions","_entityPageActions"],"sources":["../../../../src/types/actions/index.ts"],"sourcesContent":["export * from './base';\nexport * from './actionCell';\nexport * from './bulkActions';\nexport * from './collectionPageActions';\nexport * from './entityPageActions';\n"],"mappings":";;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,KAAA,CAAAK,GAAA;AAAA;AACA,IAAAE,WAAA,GAAAN,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAI,WAAA,EAAAH,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAE,WAAA,CAAAF,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAE,WAAA,CAAAF,GAAA;AAAA;AACA,IAAAG,YAAA,GAAAP,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAK,YAAA,EAAAJ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAG,YAAA,CAAAH,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAG,YAAA,CAAAH,GAAA;AAAA;AACA,IAAAI,
|
|
1
|
+
{"version":3,"names":["_base","require","Object","keys","forEach","key","exports","_actionCell","_bulkActions","_formPageActions","_collectionPageActions","_entityPageActions"],"sources":["../../../../src/types/actions/index.ts"],"sourcesContent":["export * from './base';\nexport * from './actionCell';\nexport * from './bulkActions';\nexport * from './formPageActions';\nexport * from './collectionPageActions';\nexport * from './entityPageActions';\n"],"mappings":";;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAL,KAAA,CAAAK,GAAA;AAAA;AACA,IAAAE,WAAA,GAAAN,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAI,WAAA,EAAAH,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAE,WAAA,CAAAF,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAE,WAAA,CAAAF,GAAA;AAAA;AACA,IAAAG,YAAA,GAAAP,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAK,YAAA,EAAAJ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAG,YAAA,CAAAH,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAG,YAAA,CAAAH,GAAA;AAAA;AACA,IAAAI,gBAAA,GAAAR,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAM,gBAAA,EAAAL,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAI,gBAAA,CAAAJ,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAI,gBAAA,CAAAJ,GAAA;AAAA;AACA,IAAAK,sBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,sBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,sBAAA,CAAAL,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAK,sBAAA,CAAAL,GAAA;AAAA;AACA,IAAAM,kBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,kBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,kBAAA,CAAAN,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAM,kBAAA,CAAAN,GAAA;AAAA","ignoreList":[]}
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -19,6 +19,12 @@ Object.keys(_EntityPageConfig).forEach(function (key) {
|
|
|
19
19
|
if (key in exports && exports[key] === _EntityPageConfig[key]) return;
|
|
20
20
|
exports[key] = _EntityPageConfig[key];
|
|
21
21
|
});
|
|
22
|
+
var _SettingsPageConfig = require("./SettingsPageConfig");
|
|
23
|
+
Object.keys(_SettingsPageConfig).forEach(function (key) {
|
|
24
|
+
if (key === "default" || key === "__esModule") return;
|
|
25
|
+
if (key in exports && exports[key] === _SettingsPageConfig[key]) return;
|
|
26
|
+
exports[key] = _SettingsPageConfig[key];
|
|
27
|
+
});
|
|
22
28
|
var _providers = require("./providers");
|
|
23
29
|
Object.keys(_providers).forEach(function (key) {
|
|
24
30
|
if (key === "default" || key === "__esModule") return;
|