@wix/auto-patterns 1.10.0 → 1.12.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/README.md +0 -50
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +57 -53
- package/dist/cjs/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +38 -21
- package/dist/cjs/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js +2 -1
- package/dist/cjs/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
- package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/cjs/components/DynamicIcon.js +9 -45
- package/dist/cjs/components/DynamicIcon.js.map +1 -1
- package/dist/cjs/hooks/useActionCell.js +9 -23
- package/dist/cjs/hooks/useActionCell.js.map +1 -1
- package/dist/cjs/hooks/useBaseTableFeatures.js +7 -2
- package/dist/cjs/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useBulkActionToolbar.js +28 -6
- package/dist/cjs/hooks/useBulkActionToolbar.js.map +1 -1
- package/dist/cjs/hooks/useCollectionPageActions.js +2 -3
- package/dist/cjs/hooks/useCollectionPageActions.js.map +1 -1
- package/dist/cjs/hooks/useColumns.js +19 -10
- package/dist/cjs/hooks/useColumns.js.map +1 -1
- package/dist/cjs/hooks/useCommonCollectionFeatures.js +6 -10
- package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/cjs/hooks/useEntityPageMoreActions.js +46 -0
- package/dist/cjs/hooks/useEntityPageMoreActions.js.map +1 -0
- package/dist/cjs/hooks/useGridFeatures.js +8 -12
- package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableFeatures.js +12 -8
- package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js +11 -7
- package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js +1 -1
- package/dist/cjs/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
- package/dist/cjs/types/EntityPageConfig.js.map +1 -1
- package/dist/cjs/types/actions/actionCell.js.map +1 -1
- package/dist/cjs/types/actions/base.js.map +1 -1
- package/dist/cjs/types/actions/bulkActions.js.map +1 -1
- package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
- package/dist/cjs/types/actions/entityPageActions.js +4 -0
- package/dist/cjs/types/actions/entityPageActions.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/types.js.map +1 -1
- package/dist/cjs/utils/actions/bulkDeleteAction.js +12 -1
- package/dist/cjs/utils/actions/bulkDeleteAction.js.map +1 -1
- package/dist/cjs/utils/actions/createAction.js +12 -1
- package/dist/cjs/utils/actions/createAction.js.map +1 -1
- package/dist/cjs/utils/actions/customAction.js.map +1 -1
- package/dist/cjs/utils/actions/deleteAction.js +12 -1
- package/dist/cjs/utils/actions/deleteAction.js.map +1 -1
- package/dist/cjs/utils/actions/resolveAction.js +2 -17
- package/dist/cjs/utils/actions/resolveAction.js.map +1 -1
- package/dist/cjs/utils/actions/types.js.map +1 -1
- package/dist/cjs/utils/actions/updateAction.js +12 -1
- package/dist/cjs/utils/actions/updateAction.js.map +1 -1
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js +40 -36
- package/dist/esm/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js +14 -3
- package/dist/esm/components/AutoPatternsEntityPage/AutoPatternsEntityPage.js.map +1 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js +2 -1
- package/dist/esm/components/AutoPatternsEntityPage/Fields/ImageInput.js.map +1 -1
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +6 -2
- package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
- package/dist/esm/components/DynamicIcon.js +4 -13
- package/dist/esm/components/DynamicIcon.js.map +1 -1
- package/dist/esm/hooks/useActionCell.js +9 -23
- package/dist/esm/hooks/useActionCell.js.map +1 -1
- package/dist/esm/hooks/useBaseTableFeatures.js +6 -1
- package/dist/esm/hooks/useBaseTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useBulkActionToolbar.js +27 -5
- package/dist/esm/hooks/useBulkActionToolbar.js.map +1 -1
- package/dist/esm/hooks/useCollectionPageActions.js +1 -2
- package/dist/esm/hooks/useCollectionPageActions.js.map +1 -1
- package/dist/esm/hooks/useColumns.js +19 -10
- package/dist/esm/hooks/useColumns.js.map +1 -1
- package/dist/esm/hooks/useCommonCollectionFeatures.js +2 -6
- package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
- package/dist/esm/hooks/useEntityPageMoreActions.js +42 -0
- package/dist/esm/hooks/useEntityPageMoreActions.js.map +1 -0
- package/dist/esm/hooks/useGridFeatures.js +8 -12
- package/dist/esm/hooks/useGridFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableFeatures.js +12 -8
- package/dist/esm/hooks/useTableFeatures.js.map +1 -1
- package/dist/esm/hooks/useTableGridSwitchFeatures.js +11 -7
- package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
- package/dist/esm/providers/PatternsWizardOverridesContext.js.map +1 -1
- package/dist/esm/types/CollectionPageConfig.js.map +1 -1
- package/dist/esm/types/EntityPageConfig.js.map +1 -1
- package/dist/esm/types/actions/actionCell.js.map +1 -1
- package/dist/esm/types/actions/base.js.map +1 -1
- package/dist/esm/types/actions/bulkActions.js.map +1 -1
- package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
- package/dist/esm/types/actions/entityPageActions.js +2 -0
- package/dist/esm/types/actions/entityPageActions.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/types.js.map +1 -1
- package/dist/esm/utils/actions/bulkDeleteAction.js +3 -1
- package/dist/esm/utils/actions/bulkDeleteAction.js.map +1 -1
- package/dist/esm/utils/actions/createAction.js +3 -1
- package/dist/esm/utils/actions/createAction.js.map +1 -1
- package/dist/esm/utils/actions/customAction.js.map +1 -1
- package/dist/esm/utils/actions/deleteAction.js +3 -1
- package/dist/esm/utils/actions/deleteAction.js.map +1 -1
- package/dist/esm/utils/actions/resolveAction.js +1 -7
- package/dist/esm/utils/actions/resolveAction.js.map +1 -1
- package/dist/esm/utils/actions/types.js.map +1 -1
- package/dist/esm/utils/actions/updateAction.js +3 -1
- package/dist/esm/utils/actions/updateAction.js.map +1 -1
- package/dist/types/components/AutoPatternsCollectionPageContent/AutoPatternsCollectionPageContent.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/AutoPatternsEntityPage.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsEntityPage/Fields/ImageInput.d.ts.map +1 -1
- package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
- package/dist/types/components/DynamicIcon.d.ts.map +1 -1
- package/dist/types/hooks/useActionCell.d.ts +2 -4
- package/dist/types/hooks/useActionCell.d.ts.map +1 -1
- package/dist/types/hooks/useBaseTableFeatures.d.ts +2 -0
- package/dist/types/hooks/useBaseTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useBulkActionToolbar.d.ts.map +1 -1
- package/dist/types/hooks/useCollectionPageActions.d.ts.map +1 -1
- package/dist/types/hooks/useColumns.d.ts.map +1 -1
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts +2 -3
- package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
- package/dist/types/hooks/useEntityPageMoreActions.d.ts +6 -0
- package/dist/types/hooks/useEntityPageMoreActions.d.ts.map +1 -0
- package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableFeatures.d.ts +2 -0
- package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +2 -0
- package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts +4 -2
- package/dist/types/providers/PatternsWizardOverridesContext.d.ts.map +1 -1
- package/dist/types/types/CollectionPageConfig.d.ts +42 -31
- package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
- package/dist/types/types/EntityPageConfig.d.ts +2 -0
- package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
- package/dist/types/types/actions/actionCell.d.ts +4 -4
- package/dist/types/types/actions/actionCell.d.ts.map +1 -1
- package/dist/types/types/actions/base.d.ts +0 -1
- package/dist/types/types/actions/base.d.ts.map +1 -1
- package/dist/types/types/actions/bulkActions.d.ts +19 -11
- package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
- package/dist/types/types/actions/collectionPageActions.d.ts +2 -5
- package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
- package/dist/types/types/actions/entityPageActions.d.ts +12 -0
- package/dist/types/types/actions/entityPageActions.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/types.d.ts +1 -0
- package/dist/types/types/types.d.ts.map +1 -1
- package/dist/types/utils/actions/bulkDeleteAction.d.ts +2 -1
- package/dist/types/utils/actions/bulkDeleteAction.d.ts.map +1 -1
- package/dist/types/utils/actions/createAction.d.ts +2 -1
- package/dist/types/utils/actions/createAction.d.ts.map +1 -1
- package/dist/types/utils/actions/customAction.d.ts +1 -1
- package/dist/types/utils/actions/customAction.d.ts.map +1 -1
- package/dist/types/utils/actions/deleteAction.d.ts +2 -1
- package/dist/types/utils/actions/deleteAction.d.ts.map +1 -1
- package/dist/types/utils/actions/resolveAction.d.ts +1 -3
- package/dist/types/utils/actions/resolveAction.d.ts.map +1 -1
- package/dist/types/utils/actions/types.d.ts +5 -4
- package/dist/types/utils/actions/types.d.ts.map +1 -1
- package/dist/types/utils/actions/updateAction.d.ts +2 -1
- package/dist/types/utils/actions/updateAction.d.ts.map +1 -1
- package/package.json +19 -22
- package/dist/cjs/types/wix-icons.d.js +0 -2
- package/dist/cjs/types/wix-icons.d.js.map +0 -1
- package/dist/cjs/utils/generated-icon-imports.js +0 -1438
- package/dist/cjs/utils/generated-icon-imports.js.map +0 -1
- package/dist/esm/types/wix-icons.d.js +0 -2
- package/dist/esm/types/wix-icons.d.js.map +0 -1
- package/dist/esm/utils/generated-icon-imports.js +0 -1432
- package/dist/esm/utils/generated-icon-imports.js.map +0 -1
- package/dist/types/utils/generated-icon-imports.d.ts +0 -4
- package/dist/types/utils/generated-icon-imports.d.ts.map +0 -1
|
@@ -16,9 +16,7 @@ const useCommonCollectionFeatures = ({
|
|
|
16
16
|
toolbarTitle,
|
|
17
17
|
search,
|
|
18
18
|
emptyState: emptyStateConfig,
|
|
19
|
-
collection
|
|
20
|
-
collectionType,
|
|
21
|
-
entityPageId
|
|
19
|
+
collection
|
|
22
20
|
}) => {
|
|
23
21
|
var _toolbarTitle$subtitl, _toolbarTitle$subtitl2, _toolbarTitle$subtitl3, _toolbarTitle$subtitl4, _toolbarTitle$subtitl5, _toolbarTitle$subtitl6, _toolbarTitle$subtitl7;
|
|
24
22
|
const {
|
|
@@ -26,9 +24,7 @@ const useCommonCollectionFeatures = ({
|
|
|
26
24
|
} = (0, _useEmptyStates.useEmptyStates)(emptyStateConfig);
|
|
27
25
|
const actionCell = (0, _useActionCell.useActionCell)({
|
|
28
26
|
config: actionCellConfig,
|
|
29
|
-
collectionId: collection.collectionId
|
|
30
|
-
collectionType,
|
|
31
|
-
entityPageId
|
|
27
|
+
collectionId: collection.collectionId
|
|
32
28
|
});
|
|
33
29
|
const bulkActionToolbar = (0, _useBulkActionToolbar.useBulkActionToolbar)({
|
|
34
30
|
config: bulkActionToolbarConfig,
|
|
@@ -46,7 +42,7 @@ const useCommonCollectionFeatures = ({
|
|
|
46
42
|
__self: void 0,
|
|
47
43
|
__source: {
|
|
48
44
|
fileName: _jsxFileName,
|
|
49
|
-
lineNumber:
|
|
45
|
+
lineNumber: 51,
|
|
50
46
|
columnNumber: 13
|
|
51
47
|
}
|
|
52
48
|
}, /*#__PURE__*/_react.default.createElement(_designSystem.Text, {
|
|
@@ -56,7 +52,7 @@ const useCommonCollectionFeatures = ({
|
|
|
56
52
|
__self: void 0,
|
|
57
53
|
__source: {
|
|
58
54
|
fileName: _jsxFileName,
|
|
59
|
-
lineNumber:
|
|
55
|
+
lineNumber: 52,
|
|
60
56
|
columnNumber: 15
|
|
61
57
|
}
|
|
62
58
|
}, (_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.default.createElement(_designSystem.TextButton, {
|
|
@@ -71,7 +67,7 @@ const useCommonCollectionFeatures = ({
|
|
|
71
67
|
__self: void 0,
|
|
72
68
|
__source: {
|
|
73
69
|
fileName: _jsxFileName,
|
|
74
|
-
lineNumber:
|
|
70
|
+
lineNumber: 60,
|
|
75
71
|
columnNumber: 17
|
|
76
72
|
}
|
|
77
73
|
}, (_toolbarTitle$subtitl7 = toolbarTitle.subtitle) == null || (_toolbarTitle$subtitl7 = _toolbarTitle$subtitl7.info) == null ? void 0 : _toolbarTitle$subtitl7.content.link.label))
|
|
@@ -82,7 +78,7 @@ const useCommonCollectionFeatures = ({
|
|
|
82
78
|
__self: void 0,
|
|
83
79
|
__source: {
|
|
84
80
|
fileName: _jsxFileName,
|
|
85
|
-
lineNumber:
|
|
81
|
+
lineNumber: 44,
|
|
86
82
|
columnNumber: 5
|
|
87
83
|
}
|
|
88
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_useEmptyStates","_patterns","_designSystem","_useActionCell","_useBulkActionToolbar","_jsxFileName","useCommonCollectionFeatures","actionCell","actionCellConfig","bulkActionToolbar","bulkActionToolbarConfig","toolbarTitle","search","emptyState","emptyStateConfig","collection","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_useEmptyStates","_patterns","_designSystem","_useActionCell","_useBulkActionToolbar","_jsxFileName","useCommonCollectionFeatures","actionCell","actionCellConfig","bulkActionToolbar","bulkActionToolbarConfig","toolbarTitle","search","emptyState","emptyStateConfig","collection","_toolbarTitle$subtitl","_toolbarTitle$subtitl2","_toolbarTitle$subtitl3","_toolbarTitle$subtitl4","_toolbarTitle$subtitl5","_toolbarTitle$subtitl6","_toolbarTitle$subtitl7","useEmptyStates","useActionCell","config","collectionId","useBulkActionToolbar","title","default","createElement","ToolbarTitle","subtitle","text","learnMore","info","content","Box","direction","gap","__self","__source","fileName","lineNumber","columnNumber","Text","dataHook","light","size","link","TextButton","underline","skin","as","rel","target","href","url","label","itemsLimit","showTotal","shown","exports"],"sources":["../../../src/hooks/useCommonCollectionFeatures.tsx"],"sourcesContent":["import React from 'react';\nimport { useEmptyStates } from './useEmptyStates';\n\nimport { CollectionOptimisticActions, ToolbarTitle } from '@wix/patterns';\n\nimport { Box, Text, TextButton } from '@wix/design-system';\nimport { BaseCollectionComponentConfig } from '../types';\nimport { useActionCell } from './useActionCell';\nimport { useBulkActionToolbar } from './useBulkActionToolbar';\n\nexport type UseCommonCollectionFeaturesParams = Pick<\n BaseCollectionComponentConfig,\n | 'actionCell'\n | 'toolbarTitle'\n | 'search'\n | 'emptyState'\n | 'collection'\n | 'bulkActionToolbar'\n | 'entityPageId'\n> & {\n optimisticActions: CollectionOptimisticActions<any, any>;\n};\n\nexport const useCommonCollectionFeatures = ({\n actionCell: actionCellConfig,\n bulkActionToolbar: bulkActionToolbarConfig,\n toolbarTitle,\n search,\n emptyState: emptyStateConfig,\n collection,\n}: UseCommonCollectionFeaturesParams) => {\n const { emptyState } = useEmptyStates(emptyStateConfig);\n const actionCell = useActionCell({\n config: actionCellConfig,\n collectionId: collection.collectionId,\n });\n\n const bulkActionToolbar = useBulkActionToolbar({\n config: bulkActionToolbarConfig,\n collectionId: collection.collectionId,\n });\n\n const title = toolbarTitle && (\n <ToolbarTitle\n title={toolbarTitle.title}\n subtitle={{\n text: toolbarTitle.subtitle?.text ?? '',\n learnMore: toolbarTitle.subtitle?.learnMore,\n info: toolbarTitle.subtitle?.info && {\n content: (\n <Box direction=\"vertical\" gap=\"6px\">\n <Text\n dataHook=\"toolbar-title-subtitle-info-content\"\n light\n size=\"small\"\n >\n {toolbarTitle.subtitle?.info?.content.text}\n </Text>\n {toolbarTitle.subtitle?.info?.content.link && (\n <TextButton\n dataHook=\"toolbar-title-subtitle-info-link\"\n size=\"small\"\n underline=\"always\"\n skin=\"light\"\n as=\"a\"\n rel=\"noopener\"\n target=\"_blank\"\n href={toolbarTitle.subtitle?.info?.content.link.url}\n >\n {toolbarTitle.subtitle?.info?.content.link.label}\n </TextButton>\n )}\n </Box>\n ),\n },\n }}\n itemsLimit={toolbarTitle.itemsLimit}\n showTotal={toolbarTitle.showTotal}\n />\n );\n\n return {\n search: search?.shown !== false,\n title,\n emptyState,\n actionCell,\n bulkActionToolbar,\n };\n};\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AAA8D,IAAAM,YAAA;AAevD,MAAMC,2BAA2B,GAAGA,CAAC;EAC1CC,UAAU,EAAEC,gBAAgB;EAC5BC,iBAAiB,EAAEC,uBAAuB;EAC1CC,YAAY;EACZC,MAAM;EACNC,UAAU,EAAEC,gBAAgB;EAC5BC;AACiC,CAAC,KAAK;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EACvC,MAAM;IAAET;EAAW,CAAC,GAAG,IAAAU,8BAAc,EAACT,gBAAgB,CAAC;EACvD,MAAMP,UAAU,GAAG,IAAAiB,4BAAa,EAAC;IAC/BC,MAAM,EAAEjB,gBAAgB;IACxBkB,YAAY,EAAEX,UAAU,CAACW;EAC3B,CAAC,CAAC;EAEF,MAAMjB,iBAAiB,GAAG,IAAAkB,0CAAoB,EAAC;IAC7CF,MAAM,EAAEf,uBAAuB;IAC/BgB,YAAY,EAAEX,UAAU,CAACW;EAC3B,CAAC,CAAC;EAEF,MAAME,KAAK,GAAGjB,YAAY,iBACxBd,MAAA,CAAAgC,OAAA,CAAAC,aAAA,CAAC7B,SAAA,CAAA8B,YAAY;IACXH,KAAK,EAAEjB,YAAY,CAACiB,KAAM;IAC1BI,QAAQ,EAAE;MACRC,IAAI,EAAE,EAAAjB,qBAAA,GAAAL,YAAY,CAACqB,QAAQ,qBAArBhB,qBAAA,CAAuBiB,IAAI,KAAI,EAAE;MACvCC,SAAS,GAAAjB,sBAAA,GAAEN,YAAY,CAACqB,QAAQ,qBAArBf,sBAAA,CAAuBiB,SAAS;MAC3CC,IAAI,EAAE,EAAAjB,sBAAA,GAAAP,YAAY,CAACqB,QAAQ,qBAArBd,sBAAA,CAAuBiB,IAAI,KAAI;QACnCC,OAAO,eACLvC,MAAA,CAAAgC,OAAA,CAAAC,aAAA,CAAC5B,aAAA,CAAAmC,GAAG;UAACC,SAAS,EAAC,UAAU;UAACC,GAAG,EAAC,KAAK;UAAAC,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,gBACjC/C,MAAA,CAAAgC,OAAA,CAAAC,aAAA,CAAC5B,aAAA,CAAA2C,IAAI;UACHC,QAAQ,EAAC,qCAAqC;UAC9CC,KAAK;UACLC,IAAI,EAAC,OAAO;UAAAR,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,IAAAzB,sBAAA,GAEXR,YAAY,CAACqB,QAAQ,cAAAb,sBAAA,GAArBA,sBAAA,CAAuBgB,IAAI,qBAA3BhB,sBAAA,CAA6BiB,OAAO,CAACH,IAClC,CAAC,EACN,EAAAb,sBAAA,GAAAT,YAAY,CAACqB,QAAQ,cAAAZ,sBAAA,GAArBA,sBAAA,CAAuBe,IAAI,qBAA3Bf,sBAAA,CAA6BgB,OAAO,CAACa,IAAI,kBACxCpD,MAAA,CAAAgC,OAAA,CAAAC,aAAA,CAAC5B,aAAA,CAAAgD,UAAU;UACTJ,QAAQ,EAAC,kCAAkC;UAC3CE,IAAI,EAAC,OAAO;UACZG,SAAS,EAAC,QAAQ;UAClBC,IAAI,EAAC,OAAO;UACZC,EAAE,EAAC,GAAG;UACNC,GAAG,EAAC,UAAU;UACdC,MAAM,EAAC,QAAQ;UACfC,IAAI,GAAAnC,sBAAA,GAAEV,YAAY,CAACqB,QAAQ,cAAAX,sBAAA,GAArBA,sBAAA,CAAuBc,IAAI,qBAA3Bd,sBAAA,CAA6Be,OAAO,CAACa,IAAI,CAACQ,GAAI;UAAAjB,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,IAAAtB,sBAAA,GAEnDX,YAAY,CAACqB,QAAQ,cAAAV,sBAAA,GAArBA,sBAAA,CAAuBa,IAAI,qBAA3Bb,sBAAA,CAA6Bc,OAAO,CAACa,IAAI,CAACS,KACjC,CAEX;MAET;IACF,CAAE;IACFC,UAAU,EAAEhD,YAAY,CAACgD,UAAW;IACpCC,SAAS,EAAEjD,YAAY,CAACiD,SAAU;IAAApB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAArC,YAAA;MAAAsC,UAAA;MAAAC,YAAA;IAAA;EAAA,CACnC,CACF;EAED,OAAO;IACLhC,MAAM,EAAE,CAAAA,MAAM,oBAANA,MAAM,CAAEiD,KAAK,MAAK,KAAK;IAC/BjC,KAAK;IACLf,UAAU;IACVN,UAAU;IACVE;EACF,CAAC;AACH,CAAC;AAACqD,OAAA,CAAAxD,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.useEntityPageMoreActions = useEntityPageMoreActions;
|
|
5
|
+
var _actions = require("../utils/actions");
|
|
6
|
+
var _react = require("react");
|
|
7
|
+
function useEntityPageMoreActions(moreActions, entity, sdk, form) {
|
|
8
|
+
const buildEntityPageActions = (0, _react.useCallback)(() => {
|
|
9
|
+
if (!moreActions) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const buildAction = actionConfig => {
|
|
13
|
+
let actionToResolve = null;
|
|
14
|
+
const baseParams = {
|
|
15
|
+
actionParams: {
|
|
16
|
+
entity,
|
|
17
|
+
form
|
|
18
|
+
},
|
|
19
|
+
sdk
|
|
20
|
+
};
|
|
21
|
+
switch (actionConfig.type) {
|
|
22
|
+
case 'custom':
|
|
23
|
+
actionToResolve = (0, _actions.customAction)({
|
|
24
|
+
action: actionConfig,
|
|
25
|
+
...baseParams
|
|
26
|
+
});
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
if (!actionToResolve) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const resolved = (0, _actions.resolveAction)(actionConfig, actionToResolve);
|
|
35
|
+
return {
|
|
36
|
+
onClick: resolved.onClick,
|
|
37
|
+
text: resolved.label,
|
|
38
|
+
prefixIcon: resolved.icon,
|
|
39
|
+
disabled: resolved.disabled
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
return moreActions.map(group => group.map(buildAction).filter(Boolean));
|
|
43
|
+
}, [moreActions, sdk, entity, form]);
|
|
44
|
+
return buildEntityPageActions() ?? [];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=useEntityPageMoreActions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_actions","require","_react","useEntityPageMoreActions","moreActions","entity","sdk","form","buildEntityPageActions","useCallback","buildAction","actionConfig","actionToResolve","baseParams","actionParams","type","customAction","action","resolved","resolveAction","onClick","text","label","prefixIcon","icon","disabled","map","group","filter","Boolean"],"sources":["../../../src/hooks/useEntityPageMoreActions.ts"],"sourcesContent":["import { ActionsSDK, ResolvedAction } from '../types';\nimport {\n EntityPageMoreActions,\n EntityPageActionConfig,\n} from '../types/actions';\nimport { customAction, resolveAction } from '../utils/actions';\nimport { useCallback } from 'react';\nimport { MoreActionsItem } from '@wix/patterns';\nimport { FieldValues, UseFormReturn } from '@wix/patterns/form';\n\nexport function useEntityPageMoreActions(\n moreActions: EntityPageMoreActions | undefined,\n entity: Record<string, any>,\n sdk: ActionsSDK,\n form: UseFormReturn<FieldValues, any, undefined>,\n) {\n const buildEntityPageActions = useCallback(() => {\n if (!moreActions) {\n return;\n }\n\n const buildAction = (\n actionConfig: EntityPageActionConfig,\n ): MoreActionsItem | null => {\n let actionToResolve: Partial<ResolvedAction> | null = null;\n const baseParams = {\n actionParams: { entity, form },\n sdk,\n };\n\n switch (actionConfig.type) {\n case 'custom':\n actionToResolve = customAction({\n action: actionConfig,\n ...baseParams,\n });\n break;\n default:\n return null;\n }\n\n if (!actionToResolve) {\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 return (moreActions as EntityPageActionConfig[][]).map((group) =>\n group.map(buildAction).filter(Boolean),\n ) as MoreActionsItem[][];\n }, [moreActions, sdk, entity, form]);\n\n return buildEntityPageActions() ?? [];\n}\n"],"mappings":";;;;AAKA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIO,SAASE,wBAAwBA,CACtCC,WAA8C,EAC9CC,MAA2B,EAC3BC,GAAe,EACfC,IAAgD,EAChD;EACA,MAAMC,sBAAsB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC/C,IAAI,CAACL,WAAW,EAAE;MAChB;IACF;IAEA,MAAMM,WAAW,GACfC,YAAoC,IACT;MAC3B,IAAIC,eAA+C,GAAG,IAAI;MAC1D,MAAMC,UAAU,GAAG;QACjBC,YAAY,EAAE;UAAET,MAAM;UAAEE;QAAK,CAAC;QAC9BD;MACF,CAAC;MAED,QAAQK,YAAY,CAACI,IAAI;QACvB,KAAK,QAAQ;UACXH,eAAe,GAAG,IAAAI,qBAAY,EAAC;YAC7BC,MAAM,EAAEN,YAAY;YACpB,GAAGE;UACL,CAAC,CAAC;UACF;QACF;UACE,OAAO,IAAI;MACf;MAEA,IAAI,CAACD,eAAe,EAAE;QACpB,OAAO,IAAI;MACb;MAEA,MAAMM,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,OAAQrB,WAAW,CAAgCsB,GAAG,CAAEC,KAAK,IAC3DA,KAAK,CAACD,GAAG,CAAChB,WAAW,CAAC,CAACkB,MAAM,CAACC,OAAO,CACvC,CAAC;EACH,CAAC,EAAE,CAACzB,WAAW,EAAEE,GAAG,EAAED,MAAM,EAAEE,IAAI,CAAC,CAAC;EAEpC,OAAOC,sBAAsB,CAAC,CAAC,IAAI,EAAE;AACvC","ignoreList":[]}
|
|
@@ -10,16 +10,13 @@ var _SchemaContext = require("../providers/SchemaContext");
|
|
|
10
10
|
var _useAutoPatternsOptimisticActions = require("./useAutoPatternsOptimisticActions");
|
|
11
11
|
var _useBaseGridFeatures = require("./useBaseGridFeatures");
|
|
12
12
|
const useGridFeatures = configuration => {
|
|
13
|
-
const {
|
|
14
|
-
collection
|
|
15
|
-
} = configuration;
|
|
16
13
|
const {
|
|
17
14
|
collectionId,
|
|
18
15
|
limit,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = collection;
|
|
16
|
+
reflectQueryInUrl,
|
|
17
|
+
selectAllScope,
|
|
18
|
+
selectionUpdateMode
|
|
19
|
+
} = configuration.collection;
|
|
23
20
|
const {
|
|
24
21
|
renderItem,
|
|
25
22
|
imagePlacement,
|
|
@@ -50,15 +47,14 @@ const useGridFeatures = configuration => {
|
|
|
50
47
|
}) => String(err),
|
|
51
48
|
fetchData,
|
|
52
49
|
limit,
|
|
53
|
-
persistQueryToUrl,
|
|
54
|
-
disableAutoSelectAllCount,
|
|
55
|
-
selectionConsistencyMode
|
|
50
|
+
persistQueryToUrl: reflectQueryInUrl,
|
|
51
|
+
disableAutoSelectAllCount: selectAllScope === 'page',
|
|
52
|
+
selectionConsistencyMode: selectionUpdateMode
|
|
56
53
|
});
|
|
57
54
|
const optimisticActions = (0, _useAutoPatternsOptimisticActions.useAutoPatternsOptimisticActions)(collectionId, state.collection);
|
|
58
55
|
const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
|
|
59
56
|
...configuration,
|
|
60
|
-
optimisticActions
|
|
61
|
-
collectionType: 'Grid'
|
|
57
|
+
optimisticActions
|
|
62
58
|
});
|
|
63
59
|
return {
|
|
64
60
|
...commonFeatures,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","useGridFeatures","configuration","
|
|
1
|
+
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","useGridFeatures","configuration","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","renderItem","imagePlacement","preset","visibleFieldIds","useBaseGridFeatures","filterComponent","filtersObject","filtersMapping","useFilters","filters","fetchData","useFetchData","collectionConfig","schema","useSchema","state","useGridCollection","queryName","itemKey","gridItem","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","useAutoPatternsOptimisticActions","commonFeatures","useCommonCollectionFeatures","exports"],"sources":["../../../src/hooks/useGridFeatures.tsx"],"sourcesContent":["import { GridConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useGridCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\n\nexport const useGridFeatures = (configuration: GridConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(configuration);\n\n const { filterComponent, filtersObject, filtersMapping } = useFilters(\n configuration.filters,\n );\n\n const { fetchData } = useFetchData({\n collectionConfig: configuration.collection,\n visibleFieldIds,\n filtersMapping,\n });\n\n const schema = useSchema();\n\n const state = useGridCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (gridItem) => gridItem[schema.idField],\n itemName: (gridItem) => gridItem[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (gridItem) => gridItem.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n imagePlacement,\n preset,\n optimisticActions,\n renderItem,\n filters: filterComponent,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,iCAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AAEO,MAAMO,eAAe,GAAIC,aAAyB,IAAK;EAC5D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGL,aAAa,CAACM,UAAU;EAE5B,MAAM;IAAEC,UAAU;IAAEC,cAAc;IAAEC,MAAM;IAAEC;EAAgB,CAAC,GAC3D,IAAAC,wCAAmB,EAACX,aAAa,CAAC;EAEpC,MAAM;IAAEY,eAAe;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAG,IAAAC,sBAAU,EACnEf,aAAa,CAACgB,OAChB,CAAC;EAED,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,0BAAY,EAAC;IACjCC,gBAAgB,EAAEnB,aAAa,CAACM,UAAU;IAC1CI,eAAe;IACfI;EACF,CAAC,CAAC;EAEF,MAAMM,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EAE1B,MAAMC,KAAK,GAAG,IAAAC,2BAAiB,EAAM;IACnCC,SAAS,EAAE,GAAGvB,YAAY,EAAE;IAC5BwB,OAAO,EAAGC,QAAQ,IAAKA,QAAQ,CAACN,MAAM,CAACO,OAAO,CAAC;IAC/CC,QAAQ,EAAGF,QAAQ,IAAKA,QAAQ,CAACN,MAAM,CAACS,YAAY,CAAC;IACrDb,OAAO,EAAEH,aAAa;IACtBiB,gBAAgB,EAAGJ,QAAQ,IAAKA,QAAQ,CAACK,cAAc;IACvDC,iBAAiB,EAAEA,CAAC;MAAEC;IAAI,CAAC,KAAKC,MAAM,CAACD,GAAG,CAAC;IAC3ChB,SAAS;IACTf,KAAK;IACLiC,iBAAiB,EAAEhC,iBAAiB;IACpCiC,yBAAyB,EAAEhC,cAAc,KAAK,MAAM;IACpDiC,wBAAwB,EAAEhC;EAC5B,CAAC,CAAC;EAEF,MAAMiC,iBAAiB,GAAG,IAAAC,kEAAgC,EACxDtC,YAAY,EACZqB,KAAK,CAAChB,UACR,CAAC;EAED,MAAMkC,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAGzC,aAAa;IAChBsC;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,cAAc;IACjBlB,KAAK;IACLd,cAAc;IACdC,MAAM;IACN6B,iBAAiB;IACjB/B,UAAU;IACVS,OAAO,EAAEJ;EACX,CAAC;AACH,CAAC;AAAC8B,OAAA,CAAA3C,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -13,9 +13,9 @@ const useTableFeatures = configuration => {
|
|
|
13
13
|
const {
|
|
14
14
|
collectionId,
|
|
15
15
|
limit,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
reflectQueryInUrl,
|
|
17
|
+
selectAllScope,
|
|
18
|
+
selectionUpdateMode
|
|
19
19
|
} = configuration.collection;
|
|
20
20
|
const {
|
|
21
21
|
filterComponent,
|
|
@@ -26,7 +26,9 @@ const useTableFeatures = configuration => {
|
|
|
26
26
|
customColumns,
|
|
27
27
|
visibleFieldIds,
|
|
28
28
|
columns,
|
|
29
|
-
onRowClick
|
|
29
|
+
onRowClick,
|
|
30
|
+
stickyColumns,
|
|
31
|
+
stickySelectionColumn
|
|
30
32
|
} = (0, _useBaseTableFeatures.useBaseTableFeatures)(configuration);
|
|
31
33
|
const {
|
|
32
34
|
fetchData
|
|
@@ -47,9 +49,9 @@ const useTableFeatures = configuration => {
|
|
|
47
49
|
}) => String(err),
|
|
48
50
|
fetchData,
|
|
49
51
|
limit,
|
|
50
|
-
persistQueryToUrl,
|
|
51
|
-
disableAutoSelectAllCount,
|
|
52
|
-
selectionConsistencyMode
|
|
52
|
+
persistQueryToUrl: reflectQueryInUrl,
|
|
53
|
+
disableAutoSelectAllCount: selectAllScope === 'page',
|
|
54
|
+
selectionConsistencyMode: selectionUpdateMode
|
|
53
55
|
});
|
|
54
56
|
const optimisticActions = (0, _useAutoPatternsOptimisticActions.useAutoPatternsOptimisticActions)(collectionId, state.collection);
|
|
55
57
|
const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
|
|
@@ -63,7 +65,9 @@ const useTableFeatures = configuration => {
|
|
|
63
65
|
filters: filterComponent,
|
|
64
66
|
optimisticActions,
|
|
65
67
|
customColumns,
|
|
66
|
-
onRowClick
|
|
68
|
+
onRowClick,
|
|
69
|
+
stickyColumns,
|
|
70
|
+
stickySelectionColumn
|
|
67
71
|
};
|
|
68
72
|
};
|
|
69
73
|
exports.useTableFeatures = useTableFeatures;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseTableFeatures","useTableFeatures","configuration","collectionId","limit","
|
|
1
|
+
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseTableFeatures","useTableFeatures","configuration","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filtersMapping","useFilters","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","useBaseTableFeatures","fetchData","useFetchData","collectionConfig","schema","useSchema","state","useTableCollection","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","useAutoPatternsOptimisticActions","commonFeatures","useCommonCollectionFeatures","exports"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = configuration.collection;\n\n const { filterComponent, filtersObject, filtersMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n collectionConfig: configuration.collection,\n visibleFieldIds,\n filtersMapping,\n });\n\n const schema = useSchema();\n\n const state = useTableCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,iCAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AAEO,MAAMO,gBAAgB,GAAIC,aAA0B,IAAK;EAC9D,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGL,aAAa,CAACM,UAAU;EAE5B,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAG,IAAAC,sBAAU,EACnEV,aAAa,CAACW,OAChB,CAAC;EACD,MAAM;IACJC,aAAa;IACbC,eAAe;IACfC,OAAO;IACPC,UAAU;IACVC,aAAa;IACbC;EACF,CAAC,GAAG,IAAAC,0CAAoB,EAAClB,aAAa,CAAC;EAEvC,MAAM;IAAEmB;EAAU,CAAC,GAAG,IAAAC,0BAAY,EAAC;IACjCC,gBAAgB,EAAErB,aAAa,CAACM,UAAU;IAC1CO,eAAe;IACfJ;EACF,CAAC,CAAC;EAEF,MAAMa,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EAE1B,MAAMC,KAAK,GAAG,IAAAC,4BAAkB,EAAM;IACpCC,SAAS,EAAE,GAAGzB,YAAY,EAAE;IAC5B0B,OAAO,EAAGC,IAAI,IAAKA,IAAI,CAACN,MAAM,CAACO,OAAO,CAAC;IACvCC,QAAQ,EAAGF,IAAI,IAAKA,IAAI,CAACN,MAAM,CAACS,YAAY,CAAC;IAC7CpB,OAAO,EAAEH,aAAa;IACtBwB,gBAAgB,EAAGJ,IAAI,IAAKA,IAAI,CAACK,cAAc;IAC/CC,iBAAiB,EAAEA,CAAC;MAAEC;IAAI,CAAC,KAAKC,MAAM,CAACD,GAAG,CAAC;IAC3ChB,SAAS;IACTjB,KAAK;IACLmC,iBAAiB,EAAElC,iBAAiB;IACpCmC,yBAAyB,EAAElC,cAAc,KAAK,MAAM;IACpDmC,wBAAwB,EAAElC;EAC5B,CAAC,CAAC;EAEF,MAAMmC,iBAAiB,GAAG,IAAAC,kEAAgC,EACxDxC,YAAY,EACZuB,KAAK,CAAClB,UACR,CAAC;EAED,MAAMoC,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAG3C,aAAa;IAChBwC;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,cAAc;IACjBlB,KAAK;IACLV,OAAO;IACPH,OAAO,EAAEJ,eAAe;IACxBiC,iBAAiB;IACjB5B,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC;EACF,CAAC;AACH,CAAC;AAAC2B,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -15,9 +15,9 @@ const useTableGridSwitchFeatures = config => {
|
|
|
15
15
|
const {
|
|
16
16
|
collectionId,
|
|
17
17
|
limit,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
reflectQueryInUrl,
|
|
19
|
+
selectAllScope,
|
|
20
|
+
selectionUpdateMode
|
|
21
21
|
} = config.collection;
|
|
22
22
|
const {
|
|
23
23
|
filterComponent,
|
|
@@ -34,7 +34,9 @@ const useTableGridSwitchFeatures = config => {
|
|
|
34
34
|
customColumns,
|
|
35
35
|
visibleFieldIds: tableVisibleFieldIds,
|
|
36
36
|
columns: tableColumns,
|
|
37
|
-
onRowClick
|
|
37
|
+
onRowClick,
|
|
38
|
+
stickyColumns,
|
|
39
|
+
stickySelectionColumn
|
|
38
40
|
} = (0, _useBaseTableFeatures.useBaseTableFeatures)(config);
|
|
39
41
|
const {
|
|
40
42
|
fetchData: tableFetchData
|
|
@@ -54,9 +56,9 @@ const useTableGridSwitchFeatures = config => {
|
|
|
54
56
|
}) => String(err),
|
|
55
57
|
fetchData: tableFetchData,
|
|
56
58
|
limit,
|
|
57
|
-
persistQueryToUrl,
|
|
58
|
-
disableAutoSelectAllCount,
|
|
59
|
-
selectionConsistencyMode
|
|
59
|
+
persistQueryToUrl: reflectQueryInUrl,
|
|
60
|
+
disableAutoSelectAllCount: selectAllScope === 'page',
|
|
61
|
+
selectionConsistencyMode: selectionUpdateMode
|
|
60
62
|
});
|
|
61
63
|
const optimisticActions = (0, _useAutoPatternsOptimisticActions.useAutoPatternsOptimisticActions)(collectionId, state.collection);
|
|
62
64
|
const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
|
|
@@ -71,6 +73,8 @@ const useTableGridSwitchFeatures = config => {
|
|
|
71
73
|
optimisticActions,
|
|
72
74
|
customColumns,
|
|
73
75
|
onRowClick,
|
|
76
|
+
stickyColumns,
|
|
77
|
+
stickySelectionColumn,
|
|
74
78
|
// Grid specific features
|
|
75
79
|
imagePlacement,
|
|
76
80
|
preset,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","_useBaseTableFeatures","useTableGridSwitchFeatures","config","schema","useSchema","collectionId","limit","
|
|
1
|
+
{"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_SchemaContext","_useAutoPatternsOptimisticActions","_useBaseGridFeatures","_useBaseTableFeatures","useTableGridSwitchFeatures","config","schema","useSchema","collectionId","limit","reflectQueryInUrl","selectAllScope","selectionUpdateMode","collection","filterComponent","filtersObject","filtersMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","useBaseTableFeatures","fetchData","tableFetchData","useFetchData","collectionConfig","Array","from","Set","state","useTableGridSwitchCollection","queryName","itemKey","item","idField","itemName","displayField","toExtendedFields","extendedFields","fetchErrorMessage","err","String","persistQueryToUrl","disableAutoSelectAllCount","selectionConsistencyMode","optimisticActions","useAutoPatternsOptimisticActions","commonFeatures","useCommonCollectionFeatures","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useSchema } from '../providers/SchemaContext';\nimport { useAutoPatternsOptimisticActions } from './useAutoPatternsOptimisticActions';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const schema = useSchema();\n\n const {\n collectionId,\n limit,\n reflectQueryInUrl,\n selectAllScope,\n selectionUpdateMode,\n } = config.collection;\n\n const { filterComponent, filtersObject, filtersMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n } = useBaseTableFeatures(config);\n\n const { fetchData: tableFetchData } = useFetchData({\n collectionConfig: config.collection,\n visibleFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filtersMapping,\n });\n\n const state = useTableGridSwitchCollection<any>({\n queryName: `${collectionId}`,\n itemKey: (item) => item[schema.idField],\n itemName: (item) => item[schema.displayField],\n filters: filtersObject,\n toExtendedFields: (item) => item.extendedFields,\n fetchErrorMessage: ({ err }) => String(err),\n fetchData: tableFetchData,\n limit,\n persistQueryToUrl: reflectQueryInUrl,\n disableAutoSelectAllCount: selectAllScope === 'page',\n selectionConsistencyMode: selectionUpdateMode,\n });\n\n const optimisticActions = useAutoPatternsOptimisticActions(\n collectionId,\n state.collection,\n );\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n optimisticActions,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n optimisticActions,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,iCAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AAEO,MAAMQ,0BAA0B,GAAIC,MAA6B,IAAK;EAC3E,MAAMC,MAAM,GAAG,IAAAC,wBAAS,EAAC,CAAC;EAE1B,MAAM;IACJC,YAAY;IACZC,KAAK;IACLC,iBAAiB;IACjBC,cAAc;IACdC;EACF,CAAC,GAAGP,MAAM,CAACQ,UAAU;EAErB,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAe,CAAC,GAAG,IAAAC,sBAAU,EACnEZ,MAAM,CAACa,OACT,CAAC;EAED,MAAM;IACJC,MAAM;IACNC,cAAc;IACdC,eAAe,EAAEC,mBAAmB;IACpCC;EACF,CAAC,GAAG,IAAAC,wCAAmB,EAACnB,MAAM,CAAC;EAE/B,MAAM;IACJoB,aAAa;IACbJ,eAAe,EAAEK,oBAAoB;IACrCC,OAAO,EAAEC,YAAY;IACrBC,UAAU;IACVC,aAAa;IACbC;EACF,CAAC,GAAG,IAAAC,0CAAoB,EAAC3B,MAAM,CAAC;EAEhC,MAAM;IAAE4B,SAAS,EAAEC;EAAe,CAAC,GAAG,IAAAC,0BAAY,EAAC;IACjDC,gBAAgB,EAAE/B,MAAM,CAACQ,UAAU;IACnCQ,eAAe,EAAEgB,KAAK,CAACC,IAAI,CACzB,IAAIC,GAAG,CAAC,CAAC,GAAGb,oBAAoB,EAAE,GAAGJ,mBAAmB,CAAC,CAC3D,CAAC;IACDN;EACF,CAAC,CAAC;EAEF,MAAMwB,KAAK,GAAG,IAAAC,sCAA4B,EAAM;IAC9CC,SAAS,EAAE,GAAGlC,YAAY,EAAE;IAC5BmC,OAAO,EAAGC,IAAI,IAAKA,IAAI,CAACtC,MAAM,CAACuC,OAAO,CAAC;IACvCC,QAAQ,EAAGF,IAAI,IAAKA,IAAI,CAACtC,MAAM,CAACyC,YAAY,CAAC;IAC7C7B,OAAO,EAAEH,aAAa;IACtBiC,gBAAgB,EAAGJ,IAAI,IAAKA,IAAI,CAACK,cAAc;IAC/CC,iBAAiB,EAAEA,CAAC;MAAEC;IAAI,CAAC,KAAKC,MAAM,CAACD,GAAG,CAAC;IAC3ClB,SAAS,EAAEC,cAAc;IACzBzB,KAAK;IACL4C,iBAAiB,EAAE3C,iBAAiB;IACpC4C,yBAAyB,EAAE3C,cAAc,KAAK,MAAM;IACpD4C,wBAAwB,EAAE3C;EAC5B,CAAC,CAAC;EAEF,MAAM4C,iBAAiB,GAAG,IAAAC,kEAAgC,EACxDjD,YAAY,EACZgC,KAAK,CAAC3B,UACR,CAAC;EAED,MAAM6C,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAGtD,MAAM;IACTmD;EACF,CAAC,CAAC;EAEF,OAAO;IACL,GAAGE,cAAc;IACjBlB,KAAK;IACLb,OAAO,EAAEC,YAAY;IACrBV,OAAO,EAAEJ,eAAe;IACxB0C,iBAAiB;IACjB/B,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrB;IACAX,cAAc;IACdD,MAAM;IACNI;EACF,CAAC;AACH,CAAC;AAACqC,OAAA,CAAAxD,0BAAA,GAAAA,0BAAA","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","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {
|
|
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","PatternsWizardOverridesContext","createContext","undefined","PatternsWizardOverridesProvider","children","value","createElement","Provider","__self","__source","fileName","lineNumber","columnNumber","exports","usePatternsWizardOverridesContext","useContext"],"sources":["../../../src/providers/PatternsWizardOverridesContext.tsx"],"sourcesContent":["import React, { createContext, useContext, ReactNode } from 'react';\nimport {\n CustomComponentProps,\n EntityPageMoreActionsActionParams,\n IColumnValue,\n} from '../types';\nimport { CollectionConfig } from '@wix/patterns';\nimport { CustomActionParams, ResolvedAction } from '../utils/actions/types';\nimport { CollectionPageActionParams } from '../types/actions/collectionPageActions';\nimport { ActionCellActionParams } from '../types/actions/actionCell';\n\nexport interface PatternsWizardOverridesContextProps {\n actions?: Record<\n string,\n (\n props: CustomActionParams<\n | EntityPageMoreActionsActionParams\n | CollectionPageActionParams\n | ActionCellActionParams\n >,\n ) => ResolvedAction\n >;\n columns?: Record<string, (props: IColumnValue<any>) => void>;\n modals?: Record<string, React.FC<any>>;\n HeaderAddon?: React.FC;\n emptyState?: Record<string, () => void>;\n fetchData?: Record<string, CollectionConfig<any, any>['fetchData']>;\n components?: Record<string, React.FC<CustomComponentProps>>;\n}\n\nconst PatternsWizardOverridesContext = createContext<\n PatternsWizardOverridesContextProps | undefined\n>(undefined);\n\nexport const PatternsWizardOverridesProvider: React.FC<{\n children: ReactNode;\n value: PatternsWizardOverridesContextProps;\n}> = ({ children, value }) => {\n return (\n <PatternsWizardOverridesContext.Provider value={value}>\n {children}\n </PatternsWizardOverridesContext.Provider>\n );\n};\n\nexport const usePatternsWizardOverridesContext = ():\n | PatternsWizardOverridesContextProps\n | undefined => {\n return useContext(PatternsWizardOverridesContext);\n};\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;AA8BpE,MAAMW,8BAA8B,gBAAG,IAAAC,oBAAa,EAElDC,SAAS,CAAC;AAEL,MAAMC,+BAGX,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC5B,oBACE7B,MAAA,CAAAU,OAAA,CAAAoB,aAAA,CAACN,8BAA8B,CAACO,QAAQ;IAACF,KAAK,EAAEA,KAAM;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA/B,YAAA;MAAAgC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACnDR,QACsC,CAAC;AAE9C,CAAC;AAACS,OAAA,CAAAV,+BAAA,GAAAA,+BAAA;AAEK,MAAMW,iCAAiC,GAAGA,CAAA,KAEhC;EACf,OAAO,IAAAC,iBAAU,EAACf,8BAA8B,CAAC;AACnD,CAAC;AAACa,OAAA,CAAAC,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ComponentTypeEnum","exports"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface
|
|
1
|
+
{"version":3,"names":["ComponentTypeEnum","exports"],"sources":["../../../src/types/CollectionPageConfig.ts"],"sourcesContent":["import { CollectionToolbarFiltersProps } from '@wix/patterns';\nimport { DateRangeFilterMode, DateRangeOptions } from '@wix/patterns/core';\nimport { BaseCollectionConfig } from './types';\nimport {\n ActionCellConfig,\n BulkActionsConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n text: string;\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n text: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n route: {\n path: string;\n };\n title: CollectionPageTitle;\n subtitle?: CollectionPageSubtitle;\n actions?: {\n primaryActions?: CollectionPagePrimaryActions;\n secondaryActions?: CollectionPageSecondaryActions;\n };\n components: ComponentConfig[];\n}\n\nexport interface ComponentConfig extends BaseCollectionComponentConfig {\n layout: LayoutItemConfig[];\n}\n\nexport interface LayoutItemConfig {\n type: 'Table' | 'Grid';\n table?: TableSpecificConfig;\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n columns: ColumnsConfig;\n customColumns?: {\n enabled: boolean;\n };\n stickyColumns?: number;\n}\n\nexport interface GridSpecificConfig {\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport interface CollectionConfig extends BaseCollectionConfig {\n fetchData?: FetchData;\n limit?: number;\n reflectQueryInUrl?: boolean;\n selectAllScope?: 'page' | 'all';\n selectionUpdateMode?: 'preserve' | 'clear';\n}\n\nexport interface BaseCollectionComponentConfig {\n collection: CollectionConfig;\n entityPageId?: string;\n search?: { shown?: boolean };\n toolbarTitle?: ToolbarTitle;\n actionCell?: ActionCellConfig;\n emptyState?: EmptyState;\n filters?: FiltersConfig;\n bulkActionToolbar?: BulkActionsConfig;\n}\n\nexport interface ToolbarTitle {\n title: string;\n subtitle?: {\n text: string;\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n showTotal?: boolean;\n itemsLimit?: number;\n}\n\nexport interface Column {\n id: string;\n name: string;\n width: string;\n sortable?: boolean;\n defaultSortOrder?: 'asc' | 'desc';\n sortMode?: 'asc' | 'desc';\n defaultHidden?: boolean;\n hiddenFromCustomColumnsSelection?: boolean;\n hideable?: boolean;\n reorderDisabled?: boolean;\n}\n\nexport interface GridItem {\n titleFieldId: string;\n subtitleFieldId?: string;\n imageFieldId?: string;\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n title?: string;\n subtitle?: string;\n image?: {\n id: string;\n };\n addNewCta?: {\n id?: string;\n text?: string;\n };\n customCta?: {\n id?: string;\n };\n}\n\ninterface FetchData {\n id: string;\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\nexport type FilterOptionType =\n | 'checkbox'\n | 'inlineCheckbox'\n | 'radio'\n | 'select';\n\nexport enum ComponentTypeEnum {\n SINGLE = 'single',\n MULTI_SELECT = 'multi-select',\n RADIO_GROUP = 'radio-group',\n NUMBER = 'number',\n DATE_RANGE = 'date-range',\n}\n\nexport type FilterItems = Filter[];\nexport interface FiltersConfig {\n items: FilterItems;\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n mode?: DateRangeFilterMode;\n presets?: DateRangeOptions;\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n min?: number;\n max?: number;\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n trueLabel?: string;\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n options: FilterOption[];\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n id: string;\n fieldId: string;\n displayName?: string;\n sectionTitle?: string;\n openByDefault?: boolean;\n tagLabel?: string;\n numberConfig?: NumberFilterConfig;\n dateConfig?: DateFilterConfig;\n booleanConfig?: BooleanFilterConfig;\n enumConfig?: EnumFilterConfig;\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":";;;;IAoKYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/EntityPageConfig.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\n\nexport interface EntityPageConfig {\n route: {\n path: string;\n params: {\n id: string;\n };\n };\n title?: {\n text: string;\n };\n subtitle?: {\n text: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n collectionId: string;\n entityTypeSource: string;\n parentPageId?: string;\n layout?: {\n main: CardLayout[];\n sidebar?: CardLayout[];\n };\n}\n\nexport interface CardLayout {\n type: 'card';\n card: {\n title: {\n text: string;\n };\n subtitle?: {\n text: string;\n };\n children: LayoutContent[];\n };\n}\n\nexport type LayoutContent =\n | FieldContent\n | ContainerContent\n | ComponentItemContent;\n\ninterface FieldContent {\n type: 'field';\n field: {\n span?: number;\n fieldId: string;\n };\n}\n\ninterface ContainerContent {\n type: 'container';\n container: {\n span?: number;\n children: LayoutContent[];\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n span?: number;\n componentId: string;\n };\n}\n\nexport interface CustomComponentProps {\n entity?: Record<string, any>;\n form: UseFormReturn<FieldValues, any, undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/EntityPageConfig.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { EntityPageMoreActions } from './actions/entityPageActions';\n\nexport interface EntityPageConfig {\n route: {\n path: string;\n params: {\n id: string;\n };\n };\n title?: {\n text: string;\n };\n subtitle?: {\n text: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n collectionId: string;\n entityTypeSource: string;\n parentPageId?: string;\n layout?: {\n main: CardLayout[];\n sidebar?: CardLayout[];\n };\n moreActions?: EntityPageMoreActions;\n}\n\nexport interface CardLayout {\n type: 'card';\n card: {\n title: {\n text: string;\n };\n subtitle?: {\n text: string;\n };\n children: LayoutContent[];\n };\n}\n\nexport type LayoutContent =\n | FieldContent\n | ContainerContent\n | ComponentItemContent;\n\ninterface FieldContent {\n type: 'field';\n field: {\n span?: number;\n fieldId: string;\n };\n}\n\ninterface ContainerContent {\n type: 'container';\n container: {\n span?: number;\n children: LayoutContent[];\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n span?: number;\n componentId: string;\n };\n}\n\nexport interface CustomComponentProps {\n entity?: Record<string, any>;\n form: UseFormReturn<FieldValues, any, undefined>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/actionCell.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n CustomModalActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n} from './base';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomModalActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n item: ActionCellItemConfig;\n}\n\nexport interface ActionCellSecondaryActions {\n items: ActionCellItemConfig[];\n inlineCount?: number;\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n primaryAction?: ActionCellPrimaryAction;\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ActionCellActionParams {\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type BaseActionItemConfig = {\n id: string;\n label?: string;\n
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/base.ts"],"sourcesContent":["export type BaseActionItemConfig = {\n id: string;\n label?: string;\n};\n\nexport interface Feedback {\n successToast?: { text: string };\n errorToast?: { text: string };\n}\n\nexport interface BaseActionModal {\n title?: { text: string };\n actions?: {\n submit?: { text: string };\n cancel?: { text: string };\n };\n feedback?: Feedback;\n}\n\nexport interface ActionModalField {\n id: string;\n label?: string;\n}\n\nexport interface DeleteActionModal extends BaseActionModal {\n description?: { text: string };\n}\n\nexport interface BulkDeleteActionModal extends DeleteActionModal {}\n\nexport type BulkDeleteAction =\n | {\n mode: 'modal';\n modal: BulkDeleteActionModal;\n custom?: never;\n }\n | {\n mode: 'custom';\n custom: CustomAction;\n modal?: never;\n };\n\nexport type DeleteAction = {\n mode: 'modal';\n modal: DeleteActionModal;\n};\n\nexport interface BaseActionPage {\n id: string;\n}\n\nexport type CustomAction = {};\n\nexport type CustomModalAction = {\n id: string;\n};\n\nexport interface ActionModalWithFields extends BaseActionModal {\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 mode: 'page';\n page: UpdateActionPage;\n};\n\nexport type CreateAction = {\n mode: 'page';\n page: CreateActionPage;\n};\n\nexport type CreateActionConfig = BaseActionItemConfig & {\n type: 'create';\n create: CreateAction;\n};\n\nexport type UpdateActionConfig = BaseActionItemConfig & {\n type: 'update';\n update: UpdateAction;\n};\n\nexport type DeleteActionConfig = BaseActionItemConfig & {\n type: 'delete';\n delete: DeleteAction;\n};\n\nexport type BulkDeleteActionConfig = BaseActionItemConfig & {\n type: 'bulkDelete';\n bulkDelete: BulkDeleteAction;\n};\n\nexport type CustomModalActionConfig = BaseActionItemConfig & {\n type: 'customModal';\n customModal: CustomModalAction;\n};\n\nexport type CustomActionConfig = BaseActionItemConfig & {\n type: 'custom';\n custom: CustomAction;\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n CustomModalActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig =\n | BulkDeleteActionConfig\n | CustomModalActionConfig\n | CustomActionConfig;\n\
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/bulkActions.ts"],"sourcesContent":["import {\n BaseActionParams,\n CustomActionModalProps,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n BulkDeleteActionConfig,\n CustomActionConfig,\n CustomModalActionConfig,\n} from './base';\n\nexport type BulkActionItemConfig =\n | BulkDeleteActionConfig\n | CustomModalActionConfig\n | CustomActionConfig;\n\ntype BulkActionSingleItem = {\n type: 'single';\n single: {\n item: BulkActionItemConfig;\n };\n};\n\ntype BulkActionMultiItem = {\n type: 'multi';\n multi: {\n label: string;\n items: BulkActionItemConfig[];\n };\n};\n\nexport type BulkActionSectionItem = BulkActionItemConfig[];\n\nexport type BulkActionPrimaryItem = BulkActionSingleItem | BulkActionMultiItem;\nexport type BulkActionSecondaryItem = BulkActionSectionItem;\n\nexport interface BulkActionsConfig {\n primaryActions?: BulkActionPrimaryItem[];\n secondaryActions?: BulkActionSecondaryItem[];\n}\n\nexport interface BulkActionsActionParams {\n selectedValues: any[];\n total: number;\n}\n\nexport interface CustomBulkActionsActionParams extends BaseActionParams {\n actionParams: BulkActionsActionParams;\n}\nexport type CustomBulkActionsActionResolver = (\n params: CustomBulkActionsActionParams,\n) => ResolvedAction;\n\nexport interface CustomBulkActionsActionModalProps\n extends CustomActionModalProps {\n actionParams: BulkActionsActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/collectionPageActions.ts"],"sourcesContent":["import {\n CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CreateActionConfig,\n CustomActionConfig,\n CustomModalActionConfig,\n} from './base';\n\nexport type CollectionPageActionConfig = (\n | CreateActionConfig\n | CustomModalActionConfig\n | CustomActionConfig\n) & {\n collection: {\n collectionId: string;\n entityTypeSource: 'cms';\n };\n};\n\ntype CollectionPageSingleAction = {\n type: 'single';\n single: {\n item: CollectionPageActionConfig;\n };\n multi?: never;\n};\n\ntype CollectionPageMultiAction = {\n type: 'multi';\n multi: {\n label: string;\n items: CollectionPageActionConfig[];\n };\n single?: never;\n};\n\nexport type CollectionPagePrimaryActions =\n | CollectionPageSingleAction\n | CollectionPageMultiAction;\n\nexport type CollectionPageSecondaryActions =\n | CollectionPageSingleAction\n | CollectionPageMultiAction;\n\nexport interface CollectionPageActionParams {\n collectionId: string;\n}\n\nexport type CustomActionCollectionPageActionParams =\n CustomActionParams<CollectionPageActionParams>;\n\nexport type CustomActionCollectionPageActionResolver = (\n params: CustomActionCollectionPageActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCollectionPageActionModalProps\n extends CustomActionModalProps {\n actionParams: CollectionPageActionParams;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/types/actions/entityPageActions.ts"],"sourcesContent":["import { FieldValues, UseFormReturn } from '@wix/patterns/form';\nimport { CustomActionParams, ResolvedAction } from '../..';\nimport { CustomActionConfig } from './base';\n\nexport type EntityPageActionConfig = CustomActionConfig;\n\nexport type EntityPageMoreActions = EntityPageActionConfig[][];\n\nexport interface EntityPageMoreActionsActionParams {\n entity: any;\n form: UseFormReturn<FieldValues, any, undefined>;\n}\n\nexport type CustomEntityPageMoreActionsActionParams =\n CustomActionParams<EntityPageMoreActionsActionParams>;\n\nexport type CustomEntityPageMoreActionsActionResolver = (\n params: CustomEntityPageMoreActionsActionParams,\n) => ResolvedAction;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -25,4 +25,10 @@ Object.keys(_collectionPageActions).forEach(function (key) {
|
|
|
25
25
|
if (key in exports && exports[key] === _collectionPageActions[key]) return;
|
|
26
26
|
exports[key] = _collectionPageActions[key];
|
|
27
27
|
});
|
|
28
|
+
var _entityPageActions = require("./entityPageActions");
|
|
29
|
+
Object.keys(_entityPageActions).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _entityPageActions[key]) return;
|
|
32
|
+
exports[key] = _entityPageActions[key];
|
|
33
|
+
});
|
|
28
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_base","require","Object","keys","forEach","key","exports","_actionCell","_bulkActions","_collectionPageActions"],"sources":["../../../../src/types/actions/index.ts"],"sourcesContent":["export * from './base';\nexport * from './actionCell';\nexport * from './bulkActions';\nexport * from './collectionPageActions';\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,sBAAA,GAAAR,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAM,sBAAA,EAAAL,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAI,sBAAA,CAAAJ,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAI,sBAAA,CAAAJ,GAAA;AAAA","ignoreList":[]}
|
|
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,sBAAA,GAAAR,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAM,sBAAA,EAAAL,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAI,sBAAA,CAAAJ,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAI,sBAAA,CAAAJ,GAAA;AAAA;AACA,IAAAK,kBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,kBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,kBAAA,CAAAL,GAAA;EAAAC,OAAA,CAAAD,GAAA,IAAAK,kBAAA,CAAAL,GAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\n\nexport interface BaseCollectionConfig {\n collectionId: string;\n entityTypeSource: 'cms';\n}\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n imageField?: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/types/types.ts"],"sourcesContent":["import { EntityPageConfig } from './EntityPageConfig';\nimport { CollectionPageConfig } from './CollectionPageConfig';\n\nexport interface BaseCollectionConfig {\n collectionId: string;\n entityTypeSource: 'cms';\n}\n\nexport type PatternsFieldType =\n | 'SHORT_TEXT'\n | 'LONG_TEXT'\n | 'NUMBER'\n | 'BOOLEAN'\n | 'DATE'\n | 'DATETIME'\n | 'URL'\n | 'ARRAY'\n | 'REFERENCE'\n | 'IMAGE';\n\nexport interface AppConfig {\n pages: PageConfig[];\n}\n\nexport interface BasePageConfig {\n id: string;\n appMainPage?: boolean;\n}\n\nexport interface CollectionPageConfigType extends BasePageConfig {\n type: 'collectionPage';\n collectionPage: CollectionPageConfig;\n entityPage?: never;\n}\n\nexport interface EntityPageConfigType extends BasePageConfig {\n type: 'entityPage';\n entityPage: EntityPageConfig;\n collectionPage?: never;\n}\n\nexport type PageConfig = CollectionPageConfigType | EntityPageConfigType;\n\nexport type EntityProps = { [key: string]: any };\n\nexport interface IMenuItem<T extends EntityProps = any> {\n item: T;\n}\nexport interface IColumnValue<T> {\n value: T;\n row: Record<string, any>;\n}\n\nexport type QueryOperator =\n | 'CONTAINS'\n | 'ENDS_WITH'\n | 'EQ'\n | 'EXISTS'\n | 'GT'\n | 'GTE'\n | 'HAS_ALL'\n | 'HAS_SOME'\n | 'LT'\n | 'LTE'\n | 'NE'\n | 'STARTS_WITH'\n | 'URLIZED';\n\ninterface BaseField {\n id: string;\n displayName: string;\n validation?: {\n numberRange?: NumberRange;\n stringLengthRange?: StringLengthRange;\n required: boolean;\n };\n capabilities: {\n supportedQueryOperators: QueryOperator[];\n sortable: boolean;\n };\n}\n\nexport interface ReferenceField extends BaseField {\n type: 'REFERENCE';\n referenceMetadata: {\n referencedCollectionId: string;\n };\n}\n\nexport interface NonReferenceField extends BaseField {\n type: Exclude<PatternsFieldType, 'REFERENCE'>;\n}\n\nexport type Field = ReferenceField | NonReferenceField;\n\nexport interface NumberRange {\n min?: number;\n max?: number;\n}\nexport interface StringLengthRange {\n minLength?: number;\n maxLength?: number;\n}\n\nexport interface SchemaConfig {\n id: string;\n fields: Record<string, Field | undefined>;\n displayField: string;\n idField: string;\n imageField?: string;\n actions: {\n get: (entityId: string) => Promise<any>;\n create: (newEntity: Partial<any>) => Promise<any>;\n update: (updatedEntity: any) => Promise<any>;\n delete: (entityId: string) => Promise<any>;\n bulkDelete: (entityIds: string[]) => Promise<any>;\n };\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
exports.__esModule = true;
|
|
4
5
|
exports.bulkDeleteAction = void 0;
|
|
6
|
+
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/utils/actions/bulkDeleteAction.tsx";
|
|
5
9
|
const bulkDeleteAction = params => {
|
|
6
10
|
const {
|
|
7
11
|
action,
|
|
@@ -19,7 +23,14 @@ const bulkDeleteAction = params => {
|
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
label: 'Delete',
|
|
22
|
-
icon:
|
|
26
|
+
icon: /*#__PURE__*/_react.default.createElement(_wixUiIconsCommon.Delete, {
|
|
27
|
+
__self: void 0,
|
|
28
|
+
__source: {
|
|
29
|
+
fileName: _jsxFileName,
|
|
30
|
+
lineNumber: 18,
|
|
31
|
+
columnNumber: 11
|
|
32
|
+
}
|
|
33
|
+
})
|
|
23
34
|
};
|
|
24
35
|
};
|
|
25
36
|
exports.bulkDeleteAction = bulkDeleteAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["bulkDeleteAction","params","action","sdk","actionParams","onClick","bulkDelete","mode","openModal","modalParams","modal","label","icon","exports"],"sources":["../../../../src/utils/actions/bulkDeleteAction.
|
|
1
|
+
{"version":3,"names":["_wixUiIconsCommon","require","_react","_interopRequireDefault","_jsxFileName","bulkDeleteAction","params","action","sdk","actionParams","onClick","bulkDelete","mode","openModal","modalParams","modal","label","icon","default","createElement","Delete","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../../src/utils/actions/bulkDeleteAction.tsx"],"sourcesContent":["import { BulkDeleteActionParams } from './types';\nimport { Delete } from '@wix/wix-ui-icons-common';\nimport React from 'react';\n\nexport const bulkDeleteAction = (params: BulkDeleteActionParams) => {\n const { action, sdk, actionParams } = params;\n return {\n onClick: () => {\n if (action.bulkDelete.mode === 'modal') {\n sdk.openModal('BulkDeleteModal', {\n modalParams: action.bulkDelete.modal,\n actionParams,\n sdk,\n });\n }\n },\n label: 'Delete',\n icon: <Delete />,\n };\n};\n"],"mappings":";;;;;AACA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0B,IAAAG,YAAA;AAEnB,MAAMC,gBAAgB,GAAIC,MAA8B,IAAK;EAClE,MAAM;IAAEC,MAAM;IAAEC,GAAG;IAAEC;EAAa,CAAC,GAAGH,MAAM;EAC5C,OAAO;IACLI,OAAO,EAAEA,CAAA,KAAM;MACb,IAAIH,MAAM,CAACI,UAAU,CAACC,IAAI,KAAK,OAAO,EAAE;QACtCJ,GAAG,CAACK,SAAS,CAAC,iBAAiB,EAAE;UAC/BC,WAAW,EAAEP,MAAM,CAACI,UAAU,CAACI,KAAK;UACpCN,YAAY;UACZD;QACF,CAAC,CAAC;MACJ;IACF,CAAC;IACDQ,KAAK,EAAE,QAAQ;IACfC,IAAI,eAAEf,MAAA,CAAAgB,OAAA,CAAAC,aAAA,CAACnB,iBAAA,CAAAoB,MAAM;MAAAC,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAAnB,YAAA;QAAAoB,UAAA;QAAAC,YAAA;MAAA;IAAA,CAAE;EACjB,CAAC;AACH,CAAC;AAACC,OAAA,CAAArB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|