@wix/auto-patterns 1.4.0 → 1.5.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/collectionData/CollectionData.js +4 -0
- package/dist/cjs/collectionData/CollectionData.js.map +1 -0
- package/dist/cjs/collectionData/CollectionDataFactory.js +12 -0
- package/dist/cjs/collectionData/CollectionDataFactory.js.map +1 -0
- package/dist/cjs/collectionData/SchemaFactory.js +12 -0
- package/dist/cjs/collectionData/SchemaFactory.js.map +1 -0
- package/dist/cjs/{config/cms/CmsCompositeConfig.js → collectionData/cms/CmsCollectionData.js} +26 -10
- package/dist/cjs/collectionData/cms/CmsCollectionData.js.map +1 -0
- package/dist/cjs/{config → collectionData}/cms/filterUtils.js +24 -10
- package/dist/cjs/collectionData/cms/filterUtils.js.map +1 -0
- package/dist/cjs/collectionData/cms/sortUtils.js.map +1 -0
- package/dist/cjs/collectionData/constants.js +13 -0
- package/dist/cjs/collectionData/constants.js.map +1 -0
- package/dist/cjs/collectionData/index.js +10 -0
- package/dist/cjs/collectionData/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +47 -0
- package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -0
- package/dist/cjs/components/AutoPatternsApp/index.js +10 -0
- package/dist/cjs/components/AutoPatternsApp/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +22 -33
- package/dist/cjs/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +33 -142
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +164 -0
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js +33 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +50 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js +60 -0
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js +10 -0
- package/dist/cjs/components/AutoPatternsEntityPage/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +35 -0
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -0
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGridContent.js +44 -0
- package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGridContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsGrid/index.js +10 -0
- package/dist/cjs/components/AutoPatternsGrid/index.js.map +1 -0
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +61 -0
- package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +35 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTableContent.js +55 -0
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTableContent.js.map +1 -0
- package/dist/cjs/components/AutoPatternsTable/index.js +10 -0
- package/dist/cjs/components/AutoPatternsTable/index.js.map +1 -0
- package/dist/cjs/exports/react.js +7 -0
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/hooks/index.js +16 -4
- package/dist/cjs/hooks/index.js.map +1 -1
- package/dist/cjs/hooks/useColumns.js +2 -5
- package/dist/cjs/hooks/useColumns.js.map +1 -1
- package/dist/cjs/hooks/useCommonCollectionFeatures.js +109 -0
- package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -0
- package/dist/cjs/hooks/useEmptyStates.js +2 -7
- package/dist/cjs/hooks/useEmptyStates.js.map +1 -1
- package/dist/cjs/hooks/useFetchData.js +7 -8
- package/dist/cjs/hooks/useFetchData.js.map +1 -1
- package/dist/cjs/hooks/useFilters.js +72 -76
- package/dist/cjs/hooks/useFilters.js.map +1 -1
- package/dist/cjs/hooks/useGridFeatures.js +77 -0
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -0
- package/dist/cjs/hooks/useTableFeatures.js +69 -0
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -0
- package/dist/cjs/providers/CollectionDataContext.js +44 -0
- package/dist/cjs/providers/CollectionDataContext.js.map +1 -0
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/providers/{ConfigContext.js → SchemaContext.js} +21 -20
- package/dist/cjs/providers/SchemaContext.js.map +1 -0
- package/dist/cjs/providers/index.js +4 -4
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/react.js +4 -4
- package/dist/cjs/react.js.map +1 -1
- package/dist/cjs/{types.js → types/CollectionPageConfig.js} +3 -9
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -0
- package/dist/cjs/types/EntityPageConfig.js +4 -0
- package/dist/cjs/types/EntityPageConfig.js.map +1 -0
- package/dist/cjs/types/index.js +22 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/cjs/types/types.js +4 -0
- package/dist/cjs/types/types.js.map +1 -0
- package/dist/cjs/utils/filters.js +53 -0
- package/dist/cjs/utils/filters.js.map +1 -0
- package/dist/esm/collectionData/CollectionData.js +2 -0
- package/dist/esm/collectionData/CollectionData.js.map +1 -0
- package/dist/esm/collectionData/CollectionDataFactory.js +8 -0
- package/dist/esm/collectionData/CollectionDataFactory.js.map +1 -0
- package/dist/esm/collectionData/SchemaFactory.js +8 -0
- package/dist/esm/collectionData/SchemaFactory.js.map +1 -0
- package/dist/esm/{config/cms/CmsCompositeConfig.js → collectionData/cms/CmsCollectionData.js} +25 -9
- package/dist/esm/collectionData/cms/CmsCollectionData.js.map +1 -0
- package/dist/esm/{config → collectionData}/cms/filterUtils.js +25 -11
- package/dist/esm/collectionData/cms/filterUtils.js.map +1 -0
- package/dist/esm/collectionData/cms/sortUtils.js.map +1 -0
- package/dist/esm/collectionData/constants.js +9 -0
- package/dist/esm/collectionData/constants.js.map +1 -0
- package/dist/esm/collectionData/index.js +2 -0
- package/dist/esm/collectionData/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +22 -0
- package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -0
- package/dist/esm/components/AutoPatternsApp/index.js +2 -0
- package/dist/esm/components/AutoPatternsApp/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js +11 -13
- package/dist/esm/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +31 -109
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +82 -0
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js +19 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/Checkbox.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js +37 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/FormFieldInput.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js +40 -0
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ShortText.js.map +1 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js +2 -0
- package/dist/esm/components/AutoPatternsEntityPage/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +16 -0
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -0
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGridContent.js +32 -0
- package/dist/esm/components/AutoPatternsGrid/AutoPatternsGridContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsGrid/index.js +2 -0
- package/dist/esm/components/AutoPatternsGrid/index.js.map +1 -0
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +37 -0
- package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +16 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTableContent.js +43 -0
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTableContent.js.map +1 -0
- package/dist/esm/components/AutoPatternsTable/index.js +2 -0
- package/dist/esm/components/AutoPatternsTable/index.js.map +1 -0
- package/dist/esm/exports/react.js +1 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/hooks/index.js +3 -1
- package/dist/esm/hooks/index.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +3 -6
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useCommonCollectionFeatures.js +72 -0
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -0
- package/dist/esm/hooks/useEmptyStates.js +2 -7
- package/dist/esm/hooks/useEmptyStates.js.map +1 -1
- package/dist/esm/hooks/useFetchData.js +8 -9
- package/dist/esm/hooks/useFetchData.js.map +1 -1
- package/dist/esm/hooks/useFilters.js +63 -75
- package/dist/esm/hooks/useFilters.js.map +1 -1
- package/dist/esm/hooks/useGridFeatures.js +75 -0
- package/dist/esm/hooks/useGridFeatures.js.map +1 -0
- package/dist/esm/hooks/useTableFeatures.js +58 -0
- package/dist/esm/hooks/useTableFeatures.js.map +1 -0
- package/dist/esm/providers/CollectionDataContext.js +30 -0
- package/dist/esm/providers/CollectionDataContext.js.map +1 -0
- package/dist/esm/providers/PatternsWizardOverridesContext.js +1 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/providers/SchemaContext.js +30 -0
- package/dist/esm/providers/SchemaContext.js.map +1 -0
- package/dist/esm/providers/index.js +1 -1
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/react.js +1 -1
- package/dist/esm/react.js.map +1 -1
- package/dist/esm/{types.js → types/CollectionPageConfig.js} +1 -9
- package/dist/esm/types/CollectionPageConfig.js.map +1 -0
- package/dist/esm/types/EntityPageConfig.js +2 -0
- package/dist/esm/types/EntityPageConfig.js.map +1 -0
- package/dist/esm/types/index.js +4 -0
- package/dist/esm/types/index.js.map +1 -0
- package/dist/esm/types/types.js +2 -0
- package/dist/esm/types/types.js.map +1 -0
- package/dist/esm/utils/filters.js +49 -0
- package/dist/esm/utils/filters.js.map +1 -0
- package/dist/types/collectionData/CollectionData.d.ts +9 -0
- package/dist/types/collectionData/CollectionData.d.ts.map +1 -0
- package/dist/types/collectionData/CollectionDataFactory.d.ts +4 -0
- package/dist/types/collectionData/CollectionDataFactory.d.ts.map +1 -0
- package/dist/types/collectionData/SchemaFactory.d.ts +3 -0
- package/dist/types/collectionData/SchemaFactory.d.ts.map +1 -0
- package/dist/types/collectionData/cms/CmsCollectionData.d.ts +8 -0
- package/dist/types/collectionData/cms/CmsCollectionData.d.ts.map +1 -0
- package/dist/types/{config → collectionData}/cms/filterUtils.d.ts +3 -3
- package/dist/types/collectionData/cms/filterUtils.d.ts.map +1 -0
- package/dist/types/collectionData/cms/sortUtils.d.ts.map +1 -0
- package/dist/types/{config → collectionData}/constants.d.ts +4 -0
- package/dist/types/collectionData/constants.d.ts.map +1 -0
- package/dist/types/collectionData/index.d.ts +2 -0
- package/dist/types/collectionData/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts +7 -0
- package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsApp/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsApp/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts +2 -2
- package/dist/types/components/AutoPatternsCollectionPage/AutoPatternsCollectionPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts +5 -1
- package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts +7 -0
- package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts +6 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/Checkbox.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts +14 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/FormFieldInput.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts +13 -0
- package/dist/types/components/AutoPatternsEntityPage/Fields/ShortText.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsEntityPage/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +7 -0
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGridContent.d.ts +7 -0
- package/dist/types/components/AutoPatternsGrid/AutoPatternsGridContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsGrid/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsGrid/index.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts +7 -0
- package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +7 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTableContent.d.ts +7 -0
- package/dist/types/components/AutoPatternsTable/AutoPatternsTableContent.d.ts.map +1 -0
- package/dist/types/components/AutoPatternsTable/index.d.ts +2 -0
- package/dist/types/components/AutoPatternsTable/index.d.ts.map +1 -0
- package/dist/types/exports/react.d.ts +1 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/hooks/index.d.ts +3 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/useColumns.d.ts +2 -1
- package/dist/types/hooks/useColumns.d.ts.map +1 -1
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts +15 -0
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -0
- package/dist/types/hooks/useEmptyStates.d.ts +2 -1
- package/dist/types/hooks/useEmptyStates.d.ts.map +1 -1
- package/dist/types/hooks/useFetchData.d.ts +2 -1
- package/dist/types/hooks/useFetchData.d.ts.map +1 -1
- package/dist/types/hooks/useFilters.d.ts +7 -2
- package/dist/types/hooks/useFilters.d.ts.map +1 -1
- package/dist/types/hooks/useGridFeatures.d.ts +25 -0
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -0
- package/dist/types/hooks/useTableFeatures.d.ts +19 -0
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -0
- package/dist/types/providers/CollectionDataContext.d.ts +12 -0
- package/dist/types/providers/CollectionDataContext.d.ts.map +1 -0
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +2 -2
- package/dist/types/providers/SchemaContext.d.ts +11 -0
- package/dist/types/providers/SchemaContext.d.ts.map +1 -0
- package/dist/types/providers/index.d.ts +1 -1
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/react.d.ts.map +1 -1
- package/dist/types/types/CollectionPageConfig.d.ts +166 -0
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -0
- package/dist/types/types/EntityPageConfig.d.ts +17 -0
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/types.d.ts +49 -0
- package/dist/types/types/types.d.ts.map +1 -0
- package/dist/types/utils/filters.d.ts +7 -0
- package/dist/types/utils/filters.d.ts.map +1 -0
- package/package.json +24 -23
- package/dist/cjs/config/CompositeConfig.js +0 -4
- package/dist/cjs/config/CompositeConfig.js.map +0 -1
- package/dist/cjs/config/ConfigFactory.js +0 -12
- package/dist/cjs/config/ConfigFactory.js.map +0 -1
- package/dist/cjs/config/cms/CmsCompositeConfig.js.map +0 -1
- package/dist/cjs/config/cms/filterUtils.js.map +0 -1
- package/dist/cjs/config/cms/sortUtils.js.map +0 -1
- package/dist/cjs/config/constants.js +0 -9
- package/dist/cjs/config/constants.js.map +0 -1
- package/dist/cjs/config/index.js +0 -10
- package/dist/cjs/config/index.js.map +0 -1
- package/dist/cjs/hooks/useFeatures.js +0 -50
- package/dist/cjs/hooks/useFeatures.js.map +0 -1
- package/dist/cjs/hooks/useTableProps.js +0 -34
- package/dist/cjs/hooks/useTableProps.js.map +0 -1
- package/dist/cjs/providers/ConfigContext.js.map +0 -1
- package/dist/cjs/types.js.map +0 -1
- package/dist/esm/config/CompositeConfig.js +0 -2
- package/dist/esm/config/CompositeConfig.js.map +0 -1
- package/dist/esm/config/ConfigFactory.js +0 -8
- package/dist/esm/config/ConfigFactory.js.map +0 -1
- package/dist/esm/config/cms/CmsCompositeConfig.js.map +0 -1
- package/dist/esm/config/cms/filterUtils.js.map +0 -1
- package/dist/esm/config/cms/sortUtils.js.map +0 -1
- package/dist/esm/config/constants.js +0 -5
- package/dist/esm/config/constants.js.map +0 -1
- package/dist/esm/config/index.js +0 -2
- package/dist/esm/config/index.js.map +0 -1
- package/dist/esm/hooks/useFeatures.js +0 -22
- package/dist/esm/hooks/useFeatures.js.map +0 -1
- package/dist/esm/hooks/useTableProps.js +0 -29
- package/dist/esm/hooks/useTableProps.js.map +0 -1
- package/dist/esm/providers/ConfigContext.js +0 -29
- package/dist/esm/providers/ConfigContext.js.map +0 -1
- package/dist/esm/types.js.map +0 -1
- package/dist/types/config/CompositeConfig.d.ts +0 -8
- package/dist/types/config/CompositeConfig.d.ts.map +0 -1
- package/dist/types/config/ConfigFactory.d.ts +0 -4
- package/dist/types/config/ConfigFactory.d.ts.map +0 -1
- package/dist/types/config/cms/CmsCompositeConfig.d.ts +0 -7
- package/dist/types/config/cms/CmsCompositeConfig.d.ts.map +0 -1
- package/dist/types/config/cms/filterUtils.d.ts.map +0 -1
- package/dist/types/config/cms/sortUtils.d.ts.map +0 -1
- package/dist/types/config/constants.d.ts.map +0 -1
- package/dist/types/config/index.d.ts +0 -2
- package/dist/types/config/index.d.ts.map +0 -1
- package/dist/types/hooks/useFeatures.d.ts +0 -8
- package/dist/types/hooks/useFeatures.d.ts.map +0 -1
- package/dist/types/hooks/useTableProps.d.ts +0 -13
- package/dist/types/hooks/useTableProps.d.ts.map +0 -1
- package/dist/types/providers/ConfigContext.d.ts +0 -11
- package/dist/types/providers/ConfigContext.d.ts.map +0 -1
- package/dist/types/types.d.ts +0 -211
- package/dist/types/types.d.ts.map +0 -1
- /package/dist/cjs/{config → collectionData}/cms/sortUtils.js +0 -0
- /package/dist/esm/{config → collectionData}/cms/sortUtils.js +0 -0
- /package/dist/types/{config → collectionData}/cms/sortUtils.d.ts +0 -0
package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js
CHANGED
|
@@ -1,114 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _toolbarTitle$subtitl, _toolbarTitle$subtitl2, _toolbarTitle$subtitl3, _toolbarTitle$subtitl4, _toolbarTitle$subtitl5, _toolbarTitle$subtitl6, _toolbarTitle$subtitl7;
|
|
9
|
-
const config = useConfig();
|
|
2
|
+
import { AutoPatternsTable } from '../AutoPatternsTable';
|
|
3
|
+
import { AutoPatternsGrid } from '../AutoPatternsGrid';
|
|
4
|
+
export const AutoPatternsCollectionPageContent = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
configuration
|
|
7
|
+
} = _ref;
|
|
10
8
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
columns,
|
|
26
|
-
views,
|
|
27
|
-
dataExtension,
|
|
28
|
-
customColumns,
|
|
29
|
-
filters: {
|
|
30
|
-
filters,
|
|
31
|
-
components,
|
|
32
|
-
collectionToolbarFiltersProps
|
|
33
|
-
},
|
|
34
|
-
emptyState,
|
|
35
|
-
fetchData
|
|
36
|
-
} = useTableProps();
|
|
37
|
-
const tableState = useTableCollection({
|
|
38
|
-
queryName: `${collectionId}-${pageTitle.text}`,
|
|
39
|
-
itemKey: item => item._id,
|
|
40
|
-
// Should be taken from some CMS extractor to avoid hardcoding
|
|
41
|
-
itemName: item => item[config.schema.displayField],
|
|
42
|
-
filters,
|
|
43
|
-
toExtendedFields: item => item.extendedFields,
|
|
44
|
-
fetchErrorMessage: _ref => {
|
|
45
|
-
let {
|
|
46
|
-
err
|
|
47
|
-
} = _ref;
|
|
48
|
-
return String(err);
|
|
49
|
-
},
|
|
50
|
-
fetchData,
|
|
51
|
-
limit,
|
|
52
|
-
persistQueryToUrl,
|
|
53
|
-
disableAutoSelectAllCount,
|
|
54
|
-
selectionConsistencyMode
|
|
55
|
-
});
|
|
56
|
-
const secondaryActionComponents = React.useMemo(() => {
|
|
57
|
-
if (secondaryActions.length === 0) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return secondaryActions.map(action => item => ({
|
|
61
|
-
icon: /*#__PURE__*/React.createElement(Edit, null),
|
|
62
|
-
text: action.text,
|
|
63
|
-
onClick: () => {
|
|
64
|
-
var _context$actions, _context$actions$acti;
|
|
65
|
-
context == null || (_context$actions = context.actions) == null || (_context$actions$acti = _context$actions[action.id]) == null || _context$actions$acti.call(_context$actions, {
|
|
66
|
-
item
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}));
|
|
70
|
-
}, [secondaryActions, context == null ? void 0 : context.actions]);
|
|
71
|
-
return /*#__PURE__*/React.createElement(Table, {
|
|
72
|
-
search: (search == null ? void 0 : search.shown) !== false,
|
|
73
|
-
title: toolbarTitle && /*#__PURE__*/React.createElement(ToolbarTitle, {
|
|
74
|
-
title: toolbarTitle.title,
|
|
75
|
-
subtitle: {
|
|
76
|
-
text: ((_toolbarTitle$subtitl = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl.text) ?? '',
|
|
77
|
-
learnMore: (_toolbarTitle$subtitl2 = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl2.learnMore,
|
|
78
|
-
info: ((_toolbarTitle$subtitl3 = toolbarTitle.subtitle) == null ? void 0 : _toolbarTitle$subtitl3.info) && {
|
|
79
|
-
content: /*#__PURE__*/React.createElement(Box, {
|
|
80
|
-
direction: "vertical",
|
|
81
|
-
gap: "6px"
|
|
82
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
83
|
-
dataHook: "toolbar-title-subtitle-info-content",
|
|
84
|
-
light: true,
|
|
85
|
-
size: "small"
|
|
86
|
-
}, (_toolbarTitle$subtitl4 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl4 = _toolbarTitle$subtitl4.info) == null ? void 0 : _toolbarTitle$subtitl4.content.text), ((_toolbarTitle$subtitl5 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl5 = _toolbarTitle$subtitl5.info) == null ? void 0 : _toolbarTitle$subtitl5.content.link) && /*#__PURE__*/React.createElement(TextButton, {
|
|
87
|
-
dataHook: "toolbar-title-subtitle-info-link",
|
|
88
|
-
size: "small",
|
|
89
|
-
underline: "always",
|
|
90
|
-
skin: "light",
|
|
91
|
-
as: "a",
|
|
92
|
-
rel: "noopener",
|
|
93
|
-
target: "_blank",
|
|
94
|
-
href: (_toolbarTitle$subtitl6 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl6 = _toolbarTitle$subtitl6.info) == null ? void 0 : _toolbarTitle$subtitl6.content.link.url
|
|
95
|
-
}, (_toolbarTitle$subtitl7 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl7 = _toolbarTitle$subtitl7.info) == null ? void 0 : _toolbarTitle$subtitl7.content.link.label))
|
|
9
|
+
components
|
|
10
|
+
} = configuration;
|
|
11
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, components.map(component => {
|
|
12
|
+
const {
|
|
13
|
+
type
|
|
14
|
+
} = component;
|
|
15
|
+
switch (type) {
|
|
16
|
+
case 'Table':
|
|
17
|
+
if (component.table) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(AutoPatternsTable, {
|
|
19
|
+
key: component.table.collection.collectionId,
|
|
20
|
+
configuration: component.table
|
|
21
|
+
});
|
|
96
22
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
filters: components.length > 0 ? /*#__PURE__*/React.createElement(CollectionToolbarFilters, collectionToolbarFiltersProps, components) : undefined,
|
|
111
|
-
emptyState: emptyState
|
|
112
|
-
});
|
|
23
|
+
return null;
|
|
24
|
+
case 'Grid':
|
|
25
|
+
if (component.grid) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(AutoPatternsGrid, {
|
|
27
|
+
configuration: component.grid
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
default:
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
113
35
|
};
|
|
114
36
|
//# sourceMappingURL=AutoPatternsCollectionPageContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","AutoPatternsTable","AutoPatternsGrid","AutoPatternsCollectionPageContent","_ref","configuration","components","createElement","Fragment","map","component","type","table","key","collection","collectionId","grid"],"sources":["../../../../src/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.tsx"],"sourcesContent":["import React from 'react';\nimport { AutoPatternsTable } from '../AutoPatternsTable';\nimport { CollectionPageConfig } from '../../types';\nimport { AutoPatternsGrid } from '../AutoPatternsGrid';\n\nexport interface AutoPatternsCollectionPageContentProps {\n configuration: CollectionPageConfig;\n}\n\nexport const AutoPatternsCollectionPageContent = ({\n configuration,\n}: AutoPatternsCollectionPageContentProps) => {\n const { components } = configuration;\n return (\n <>\n {components.map((component) => {\n const { type } = component;\n switch (type) {\n case 'Table':\n if (component.table) {\n return (\n <AutoPatternsTable\n key={component.table.collection.collectionId}\n configuration={component.table}\n />\n );\n }\n return null;\n case 'Grid':\n if (component.grid) {\n return <AutoPatternsGrid configuration={component.grid} />;\n }\n return null;\n default:\n return null;\n }\n })}\n </>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,QAAQ,sBAAsB;AAExD,SAASC,gBAAgB,QAAQ,qBAAqB;AAMtD,OAAO,MAAMC,iCAAiC,GAAGC,IAAA,IAEH;EAAA,IAFI;IAChDC;EACsC,CAAC,GAAAD,IAAA;EACvC,MAAM;IAAEE;EAAW,CAAC,GAAGD,aAAa;EACpC,oBACEL,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,UAAU,CAACG,GAAG,CAAEC,SAAS,IAAK;IAC7B,MAAM;MAAEC;IAAK,CAAC,GAAGD,SAAS;IAC1B,QAAQC,IAAI;MACV,KAAK,OAAO;QACV,IAAID,SAAS,CAACE,KAAK,EAAE;UACnB,oBACEZ,KAAA,CAAAO,aAAA,CAACN,iBAAiB;YAChBY,GAAG,EAAEH,SAAS,CAACE,KAAK,CAACE,UAAU,CAACC,YAAa;YAC7CV,aAAa,EAAEK,SAAS,CAACE;UAAM,CAChC,CAAC;QAEN;QACA,OAAO,IAAI;MACb,KAAK,MAAM;QACT,IAAIF,SAAS,CAACM,IAAI,EAAE;UAClB,oBAAOhB,KAAA,CAAAO,aAAA,CAACL,gBAAgB;YAACG,aAAa,EAAEK,SAAS,CAACM;UAAK,CAAE,CAAC;QAC5D;QACA,OAAO,IAAI;MACb;QACE,OAAO,IAAI;IACf;EACF,CAAC,CACD,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EntityPage, useEntity, useEntityPage } from '@wix/patterns';
|
|
3
|
+
import { useForm } from '@wix/patterns/form';
|
|
4
|
+
import { Box, Card, Cell } from '@wix/design-system';
|
|
5
|
+
import { FormFieldInput } from './Fields/FormFieldInput';
|
|
6
|
+
import { useParams } from 'react-router-dom';
|
|
7
|
+
import { useSchema } from '../../providers/SchemaContext';
|
|
8
|
+
export const AutoPatternsEntityPage = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
configuration
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
title,
|
|
14
|
+
subtitle,
|
|
15
|
+
visibleFieldIds = [],
|
|
16
|
+
collectionPagePath: parentPath
|
|
17
|
+
} = configuration;
|
|
18
|
+
const form = useForm();
|
|
19
|
+
const params = useParams();
|
|
20
|
+
const entityId = params.entityId;
|
|
21
|
+
const schema = useSchema();
|
|
22
|
+
const state = useEntityPage({
|
|
23
|
+
parentPath,
|
|
24
|
+
form,
|
|
25
|
+
onSave: async () => {
|
|
26
|
+
var _state$entity;
|
|
27
|
+
const formValues = form.getValues();
|
|
28
|
+
const updatedEntity = {
|
|
29
|
+
...state.entity,
|
|
30
|
+
...formValues
|
|
31
|
+
};
|
|
32
|
+
let newUpdatedEntity;
|
|
33
|
+
// TODO: Works only for CMS collections, need to be extracted from collection data somehow or share similar context
|
|
34
|
+
if ((_state$entity = state.entity) != null && _state$entity._id) {
|
|
35
|
+
newUpdatedEntity = await schema.actions.update(updatedEntity);
|
|
36
|
+
} else {
|
|
37
|
+
newUpdatedEntity = await schema.actions.create(updatedEntity);
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
updatedEntity: newUpdatedEntity
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
saveErrorToast: () => 'Failed to save',
|
|
44
|
+
fetch: async () => {
|
|
45
|
+
if (!entityId) {
|
|
46
|
+
return {
|
|
47
|
+
entity: undefined
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const entity = await schema.actions.get(entityId);
|
|
51
|
+
return {
|
|
52
|
+
entity
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const entity = useEntity(state);
|
|
57
|
+
return /*#__PURE__*/React.createElement(EntityPage, {
|
|
58
|
+
state: state,
|
|
59
|
+
dataHook: "auto-patterns-entity-page"
|
|
60
|
+
}, /*#__PURE__*/React.createElement(EntityPage.Header, {
|
|
61
|
+
title: title ?? {
|
|
62
|
+
text: (entity == null ? void 0 : entity[schema.displayField]) ?? 'Edit Entity'
|
|
63
|
+
},
|
|
64
|
+
subtitle: subtitle
|
|
65
|
+
}), /*#__PURE__*/React.createElement(EntityPage.Content, null, /*#__PURE__*/React.createElement(EntityPage.MainContent, null, /*#__PURE__*/React.createElement(EntityPage.Card, {
|
|
66
|
+
minHeight: "50px"
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Card.Header, {
|
|
68
|
+
title: "Item details",
|
|
69
|
+
subtitle: "Modify the details of your selected item below"
|
|
70
|
+
}), /*#__PURE__*/React.createElement(Card.Divider, null), /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Box, {
|
|
71
|
+
gap: "SP2",
|
|
72
|
+
direction: "vertical"
|
|
73
|
+
}, visibleFieldIds.map(fieldId => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
74
|
+
key: fieldId
|
|
75
|
+
}, /*#__PURE__*/React.createElement(Cell, {
|
|
76
|
+
span: 12
|
|
77
|
+
}, /*#__PURE__*/React.createElement(FormFieldInput, {
|
|
78
|
+
key: fieldId,
|
|
79
|
+
field: schema.fields[fieldId]
|
|
80
|
+
}))))))))));
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=AutoPatternsEntityPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","EntityPage","useEntity","useEntityPage","useForm","Box","Card","Cell","FormFieldInput","useParams","useSchema","AutoPatternsEntityPage","_ref","configuration","title","subtitle","visibleFieldIds","collectionPagePath","parentPath","form","params","entityId","schema","state","onSave","_state$entity","formValues","getValues","updatedEntity","entity","newUpdatedEntity","_id","actions","update","create","saveErrorToast","fetch","undefined","get","createElement","dataHook","Header","text","displayField","Content","MainContent","minHeight","Divider","gap","direction","map","fieldId","Fragment","key","span","field","fields"],"sources":["../../../../src/components/AutoPatternsEntityPage/AutoPatternsEntityPage.tsx"],"sourcesContent":["import React from 'react';\nimport { EntityPageConfig } from '../../types';\nimport {\n EntityPage,\n EntityPageState,\n useEntity,\n useEntityPage,\n} from '@wix/patterns';\nimport { useForm } from '@wix/patterns/form';\nimport { Box, Card, Cell } from '@wix/design-system';\nimport { FormFieldInput } from './Fields/FormFieldInput';\nimport { useParams } from 'react-router-dom';\nimport { useSchema } from '../../providers/SchemaContext';\n\nexport interface AutoPatternsEntityPageProps {\n configuration: EntityPageConfig;\n}\n\nexport const AutoPatternsEntityPage: React.FC<AutoPatternsEntityPageProps> = ({\n configuration,\n}) => {\n const {\n title,\n subtitle,\n visibleFieldIds = [],\n collectionPagePath: parentPath,\n } = configuration;\n const form = useForm<any>();\n const params = useParams();\n const entityId = params.entityId;\n const schema = useSchema();\n const state: EntityPageState<any> = useEntityPage<any, any>({\n parentPath,\n form,\n onSave: async () => {\n const formValues = form.getValues();\n const updatedEntity: any = {\n ...state.entity,\n ...formValues,\n };\n\n let newUpdatedEntity;\n // TODO: Works only for CMS collections, need to be extracted from collection data somehow or share similar context\n if (state.entity?._id) {\n newUpdatedEntity = await schema.actions.update(updatedEntity);\n } else {\n newUpdatedEntity = await schema.actions.create(updatedEntity);\n }\n\n return { updatedEntity: newUpdatedEntity };\n },\n saveErrorToast: () => 'Failed to save',\n fetch: async () => {\n if (!entityId) {\n return { entity: undefined };\n }\n\n const entity = await schema.actions.get(entityId);\n return { entity };\n },\n });\n const entity = useEntity<any, any>(state);\n\n return (\n <EntityPage state={state} dataHook=\"auto-patterns-entity-page\">\n <EntityPage.Header\n title={\n title ?? { text: entity?.[schema.displayField] ?? 'Edit Entity' }\n }\n subtitle={subtitle}\n />\n <EntityPage.Content>\n <EntityPage.MainContent>\n <EntityPage.Card minHeight=\"50px\">\n <Card.Header\n title=\"Item details\"\n subtitle=\"Modify the details of your selected item below\"\n />\n <Card.Divider />\n <Card.Content>\n <Box gap=\"SP2\" direction=\"vertical\">\n {visibleFieldIds.map((fieldId) => (\n <React.Fragment key={fieldId}>\n <Cell span={12}>\n <FormFieldInput\n key={fieldId}\n field={schema.fields[fieldId]}\n />\n </Cell>\n </React.Fragment>\n ))}\n </Box>\n </Card.Content>\n </EntityPage.Card>\n </EntityPage.MainContent>\n </EntityPage.Content>\n </EntityPage>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SACEC,UAAU,EAEVC,SAAS,EACTC,aAAa,QACR,eAAe;AACtB,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,oBAAoB;AACpD,SAASC,cAAc,QAAQ,yBAAyB;AACxD,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,SAAS,QAAQ,+BAA+B;AAMzD,OAAO,MAAMC,sBAA6D,GAAGC,IAAA,IAEvE;EAAA,IAFwE;IAC5EC;EACF,CAAC,GAAAD,IAAA;EACC,MAAM;IACJE,KAAK;IACLC,QAAQ;IACRC,eAAe,GAAG,EAAE;IACpBC,kBAAkB,EAAEC;EACtB,CAAC,GAAGL,aAAa;EACjB,MAAMM,IAAI,GAAGf,OAAO,CAAM,CAAC;EAC3B,MAAMgB,MAAM,GAAGX,SAAS,CAAC,CAAC;EAC1B,MAAMY,QAAQ,GAAGD,MAAM,CAACC,QAAQ;EAChC,MAAMC,MAAM,GAAGZ,SAAS,CAAC,CAAC;EAC1B,MAAMa,KAA2B,GAAGpB,aAAa,CAAW;IAC1De,UAAU;IACVC,IAAI;IACJK,MAAM,EAAE,MAAAA,CAAA,KAAY;MAAA,IAAAC,aAAA;MAClB,MAAMC,UAAU,GAAGP,IAAI,CAACQ,SAAS,CAAC,CAAC;MACnC,MAAMC,aAAkB,GAAG;QACzB,GAAGL,KAAK,CAACM,MAAM;QACf,GAAGH;MACL,CAAC;MAED,IAAII,gBAAgB;MACpB;MACA,KAAAL,aAAA,GAAIF,KAAK,CAACM,MAAM,aAAZJ,aAAA,CAAcM,GAAG,EAAE;QACrBD,gBAAgB,GAAG,MAAMR,MAAM,CAACU,OAAO,CAACC,MAAM,CAACL,aAAa,CAAC;MAC/D,CAAC,MAAM;QACLE,gBAAgB,GAAG,MAAMR,MAAM,CAACU,OAAO,CAACE,MAAM,CAACN,aAAa,CAAC;MAC/D;MAEA,OAAO;QAAEA,aAAa,EAAEE;MAAiB,CAAC;IAC5C,CAAC;IACDK,cAAc,EAAEA,CAAA,KAAM,gBAAgB;IACtCC,KAAK,EAAE,MAAAA,CAAA,KAAY;MACjB,IAAI,CAACf,QAAQ,EAAE;QACb,OAAO;UAAEQ,MAAM,EAAEQ;QAAU,CAAC;MAC9B;MAEA,MAAMR,MAAM,GAAG,MAAMP,MAAM,CAACU,OAAO,CAACM,GAAG,CAACjB,QAAQ,CAAC;MACjD,OAAO;QAAEQ;MAAO,CAAC;IACnB;EACF,CAAC,CAAC;EACF,MAAMA,MAAM,GAAG3B,SAAS,CAAWqB,KAAK,CAAC;EAEzC,oBACEvB,KAAA,CAAAuC,aAAA,CAACtC,UAAU;IAACsB,KAAK,EAAEA,KAAM;IAACiB,QAAQ,EAAC;EAA2B,gBAC5DxC,KAAA,CAAAuC,aAAA,CAACtC,UAAU,CAACwC,MAAM;IAChB3B,KAAK,EACHA,KAAK,IAAI;MAAE4B,IAAI,EAAE,CAAAb,MAAM,oBAANA,MAAM,CAAGP,MAAM,CAACqB,YAAY,CAAC,KAAI;IAAc,CACjE;IACD5B,QAAQ,EAAEA;EAAS,CACpB,CAAC,eACFf,KAAA,CAAAuC,aAAA,CAACtC,UAAU,CAAC2C,OAAO,qBACjB5C,KAAA,CAAAuC,aAAA,CAACtC,UAAU,CAAC4C,WAAW,qBACrB7C,KAAA,CAAAuC,aAAA,CAACtC,UAAU,CAACK,IAAI;IAACwC,SAAS,EAAC;EAAM,gBAC/B9C,KAAA,CAAAuC,aAAA,CAACjC,IAAI,CAACmC,MAAM;IACV3B,KAAK,EAAC,cAAc;IACpBC,QAAQ,EAAC;EAAgD,CAC1D,CAAC,eACFf,KAAA,CAAAuC,aAAA,CAACjC,IAAI,CAACyC,OAAO,MAAE,CAAC,eAChB/C,KAAA,CAAAuC,aAAA,CAACjC,IAAI,CAACsC,OAAO,qBACX5C,KAAA,CAAAuC,aAAA,CAAClC,GAAG;IAAC2C,GAAG,EAAC,KAAK;IAACC,SAAS,EAAC;EAAU,GAChCjC,eAAe,CAACkC,GAAG,CAAEC,OAAO,iBAC3BnD,KAAA,CAAAuC,aAAA,CAACvC,KAAK,CAACoD,QAAQ;IAACC,GAAG,EAAEF;EAAQ,gBAC3BnD,KAAA,CAAAuC,aAAA,CAAChC,IAAI;IAAC+C,IAAI,EAAE;EAAG,gBACbtD,KAAA,CAAAuC,aAAA,CAAC/B,cAAc;IACb6C,GAAG,EAAEF,OAAQ;IACbI,KAAK,EAAEjC,MAAM,CAACkC,MAAM,CAACL,OAAO;EAAE,CAC/B,CACG,CACQ,CACjB,CACE,CACO,CACC,CACK,CACN,CACV,CAAC;AAEjB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Checkbox as CheckboxWSR } from '@wix/design-system';
|
|
3
|
+
export const Checkbox = props => {
|
|
4
|
+
const {
|
|
5
|
+
field,
|
|
6
|
+
initialValue,
|
|
7
|
+
onChange
|
|
8
|
+
} = props;
|
|
9
|
+
const [value, setValue] = useState(initialValue);
|
|
10
|
+
return /*#__PURE__*/React.createElement(CheckboxWSR, {
|
|
11
|
+
checked: value,
|
|
12
|
+
onChange: e => {
|
|
13
|
+
setValue(e.target.checked);
|
|
14
|
+
onChange(e.target.checked);
|
|
15
|
+
},
|
|
16
|
+
dataHook: `checkbox-${field.id}`
|
|
17
|
+
}, field.displayName);
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","Checkbox","CheckboxWSR","props","field","initialValue","onChange","value","setValue","createElement","checked","e","target","dataHook","id","displayName"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/Checkbox.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Checkbox as CheckboxWSR } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport interface CheckboxProps extends BaseInputProps<boolean> {}\n\nexport const Checkbox = (props: CheckboxProps) => {\n const { field, initialValue, onChange } = props;\n const [value, setValue] = useState(initialValue);\n\n return (\n <CheckboxWSR\n checked={value}\n onChange={(e) => {\n setValue(e.target.checked);\n onChange(e.target.checked);\n }}\n dataHook={`checkbox-${field.id}`}\n >\n {field.displayName}\n </CheckboxWSR>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,IAAIC,WAAW,QAAQ,oBAAoB;AAK5D,OAAO,MAAMD,QAAQ,GAAIE,KAAoB,IAAK;EAChD,MAAM;IAAEC,KAAK;IAAEC,YAAY;IAAEC;EAAS,CAAC,GAAGH,KAAK;EAC/C,MAAM,CAACI,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAACK,YAAY,CAAC;EAEhD,oBACEN,KAAA,CAAAU,aAAA,CAACP,WAAW;IACVQ,OAAO,EAAEH,KAAM;IACfD,QAAQ,EAAGK,CAAC,IAAK;MACfH,QAAQ,CAACG,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;MAC1BJ,QAAQ,CAACK,CAAC,CAACC,MAAM,CAACF,OAAO,CAAC;IAC5B,CAAE;IACFG,QAAQ,EAAE,YAAYT,KAAK,CAACU,EAAE;EAAG,GAEhCV,KAAK,CAACW,WACI,CAAC;AAElB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ShortText } from './ShortText';
|
|
3
|
+
import { useEntityPageContext } from '@wix/patterns';
|
|
4
|
+
import { useController } from '@wix/patterns/form';
|
|
5
|
+
import { collections } from '@wix/data';
|
|
6
|
+
import { Checkbox } from './Checkbox';
|
|
7
|
+
export const EDITABLE_INPUT_ELEMENTS = {
|
|
8
|
+
[collections.Type.TEXT]: ShortText,
|
|
9
|
+
[collections.Type.BOOLEAN]: Checkbox
|
|
10
|
+
};
|
|
11
|
+
export const FormFieldInput = props => {
|
|
12
|
+
var _pageState$entity, _controller$fieldStat;
|
|
13
|
+
const {
|
|
14
|
+
field
|
|
15
|
+
} = props;
|
|
16
|
+
const pageState = useEntityPageContext();
|
|
17
|
+
const controller = useController({
|
|
18
|
+
name: (field == null ? void 0 : field.id) ?? '',
|
|
19
|
+
control: pageState.form.control,
|
|
20
|
+
defaultValue: (_pageState$entity = pageState.entity) == null ? void 0 : _pageState$entity[(field == null ? void 0 : field.id) ?? '']
|
|
21
|
+
});
|
|
22
|
+
if (!field || !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) || !pageState || !pageState.entity) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType];
|
|
26
|
+
return /*#__PURE__*/React.createElement(FieldInput, {
|
|
27
|
+
field: field,
|
|
28
|
+
initialValue: pageState.entity[field.id],
|
|
29
|
+
status: controller.fieldState.invalid ? 'error' : undefined,
|
|
30
|
+
statusMessage: (_controller$fieldStat = controller.fieldState.error) == null ? void 0 : _controller$fieldStat.message,
|
|
31
|
+
inputRef: controller.field.ref,
|
|
32
|
+
value: controller.field.value,
|
|
33
|
+
onChange: controller.field.onChange,
|
|
34
|
+
onBlur: controller.field.onBlur
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=FormFieldInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ShortText","useEntityPageContext","useController","collections","Checkbox","EDITABLE_INPUT_ELEMENTS","Type","TEXT","BOOLEAN","FormFieldInput","props","_pageState$entity","_controller$fieldStat","field","pageState","controller","name","id","control","form","defaultValue","entity","hasOwnProperty","originalType","FieldInput","createElement","initialValue","status","fieldState","invalid","undefined","statusMessage","error","message","inputRef","ref","value","onChange","onBlur"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/FormFieldInput.tsx"],"sourcesContent":["import React from 'react';\nimport { ShortText } from './ShortText';\nimport { useEntityPageContext } from '@wix/patterns';\nimport { useController } from '@wix/patterns/form';\nimport { Field } from '../../../types';\nimport { collections } from '@wix/data';\nimport { Checkbox } from './Checkbox';\n\nexport interface BaseInputProps<T> {\n field: Field;\n initialValue: T;\n onChange: (newValue: T) => void;\n}\n\nexport const EDITABLE_INPUT_ELEMENTS: Partial<\n Record<collections.Type, React.ComponentType<any>>\n> = {\n [collections.Type.TEXT]: ShortText,\n [collections.Type.BOOLEAN]: Checkbox,\n};\n\nexport interface FormFieldInputProps {\n field?: Field;\n}\n\nexport const FormFieldInput = (props: FormFieldInputProps) => {\n const { field } = props;\n\n const pageState = useEntityPageContext();\n const controller = useController({\n name: field?.id ?? '',\n control: pageState.form.control,\n defaultValue: (pageState.entity as any)?.[field?.id ?? ''],\n });\n\n if (\n !field ||\n !EDITABLE_INPUT_ELEMENTS.hasOwnProperty(field.originalType) ||\n !pageState ||\n !pageState.entity\n ) {\n return null;\n }\n const FieldInput = EDITABLE_INPUT_ELEMENTS[field.originalType]!;\n\n return (\n <FieldInput\n field={field}\n initialValue={(pageState.entity as any)[field.id]}\n status={controller.fieldState.invalid ? 'error' : undefined}\n statusMessage={controller.fieldState.error?.message}\n inputRef={controller.field.ref}\n value={controller.field.value}\n onChange={controller.field.onChange}\n onBlur={controller.field.onBlur}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,aAAa,QAAQ,oBAAoB;AAElD,SAASC,WAAW,QAAQ,WAAW;AACvC,SAASC,QAAQ,QAAQ,YAAY;AAQrC,OAAO,MAAMC,uBAEZ,GAAG;EACF,CAACF,WAAW,CAACG,IAAI,CAACC,IAAI,GAAGP,SAAS;EAClC,CAACG,WAAW,CAACG,IAAI,CAACE,OAAO,GAAGJ;AAC9B,CAAC;AAMD,OAAO,MAAMK,cAAc,GAAIC,KAA0B,IAAK;EAAA,IAAAC,iBAAA,EAAAC,qBAAA;EAC5D,MAAM;IAAEC;EAAM,CAAC,GAAGH,KAAK;EAEvB,MAAMI,SAAS,GAAGb,oBAAoB,CAAC,CAAC;EACxC,MAAMc,UAAU,GAAGb,aAAa,CAAC;IAC/Bc,IAAI,EAAE,CAAAH,KAAK,oBAALA,KAAK,CAAEI,EAAE,KAAI,EAAE;IACrBC,OAAO,EAAEJ,SAAS,CAACK,IAAI,CAACD,OAAO;IAC/BE,YAAY,GAAAT,iBAAA,GAAGG,SAAS,CAACO,MAAM,qBAAjBV,iBAAA,CAA4B,CAAAE,KAAK,oBAALA,KAAK,CAAEI,EAAE,KAAI,EAAE;EAC3D,CAAC,CAAC;EAEF,IACE,CAACJ,KAAK,IACN,CAACR,uBAAuB,CAACiB,cAAc,CAACT,KAAK,CAACU,YAAY,CAAC,IAC3D,CAACT,SAAS,IACV,CAACA,SAAS,CAACO,MAAM,EACjB;IACA,OAAO,IAAI;EACb;EACA,MAAMG,UAAU,GAAGnB,uBAAuB,CAACQ,KAAK,CAACU,YAAY,CAAE;EAE/D,oBACExB,KAAA,CAAA0B,aAAA,CAACD,UAAU;IACTX,KAAK,EAAEA,KAAM;IACba,YAAY,EAAGZ,SAAS,CAACO,MAAM,CAASR,KAAK,CAACI,EAAE,CAAE;IAClDU,MAAM,EAAEZ,UAAU,CAACa,UAAU,CAACC,OAAO,GAAG,OAAO,GAAGC,SAAU;IAC5DC,aAAa,GAAAnB,qBAAA,GAAEG,UAAU,CAACa,UAAU,CAACI,KAAK,qBAA3BpB,qBAAA,CAA6BqB,OAAQ;IACpDC,QAAQ,EAAEnB,UAAU,CAACF,KAAK,CAACsB,GAAI;IAC/BC,KAAK,EAAErB,UAAU,CAACF,KAAK,CAACuB,KAAM;IAC9BC,QAAQ,EAAEtB,UAAU,CAACF,KAAK,CAACwB,QAAS;IACpCC,MAAM,EAAEvB,UAAU,CAACF,KAAK,CAACyB;EAAO,CACjC,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { FormField, Input } from '@wix/design-system';
|
|
3
|
+
export const useTextInput = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
initialValue,
|
|
6
|
+
onChange
|
|
7
|
+
} = _ref;
|
|
8
|
+
const [value, setValue] = useState(initialValue || '');
|
|
9
|
+
const handleChange = e => {
|
|
10
|
+
const newValue = e.target.value;
|
|
11
|
+
setValue(newValue);
|
|
12
|
+
onChange == null || onChange(newValue);
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
value,
|
|
16
|
+
handleChange
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export const ShortText = props => {
|
|
20
|
+
const {
|
|
21
|
+
field,
|
|
22
|
+
initialValue,
|
|
23
|
+
onChange
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
value,
|
|
27
|
+
handleChange
|
|
28
|
+
} = useTextInput({
|
|
29
|
+
initialValue,
|
|
30
|
+
onChange
|
|
31
|
+
});
|
|
32
|
+
return /*#__PURE__*/React.createElement(FormField, {
|
|
33
|
+
label: field.displayName
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
35
|
+
value: value,
|
|
36
|
+
onChange: handleChange,
|
|
37
|
+
dataHook: `short-text-${field.id}`
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=ShortText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","FormField","Input","useTextInput","_ref","initialValue","onChange","value","setValue","handleChange","e","newValue","target","ShortText","props","field","createElement","label","displayName","dataHook","id"],"sources":["../../../../../src/components/AutoPatternsEntityPage/Fields/ShortText.tsx"],"sourcesContent":["import React, { ChangeEvent, useState } from 'react';\nimport { FormField, Input } from '@wix/design-system';\nimport { BaseInputProps } from './FormFieldInput';\n\nexport const useTextInput = ({\n initialValue,\n onChange,\n}: {\n initialValue: string;\n onChange: (value: string) => void;\n}) => {\n const [value, setValue] = useState(initialValue || '');\n\n const handleChange = (\n e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,\n ) => {\n const newValue = e.target.value;\n\n setValue(newValue);\n onChange?.(newValue);\n };\n\n return {\n value,\n handleChange,\n };\n};\n\nexport interface ShortTextProps extends BaseInputProps<string> {}\n\nexport const ShortText = (props: ShortTextProps) => {\n const { field, initialValue, onChange } = props;\n const { value, handleChange } = useTextInput({\n initialValue,\n onChange,\n });\n\n return (\n <FormField label={field.displayName}>\n <Input\n value={value}\n onChange={handleChange}\n dataHook={`short-text-${field.id}`}\n />\n </FormField>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAiBC,QAAQ,QAAQ,OAAO;AACpD,SAASC,SAAS,EAAEC,KAAK,QAAQ,oBAAoB;AAGrD,OAAO,MAAMC,YAAY,GAAGC,IAAA,IAMtB;EAAA,IANuB;IAC3BC,YAAY;IACZC;EAIF,CAAC,GAAAF,IAAA;EACC,MAAM,CAACG,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAACK,YAAY,IAAI,EAAE,CAAC;EAEtD,MAAMI,YAAY,GAChBC,CAAsD,IACnD;IACH,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAACL,KAAK;IAE/BC,QAAQ,CAACG,QAAQ,CAAC;IAClBL,QAAQ,YAARA,QAAQ,CAAGK,QAAQ,CAAC;EACtB,CAAC;EAED,OAAO;IACLJ,KAAK;IACLE;EACF,CAAC;AACH,CAAC;AAID,OAAO,MAAMI,SAAS,GAAIC,KAAqB,IAAK;EAClD,MAAM;IAAEC,KAAK;IAAEV,YAAY;IAAEC;EAAS,CAAC,GAAGQ,KAAK;EAC/C,MAAM;IAAEP,KAAK;IAAEE;EAAa,CAAC,GAAGN,YAAY,CAAC;IAC3CE,YAAY;IACZC;EACF,CAAC,CAAC;EAEF,oBACEP,KAAA,CAAAiB,aAAA,CAACf,SAAS;IAACgB,KAAK,EAAEF,KAAK,CAACG;EAAY,gBAClCnB,KAAA,CAAAiB,aAAA,CAACd,KAAK;IACJK,KAAK,EAAEA,KAAM;IACbD,QAAQ,EAAEG,YAAa;IACvBU,QAAQ,EAAE,cAAcJ,KAAK,CAACK,EAAE;EAAG,CACpC,CACQ,CAAC;AAEhB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsEntityPage/index.ts"],"sourcesContent":["export * from './AutoPatternsEntityPage';\n"],"mappings":"AAAA,cAAc,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { CollectionDataProvider } from '../../providers';
|
|
3
|
+
import { AutoPatternsGridContent } from './AutoPatternsGridContent';
|
|
4
|
+
export const AutoPatternsGrid = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
configuration
|
|
7
|
+
} = _ref;
|
|
8
|
+
const visibleFieldIds = useMemo(() => [configuration.item.title, configuration.item.subtitle].filter(value => value != null), [configuration]);
|
|
9
|
+
return /*#__PURE__*/React.createElement(CollectionDataProvider, {
|
|
10
|
+
collectionConfig: configuration.collection,
|
|
11
|
+
visibleFieldIds: visibleFieldIds
|
|
12
|
+
}, /*#__PURE__*/React.createElement(AutoPatternsGridContent, {
|
|
13
|
+
configuration: configuration
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=AutoPatternsGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","CollectionDataProvider","AutoPatternsGridContent","AutoPatternsGrid","_ref","configuration","visibleFieldIds","item","title","subtitle","filter","value","createElement","collectionConfig","collection"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGrid.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { CollectionDataProvider } from '../../providers';\nimport { GridConfig } from '../../types';\nimport { AutoPatternsGridContent } from './AutoPatternsGridContent';\n\nexport interface AutoPatternsGridProps {\n configuration: GridConfig;\n}\n\nexport const AutoPatternsGrid = ({ configuration }: AutoPatternsGridProps) => {\n const visibleFieldIds = useMemo(\n () =>\n [configuration.item.title, configuration.item.subtitle].filter(\n (value) => value != null,\n ) as string[],\n [configuration],\n );\n\n return (\n <CollectionDataProvider\n collectionConfig={configuration.collection}\n visibleFieldIds={visibleFieldIds}\n >\n <AutoPatternsGridContent configuration={configuration} />\n </CollectionDataProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,sBAAsB,QAAQ,iBAAiB;AAExD,SAASC,uBAAuB,QAAQ,2BAA2B;AAMnE,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAA8C;EAAA,IAA7C;IAAEC;EAAqC,CAAC,GAAAD,IAAA;EACvE,MAAME,eAAe,GAAGN,OAAO,CAC7B,MACE,CAACK,aAAa,CAACE,IAAI,CAACC,KAAK,EAAEH,aAAa,CAACE,IAAI,CAACE,QAAQ,CAAC,CAACC,MAAM,CAC3DC,KAAK,IAAKA,KAAK,IAAI,IACtB,CAAa,EACf,CAACN,aAAa,CAChB,CAAC;EAED,oBACEN,KAAA,CAAAa,aAAA,CAACX,sBAAsB;IACrBY,gBAAgB,EAAER,aAAa,CAACS,UAAW;IAC3CR,eAAe,EAAEA;EAAgB,gBAEjCP,KAAA,CAAAa,aAAA,CAACV,uBAAuB;IAACG,aAAa,EAAEA;EAAc,CAAE,CAClC,CAAC;AAE7B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid } from '@wix/patterns';
|
|
3
|
+
import { useGridFeatures } from '../../hooks';
|
|
4
|
+
export const AutoPatternsGridContent = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
configuration
|
|
7
|
+
} = _ref;
|
|
8
|
+
const {
|
|
9
|
+
state,
|
|
10
|
+
search,
|
|
11
|
+
title,
|
|
12
|
+
emptyState,
|
|
13
|
+
filters,
|
|
14
|
+
actionCell,
|
|
15
|
+
renderItem,
|
|
16
|
+
imagePlacement,
|
|
17
|
+
preset
|
|
18
|
+
} = useGridFeatures(configuration);
|
|
19
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
20
|
+
dataHook: "auto-patterns-grid",
|
|
21
|
+
search: search,
|
|
22
|
+
title: title,
|
|
23
|
+
state: state,
|
|
24
|
+
actionCell: actionCell,
|
|
25
|
+
filters: filters,
|
|
26
|
+
emptyState: emptyState,
|
|
27
|
+
imagePlacement: imagePlacement,
|
|
28
|
+
preset: preset,
|
|
29
|
+
renderItem: renderItem
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=AutoPatternsGridContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Grid","useGridFeatures","AutoPatternsGridContent","_ref","configuration","state","search","title","emptyState","filters","actionCell","renderItem","imagePlacement","preset","createElement","dataHook"],"sources":["../../../../src/components/AutoPatternsGrid/AutoPatternsGridContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Grid } from '@wix/patterns';\nimport { GridConfig } from '../../types';\nimport { useGridFeatures } from '../../hooks';\n\nexport interface AutoPatternsGridContentProps {\n configuration: GridConfig;\n}\n\nexport const AutoPatternsGridContent = ({\n configuration,\n}: AutoPatternsGridContentProps) => {\n const {\n state,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n renderItem,\n imagePlacement,\n preset,\n } = useGridFeatures(configuration);\n\n return (\n <Grid\n dataHook=\"auto-patterns-grid\"\n search={search}\n title={title}\n state={state}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n imagePlacement={imagePlacement}\n preset={preset}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,eAAe;AAEpC,SAASC,eAAe,QAAQ,aAAa;AAM7C,OAAO,MAAMC,uBAAuB,GAAGC,IAAA,IAEH;EAAA,IAFI;IACtCC;EAC4B,CAAC,GAAAD,IAAA;EAC7B,MAAM;IACJE,KAAK;IACLC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,UAAU;IACVC,UAAU;IACVC,cAAc;IACdC;EACF,CAAC,GAAGZ,eAAe,CAACG,aAAa,CAAC;EAElC,oBACEL,KAAA,CAAAe,aAAA,CAACd,IAAI;IACHe,QAAQ,EAAC,oBAAoB;IAC7BT,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbF,KAAK,EAAEA,KAAM;IACbK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvBI,cAAc,EAAEA,cAAe;IAC/BC,MAAM,EAAEA,MAAO;IACfF,UAAU,EAAEA;EAAW,CACxB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsGrid/index.ts"],"sourcesContent":["export * from './AutoPatternsGrid';\n"],"mappings":"AAAA,cAAc,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';
|
|
3
|
+
import { AutoPatternsEntityPage } from '../AutoPatternsEntityPage';
|
|
4
|
+
import { SchemaProvider } from '../../providers/SchemaContext';
|
|
5
|
+
export const AutoPatternsPage = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
pageConfig
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
type,
|
|
11
|
+
collectionPage,
|
|
12
|
+
entityPage
|
|
13
|
+
} = pageConfig;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case 'collectionPage':
|
|
16
|
+
if (collectionPage) {
|
|
17
|
+
return /*#__PURE__*/React.createElement(AutoPatternsCollectionPage, {
|
|
18
|
+
configuration: collectionPage
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
break;
|
|
22
|
+
case 'entityPage':
|
|
23
|
+
if (entityPage) {
|
|
24
|
+
return /*#__PURE__*/React.createElement(SchemaProvider, {
|
|
25
|
+
collectionId: entityPage.collectionId,
|
|
26
|
+
entityTypeSource: entityPage.entityTypeSource
|
|
27
|
+
}, /*#__PURE__*/React.createElement(AutoPatternsEntityPage, {
|
|
28
|
+
configuration: entityPage
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=AutoPatternsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AutoPatternsCollectionPage","AutoPatternsEntityPage","SchemaProvider","AutoPatternsPage","_ref","pageConfig","type","collectionPage","entityPage","createElement","configuration","collectionId","entityTypeSource"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React from 'react';\nimport { PageConfig } from '../../types';\nimport { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';\nimport { AutoPatternsEntityPage } from '../AutoPatternsEntityPage';\nimport { SchemaProvider } from '../../providers/SchemaContext';\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return <AutoPatternsCollectionPage configuration={collectionPage} />;\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collectionId={entityPage.collectionId}\n entityTypeSource={entityPage.entityTypeSource}\n >\n <AutoPatternsEntityPage configuration={entityPage} />\n </SchemaProvider>\n );\n }\n break;\n default:\n break;\n }\n\n return null;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,0BAA0B,QAAQ,+BAA+B;AAC1E,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,cAAc,QAAQ,+BAA+B;AAM9D,OAAO,MAAMC,gBAAgB,GAAGC,IAAA,IAA2C;EAAA,IAA1C;IAAEC;EAAkC,CAAC,GAAAD,IAAA;EACpE,MAAM;IAAEE,IAAI;IAAEC,cAAc;IAAEC;EAAW,CAAC,GAAGH,UAAU;EAEvD,QAAQC,IAAI;IACV,KAAK,gBAAgB;MACnB,IAAIC,cAAc,EAAE;QAClB,oBAAOR,KAAA,CAAAU,aAAA,CAACT,0BAA0B;UAACU,aAAa,EAAEH;QAAe,CAAE,CAAC;MACtE;MACA;IACF,KAAK,YAAY;MACf,IAAIC,UAAU,EAAE;QACd,oBACET,KAAA,CAAAU,aAAA,CAACP,cAAc;UACbS,YAAY,EAAEH,UAAU,CAACG,YAAa;UACtCC,gBAAgB,EAAEJ,UAAU,CAACI;QAAiB,gBAE9Cb,KAAA,CAAAU,aAAA,CAACR,sBAAsB;UAACS,aAAa,EAAEF;QAAW,CAAE,CACtC,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { CollectionDataProvider } from '../../providers';
|
|
3
|
+
import { AutoPatternsTableContent } from './AutoPatternsTableContent';
|
|
4
|
+
export const AutoPatternsTable = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
configuration
|
|
7
|
+
} = _ref;
|
|
8
|
+
const visibleFieldIds = useMemo(() => configuration.columns.map(column => column.id), [configuration]);
|
|
9
|
+
return /*#__PURE__*/React.createElement(CollectionDataProvider, {
|
|
10
|
+
collectionConfig: configuration.collection,
|
|
11
|
+
visibleFieldIds: visibleFieldIds
|
|
12
|
+
}, /*#__PURE__*/React.createElement(AutoPatternsTableContent, {
|
|
13
|
+
configuration: configuration
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=AutoPatternsTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useMemo","CollectionDataProvider","AutoPatternsTableContent","AutoPatternsTable","_ref","configuration","visibleFieldIds","columns","map","column","id","createElement","collectionConfig","collection"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { TableConfig } from '../../types';\nimport { CollectionDataProvider } from '../../providers';\nimport { AutoPatternsTableContent } from './AutoPatternsTableContent';\n\nexport interface AutoPatternsTableProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableProps) => {\n const visibleFieldIds = useMemo(\n () => configuration.columns.map((column) => column.id),\n [configuration],\n );\n\n return (\n <CollectionDataProvider\n collectionConfig={configuration.collection}\n visibleFieldIds={visibleFieldIds}\n >\n <AutoPatternsTableContent configuration={configuration} />\n </CollectionDataProvider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,sBAAsB,QAAQ,iBAAiB;AACxD,SAASC,wBAAwB,QAAQ,4BAA4B;AAMrE,OAAO,MAAMC,iBAAiB,GAAGC,IAAA,IAEH;EAAA,IAFI;IAChCC;EACsB,CAAC,GAAAD,IAAA;EACvB,MAAME,eAAe,GAAGN,OAAO,CAC7B,MAAMK,aAAa,CAACE,OAAO,CAACC,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,EAAE,CAAC,EACtD,CAACL,aAAa,CAChB,CAAC;EAED,oBACEN,KAAA,CAAAY,aAAA,CAACV,sBAAsB;IACrBW,gBAAgB,EAAEP,aAAa,CAACQ,UAAW;IAC3CP,eAAe,EAAEA;EAAgB,gBAEjCP,KAAA,CAAAY,aAAA,CAACT,wBAAwB;IAACG,aAAa,EAAEA;EAAc,CAAE,CACnC,CAAC;AAE7B,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Table, usePatternsNavigate } from '@wix/patterns';
|
|
3
|
+
import { useTableFeatures } from '../../hooks';
|
|
4
|
+
import { useCollectionData } from '../../providers';
|
|
5
|
+
export const AutoPatternsTableContent = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
configuration
|
|
8
|
+
} = _ref;
|
|
9
|
+
const {
|
|
10
|
+
navigateToEntityPage
|
|
11
|
+
} = usePatternsNavigate();
|
|
12
|
+
const {
|
|
13
|
+
state,
|
|
14
|
+
columns,
|
|
15
|
+
customColumns,
|
|
16
|
+
search,
|
|
17
|
+
title,
|
|
18
|
+
emptyState,
|
|
19
|
+
filters,
|
|
20
|
+
actionCell
|
|
21
|
+
} = useTableFeatures(configuration);
|
|
22
|
+
const {
|
|
23
|
+
entityIdKey
|
|
24
|
+
} = useCollectionData();
|
|
25
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
26
|
+
dataHook: "auto-patterns-table",
|
|
27
|
+
search: search,
|
|
28
|
+
title: title,
|
|
29
|
+
state: state,
|
|
30
|
+
columns: columns,
|
|
31
|
+
customColumns: customColumns,
|
|
32
|
+
actionCell: actionCell,
|
|
33
|
+
filters: filters,
|
|
34
|
+
emptyState: emptyState,
|
|
35
|
+
onRowClick: item => {
|
|
36
|
+
navigateToEntityPage({
|
|
37
|
+
path: `/${item[entityIdKey]}`,
|
|
38
|
+
entity: item
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=AutoPatternsTableContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Table","usePatternsNavigate","useTableFeatures","useCollectionData","AutoPatternsTableContent","_ref","configuration","navigateToEntityPage","state","columns","customColumns","search","title","emptyState","filters","actionCell","entityIdKey","createElement","dataHook","onRowClick","item","path","entity"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTableContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Table, usePatternsNavigate } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\nimport { useCollectionData } from '../../providers';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTableContent = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const { navigateToEntityPage } = usePatternsNavigate();\n\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n actionCell,\n } = useTableFeatures(configuration);\n\n const { entityIdKey } = useCollectionData();\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n customColumns={customColumns}\n actionCell={actionCell}\n filters={filters}\n emptyState={emptyState}\n onRowClick={(item) => {\n navigateToEntityPage({\n path: `/${item[entityIdKey]}`,\n entity: item,\n });\n }}\n />\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,mBAAmB,QAAQ,eAAe;AAE1D,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,iBAAiB,QAAQ,iBAAiB;AAMnD,OAAO,MAAMC,wBAAwB,GAAGC,IAAA,IAEH;EAAA,IAFI;IACvCC;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IAAEE;EAAqB,CAAC,GAAGN,mBAAmB,CAAC,CAAC;EAEtD,MAAM;IACJO,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC;EACF,CAAC,GAAGb,gBAAgB,CAACI,aAAa,CAAC;EAEnC,MAAM;IAAEU;EAAY,CAAC,GAAGb,iBAAiB,CAAC,CAAC;EAE3C,oBACEJ,KAAA,CAAAkB,aAAA,CAACjB,KAAK;IACJkB,QAAQ,EAAC,qBAAqB;IAC9BP,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAc;IAC7BK,UAAU,EAAEA,UAAW;IACvBD,OAAO,EAAEA,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvBM,UAAU,EAAGC,IAAI,IAAK;MACpBb,oBAAoB,CAAC;QACnBc,IAAI,EAAE,IAAID,IAAI,CAACJ,WAAW,CAAC,EAAE;QAC7BM,MAAM,EAAEF;MACV,CAAC,CAAC;IACJ;EAAE,CACH,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/components/AutoPatternsTable/index.ts"],"sourcesContent":["export * from './AutoPatternsTable';\n"],"mappings":"AAAA,cAAc,qBAAqB","ignoreList":[]}
|