@wix/auto-patterns 1.29.0 → 1.31.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.
Files changed (107) hide show
  1. package/dist/cjs/hooks/index.js +0 -7
  2. package/dist/cjs/hooks/index.js.map +1 -1
  3. package/dist/cjs/hooks/useActionsSDK.js +7 -2
  4. package/dist/cjs/hooks/useActionsSDK.js.map +1 -1
  5. package/dist/cjs/hooks/useAppContextSync.js +24 -0
  6. package/dist/cjs/hooks/useAppContextSync.js.map +1 -0
  7. package/dist/cjs/hooks/useGridFeatures.js +10 -2
  8. package/dist/cjs/hooks/useGridFeatures.js.map +1 -1
  9. package/dist/cjs/hooks/useTableFeatures.js +10 -2
  10. package/dist/cjs/hooks/useTableFeatures.js.map +1 -1
  11. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +10 -2
  12. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +1 -1
  13. package/dist/cjs/providers/AppContext.js +10 -8
  14. package/dist/cjs/providers/AppContext.js.map +1 -1
  15. package/dist/cjs/providers/AppContextData.js +40 -0
  16. package/dist/cjs/providers/AppContextData.js.map +1 -0
  17. package/dist/cjs/providers/ItemsContext.js +14 -11
  18. package/dist/cjs/providers/ItemsContext.js.map +1 -1
  19. package/dist/cjs/providers/index.js +7 -0
  20. package/dist/cjs/providers/index.js.map +1 -1
  21. package/dist/cjs/types/CollectionPageConfig.js.map +1 -1
  22. package/dist/cjs/types/EntityPageConfig.js.map +1 -1
  23. package/dist/cjs/types/actions/actionCell.js.map +1 -1
  24. package/dist/cjs/types/actions/base.js.map +1 -1
  25. package/dist/cjs/types/actions/bulkActions.js.map +1 -1
  26. package/dist/cjs/types/actions/collectionPageActions.js.map +1 -1
  27. package/dist/cjs/types/actions/entityPageActions.js.map +1 -1
  28. package/dist/cjs/types/fetchData.js.map +1 -1
  29. package/dist/cjs/types/types.js.map +1 -1
  30. package/dist/cjs/utils/actions/types.js.map +1 -1
  31. package/dist/docs/app_context.md +64 -0
  32. package/dist/docs/auto-patterns-guide.md +69 -0
  33. package/dist/docs/sdk_utilities.md +5 -0
  34. package/dist/esm/hooks/index.js +0 -1
  35. package/dist/esm/hooks/index.js.map +1 -1
  36. package/dist/esm/hooks/useActionsSDK.js +7 -2
  37. package/dist/esm/hooks/useActionsSDK.js.map +1 -1
  38. package/dist/esm/hooks/useAppContextSync.js +19 -0
  39. package/dist/esm/hooks/useAppContextSync.js.map +1 -0
  40. package/dist/esm/hooks/useGridFeatures.js +10 -2
  41. package/dist/esm/hooks/useGridFeatures.js.map +1 -1
  42. package/dist/esm/hooks/useTableFeatures.js +10 -2
  43. package/dist/esm/hooks/useTableFeatures.js.map +1 -1
  44. package/dist/esm/hooks/useTableGridSwitchFeatures.js +10 -2
  45. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +1 -1
  46. package/dist/esm/providers/AppContext.js +7 -5
  47. package/dist/esm/providers/AppContext.js.map +1 -1
  48. package/dist/esm/providers/AppContextData.js +26 -0
  49. package/dist/esm/providers/AppContextData.js.map +1 -0
  50. package/dist/esm/providers/ItemsContext.js +10 -7
  51. package/dist/esm/providers/ItemsContext.js.map +1 -1
  52. package/dist/esm/providers/index.js +1 -0
  53. package/dist/esm/providers/index.js.map +1 -1
  54. package/dist/esm/types/CollectionPageConfig.js.map +1 -1
  55. package/dist/esm/types/EntityPageConfig.js.map +1 -1
  56. package/dist/esm/types/actions/actionCell.js.map +1 -1
  57. package/dist/esm/types/actions/base.js.map +1 -1
  58. package/dist/esm/types/actions/bulkActions.js.map +1 -1
  59. package/dist/esm/types/actions/collectionPageActions.js.map +1 -1
  60. package/dist/esm/types/actions/entityPageActions.js.map +1 -1
  61. package/dist/esm/types/fetchData.js.map +1 -1
  62. package/dist/esm/types/types.js.map +1 -1
  63. package/dist/esm/utils/actions/types.js.map +1 -1
  64. package/dist/types/hooks/index.d.ts +0 -1
  65. package/dist/types/hooks/index.d.ts.map +1 -1
  66. package/dist/types/hooks/useActionsSDK.d.ts.map +1 -1
  67. package/dist/types/hooks/useAppContextSync.d.ts +2 -0
  68. package/dist/types/hooks/useAppContextSync.d.ts.map +1 -0
  69. package/dist/types/hooks/useEntityPageHeaderTexts.d.ts.map +1 -1
  70. package/dist/types/hooks/useGridFeatures.d.ts.map +1 -1
  71. package/dist/types/hooks/useTableFeatures.d.ts.map +1 -1
  72. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +1 -1
  73. package/dist/types/providers/AppContext.d.ts +2 -2
  74. package/dist/types/providers/AppContext.d.ts.map +1 -1
  75. package/dist/types/providers/AppContextData.d.ts +13 -0
  76. package/dist/types/providers/AppContextData.d.ts.map +1 -0
  77. package/dist/types/providers/ItemsContext.d.ts +6 -4
  78. package/dist/types/providers/ItemsContext.d.ts.map +1 -1
  79. package/dist/types/providers/index.d.ts +1 -0
  80. package/dist/types/providers/index.d.ts.map +1 -1
  81. package/dist/types/types/CollectionPageConfig.d.ts +315 -0
  82. package/dist/types/types/CollectionPageConfig.d.ts.map +1 -1
  83. package/dist/types/types/EntityPageConfig.d.ts +111 -0
  84. package/dist/types/types/EntityPageConfig.d.ts.map +1 -1
  85. package/dist/types/types/actions/actionCell.d.ts +41 -0
  86. package/dist/types/types/actions/actionCell.d.ts.map +1 -1
  87. package/dist/types/types/actions/base.d.ts +84 -0
  88. package/dist/types/types/actions/base.d.ts.map +1 -1
  89. package/dist/types/types/actions/bulkActions.d.ts +40 -0
  90. package/dist/types/types/actions/bulkActions.d.ts.map +1 -1
  91. package/dist/types/types/actions/collectionPageActions.d.ts +30 -0
  92. package/dist/types/types/actions/collectionPageActions.d.ts.map +1 -1
  93. package/dist/types/types/actions/entityPageActions.d.ts +25 -0
  94. package/dist/types/types/actions/entityPageActions.d.ts.map +1 -1
  95. package/dist/types/types/fetchData.d.ts +35 -0
  96. package/dist/types/types/fetchData.d.ts.map +1 -1
  97. package/dist/types/types/types.d.ts +107 -0
  98. package/dist/types/types/types.d.ts.map +1 -1
  99. package/dist/types/utils/actions/types.d.ts +1 -0
  100. package/dist/types/utils/actions/types.d.ts.map +1 -1
  101. package/package.json +12 -12
  102. package/dist/cjs/hooks/useUpdateAppContextItems.js +0 -18
  103. package/dist/cjs/hooks/useUpdateAppContextItems.js.map +0 -1
  104. package/dist/esm/hooks/useUpdateAppContextItems.js +0 -13
  105. package/dist/esm/hooks/useUpdateAppContextItems.js.map +0 -1
  106. package/dist/types/hooks/useUpdateAppContextItems.d.ts +0 -2
  107. package/dist/types/hooks/useUpdateAppContextItems.d.ts.map +0 -1
@@ -47,13 +47,6 @@ Object.keys(_useEntityPageHeaderTexts).forEach(function (key) {
47
47
  if (key in exports && exports[key] === _useEntityPageHeaderTexts[key]) return;
48
48
  exports[key] = _useEntityPageHeaderTexts[key];
49
49
  });
50
- var _useUpdateAppContextItems = require("./useUpdateAppContextItems");
51
- Object.keys(_useUpdateAppContextItems).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
54
- if (key in exports && exports[key] === _useUpdateAppContextItems[key]) return;
55
- exports[key] = _useUpdateAppContextItems[key];
56
- });
57
50
  var _AppContext = require("../providers/AppContext");
58
51
  exports.useAppContext = _AppContext.useAppContext;
59
52
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_useTableFeatures","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_useFilters","_useGridFeatures","_useNavigationUtils","_usePagePath","_useEntityPageHeaderTexts","_useUpdateAppContextItems","_AppContext","useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useTableFeatures';\nexport * from './useFilters';\nexport * from './useGridFeatures';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport * from './useUpdateAppContextItems';\nexport { useAppContext } from '../providers/AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAA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AAA,CAAAL,GAAA,IAAAW,yBAAA,CAAAX,GAAA;AAAA;AACA,IAAAY,WAAA,GAAAhB,OAAA;AAAwDS,OAAA,CAAAQ,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useTableFeatures","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_useFilters","_useGridFeatures","_useNavigationUtils","_usePagePath","_useEntityPageHeaderTexts","_AppContext","useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useTableFeatures';\nexport * from './useFilters';\nexport * from './useGridFeatures';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport { useAppContext } from '../providers/AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,iBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,iBAAA,CAAAK,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAL,iBAAA,CAAAK,GAAA;AAAA;AACA,IAAAM,WAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,WAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAM,WAAA,CAAAN,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAM,WAAA,CAAAN,GAAA;AAAA;AACA,IAAAO,gBA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MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,yBAAA,CAAAV,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAU,yBAAA,CAAAV,GAAA;AAAA;AACA,IAAAW,WAAA,GAAAf,OAAA;AAAwDS,OAAA,CAAAO,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
@@ -6,6 +6,7 @@ var _react = require("react");
6
6
  var _providers = require("../providers");
7
7
  var _useBaseSDK = require("./useBaseSDK");
8
8
  var _OptimisticActionsContext = require("../providers/OptimisticActionsContext");
9
+ var _AppContext = require("../providers/AppContext");
9
10
  const useActionsSDK = ({
10
11
  collectionId
11
12
  }) => {
@@ -15,6 +16,9 @@ const useActionsSDK = ({
15
16
  const {
16
17
  getOptimisticActions
17
18
  } = (0, _OptimisticActionsContext.useOptimisticActionsContext)();
19
+ const {
20
+ refreshCollection
21
+ } = (0, _AppContext.useAppContext)();
18
22
  const baseSDK = (0, _useBaseSDK.useBaseSDK)();
19
23
  /* eslint-disable react-hooks/exhaustive-deps */
20
24
  // disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,
@@ -23,8 +27,9 @@ const useActionsSDK = ({
23
27
  // TODO: Why spread and not sdk.app/base.openModal ... instead
24
28
  getSchema,
25
29
  collectionId,
26
- getOptimisticActions
27
- }), [getSchema, collectionId, getOptimisticActions, baseSDK]);
30
+ getOptimisticActions,
31
+ refreshCollection
32
+ }), [getSchema, collectionId, getOptimisticActions, baseSDK, refreshCollection]);
28
33
 
29
34
  /* eslint-enable react-hooks/exhaustive-deps */
30
35
 
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_providers","_useBaseSDK","_OptimisticActionsContext","useActionsSDK","collectionId","getSchema","useSchemaRegistry","getOptimisticActions","useOptimisticActionsContext","baseSDK","useBaseSDK","sdk","useMemo","exports"],"sources":["../../../src/hooks/useActionsSDK.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSchemaRegistry } from '../providers';\nimport { ActionsSDK } from '../utils/actions/types';\nimport { useBaseSDK } from './useBaseSDK';\nimport { useOptimisticActionsContext } from '../providers/OptimisticActionsContext';\n\nexport interface ActionsSDKParams {\n collectionId: string;\n}\n\nexport const useActionsSDK = ({ collectionId }: ActionsSDKParams) => {\n const { getSchema } = useSchemaRegistry();\n\n const { getOptimisticActions } = useOptimisticActionsContext();\n\n const baseSDK = useBaseSDK();\n /* eslint-disable react-hooks/exhaustive-deps */\n // disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,\n const sdk = useMemo<ActionsSDK>(\n () => ({\n ...baseSDK, // TODO: Why spread and not sdk.app/base.openModal ... instead\n getSchema,\n collectionId,\n getOptimisticActions,\n }),\n [getSchema, collectionId, getOptimisticActions, baseSDK],\n );\n\n /* eslint-enable react-hooks/exhaustive-deps */\n\n return sdk;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AAMO,MAAMI,aAAa,GAAGA,CAAC;EAAEC;AAA+B,CAAC,KAAK;EACnE,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,4BAAiB,EAAC,CAAC;EAEzC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,qDAA2B,EAAC,CAAC;EAE9D,MAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAC,CAAC;EAC5B;EACA;EACA,MAAMC,GAAG,GAAG,IAAAC,cAAO,EACjB,OAAO;IACL,GAAGH,OAAO;IAAE;IACZJ,SAAS;IACTD,YAAY;IACZG;EACF,CAAC,CAAC,EACF,CAACF,SAAS,EAAED,YAAY,EAAEG,oBAAoB,EAAEE,OAAO,CACzD,CAAC;;EAED;;EAEA,OAAOE,GAAG;AACZ,CAAC;AAACE,OAAA,CAAAV,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_providers","_useBaseSDK","_OptimisticActionsContext","_AppContext","useActionsSDK","collectionId","getSchema","useSchemaRegistry","getOptimisticActions","useOptimisticActionsContext","refreshCollection","useAppContext","baseSDK","useBaseSDK","sdk","useMemo","exports"],"sources":["../../../src/hooks/useActionsSDK.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useSchemaRegistry } from '../providers';\nimport { ActionsSDK } from '../utils/actions/types';\nimport { useBaseSDK } from './useBaseSDK';\nimport { useOptimisticActionsContext } from '../providers/OptimisticActionsContext';\nimport { useAppContext } from '../providers/AppContext';\n\nexport interface ActionsSDKParams {\n collectionId: string;\n}\n\nexport const useActionsSDK = ({ collectionId }: ActionsSDKParams) => {\n const { getSchema } = useSchemaRegistry();\n\n const { getOptimisticActions } = useOptimisticActionsContext();\n\n const { refreshCollection } = useAppContext();\n\n const baseSDK = useBaseSDK();\n /* eslint-disable react-hooks/exhaustive-deps */\n // disabled because bug in Patterns that navigateToEntityPage isn't wrapped with useCallback,\n const sdk = useMemo<ActionsSDK>(\n () => ({\n ...baseSDK, // TODO: Why spread and not sdk.app/base.openModal ... instead\n getSchema,\n collectionId,\n getOptimisticActions,\n refreshCollection,\n }),\n [getSchema, collectionId, getOptimisticActions, baseSDK, refreshCollection],\n );\n\n /* eslint-enable react-hooks/exhaustive-deps */\n\n return sdk;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,yBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAMO,MAAMK,aAAa,GAAGA,CAAC;EAAEC;AAA+B,CAAC,KAAK;EACnE,MAAM;IAAEC;EAAU,CAAC,GAAG,IAAAC,4BAAiB,EAAC,CAAC;EAEzC,MAAM;IAAEC;EAAqB,CAAC,GAAG,IAAAC,qDAA2B,EAAC,CAAC;EAE9D,MAAM;IAAEC;EAAkB,CAAC,GAAG,IAAAC,yBAAa,EAAC,CAAC;EAE7C,MAAMC,OAAO,GAAG,IAAAC,sBAAU,EAAC,CAAC;EAC5B;EACA;EACA,MAAMC,GAAG,GAAG,IAAAC,cAAO,EACjB,OAAO;IACL,GAAGH,OAAO;IAAE;IACZN,SAAS;IACTD,YAAY;IACZG,oBAAoB;IACpBE;EACF,CAAC,CAAC,EACF,CAACJ,SAAS,EAAED,YAAY,EAAEG,oBAAoB,EAAEI,OAAO,EAAEF,iBAAiB,CAC5E,CAAC;;EAED;;EAEA,OAAOI,GAAG;AACZ,CAAC;AAACE,OAAA,CAAAZ,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.useAppContextSync = void 0;
5
+ var _react = require("react");
6
+ var _AppContextData = require("../providers/AppContextData");
7
+ const useAppContextSync = (items, refreshCollection) => {
8
+ const {
9
+ setItems,
10
+ setRefreshCollection
11
+ } = (0, _AppContextData.useAppContextData)();
12
+ (0, _react.useEffect)(() => {
13
+ if (items) {
14
+ setItems(items);
15
+ }
16
+ }, [items, setItems]);
17
+ (0, _react.useEffect)(() => {
18
+ if (refreshCollection) {
19
+ setRefreshCollection(refreshCollection);
20
+ }
21
+ }, [refreshCollection, setRefreshCollection]);
22
+ };
23
+ exports.useAppContextSync = useAppContextSync;
24
+ //# sourceMappingURL=useAppContextSync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_AppContextData","useAppContextSync","items","refreshCollection","setItems","setRefreshCollection","useAppContextData","useEffect","exports"],"sources":["../../../src/hooks/useAppContextSync.ts"],"sourcesContent":["import { useEffect } from 'react';\nimport { useAppContextData } from '../providers/AppContextData';\n\nexport const useAppContextSync = (\n items: any[],\n refreshCollection: () => void,\n) => {\n const { setItems, setRefreshCollection } = useAppContextData();\n\n useEffect(() => {\n if (items) {\n setItems(items);\n }\n }, [items, setItems]);\n\n useEffect(() => {\n if (refreshCollection) {\n setRefreshCollection(refreshCollection);\n }\n }, [refreshCollection, setRefreshCollection]);\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEO,MAAME,iBAAiB,GAAGA,CAC/BC,KAAY,EACZC,iBAA6B,KAC1B;EACH,MAAM;IAAEC,QAAQ;IAAEC;EAAqB,CAAC,GAAG,IAAAC,iCAAiB,EAAC,CAAC;EAE9D,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAIL,KAAK,EAAE;MACTE,QAAQ,CAACF,KAAK,CAAC;IACjB;EACF,CAAC,EAAE,CAACA,KAAK,EAAEE,QAAQ,CAAC,CAAC;EAErB,IAAAG,gBAAS,EAAC,MAAM;IACd,IAAIJ,iBAAiB,EAAE;MACrBE,oBAAoB,CAACF,iBAAiB,CAAC;IACzC;EACF,CAAC,EAAE,CAACA,iBAAiB,EAAEE,oBAAoB,CAAC,CAAC;AAC/C,CAAC;AAACG,OAAA,CAAAP,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -8,7 +8,8 @@ var _useCommonCollectionFeatures = require("./useCommonCollectionFeatures");
8
8
  var _useFilters = require("./useFilters");
9
9
  var _useBaseGridFeatures = require("./useBaseGridFeatures");
10
10
  var _useBaseCollectionParams = require("./useBaseCollectionParams");
11
- var _useUpdateAppContextItems = require("./useUpdateAppContextItems");
11
+ var _useAppContextSync = require("./useAppContextSync");
12
+ var _react = require("react");
12
13
  const useGridFeatures = configuration => {
13
14
  const {
14
15
  renderItem,
@@ -34,7 +35,14 @@ const useGridFeatures = configuration => {
34
35
  });
35
36
  const state = (0, _patterns.useGridCollection)(params);
36
37
  const items = (0, _patterns.useSelector)(() => state.collection.result.items);
37
- (0, _useUpdateAppContextItems.useUpdateAppContextItems)(items);
38
+ const refreshCollection = (0, _react.useCallback)(() => {
39
+ return () => {
40
+ return state.collection.clearResultAndMoveToStart({
41
+ force: true
42
+ });
43
+ };
44
+ }, [state.collection]);
45
+ (0, _useAppContextSync.useAppContextSync)(items, refreshCollection);
38
46
  const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
39
47
  ...configuration,
40
48
  collectionState: state.collection
@@ -1 +1 @@
1
- {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseGridFeatures","_useBaseCollectionParams","_useUpdateAppContextItems","useGridFeatures","configuration","renderItem","imagePlacement","preset","visibleFieldIds","useBaseGridFeatures","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","fetchData","useFetchData","searchableFieldIds","params","useBaseCollectionParams","config","collection","state","useGridCollection","items","useSelector","result","useUpdateAppContextItems","commonFeatures","useCommonCollectionFeatures","collectionState","exports"],"sources":["../../../src/hooks/useGridFeatures.tsx"],"sourcesContent":["import { GridConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useGridCollection, useSelector } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useUpdateAppContextItems } from './useUpdateAppContextItems';\n\nexport const useGridFeatures = (configuration: GridConfig) => {\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(configuration);\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useGridCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n useUpdateAppContextItems(items);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n imagePlacement,\n preset,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AAA,CAAA5B,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseGridFeatures","_useBaseCollectionParams","_useAppContextSync","_react","useGridFeatures","configuration","renderItem","imagePlacement","preset","visibleFieldIds","useBaseGridFeatures","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","fetchData","useFetchData","searchableFieldIds","params","useBaseCollectionParams","config","collection","state","useGridCollection","items","useSelector","result","refreshCollection","useCallback","clearResultAndMoveToStart","force","useAppContextSync","commonFeatures","useCommonCollectionFeatures","collectionState","exports"],"sources":["../../../src/hooks/useGridFeatures.tsx"],"sourcesContent":["import { GridConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useGridCollection, useSelector } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useGridFeatures = (configuration: GridConfig) => {\n const { renderItem, imagePlacement, preset, visibleFieldIds } =\n useBaseGridFeatures(configuration);\n\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useGridCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n imagePlacement,\n preset,\n renderItem,\n filters: filterComponent,\n };\n};\n"],"mappings":";;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Ac,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAG7B,aAAa;IAChB8B,eAAe,EAAEZ,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGW,cAAc;IACjBV,KAAK;IACLhB,cAAc;IACdC,MAAM;IACNF,UAAU;IACVS,OAAO,EAAEJ;EACX,CAAC;AACH,CAAC;AAACyB,OAAA,CAAAhC,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -9,7 +9,8 @@ var _useFilters = require("./useFilters");
9
9
  var _useBaseTableFeatures = require("./useBaseTableFeatures");
10
10
  var _AutoPatternsOverridesContext = require("../providers/AutoPatternsOverridesContext");
11
11
  var _useBaseCollectionParams = require("./useBaseCollectionParams");
12
- var _useUpdateAppContextItems = require("./useUpdateAppContextItems");
12
+ var _useAppContextSync = require("./useAppContextSync");
13
+ var _react = require("react");
13
14
  const useTableFeatures = configuration => {
14
15
  var _configuration$sectio, _overrides$sections;
15
16
  const {
@@ -40,7 +41,14 @@ const useTableFeatures = configuration => {
40
41
  });
41
42
  const state = (0, _patterns.useTableCollection)(params);
42
43
  const items = (0, _patterns.useSelector)(() => state.collection.result.items);
43
- (0, _useUpdateAppContextItems.useUpdateAppContextItems)(items);
44
+ const refreshCollection = (0, _react.useCallback)(() => {
45
+ return () => {
46
+ return state.collection.clearResultAndMoveToStart({
47
+ force: true
48
+ });
49
+ };
50
+ }, [state.collection]);
51
+ (0, _useAppContextSync.useAppContextSync)(items, refreshCollection);
44
52
  const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
45
53
  ...configuration,
46
54
  collectionState: state.collection
@@ -1 +1 @@
1
- {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseTableFeatures","_AutoPatternsOverridesContext","_useBaseCollectionParams","_useUpdateAppContextItems","useTableFeatures","configuration","_configuration$sectio","_overrides$sections","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","useFetchData","searchableFieldIds","overrides","useAutoPatternsOverridesContext","params","useBaseCollectionParams","config","collection","state","useTableCollection","items","useSelector","result","useUpdateAppContextItems","commonFeatures","useCommonCollectionFeatures","collectionState","sections","id","renderSection","TableSections","undefined","exports"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useSelector, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useAutoPatternsOverridesContext } from '../providers/AutoPatternsOverridesContext';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useUpdateAppContextItems } from './useUpdateAppContextItems';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const overrides = useAutoPatternsOverridesContext();\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n useUpdateAppContextItems(items);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n };\n};\n"],"mappings":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MU,QAAQ,GACZ,CAAAjC,qBAAA,GAAAD,aAAa,CAACkC,QAAQ,aAAtBjC,qBAAA,CAAwBkC,EAAE,IAC1BhB,SAAS,aAAAjB,mBAAA,GAATiB,SAAS,CAAEe,QAAQ,aAAnBhC,mBAAA,CAAsBF,aAAa,CAACkC,QAAQ,CAACC,EAAE,CAAC,GAC5C;IACEC,aAAa,EAAEjB,SAAS,CAACe,QAAQ,CAAClC,aAAa,CAACkC,QAAQ,CAACC,EAAE,CAAC;IAC5DE,aAAa,EAAbA;EACF,CAAC,GACDC,SAAS;EAEf,OAAO;IACL,GAAGP,cAAc;IACjBN,KAAK;IACLf,OAAO;IACPH,OAAO,EAAEJ,eAAe;IACxBK,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZoB;EACF,CAAC;AACH,CAAC;AAACK,OAAA,CAAAxC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseTableFeatures","_AutoPatternsOverridesContext","_useBaseCollectionParams","_useAppContextSync","_react","useTableFeatures","configuration","_configuration$sectio","_overrides$sections","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","customColumns","visibleFieldIds","columns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","useFetchData","searchableFieldIds","overrides","useAutoPatternsOverridesContext","params","useBaseCollectionParams","config","collection","state","useTableCollection","items","useSelector","result","refreshCollection","useCallback","clearResultAndMoveToStart","force","useAppContextSync","commonFeatures","useCommonCollectionFeatures","collectionState","sections","id","renderSection","TableSections","undefined","exports"],"sources":["../../../src/hooks/useTableFeatures.tsx"],"sourcesContent":["import { TableConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { TableSections, useSelector, useTableCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useAutoPatternsOverridesContext } from '../providers/AutoPatternsOverridesContext';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useTableFeatures = (configuration: TableConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n configuration.filters,\n );\n const {\n customColumns,\n visibleFieldIds,\n columns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(configuration);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: visibleFieldIds,\n filterFieldMapping,\n });\n\n const overrides = useAutoPatternsOverridesContext();\n\n const params = useBaseCollectionParams({\n config: configuration.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...configuration,\n collectionState: state.collection,\n });\n\n const sections =\n configuration.sections?.id &&\n overrides?.sections?.[configuration.sections.id]\n ? {\n renderSection: overrides.sections[configuration.sections.id],\n TableSections,\n }\n : undefined;\n\n return {\n ...commonFeatures,\n state,\n columns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\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,qBAAA,GAAAJ,OAAA;AACA,IAAAK,6BAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAEO,MAAMS,gBAA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D,aAAa,CAACsC,QAAQ,aAAtBrC,qBAAA,CAAwBsC,EAAE,IAC1BpB,SAAS,aAAAjB,mBAAA,GAATiB,SAAS,CAAEmB,QAAQ,aAAnBpC,mBAAA,CAAsBF,aAAa,CAACsC,QAAQ,CAACC,EAAE,CAAC,GAC5C;IACEC,aAAa,EAAErB,SAAS,CAACmB,QAAQ,CAACtC,aAAa,CAACsC,QAAQ,CAACC,EAAE,CAAC;IAC5DE,aAAa,EAAbA;EACF,CAAC,GACDC,SAAS;EAEf,OAAO;IACL,GAAGP,cAAc;IACjBV,KAAK;IACLf,OAAO;IACPH,OAAO,EAAEJ,eAAe;IACxBK,aAAa;IACbG,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZwB;EACF,CAAC;AACH,CAAC;AAACK,OAAA,CAAA5C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -9,7 +9,8 @@ var _useFilters = require("./useFilters");
9
9
  var _useBaseGridFeatures = require("./useBaseGridFeatures");
10
10
  var _useBaseTableFeatures = require("./useBaseTableFeatures");
11
11
  var _useBaseCollectionParams = require("./useBaseCollectionParams");
12
- var _useUpdateAppContextItems = require("./useUpdateAppContextItems");
12
+ var _useAppContextSync = require("./useAppContextSync");
13
+ var _react = require("react");
13
14
  const useTableGridSwitchFeatures = config => {
14
15
  const {
15
16
  filterComponent,
@@ -44,7 +45,14 @@ const useTableGridSwitchFeatures = config => {
44
45
  });
45
46
  const state = (0, _patterns.useTableGridSwitchCollection)(params);
46
47
  const items = (0, _patterns.useSelector)(() => state.collection.result.items);
47
- (0, _useUpdateAppContextItems.useUpdateAppContextItems)(items);
48
+ const refreshCollection = (0, _react.useCallback)(() => {
49
+ return () => {
50
+ return state.collection.clearResultAndMoveToStart({
51
+ force: true
52
+ });
53
+ };
54
+ }, [state.collection]);
55
+ (0, _useAppContextSync.useAppContextSync)(items, refreshCollection);
48
56
  const commonFeatures = (0, _useCommonCollectionFeatures.useCommonCollectionFeatures)({
49
57
  ...config,
50
58
  collectionState: state.collection
@@ -1 +1 @@
1
- {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseGridFeatures","_useBaseTableFeatures","_useBaseCollectionParams","_useUpdateAppContextItems","useTableGridSwitchFeatures","config","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","useFetchData","searchableFieldIds","Array","from","Set","params","useBaseCollectionParams","collection","state","useTableGridSwitchCollection","items","useSelector","result","useUpdateAppContextItems","commonFeatures","useCommonCollectionFeatures","collectionState","horizontalScroll","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useSelector, useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useUpdateAppContextItems } from './useUpdateAppContextItems';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: config.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableGridSwitchCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n useUpdateAppContextItems(items);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem,\n showTitleBar,\n };\n};\n"],"mappings":";;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,4BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AACA,IAAAO,yBAAA,GAAAP,OAAA;AAEO,MAAMQ,0BAA0B,GAAIC,MAA6B,IAAK;EAC3E,MAAM;IAAEC,eAAe;IAAEC,aAAa;IAAEC;EAAmB,CAAC,GAAG,IAAAC,sBAAU,EACvEJ,MAAM,CAACK,OACT,CAAC;EAED,MAAM;IACJC,MAAM;IACNC,cAAc;IACdC,eAAe,EAAEC,mBAAmB;IACpCC;EACF,CAAC,GAAG,IAAAC,wCAAmB,EAACX,MAAM,CAAC;EAE/B,MAAM;IACJY,aAAa;IACbJ,eAAe,EAAEK,oBAAoB;IACrCC,OAAO,EAAEC,YAAY;IACrBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC;EACF,CAAC,GAAG,IAAAC,0CAAoB,EAACpB,MAAM,CAAC;EAEhC,MAAM;IAAEqB;EAAU,CAAC,GAAG,IAAAC,0BAAY,EAAC;IACjCC,kBAAkB,EAAEC,KAAK,CAACC,IAAI,CAC5B,IAAIC,GAAG,CAAC,CAAC,GAAGb,oBAAoB,EAAE,GAAGJ,mBAAmB,CAAC,CAC3D,CAAC;IACDN;EACF,CAAC,CAAC;EAEF,MAAMwB,MAAM,GAAG,IAAAC,gDAAuB,EAAC;IACrC5B,MAAM,EAAEA,MAAM,CAAC6B,UAAU;IACzBR,SAAS;IACThB,OAAO,EAAEH;EACX,CAAC,CAAC;EAEF,MAAM4B,KAAK,GAAG,IAAAC,sCAA4B,EAAMJ,MAAM,CAAC;EACvD,MAAMK,KAAK,GAAG,IAAAC,qBAAW,EAAC,MAAMH,KAAK,CAACD,UAAU,CAACK,MAAM,CAACF,KAAK,CAAC;EAC9D,IAAAG,kDAAwB,EAACH,KAAK,CAAC;EAE/B,MAAMI,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAGrC,MAAM;IACTsC,eAAe,EAAER,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGO,cAAc;IACjBN,KAAK;IACLhB,OAAO,EAAEC,YAAY;IACrBV,OAAO,EAAEJ,eAAe;IACxBW,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBqB,gBAAgB,EAAE,IAAI;IACtB;IACAhC,cAAc;IACdD,MAAM;IACNI,UAAU;IACVS;EACF,CAAC;AACH,CAAC;AAACqB,OAAA,CAAAzC,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_useFetchData","require","_patterns","_useCommonCollectionFeatures","_useFilters","_useBaseGridFeatures","_useBaseTableFeatures","_useBaseCollectionParams","_useAppContextSync","_react","useTableGridSwitchFeatures","config","filterComponent","filtersObject","filterFieldMapping","useFilters","filters","preset","imagePlacement","visibleFieldIds","gridVisibleFieldIds","renderItem","useBaseGridFeatures","customColumns","tableVisibleFieldIds","columns","tableColumns","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","useBaseTableFeatures","fetchData","useFetchData","searchableFieldIds","Array","from","Set","params","useBaseCollectionParams","collection","state","useTableGridSwitchCollection","items","useSelector","result","refreshCollection","useCallback","clearResultAndMoveToStart","force","useAppContextSync","commonFeatures","useCommonCollectionFeatures","collectionState","horizontalScroll","exports"],"sources":["../../../src/hooks/useTableGridSwitchFeatures.tsx"],"sourcesContent":["import { TableGridSwitchConfig } from '../types';\nimport { useFetchData } from './useFetchData';\nimport { useSelector, useTableGridSwitchCollection } from '@wix/patterns';\nimport { useCommonCollectionFeatures } from './useCommonCollectionFeatures';\nimport { useFilters } from './useFilters';\nimport { useBaseGridFeatures } from './useBaseGridFeatures';\nimport { useBaseTableFeatures } from './useBaseTableFeatures';\nimport { useBaseCollectionParams } from './useBaseCollectionParams';\nimport { useAppContextSync } from './useAppContextSync';\nimport { useCallback } from 'react';\n\nexport const useTableGridSwitchFeatures = (config: TableGridSwitchConfig) => {\n const { filterComponent, filtersObject, filterFieldMapping } = useFilters(\n config.filters,\n );\n\n const {\n preset,\n imagePlacement,\n visibleFieldIds: gridVisibleFieldIds,\n renderItem,\n } = useBaseGridFeatures(config);\n\n const {\n customColumns,\n visibleFieldIds: tableVisibleFieldIds,\n columns: tableColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n } = useBaseTableFeatures(config);\n\n const { fetchData } = useFetchData({\n searchableFieldIds: Array.from(\n new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds]),\n ),\n filterFieldMapping,\n });\n\n const params = useBaseCollectionParams({\n config: config.collection,\n fetchData,\n filters: filtersObject,\n });\n\n const state = useTableGridSwitchCollection<any>(params);\n const items = useSelector(() => state.collection.result.items);\n\n const refreshCollection = useCallback(() => {\n return () => {\n return state.collection.clearResultAndMoveToStart({ force: true });\n };\n }, [state.collection]);\n\n useAppContextSync(items, refreshCollection);\n\n const commonFeatures = useCommonCollectionFeatures({\n ...config,\n collectionState: state.collection,\n });\n\n return {\n ...commonFeatures,\n state,\n columns: tableColumns,\n filters: filterComponent,\n customColumns,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n horizontalScroll: true,\n // Grid specific features\n imagePlacement,\n preset,\n renderItem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W,EAAC,MAAMH,KAAK,CAACD,UAAU,CAACK,MAAM,CAACF,KAAK,CAAC;EAE9D,MAAMG,iBAAiB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IAC1C,OAAO,MAAM;MACX,OAAON,KAAK,CAACD,UAAU,CAACQ,yBAAyB,CAAC;QAAEC,KAAK,EAAE;MAAK,CAAC,CAAC;IACpE,CAAC;EACH,CAAC,EAAE,CAACR,KAAK,CAACD,UAAU,CAAC,CAAC;EAEtB,IAAAU,oCAAiB,EAACP,KAAK,EAAEG,iBAAiB,CAAC;EAE3C,MAAMK,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IACjD,GAAGzC,MAAM;IACT0C,eAAe,EAAEZ,KAAK,CAACD;EACzB,CAAC,CAAC;EAEF,OAAO;IACL,GAAGW,cAAc;IACjBV,KAAK;IACLhB,OAAO,EAAEC,YAAY;IACrBV,OAAO,EAAEJ,eAAe;IACxBW,aAAa;IACbI,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrByB,gBAAgB,EAAE,IAAI;IACtB;IACApC,cAAc;IACdD,MAAM;IACNI,UAAU;IACVS;EACF,CAAC;AACH,CAAC;AAACyB,OAAA,CAAA7C,0BAAA,GAAAA,0BAAA","ignoreList":[]}
@@ -3,7 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.useAppContext = exports.AppContextProvider = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
- var _ItemsContext = require("./ItemsContext");
6
+ var _AppContextData = require("./AppContextData");
7
7
  var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/AppContext.tsx";
8
8
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
9
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -12,17 +12,19 @@ const AppContextInner = ({
12
12
  children
13
13
  }) => {
14
14
  const {
15
- items
16
- } = (0, _ItemsContext.useItemsContext)();
15
+ items,
16
+ refreshCollection
17
+ } = (0, _AppContextData.useAppContextData)();
17
18
  const contextValue = {
18
- items
19
+ items,
20
+ refreshCollection
19
21
  };
20
22
  return /*#__PURE__*/_react.default.createElement(AppContext.Provider, {
21
23
  value: contextValue,
22
24
  __self: void 0,
23
25
  __source: {
24
26
  fileName: _jsxFileName,
25
- lineNumber: 24,
27
+ lineNumber: 26,
26
28
  columnNumber: 5
27
29
  }
28
30
  }, children);
@@ -30,18 +32,18 @@ const AppContextInner = ({
30
32
  const AppContextProvider = ({
31
33
  children
32
34
  }) => {
33
- return /*#__PURE__*/_react.default.createElement(_ItemsContext.ItemsContextProvider, {
35
+ return /*#__PURE__*/_react.default.createElement(_AppContextData.AppContextDataProvider, {
34
36
  __self: void 0,
35
37
  __source: {
36
38
  fileName: _jsxFileName,
37
- lineNumber: 32,
39
+ lineNumber: 34,
38
40
  columnNumber: 5
39
41
  }
40
42
  }, /*#__PURE__*/_react.default.createElement(AppContextInner, {
41
43
  __self: void 0,
42
44
  __source: {
43
45
  fileName: _jsxFileName,
44
- lineNumber: 33,
46
+ lineNumber: 35,
45
47
  columnNumber: 7
46
48
  }
47
49
  }, children));
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_ItemsContext","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AppContext","createContext","undefined","AppContextInner","children","items","useItemsContext","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","AppContextProvider","ItemsContextProvider","exports","useAppContext","context","useContext","Error"],"sources":["../../../src/providers/AppContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext } from 'react';\nimport {\n ItemsContextProvider,\n ItemsContextValue,\n useItemsContext,\n} from './ItemsContext';\n\ninterface AppContextValue extends Pick<ItemsContextValue, 'items'> {}\n\nconst AppContext = createContext<AppContextValue | undefined>(undefined);\n\nexport interface AppContextProviderProps {\n children: ReactNode;\n}\n\nconst AppContextInner: React.FC<AppContextProviderProps> = ({ children }) => {\n const { items } = useItemsContext();\n\n const contextValue: AppContextValue = {\n items,\n };\n\n return (\n <AppContext.Provider value={contextValue}>{children}</AppContext.Provider>\n );\n};\n\nexport const AppContextProvider: React.FC<AppContextProviderProps> = ({\n children,\n}) => {\n return (\n <ItemsContextProvider>\n <AppContextInner>{children}</AppContextInner>\n </ItemsContextProvider>\n );\n};\n\nexport const useAppContext = (): AppContextValue => {\n const context = useContext(AppContext);\n\n if (context === undefined) {\n throw new Error('useAppContext must be used within an AppContextProvider');\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAIwB,IAAAE,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,SAAAL,wBAAAK,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,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AAsB,aAAA,CAAC9B,aAAA,CAAAuC,oBAAoB;IAAAN,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlC,YAAA;MAAAmC,UAAA;MAAAC,YAAA;IAAA;EAAA,gBACnBxC,MAAA,CAAAW,OAAA,CAAAsB,aAAA,CAACL,eAAe;IAAAQ,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAlC,YAAA;MAAAmC,UAAA;MAAAC,YAAA;IAAA;EAAA,GAAEX,QAA0B,CACxB,CAAC;AAE3B,CAAC;AAACc,OAAA,CAAAF,kBAAA,GAAAA,kBAAA;AAEK,MAAMG,aAAa,GAAGA,CAAA,KAAuB;EAClD,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACrB,UAAU,CAAC;EAEtC,IAAIoB,OAAO,KAAKlB,SAAS,EAAE;IACzB,MAAM,IAAIoB,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_AppContextData","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AppContext","createContext","undefined","AppContextInner","children","items","refreshCollection","useAppContextData","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","AppContextProvider","AppContextDataProvider","exports","useAppContext","context","useContext","Error"],"sources":["../../../src/providers/AppContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext } from 'react';\nimport {\n AppContextDataProvider,\n AppContextDataValue,\n useAppContextData,\n} from './AppContextData';\n\ninterface AppContextValue\n extends Pick<AppContextDataValue, 'items' | 'refreshCollection'> {}\n\nconst AppContext = createContext<AppContextValue | undefined>(undefined);\n\nexport interface AppContextProviderProps {\n children: ReactNode;\n}\n\nconst AppContextInner: React.FC<AppContextProviderProps> = ({ children }) => {\n const { items, refreshCollection } = useAppContextData();\n\n const contextValue: AppContextValue = {\n items,\n refreshCollection,\n };\n\n return (\n <AppContext.Provider value={contextValue}>{children}</AppContext.Provider>\n );\n};\n\nexport const AppContextProvider: React.FC<AppContextProviderProps> = ({\n children,\n}) => {\n return (\n <AppContextDataProvider>\n <AppContextInner>{children}</AppContextInner>\n </AppContextDataProvider>\n );\n};\n\nexport const useAppContext = (): AppContextValue => {\n const context = useContext(AppContext);\n\n if (context === undefined) {\n throw new Error('useAppContext must be used within an AppContextProvider');\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAI0B,IAAAE,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,SAAAL,wBAAAK,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,UA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,kBAAA,GAAAA,kBAAA;AAEK,MAAMG,aAAa,GAAGA,CAAA,KAAuB;EAClD,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACtB,UAAU,CAAC;EAEtC,IAAIqB,OAAO,KAAKnB,SAAS,EAAE;IACzB,MAAM,IAAIqB,KAAK,CAAC,yDAAyD,CAAC;EAC5E;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.useAppContextData = exports.AppContextDataProvider = void 0;
5
+ var _react = _interopRequireWildcard(require("react"));
6
+ var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/AppContextData.tsx";
7
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
8
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
+ const AppContextDataContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
+ const AppContextDataProvider = ({
11
+ children
12
+ }) => {
13
+ const [items, setItems] = (0, _react.useState)([]);
14
+ const [refreshCollection, setRefreshCollection] = (0, _react.useState)(() => {});
15
+ const contextValue = {
16
+ items,
17
+ setItems,
18
+ refreshCollection,
19
+ setRefreshCollection
20
+ };
21
+ return /*#__PURE__*/_react.default.createElement(AppContextDataContext.Provider, {
22
+ value: contextValue,
23
+ __self: void 0,
24
+ __source: {
25
+ fileName: _jsxFileName,
26
+ lineNumber: 34,
27
+ columnNumber: 5
28
+ }
29
+ }, children);
30
+ };
31
+ exports.AppContextDataProvider = AppContextDataProvider;
32
+ const useAppContextData = () => {
33
+ const context = (0, _react.useContext)(AppContextDataContext);
34
+ if (context === undefined) {
35
+ throw new Error('useAppContextData must be used within an AppContextDataProvider');
36
+ }
37
+ return context;
38
+ };
39
+ exports.useAppContextData = useAppContextData;
40
+ //# sourceMappingURL=AppContextData.js.map
@@ -0,0 +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","AppContextDataContext","createContext","undefined","AppContextDataProvider","children","items","setItems","useState","refreshCollection","setRefreshCollection","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useAppContextData","context","useContext","Error"],"sources":["../../../src/providers/AppContextData.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface AppContextDataValue {\n items: any[];\n setItems: (items: any[]) => void;\n refreshCollection: () => void;\n setRefreshCollection: (refreshFn: () => void) => void;\n}\n\nconst AppContextDataContext = createContext<AppContextDataValue | undefined>(\n undefined,\n);\n\nexport interface AppContextDataProviderProps {\n children: ReactNode;\n}\n\nexport const AppContextDataProvider: React.FC<AppContextDataProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n const [refreshCollection, setRefreshCollection] = useState<() => void>(\n () => {},\n );\n\n const contextValue: AppContextDataValue = {\n items,\n setItems,\n refreshCollection,\n setRefreshCollection,\n };\n\n return (\n <AppContextDataContext.Provider value={contextValue}>\n {children}\n </AppContextDataContext.Provider>\n );\n};\n\nexport const useAppContextData = (): AppContextDataValue => {\n const context = useContext(AppContextDataContext);\n\n if (context === undefined) {\n throw new Error(\n 'useApp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AAC,oBAAa,EACzCC,SACF,CAAC;AAMM,MAAMC,sBAA6D,GAAGA,CAAC;EAC5EC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAQ,EAAE,CAAC;EAC7C,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG,IAAAF,eAAQ,EACxD,MAAM,CAAC,CACT,CAAC;EAED,MAAMG,YAAiC,GAAG;IACxCL,KAAK;IACLC,QAAQ;IACRE,iBAAiB;IACjBC;EACF,CAAC;EAED,oBACEjC,MAAA,CAAAU,OAAA,CAAAyB,aAAA,CAACX,qBAAqB,CAACY,QAAQ;IAACC,KAAK,EAAEH,YAAa;IAAAI,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAArC,YAAA;MAAAsC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDd,QAC6B,CAAC;AAErC,CAAC;AAACe,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAEK,MAAMiB,iBAAiB,GAAGA,CAAA,KAA2B;EAC1D,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACtB,qBAAqB,CAAC;EAEjD,IAAIqB,OAAO,KAAKnB,SAAS,EAAE;IACzB,MAAM,IAAIqB,KAAK,CACb,iEACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -1,37 +1,40 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.useItemsContext = exports.ItemsContextProvider = void 0;
4
+ exports.useAppContextData = exports.AppContextDataProvider = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
6
  var _jsxFileName = "/home/builduser/work/73d19ce3378ce4dd/packages/auto-patterns/dist/cjs/providers/ItemsContext.tsx";
7
7
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
8
8
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
9
- const ItemsContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
- const ItemsContextProvider = ({
9
+ const AppContextDataContext = /*#__PURE__*/(0, _react.createContext)(undefined);
10
+ const AppContextDataProvider = ({
11
11
  children
12
12
  }) => {
13
13
  const [items, setItems] = (0, _react.useState)([]);
14
+ const [refreshCollection, setRefreshCollection] = (0, _react.useState)(undefined);
14
15
  const contextValue = {
15
16
  items,
16
- setItems
17
+ setItems,
18
+ refreshCollection,
19
+ setRefreshCollection
17
20
  };
18
- return /*#__PURE__*/_react.default.createElement(ItemsContext.Provider, {
21
+ return /*#__PURE__*/_react.default.createElement(AppContextDataContext.Provider, {
19
22
  value: contextValue,
20
23
  __self: void 0,
21
24
  __source: {
22
25
  fileName: _jsxFileName,
23
- lineNumber: 25,
26
+ lineNumber: 34,
24
27
  columnNumber: 5
25
28
  }
26
29
  }, children);
27
30
  };
28
- exports.ItemsContextProvider = ItemsContextProvider;
29
- const useItemsContext = () => {
30
- const context = (0, _react.useContext)(ItemsContext);
31
+ exports.AppContextDataProvider = AppContextDataProvider;
32
+ const useAppContextData = () => {
33
+ const context = (0, _react.useContext)(AppContextDataContext);
31
34
  if (context === undefined) {
32
- throw new Error('useItemsContext must be used within an ItemsContextProvider');
35
+ throw new Error('useAppContextData must be used within an AppContextDataProvider');
33
36
  }
34
37
  return context;
35
38
  };
36
- exports.useItemsContext = useItemsContext;
39
+ exports.useAppContextData = useAppContextData;
37
40
  //# sourceMappingURL=ItemsContext.js.map
@@ -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","ItemsContext","createContext","undefined","ItemsContextProvider","children","items","setItems","useState","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useItemsContext","context","useContext","Error"],"sources":["../../../src/providers/ItemsContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface ItemsContextValue {\n items: any[];\n setItems: (items: any[]) => void;\n}\n\nconst ItemsContext = createContext<ItemsContextValue | undefined>(undefined);\n\nexport interface ItemsContextProviderProps {\n children: ReactNode;\n}\n\nexport const ItemsContextProvider: React.FC<ItemsContextProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n\n const contextValue: ItemsContextValue = {\n items,\n setItems,\n };\n\n return (\n <ItemsContext.Provider value={contextValue}>\n {children}\n </ItemsContext.Provider>\n );\n};\n\nexport const useItemsContext = (): ItemsContextValue => {\n const context = useContext(ItemsContext);\n\n if (context === undefined) {\n throw new Error(\n 'useItemsContext must be used within an ItemsContextProvider',\n );\n }\n\n return context;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8E,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,uBA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oB,CAAC;AAE5B,CAAC;AAACa,OAAA,CAAAd,oBAAA,GAAAA,oBAAA;AAEK,MAAMe,eAAe,GAAGA,CAAA,KAAyB;EACtD,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACpB,YAAY,CAAC;EAExC,IAAImB,OAAO,KAAKjB,SAAS,EAAE;IACzB,MAAM,IAAImB,KAAK,CACb,6DACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,eAAA,GAAAA,eAAA","ignoreList":[]}
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","AppContextDataContext","createContext","undefined","AppContextDataProvider","children","items","setItems","useState","refreshCollection","setRefreshCollection","contextValue","createElement","Provider","value","__self","__source","fileName","lineNumber","columnNumber","exports","useAppContextData","context","useContext","Error"],"sources":["../../../src/providers/ItemsContext.tsx"],"sourcesContent":["import React, { ReactNode, createContext, useContext, useState } from 'react';\n\nexport interface AppContextDataValue {\n items: any[];\n setItems: (items: any[]) => void;\n refreshCollection?: () => void;\n setRefreshCollection: (refreshFn: () => void) => void;\n}\n\nconst AppContextDataContext = createContext<AppContextDataValue | undefined>(\n undefined,\n);\n\nexport interface AppContextDataProviderProps {\n children: ReactNode;\n}\n\nexport const AppContextDataProvider: React.FC<AppContextDataProviderProps> = ({\n children,\n}) => {\n const [items, setItems] = useState<any[]>([]);\n const [refreshCollection, setRefreshCollection] = useState<\n (() => void) | undefined\n >(undefined);\n\n const contextValue: AppContextDataValue = {\n items,\n setItems,\n refreshCollection,\n setRefreshCollection,\n };\n\n return (\n <AppContextDataContext.Provider value={contextValue}>\n {children}\n </AppContextDataContext.Provider>\n );\n};\n\nexport const useAppContextData = (): AppContextDataValue => {\n const context = useContext(AppContextDataContext);\n\n if (context === undefined) {\n throw new Error(\n 'useAppContextData must be used within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Aa,EACzCC,SACF,CAAC;AAMM,MAAMC,sBAA6D,GAAGA,CAAC;EAC5EC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG,IAAAC,eAAQ,EAAQ,EAAE,CAAC;EAC7C,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAG,IAAAF,eAAQ,EAExDL,SAAS,CAAC;EAEZ,MAAMQ,YAAiC,GAAG;IACxCL,KAAK;IACLC,QAAQ;IACRE,iBAAiB;IACjBC;EACF,CAAC;EAED,oBACEjC,MAAA,CAAAU,OAAA,CAAAyB,aAAA,CAACX,qBAAqB,CAACY,QAAQ;IAACC,KAAK,EAAEH,YAAa;IAAAI,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAArC,YAAA;MAAAsC,UAAA;MAAAC,YAAA;IAAA;EAAA,GACjDd,QAC6B,CAAC;AAErC,CAAC;AAACe,OAAA,CAAAhB,sBAAA,GAAAA,sBAAA;AAEK,MAAMiB,iBAAiB,GAAGA,CAAA,KAA2B;EAC1D,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACtB,qBAAqB,CAAC;EAEjD,IAAIqB,OAAO,KAAKnB,SAAS,EAAE;IACzB,MAAM,IAAIqB,KAAK,CACb,iEACF,CAAC;EACH;EAEA,OAAOF,OAAO;AAChB,CAAC;AAACF,OAAA,CAAAC,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -47,6 +47,13 @@ Object.keys(_ErrorContext).forEach(function (key) {
47
47
  if (key in exports && exports[key] === _ErrorContext[key]) return;
48
48
  exports[key] = _ErrorContext[key];
49
49
  });
50
+ var _AppContextData = require("./AppContextData");
51
+ Object.keys(_AppContextData).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
54
+ if (key in exports && exports[key] === _AppContextData[key]) return;
55
+ exports[key] = _AppContextData[key];
56
+ });
50
57
  var _AppContext = require("./AppContext");
51
58
  exports.useAppContext = _AppContext.useAppContext;
52
59
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_AutoPatternsOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext","_AppContext","useAppContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './AutoPatternsOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\nexport { useAppContext } from './AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAL,cAAA,CAAAK,GAAA;AAAA;AACA,IAAAM,6BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,6BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAM,6BAAA,CAAAN,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAM,6BAAA,CAAAN,GAAA;AAAA;AACA,IAAAO,aAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,aAAA,EAAAR,OAAA,WAAAC,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,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,aAAA,CAAAV,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAU,aAAA,CAAAV,GAAA;AAAA;AACA,IAAAW,WAAA,GAAAf,OAAA;AAA6CS,OAAA,CAAAO,aAAA,GAAAD,WAAA,CAAAC,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_SchemaContext","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_AutoPatternsOverridesContext","_ModalContext","_SchemaRegistryContext","_AppConfigContext","_ErrorContext","_AppContextData","_AppContext","useAppContext"],"sources":["../../../src/providers/index.ts"],"sourcesContent":["export * from './SchemaContext';\nexport * from './AutoPatternsOverridesContext';\nexport * from './ModalContext';\nexport * from './SchemaRegistryContext';\nexport * from './AppConfigContext';\nexport * from './ErrorContext';\nexport * from './AppContextData';\nexport { useAppContext } from './AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,cAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAL,cAAA,CAAAK,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAL,cAAA,CAAAK,GAAA;AAAA;AACA,IAAAM,6BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,6BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL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C,MAAA,CAAAC,IAAA,CAAAY,aAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAU,aAAA,CAAAV,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAU,aAAA,CAAAV,GAAA;AAAA;AACA,IAAAW,eAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,eAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,eAAA,CAAAX,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAW,eAAA,CAAAX,GAAA;AAAA;AACA,IAAAY,WAAA,GAAAhB,OAAA;AAA6CS,OAAA,CAAAQ,aAAA,GAAAD,WAAA,CAAAC,aAAA","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 CollectionPageOnRowClickActionConfig,\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 CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n type: 'collection';\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n type: 'custom';\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\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 onRowClick?: CollectionPageOnRowClickActionConfig;\n showTitleBar?: boolean;\n sections?: {\n id: string;\n };\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 type CollectionConfig = BaseCollectionConfig & {\n limit?: number;\n reflectQueryInUrl?: boolean;\n selectAllScope?: 'page' | 'all';\n selectionUpdateMode?: 'preserve' | 'clear';\n optimisticActions?: {\n id: string;\n };\n paginationMode?: 'cursor' | 'offset';\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\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":";;;;IAkLYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
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 CollectionPageOnRowClickActionConfig,\n CollectionPagePrimaryActions,\n CollectionPageSecondaryActions,\n} from './actions';\n\nexport interface CollectionPageTitle {\n /**\n * The title text.\n */\n text: string;\n /**\n * Determines whether to hide the number of total entities on the title of the page.\n */\n hideTotal?: boolean;\n}\n\nexport interface CollectionPageSubtitle {\n /**\n * The subtitle text.\n */\n text: string;\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button. defaults to \"Learn More\".\n */\n label?: string;\n };\n}\n\nexport interface CollectionPageConfig {\n /**\n * Route configuration.\n */\n route: {\n /**\n * Route path (relative path).\n */\n path: string;\n };\n /**\n * Page title configuration.\n */\n title: CollectionPageTitle;\n /**\n * Page subtitle configuration.\n */\n subtitle?: CollectionPageSubtitle;\n /**\n * Page-level actions to render in the page header.\n */\n actions?: {\n /**\n * Primary actions.\n */\n primaryActions?: CollectionPagePrimaryActions;\n /**\n * Secondary actions.\n */\n secondaryActions?: CollectionPageSecondaryActions;\n };\n /**\n * Components rendered within the page layout.\n */\n components: ComponentConfig[];\n}\n\nexport interface CollectionComponentConfig\n extends BaseCollectionComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'collection';\n /**\n * Layout items to render.\n */\n layout: LayoutItemConfig[];\n}\n\nexport interface CustomComponentConfig {\n /**\n * Type discriminator.\n */\n type: 'custom';\n /**\n * Identifier that maps to a custom React component provided via overrides.\n */\n id: string;\n}\n\nexport type ComponentConfig = CollectionComponentConfig | CustomComponentConfig;\n\nexport interface LayoutItemConfig {\n /**\n * Rendering mode for the collection component.\n */\n type: 'Table' | 'Grid';\n /**\n * Table-specific configuration.\n */\n table?: TableSpecificConfig;\n /**\n * Grid-specific configuration.\n */\n grid?: GridSpecificConfig;\n}\n\nexport type ColumnsConfig = Column[];\n\nexport interface TableSpecificConfig {\n /**\n * Table columns configuration.\n */\n columns: ColumnsConfig;\n /**\n * Enables custom columns (hide/reorder columns) functionality.\n */\n customColumns?: {\n enabled: boolean;\n };\n /**\n * Number of leading columns that remain sticky on horizontal scroll.\n */\n stickyColumns?: number;\n /**\n * Row click action.\n */\n onRowClick?: CollectionPageOnRowClickActionConfig;\n /**\n * Show column headers (title bar).\n * @default true\n */\n showTitleBar?: boolean;\n /**\n * Sectioning support for table.\n *\n * The `id` must match the identifier of a custom sectioning override component.\n * This allows you to provide a custom React component for table section rendering.\n */\n sections?: {\n id: string;\n };\n}\n\nexport interface GridSpecificConfig {\n /**\n * Grid item.\n */\n item: GridItem;\n}\n\nexport interface TableConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig {}\n\nexport interface GridConfig\n extends BaseCollectionComponentConfig,\n GridSpecificConfig {}\n\nexport interface TableGridSwitchConfig\n extends BaseCollectionComponentConfig,\n TableSpecificConfig,\n GridSpecificConfig {}\n\nexport type CollectionConfig = BaseCollectionConfig & {\n /**\n * Default fetch limit (items per page).\n */\n limit?: number;\n /**\n * Reflect search/filters/sort in the URL.\n * @default false\n */\n reflectQueryInUrl?: boolean;\n /**\n * Scope of \"Select All\":\n * - 'all': select the entire collection (server-side).\n * - 'page': select only currently visible items.\n * @default \"all\"\n */\n selectAllScope?: 'page' | 'all';\n /**\n * Selection behavior when data changes:\n * - 'preserve': keep current selections if still valid.\n * - 'clear': clear selection on data refresh.\n * @default \"clear\"\n */\n selectionUpdateMode?: 'preserve' | 'clear';\n /**\n * Enables optimistic UI actions;\n * Identifier that maps to a custom optimistic actions provided via overrides.\n */\n optimisticActions?: {\n id: string;\n };\n /**\n * Pagination strategy:\n * - 'cursor': `find()` must return { items, cursor, total? }\n * - 'offset': `find()` must return { items, hasNext, total? }\n * @default \"offset\"\n */\n paginationMode?: 'cursor' | 'offset';\n};\n\nexport interface BaseCollectionComponentConfig {\n /**\n * Collection data configuration and behavior.\n */\n collection: CollectionConfig;\n /**\n * Entity page to navigate to (by page id) when interacting with rows (e.g. onRowClick/update).\n */\n entityPageId?: string;\n /**\n * Search configuration.\n */\n search?: {\n /**\n * Whether to show the search input.\n * @default true\n */\n shown?: boolean;\n };\n /**\n * Toolbar title configuration.\n */\n toolbarTitle?: ToolbarTitle;\n /**\n * Action cell configuration per row.\n */\n actionCell?: ActionCellConfig;\n /**\n * Empty state configuration.\n */\n emptyState?: EmptyState;\n /**\n * Filters configuration.\n */\n filters?: FiltersConfig;\n /**\n * Bulk action toolbar configuration.\n */\n bulkActionToolbar?: BulkActionsConfig;\n}\n\nexport interface ToolbarTitle {\n /**\n * Title text.\n */\n title: string;\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text: string;\n /**\n * Info tooltip content with an optional link.\n */\n info?: {\n content: {\n text: string;\n link?: {\n url: string;\n label: string;\n };\n };\n };\n /**\n * \"Learn more\" link.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Show total items on the toolbar.\n * @default false\n */\n showTotal?: boolean;\n /**\n * Limit displayed item count in the toolbar.\n */\n itemsLimit?: number;\n}\n\nexport interface Column {\n /**\n * FieldId to bind the column to.\n */\n id: string;\n /**\n * Column header text.\n */\n name: string;\n /**\n * CSS width value (e.g. '120px', '20%').\n */\n width: string;\n /**\n * Whether the column supports sorting.\n */\n sortable?: boolean;\n /**\n * Initial sort order when the page loads.\n */\n defaultSortOrder?: 'asc' | 'desc';\n /**\n * Current sort mode selected in UI.\n */\n sortMode?: 'asc' | 'desc';\n /**\n * Hide column by default in the custom columns panel.\n * When true, the column will not be shown initially and must be enabled by the user via the customize columns UI.\n */\n defaultHidden?: boolean;\n /**\n * Exclude from the \"customize columns\" selection UI.\n */\n hiddenFromCustomColumnsSelection?: boolean;\n /**\n * Controls whether the \"hide/show\" checkbox for this column is enabled in the custom columns panel.\n * If set to false, the checkbox will be disabled and the user cannot toggle visibility for this column.\n */\n hideable?: boolean;\n /**\n * Prevent column reordering in the customization UI.\n */\n reorderDisabled?: boolean;\n}\n\nexport interface GridItem {\n /**\n * FieldId to use as the card title.\n */\n titleFieldId: string;\n /**\n * FieldId to use as the card subtitle.\n */\n subtitleFieldId?: string;\n /**\n * FieldId to use as the card image.\n */\n imageFieldId?: string;\n /**\n * Controls which content is shown in the card (preset):\n * - 'full': shows title and subtitle.\n * - 'title': shows only the title.\n * - 'empty': hides both title and subtitle.\n */\n cardContentMode?: 'full' | 'title' | 'empty'; // Footer is not supported in auto-patterns\n /**\n * Position of the image inside the card layout.\n */\n imagePlacement?: 'top' | 'side';\n}\n\nexport interface EmptyState {\n /**\n * Empty state title.\n */\n title?: string;\n /**\n * Empty state subtitle.\n */\n subtitle?: string;\n /**\n * Image to display in the empty state.\n */\n image?: {\n id: string;\n };\n /**\n * \"Add new\" call-to-action button.\n */\n addNewCta?: {\n id?: string;\n text?: string;\n };\n /**\n * Custom CTA slot (advanced).\n */\n customCta?: {\n id?: string;\n };\n}\n\nexport interface FilterOption {\n value: string;\n label: string;\n}\n\nexport type FilterSelectionMode = 'single' | 'multiple';\n\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[];\n\nexport interface FiltersConfig {\n /**\n * Filter items to display.\n */\n items: FilterItems;\n /**\n * Maximum number of filters shown inline before moving to the panel.\n * @default 0 (all in panel).\n */\n maxInlineFilters?: CollectionToolbarFiltersProps['inline'];\n /**\n * Title for the filter panel drawer.\n */\n panelTitle?: string;\n}\n\nexport interface BaseOptionsFilterConfig {\n /**\n * Selection behavior: single choice or multiple choices.\n */\n selectionMode: FilterSelectionMode;\n}\n\nexport interface DateFilterConfig {\n /**\n * Controls behavior: presets only, custom only, or both.\n */\n mode?: DateRangeFilterMode;\n /**\n * Which preset ranges to display (only if mode supports presets).\n */\n presets?: DateRangeOptions;\n /**\n * Whether to include time selection.\n * @default true\n */\n includeTime?: boolean;\n}\n\nexport interface NumberFilterConfig {\n /**\n * Minimum allowed value.\n */\n min?: number;\n /**\n * Maximum allowed value.\n */\n max?: number;\n /**\n * Whether decimal values are allowed.\n */\n allowedDecimals?: boolean;\n}\n\nexport interface BooleanFilterConfig {\n /**\n * Label for the \"true\" option.\n */\n trueLabel?: string;\n /**\n * Label for the \"false\" option.\n */\n falseLabel?: string;\n}\n\nexport interface EnumFilterConfig extends BaseOptionsFilterConfig {\n /**\n * List of available options.\n */\n options: FilterOption[];\n /**\n * Rendering control for option appearance.\n */\n optionType?: FilterOptionType;\n}\n\nexport interface DynamicOptionsFilterConfig extends BaseOptionsFilterConfig {}\n\nexport interface Filter {\n /**\n * Filter unique identifier.\n */\n id: string;\n /**\n * Target field id this filter controls.\n */\n fieldId: string;\n /**\n * Optional filter display name (defaults to field name).\n */\n displayName?: string;\n /**\n * Optional grouping label. Filters with the same `sectionTitle` are grouped together.\n */\n sectionTitle?: string;\n /**\n * Whether the filter item is expanded by default in the panel.\n */\n openByDefault?: boolean;\n /**\n * Label shown in the table/grid tag when the filter is active.\n */\n tagLabel?: string;\n /**\n * Configuration for number inputs (NUMBER fields).\n */\n numberConfig?: NumberFilterConfig;\n /**\n * Configuration for date inputs (DATETIME fields).\n */\n dateConfig?: DateFilterConfig;\n /**\n * Configuration for boolean input labels (BOOLEAN fields).\n */\n booleanConfig?: BooleanFilterConfig;\n /**\n * Configuration for enum inputs (ARRAY/ARRAY_STRING fields).\n */\n enumConfig?: EnumFilterConfig;\n /**\n * Dynamic options configuration (advanced).\n */\n dynamicOptionsConfig?: DynamicOptionsFilterConfig;\n}\n"],"mappings":";;;;IAqaYA,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';\nimport {\n EntityPageMoreActions,\n EntityPagePrimaryActions,\n EntityPageSecondaryActions,\n} from './actions/entityPageActions';\nimport { BaseCollectionConfig } from './types';\n\nexport type EntityPageBaseConfig = {\n route: {\n path: string;\n params: {\n id: string;\n };\n };\n title?: {\n text: string;\n badges?: {\n id: string;\n };\n };\n subtitle?: {\n text?: string;\n id?: string;\n learnMore?: {\n url: string;\n label?: string;\n };\n };\n parentPageId?: string;\n layout?: {\n main: CardLayout[];\n sidebar?: CardLayout[];\n };\n} & BaseCollectionConfig;\n\nexport type EditEntityPageConfig = EntityPageBaseConfig & {\n mode?: 'edit';\n actions?: {\n primaryActions?: never;\n secondaryActions?: never;\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type ViewEntityPageConfig = EntityPageBaseConfig & {\n mode: 'view';\n actions?: {\n primaryActions?: EntityPagePrimaryActions;\n secondaryActions?: EntityPageSecondaryActions;\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type EntityPageConfig = EditEntityPageConfig | ViewEntityPageConfig;\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 {\n EntityPageMoreActions,\n EntityPagePrimaryActions,\n EntityPageSecondaryActions,\n} from './actions/entityPageActions';\nimport { BaseCollectionConfig } from './types';\n\nexport type EntityPageBaseConfig = {\n /**\n * Route configuration for the entity page.\n */\n route: {\n /**\n * Route path (e.g. '/products/:id').\n */\n path: string;\n /**\n * Mapping for dynamic params used in the path.\n * `id` must match the placeholder used in `path`.\n */\n params: {\n id: string;\n };\n };\n /**\n * Title configuration.\n */\n title?: {\n /**\n * Title text.\n */\n text: string;\n /**\n * Badges slot identifier for dynamic overrides.\n */\n badges?: {\n id: string;\n };\n };\n /**\n * Subtitle configuration.\n */\n subtitle?: {\n /**\n * Subtitle text.\n */\n text?: string;\n /**\n * Subtitle slot identifier for dynamic overrides.\n */\n id?: string;\n /**\n * \"Learn more\" link near the subtitle.\n */\n learnMore?: {\n /**\n * Where the link should navigate to.\n */\n url: string;\n /**\n * The label of the link button.\n */\n label?: string;\n };\n };\n /**\n * Parent collection page id for navigation breadcrumbs/back behavior.\n */\n parentPageId?: string;\n /**\n * Page layout: main content cards and optional sidebar cards.\n */\n layout?: {\n /**\n * Main column card layout.\n */\n main: CardLayout[];\n /**\n * Sidebar column card layout.\n */\n sidebar?: CardLayout[];\n };\n} & BaseCollectionConfig;\n\nexport type EditEntityPageConfig = EntityPageBaseConfig & {\n /**\n * Page mode.\n * @default 'edit'\n */\n mode?: 'edit';\n /**\n * Page actions.\n *\n * Edit mode supports only `moreActions`.\n */\n actions?: {\n primaryActions?: never;\n secondaryActions?: never;\n /**\n * Contextual actions (e.g., custom actions).\n */\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type ViewEntityPageConfig = EntityPageBaseConfig & {\n /**\n * Page mode.\n */\n mode: 'view';\n /**\n * Page actions.\n *\n * View mode supports `primaryActions`, `secondaryActions`, and `moreActions`.\n */\n actions?: {\n /**\n * Primary actions (e.g., Create).\n */\n primaryActions?: EntityPagePrimaryActions;\n /**\n * Secondary actions (e.g., menu with secondary items).\n */\n secondaryActions?: EntityPageSecondaryActions;\n /**\n * Additional context menu actions.\n */\n moreActions?: EntityPageMoreActions;\n };\n};\n\nexport type EntityPageConfig = EditEntityPageConfig | ViewEntityPageConfig;\n\nexport interface CardLayout {\n type: 'card';\n card: {\n /**\n * Card header title.\n */\n title: {\n text: string;\n };\n /**\n * Optional card subtitle.\n */\n subtitle?: {\n text: string;\n };\n /**\n * Card content items (fields, containers, or custom components).\n */\n children: LayoutContent[];\n };\n}\n\nexport type LayoutContent =\n | FieldContent\n | ContainerContent\n | ComponentItemContent;\n\ninterface FieldContent {\n type: 'field';\n field: {\n /**\n * Number of columns (out of 12) that this field should span in the layout grid.\n */\n span?: number;\n /**\n * FieldId from the schema to render in this position.\n */\n fieldId: string;\n };\n}\n\ninterface ContainerContent {\n type: 'container';\n container: {\n /**\n * Number of columns (out of 12) that this container should span in the layout grid.\n */\n span?: number;\n /**\n * Nested layout items inside the container.\n */\n children: LayoutContent[];\n };\n}\n\ninterface ComponentItemContent {\n type: 'component';\n component: {\n /**\n * Number of columns (out of 12) that this component should span in the layout grid.\n */\n span?: number;\n /**\n * Identifier mapping to a custom component provided via overrides.\n */\n componentId: string;\n };\n}\n\nexport interface CustomComponentProps {\n /**\n * Current entity data.\n */\n entity?: Record<string, any>;\n /**\n * Form APIs when in edit mode.\n */\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 CustomActionModalProps,\n CustomActionParams,\n ResolvedAction,\n} from '../../exports/types';\nimport {\n CustomActionConfig,\n DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n item: ActionCellItemConfig;\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n items: (ActionCellItemConfig | DividerActionConfig)[];\n inlineCount?: number;\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n primaryAction?: ActionCellPrimaryAction;\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n prefixIcon?: IconElement;\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}
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 DeleteActionConfig,\n UpdateActionConfig,\n DividerActionConfig,\n} from './base';\nimport { IconElement } from '@wix/design-system';\n\nexport type ActionCellItemConfig =\n | UpdateActionConfig\n | CustomActionConfig\n | DeleteActionConfig;\n\nexport interface ActionCellPrimaryAction {\n /**\n * The action item configuration.\n */\n item: ActionCellItemConfig;\n /**\n * Whether the primary action should always be visible.\n * If true, the action is always visible; if false, it is visible only when hovering the row.\n * @default false\n */\n alwaysVisible?: boolean;\n}\n\nexport interface ActionCellSecondaryActions {\n /**\n * Array of action items and dividers for the secondary actions menu.\n */\n items: (ActionCellItemConfig | DividerActionConfig)[];\n /**\n * Number of secondary actions to show inline before moving to overflow menu.\n * Remaining actions appear in a \"more actions\" dropdown.\n * @default 0 (all actions in dropdown)\n */\n inlineCount?: number;\n /**\n * Whether inline secondary actions should always be visible.\n * If true, the inline actions are always visible; if false, they are visible only when hovering the row.\n * @default false\n */\n inlineAlwaysVisible?: boolean;\n}\n\nexport interface ActionCellConfig {\n /**\n * Primary action configuration.\n * Shown as the main action button in each row.\n */\n primaryAction?: ActionCellPrimaryAction;\n /**\n * Secondary actions configuration.\n * Shown as additional actions in dropdown or inline.\n */\n secondaryActions?: ActionCellSecondaryActions;\n}\n\nexport interface ResolvedActionCellPrimaryAction\n extends Omit<ResolvedAction, 'icon'> {\n /**\n * Icon displayed before the action label.\n */\n prefixIcon?: IconElement;\n /**\n * Icon displayed after the action label.\n */\n suffixIcon?: IconElement;\n}\n\nexport interface ActionCellActionParams {\n /**\n * The data item (row) that the action is being performed on.\n */\n item: any;\n}\n\nexport type CustomActionCellActionParams =\n CustomActionParams<ActionCellActionParams>;\n\nexport type CustomActionCellPrimaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedActionCellPrimaryAction;\n\nexport type CustomActionCellSecondaryActionResolver = (\n params: CustomActionCellActionParams,\n) => ResolvedAction;\n\nexport interface CustomActionCellActionModalProps\n extends CustomActionModalProps {\n /**\n * Action parameters including the row item context.\n */\n actionParams: ActionCellActionParams;\n}\n"],"mappings":"","ignoreList":[]}