@wix/auto-patterns 1.42.0 → 1.44.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 (175) hide show
  1. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js +19 -5
  2. package/dist/cjs/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  3. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +29 -74
  4. package/dist/cjs/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  5. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js +147 -25
  6. package/dist/cjs/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  7. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js +10 -27
  8. package/dist/cjs/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  9. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js +141 -40
  10. package/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  11. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +169 -9
  12. package/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  13. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js +11 -0
  14. package/dist/cjs/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  15. package/dist/cjs/hooks/getFilterComponent.js +52 -0
  16. package/dist/cjs/hooks/getFilterComponent.js.map +1 -0
  17. package/dist/cjs/hooks/index.js +4 -11
  18. package/dist/cjs/hooks/index.js.map +1 -1
  19. package/dist/cjs/hooks/pluginsDynamicImports.js +25 -0
  20. package/dist/cjs/hooks/pluginsDynamicImports.js.map +1 -0
  21. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js +30 -0
  22. package/dist/cjs/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  23. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js +62 -0
  24. package/dist/cjs/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  25. package/dist/cjs/hooks/useBasePatternsStateParams.js +36 -0
  26. package/dist/cjs/hooks/useBasePatternsStateParams.js.map +1 -0
  27. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js +15 -0
  28. package/dist/cjs/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  29. package/dist/cjs/hooks/useCommonCollectionFeatures.js +14 -4
  30. package/dist/cjs/hooks/useCommonCollectionFeatures.js.map +1 -1
  31. package/dist/cjs/hooks/useFilters.js +17 -103
  32. package/dist/cjs/hooks/useFilters.js.map +1 -1
  33. package/dist/cjs/hooks/useFiltersState.js +112 -0
  34. package/dist/cjs/hooks/useFiltersState.js.map +1 -0
  35. package/dist/cjs/hooks/useGridFeaturesAsync.js +42 -0
  36. package/dist/cjs/hooks/useGridFeaturesAsync.js.map +1 -0
  37. package/dist/cjs/hooks/useGridVisibleFieldIds.js +17 -0
  38. package/dist/cjs/hooks/useGridVisibleFieldIds.js.map +1 -0
  39. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js +22 -0
  40. package/dist/cjs/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  41. package/dist/cjs/hooks/useTableFeaturesAsync.js +51 -0
  42. package/dist/cjs/hooks/useTableFeaturesAsync.js.map +1 -0
  43. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js +52 -0
  44. package/dist/cjs/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  45. package/dist/cjs/hooks/useTableSections.js +18 -0
  46. package/dist/cjs/hooks/useTableSections.js.map +1 -0
  47. package/dist/cjs/utils/filterCreators.js +16 -31
  48. package/dist/cjs/utils/filterCreators.js.map +1 -1
  49. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js +18 -0
  50. package/dist/cjs/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  51. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js +21 -0
  52. package/dist/cjs/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  53. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js +14 -1
  54. package/dist/esm/components/AutoPatternsApp/AutoPatternsApp.js.map +1 -1
  55. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js +23 -31
  56. package/dist/esm/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.js.map +1 -1
  57. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js +134 -28
  58. package/dist/esm/components/AutoPatternsGrid/AutoPatternsGrid.js.map +1 -1
  59. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js +3 -7
  60. package/dist/esm/components/AutoPatternsRoute/AutoPatternsPage.js.map +1 -1
  61. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js +126 -41
  62. package/dist/esm/components/AutoPatternsTable/AutoPatternsTable.js.map +1 -1
  63. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js +155 -10
  64. package/dist/esm/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.js.map +1 -1
  65. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js +7 -0
  66. package/dist/esm/hooks/getCommonCollectionFeaturesAsync.js.map +1 -0
  67. package/dist/esm/hooks/getFilterComponent.js +48 -0
  68. package/dist/esm/hooks/getFilterComponent.js.map +1 -0
  69. package/dist/esm/hooks/index.js +1 -2
  70. package/dist/esm/hooks/index.js.map +1 -1
  71. package/dist/esm/hooks/pluginsDynamicImports.js +13 -0
  72. package/dist/esm/hooks/pluginsDynamicImports.js.map +1 -0
  73. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js +28 -0
  74. package/dist/esm/hooks/useAsyncFeaturesPromiseState.js.map +1 -0
  75. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js +58 -0
  76. package/dist/esm/hooks/useBaseCollectionComponentReadyFeatures.js.map +1 -0
  77. package/dist/esm/hooks/useBasePatternsStateParams.js +32 -0
  78. package/dist/esm/hooks/useBasePatternsStateParams.js.map +1 -0
  79. package/dist/esm/hooks/useCollectionInitAsyncDeps.js +11 -0
  80. package/dist/esm/hooks/useCollectionInitAsyncDeps.js.map +1 -0
  81. package/dist/esm/hooks/useCommonCollectionFeatures.js +1 -0
  82. package/dist/esm/hooks/useCommonCollectionFeatures.js.map +1 -1
  83. package/dist/esm/hooks/useFilters.js +14 -100
  84. package/dist/esm/hooks/useFilters.js.map +1 -1
  85. package/dist/esm/hooks/useFiltersState.js +107 -0
  86. package/dist/esm/hooks/useFiltersState.js.map +1 -0
  87. package/dist/esm/hooks/useGridFeaturesAsync.js +37 -0
  88. package/dist/esm/hooks/useGridFeaturesAsync.js.map +1 -0
  89. package/dist/esm/hooks/useGridVisibleFieldIds.js +13 -0
  90. package/dist/esm/hooks/useGridVisibleFieldIds.js.map +1 -0
  91. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js +18 -0
  92. package/dist/esm/hooks/useSyncCollectionStateToAppContext.js.map +1 -0
  93. package/dist/esm/hooks/useTableFeaturesAsync.js +46 -0
  94. package/dist/esm/hooks/useTableFeaturesAsync.js.map +1 -0
  95. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js +47 -0
  96. package/dist/esm/hooks/useTableGridSwitchFeaturesAsync.js.map +1 -0
  97. package/dist/esm/hooks/useTableSections.js +14 -0
  98. package/dist/esm/hooks/useTableSections.js.map +1 -0
  99. package/dist/esm/utils/filterCreators.js +17 -32
  100. package/dist/esm/utils/filterCreators.js.map +1 -1
  101. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js +14 -0
  102. package/dist/esm/utils/minimalRequiredPatternsRuntimeCheck.js.map +1 -0
  103. package/dist/esm/utils/minimalRequiredRuntimeCheck.js +17 -0
  104. package/dist/esm/utils/minimalRequiredRuntimeCheck.js.map +1 -0
  105. package/dist/types/components/AutoPatternsApp/AutoPatternsApp.d.ts.map +1 -1
  106. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts +6 -0
  107. package/dist/types/components/AutoPatternsCollectionComponent/AutoPatternsCollectionComponent.d.ts.map +1 -1
  108. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts +17 -2
  109. package/dist/types/components/AutoPatternsGrid/AutoPatternsGrid.d.ts.map +1 -1
  110. package/dist/types/components/AutoPatternsRoute/AutoPatternsPage.d.ts.map +1 -1
  111. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts +17 -2
  112. package/dist/types/components/AutoPatternsTable/AutoPatternsTable.d.ts.map +1 -1
  113. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts +18 -2
  114. package/dist/types/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.d.ts.map +1 -1
  115. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts +4 -0
  116. package/dist/types/hooks/getCommonCollectionFeaturesAsync.d.ts.map +1 -0
  117. package/dist/types/hooks/getFilterComponent.d.ts +4 -0
  118. package/dist/types/hooks/getFilterComponent.d.ts.map +1 -0
  119. package/dist/types/hooks/index.d.ts +1 -2
  120. package/dist/types/hooks/index.d.ts.map +1 -1
  121. package/dist/types/hooks/pluginsDynamicImports.d.ts +7 -0
  122. package/dist/types/hooks/pluginsDynamicImports.d.ts.map +1 -0
  123. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts +6 -0
  124. package/dist/types/hooks/useAsyncFeaturesPromiseState.d.ts.map +1 -0
  125. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts +36 -0
  126. package/dist/types/hooks/useBaseCollectionComponentReadyFeatures.d.ts.map +1 -0
  127. package/dist/types/hooks/useBasePatternsStateParams.d.ts +31 -0
  128. package/dist/types/hooks/useBasePatternsStateParams.d.ts.map +1 -0
  129. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts +4 -0
  130. package/dist/types/hooks/useCollectionInitAsyncDeps.d.ts.map +1 -0
  131. package/dist/types/hooks/useCommonCollectionFeatures.d.ts +1 -0
  132. package/dist/types/hooks/useCommonCollectionFeatures.d.ts.map +1 -1
  133. package/dist/types/hooks/useFilters.d.ts +9 -21
  134. package/dist/types/hooks/useFilters.d.ts.map +1 -1
  135. package/dist/types/hooks/useFiltersState.d.ts +26 -0
  136. package/dist/types/hooks/useFiltersState.d.ts.map +1 -0
  137. package/dist/types/hooks/useGridDragAndDrop.d.ts +1 -1
  138. package/dist/types/hooks/useGridFeaturesAsync.d.ts +26 -0
  139. package/dist/types/hooks/useGridFeaturesAsync.d.ts.map +1 -0
  140. package/dist/types/hooks/useGridVisibleFieldIds.d.ts +3 -0
  141. package/dist/types/hooks/useGridVisibleFieldIds.d.ts.map +1 -0
  142. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts +6 -0
  143. package/dist/types/hooks/useSyncCollectionStateToAppContext.d.ts.map +1 -0
  144. package/dist/types/hooks/useTableFeaturesAsync.d.ts +29 -0
  145. package/dist/types/hooks/useTableFeaturesAsync.d.ts.map +1 -0
  146. package/dist/types/hooks/useTableGridSwitchDragAndDrop.d.ts +1 -1
  147. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts +29 -0
  148. package/dist/types/hooks/useTableGridSwitchFeaturesAsync.d.ts.map +1 -0
  149. package/dist/types/hooks/useTableSections.d.ts +8 -0
  150. package/dist/types/hooks/useTableSections.d.ts.map +1 -0
  151. package/dist/types/utils/filterCreators.d.ts +10 -19
  152. package/dist/types/utils/filterCreators.d.ts.map +1 -1
  153. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts +5 -0
  154. package/dist/types/utils/minimalRequiredPatternsRuntimeCheck.d.ts.map +1 -0
  155. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts +9 -0
  156. package/dist/types/utils/minimalRequiredRuntimeCheck.d.ts.map +1 -0
  157. package/package.json +18 -17
  158. package/dist/cjs/hooks/useGridFeatures.js +0 -63
  159. package/dist/cjs/hooks/useGridFeatures.js.map +0 -1
  160. package/dist/cjs/hooks/useTableFeatures.js +0 -79
  161. package/dist/cjs/hooks/useTableFeatures.js.map +0 -1
  162. package/dist/cjs/hooks/useTableGridSwitchFeatures.js +0 -83
  163. package/dist/cjs/hooks/useTableGridSwitchFeatures.js.map +0 -1
  164. package/dist/esm/hooks/useGridFeatures.js +0 -58
  165. package/dist/esm/hooks/useGridFeatures.js.map +0 -1
  166. package/dist/esm/hooks/useTableFeatures.js +0 -74
  167. package/dist/esm/hooks/useTableFeatures.js.map +0 -1
  168. package/dist/esm/hooks/useTableGridSwitchFeatures.js +0 -78
  169. package/dist/esm/hooks/useTableGridSwitchFeatures.js.map +0 -1
  170. package/dist/types/hooks/useGridFeatures.d.ts +0 -43
  171. package/dist/types/hooks/useGridFeatures.d.ts.map +0 -1
  172. package/dist/types/hooks/useTableFeatures.d.ts +0 -27
  173. package/dist/types/hooks/useTableFeatures.d.ts.map +0 -1
  174. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts +0 -52
  175. package/dist/types/hooks/useTableGridSwitchFeatures.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_SchemaContext","_SkeletonEntity","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsCollectionPage","lazy","Promise","resolve","then","module","AutoPatternsEntityPage","AutoPatternsPage","pageConfig","type","collectionPage","entityPage","createElement","Suspense","fallback","__self","__source","fileName","lineNumber","columnNumber","configuration","SchemaProvider","collection","skeleton","SkeletonEntity","exports"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { PageConfig } from '../../types';\nimport { SchemaProvider } from '../../providers/SchemaContext';\nimport { SkeletonEntity } from '../AutoPatternsEntityPage/SkeletonEntity';\n\nconst AutoPatternsCollectionPage = lazy(() =>\n import('../AutoPatternsCollectionPage').then((module) => ({\n default: module.AutoPatternsCollectionPage,\n })),\n);\nconst AutoPatternsEntityPage = lazy(() =>\n import('../AutoPatternsEntityPage').then((module) => ({\n default: module.AutoPatternsEntityPage,\n })),\n);\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return (\n <Suspense fallback={<div />}>\n <AutoPatternsCollectionPage configuration={collectionPage} />\n </Suspense>\n );\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collection={entityPage}\n skeleton={<SkeletonEntity entityPage={entityPage} />}\n >\n <Suspense fallback={<SkeletonEntity entityPage={entityPage} />}>\n <AutoPatternsEntityPage configuration={entityPage} />\n </Suspense>\n </SchemaProvider>\n );\n }\n break;\n default:\n break;\n }\n\n return null;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAA0E,IAAAG,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,SAAAN,wBAAAM,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,UAAA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AA;cAAAC,QAAA,EAAAtC,YAAA;cAAAuC,UAAA;cAAAC,YAAA;YAAA;UAAA,CAAE,CAAE;UAAAJ,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAAtC,YAAA;YAAAuC,UAAA;YAAAC,YAAA;UAAA;QAAA,gBAC7D7C,MAAA,CAAAY,OAAA,CAAA0B,aAAA,CAACN,sBAAsB;UAACc,aAAa,EAAET,UAAW;UAAAI,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAAtC,YAAA;YAAAuC,UAAA;YAAAC,YAAA;UAAA;QAAA,CAAE,CAC5C,CACI,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC;AAACM,OAAA,CAAAlB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_SchemaContext","_SkeletonEntity","_AutoPatternsCollectionPage","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsEntityPage","lazy","Promise","resolve","then","module","AutoPatternsPage","pageConfig","type","collectionPage","entityPage","createElement","AutoPatternsCollectionPage","configuration","__self","__source","fileName","lineNumber","columnNumber","SchemaProvider","collection","skeleton","SkeletonEntity","Suspense","fallback","exports"],"sources":["../../../../src/components/AutoPatternsRoute/AutoPatternsPage.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { PageConfig } from '../../types';\nimport { SchemaProvider } from '../../providers/SchemaContext';\nimport { SkeletonEntity } from '../AutoPatternsEntityPage/SkeletonEntity';\nimport { AutoPatternsCollectionPage } from '../AutoPatternsCollectionPage';\n\nconst AutoPatternsEntityPage = lazy(() =>\n import('../AutoPatternsEntityPage').then((module) => ({\n default: module.AutoPatternsEntityPage,\n })),\n);\n\nexport interface AutoPatternsPageProps {\n pageConfig: PageConfig;\n}\n\nexport const AutoPatternsPage = ({ pageConfig }: AutoPatternsPageProps) => {\n const { type, collectionPage, entityPage } = pageConfig;\n\n switch (type) {\n case 'collectionPage':\n if (collectionPage) {\n return <AutoPatternsCollectionPage configuration={collectionPage} />;\n }\n break;\n case 'entityPage':\n if (entityPage) {\n return (\n <SchemaProvider\n collection={entityPage}\n skeleton={<SkeletonEntity entityPage={entityPage} />}\n >\n <Suspense fallback={<SkeletonEntity entityPage={entityPage} />}>\n <AutoPatternsEntityPage configuration={entityPage} />\n </Suspense>\n </SchemaProvider>\n );\n }\n break;\n default:\n break;\n }\n\n return null;\n};\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAA2E,IAAAI,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,SAAAP,wBAAAO,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,GA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,CAAA6C,cAAc;YAACZ,UAAU,EAAEA,UAAW;YAAAI,MAAA;YAAAC,QAAA;cAAAC,QAAA,EAAArC,YAAA;cAAAsC,UAAA;cAAAC,YAAA;YAAA;UAAA,CAAE,CAAE;UAAAJ,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,gBAErD7C,MAAA,CAAAa,OAAA,CAAAyB,aAAA,CAACtC,MAAA,CAAAkD,QAAQ;UAACC,QAAQ,eAAEnD,MAAA,CAAAa,OAAA,CAAAyB,aAAA,CAAClC,eAAA,CAAA6C,cAAc;YAACZ,UAAU,EAAEA,UAAW;YAAAI,MAAA;YAAAC,QAAA;cAAAC,QAAA,EAAArC,YAAA;cAAAsC,UAAA;cAAAC,YAAA;YAAA;UAAA,CAAE,CAAE;UAAAJ,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,gBAC7D7C,MAAA,CAAAa,OAAA,CAAAyB,aAAA,CAACX,sBAAsB;UAACa,aAAa,EAAEH,UAAW;UAAAI,MAAA;UAAAC,QAAA;YAAAC,QAAA,EAAArC,YAAA;YAAAsC,UAAA;YAAAC,YAAA;UAAA;QAAA,CAAE,CAC5C,CACI,CAAC;MAErB;MACA;IACF;MACE;EACJ;EAEA,OAAO,IAAI;AACb,CAAC;AAACO,OAAA,CAAAnB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -4,59 +4,160 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports.AutoPatternsTable = void 0;
6
6
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _patterns = require("@wix/patterns");
9
- var _hooks = require("../../hooks");
9
+ var _useBasePatternsStateParams = require("../../hooks/useBasePatternsStateParams");
10
+ var _useTableFeaturesAsync = require("../../hooks/useTableFeaturesAsync");
11
+ var _useBaseCollectionComponentReadyFeatures = require("../../hooks/useBaseCollectionComponentReadyFeatures");
10
12
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsTable/AutoPatternsTable.tsx";
11
- const AutoPatternsTable = ({
12
- configuration
13
- }) => {
13
+ 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); }
14
+ 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; }
15
+ /**
16
+ * AutoPatternsTableLoaded - Step 4 in Table Flow
17
+ *
18
+ * FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → useTableFeaturesAsync → [AutoPatternsTableLoaded] → useBaseCollectionComponentReadyFeatures → Table
19
+ *
20
+ * This component renders when all async features have been loaded and are ready.
21
+ * It represents the "loaded" state of the table flow and handles:
22
+ *
23
+ * Key Responsibilities:
24
+ * - Creates the table collection state using loaded async features
25
+ * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
26
+ * - Extracts and applies table-specific features (baseTableFeatures, sections, dragAndDrop)
27
+ * - Renders the final Table component with all features combined
28
+ * - Merges all feature props into a single props object for the Table
29
+ */
30
+ const AutoPatternsTableLoaded = props => {
14
31
  const {
15
- state,
16
- columns,
17
- customColumns,
18
- search,
19
- title,
20
- emptyState,
21
- filters,
22
- views,
23
- actionCell,
24
- bulkActionToolbar,
25
- onRowClick,
26
- stickyColumns,
27
- stickySelectionColumn,
28
- showTitleBar,
32
+ config,
33
+ asyncFeaturesState,
34
+ baseStateParams,
35
+ dataHook
36
+ } = props;
37
+
38
+ // Extract loaded async features from the successful feature loading state
39
+ const {
40
+ baseTableFeatures,
29
41
  sections,
30
- dragAndDropProps,
31
- dataExtension
32
- } = (0, _hooks.useTableFeatures)(configuration);
42
+ dragAndDrop
43
+ } = (0, _patterns.useSelector)(() => ({
44
+ ...asyncFeaturesState.status.data
45
+ }));
46
+
47
+ // Create table collection state with the loaded async dependencies
48
+ const state = (0, _patterns.useTableCollection)(baseStateParams.params);
49
+
50
+ // STEP 5: Call shared hook that prepares final collection features
51
+ // This hook is shared across all three flows (Table, Grid, TableGridSwitch)
52
+ const baseCollectionComponentReadyFeatures = (0, _useBaseCollectionComponentReadyFeatures.useBaseCollectionComponentReadyFeatures)({
53
+ config,
54
+ collection: state.collection,
55
+ asyncFeaturesState,
56
+ baseStateParams
57
+ });
58
+
59
+ // Extract feature-specific props from loaded features
60
+ const dragAndDropProps = dragAndDrop == null || dragAndDrop.useTableDragAndDrop == null ? void 0 : dragAndDrop.useTableDragAndDrop(config);
61
+ const baseTableFeaturesProps = baseTableFeatures == null ? void 0 : baseTableFeatures.useBaseTableFeatures(config);
62
+ const sectionsProps = sections == null ? void 0 : sections.useTableSections(config);
63
+
64
+ // FINAL STEP: Render the fully-featured Table component
65
+ // Combines all loaded features into final table props
33
66
  return /*#__PURE__*/_react.default.createElement(_patterns.Table, (0, _extends2.default)({
34
- dataHook: "auto-patterns-table",
35
- search: search,
36
- title: title,
67
+ dataHook: dataHook,
37
68
  state: state,
38
- columns: columns,
39
- dataExtension: dataExtension,
40
- customColumns: customColumns
41
- }, dragAndDropProps, {
42
- actionCell: actionCell,
43
- filters: filters,
44
- views: views,
45
- emptyState: emptyState,
46
- bulkActionToolbar: bulkActionToolbar,
47
- onRowClick: onRowClick,
69
+ columns: [],
48
70
  horizontalScroll: true,
49
- stickyColumns: stickyColumns,
50
- stickySelectionColumn: stickySelectionColumn,
51
- showTitleBar: showTitleBar,
52
- sections: sections,
71
+ useNewInfiniteScrollLoader: true
72
+ }, sectionsProps && {
73
+ sections: sectionsProps
74
+ }, baseTableFeaturesProps, baseCollectionComponentReadyFeatures, dragAndDropProps, {
53
75
  __self: void 0,
54
76
  __source: {
55
77
  fileName: _jsxFileName,
56
- lineNumber: 34,
78
+ lineNumber: 70,
57
79
  columnNumber: 5
58
80
  }
59
81
  }));
60
82
  };
83
+
84
+ /**
85
+ * AutoPatternsTable - Step 2 in Table Flow
86
+ *
87
+ * FLOW 1: AutoPatternsCollectionComponent → [AutoPatternsTable] → useTableFeaturesAsync → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table
88
+ *
89
+ * This is the main table component that orchestrates the table rendering flow.
90
+ * It handles the loading states and coordinates between async feature loading and final rendering.
91
+ *
92
+ * Key Responsibilities:
93
+ * - Prepares visible field IDs from table column configuration
94
+ * - Calls useTableFeaturesAsync (Step 3) to load table-specific async features
95
+ * - Creates initial table state with basic collection
96
+ * - Monitors loading status and switches between loading/loaded states
97
+ * - Renders skeleton table during loading or AutoPatternsTableLoaded when ready
98
+ */
99
+ const AutoPatternsTable = props => {
100
+ const {
101
+ config
102
+ } = props;
103
+
104
+ // Extract visible field IDs from table columns for data fetching optimization
105
+ const visibleFieldIds = (0, _react.useMemo)(() => config.columns.map(column => column.id), [config]);
106
+
107
+ // Initialize base state parameters with collection config and visible fields
108
+ const baseStateParams = (0, _useBasePatternsStateParams.useBasePatternsStateParams)(config, {
109
+ visibleFieldIds
110
+ });
111
+
112
+ // STEP 3: Load table-specific async features (drag&drop, sections, base table features)
113
+ const {
114
+ asyncFeaturesState
115
+ } = (0, _useTableFeaturesAsync.useTableFeaturesAsync)({
116
+ config
117
+ });
118
+
119
+ // Create patterns container and collection factory
120
+ const container = (0, _patterns.useWixPatternsContainer)();
121
+ const createCollection = (0, _patterns.useCreateCollection)();
122
+
123
+ // Initialize table state with basic collection (used during loading)
124
+ const [state] = (0, _react.useState)(() => new _patterns.TableState({
125
+ collection: createCollection(baseStateParams.params),
126
+ container
127
+ }));
128
+
129
+ // Monitor async features loading status
130
+ const isReady = (0, _patterns.useSelector)(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
131
+ const dataHook = 'auto-patterns-table';
132
+ if (isReady) {
133
+ // STEP 4: All features loaded - render the fully-featured table
134
+ return /*#__PURE__*/_react.default.createElement(AutoPatternsTableLoaded, {
135
+ dataHook: dataHook,
136
+ config: config,
137
+ baseStateParams: baseStateParams,
138
+ asyncFeaturesState: asyncFeaturesState,
139
+ __self: void 0,
140
+ __source: {
141
+ fileName: _jsxFileName,
142
+ lineNumber: 140,
143
+ columnNumber: 7
144
+ }
145
+ });
146
+ }
147
+
148
+ // LOADING STATE: Render basic table skeleton while features are loading
149
+ return /*#__PURE__*/_react.default.createElement(_patterns.Table, {
150
+ dataHook: dataHook,
151
+ useNewInfiniteScrollLoader: true,
152
+ state: state,
153
+ columns: [],
154
+ __self: void 0,
155
+ __source: {
156
+ fileName: _jsxFileName,
157
+ lineNumber: 151,
158
+ columnNumber: 5
159
+ }
160
+ });
161
+ };
61
162
  exports.AutoPatternsTable = AutoPatternsTable;
62
163
  //# sourceMappingURL=AutoPatternsTable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_hooks","_jsxFileName","AutoPatternsTable","configuration","state","columns","customColumns","search","title","emptyState","filters","views","actionCell","bulkActionToolbar","onRowClick","stickyColumns","stickySelectionColumn","showTitleBar","sections","dragAndDropProps","dataExtension","useTableFeatures","default","createElement","Table","_extends2","dataHook","horizontalScroll","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React from 'react';\nimport { Table } from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useTableFeatures } from '../../hooks';\n\nexport interface AutoPatternsTableContentProps {\n configuration: TableConfig;\n}\n\nexport const AutoPatternsTable = ({\n configuration,\n}: AutoPatternsTableContentProps) => {\n const {\n state,\n columns,\n customColumns,\n search,\n title,\n emptyState,\n filters,\n views,\n actionCell,\n bulkActionToolbar,\n onRowClick,\n stickyColumns,\n stickySelectionColumn,\n showTitleBar,\n sections,\n dragAndDropProps,\n dataExtension,\n } = useTableFeatures(configuration);\n\n return (\n <Table\n dataHook=\"auto-patterns-table\"\n search={search}\n title={title}\n state={state}\n columns={columns}\n dataExtension={dataExtension}\n customColumns={customColumns}\n {...dragAndDropProps}\n actionCell={actionCell}\n filters={filters}\n views={views}\n emptyState={emptyState}\n bulkActionToolbar={bulkActionToolbar}\n onRowClick={onRowClick}\n horizontalScroll\n stickyColumns={stickyColumns}\n stickySelectionColumn={stickySelectionColumn}\n showTitleBar={showTitleBar}\n sections={sections}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAA+C,IAAAG,YAAA;AAMxC,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC;AAC6B,CAAC,KAAK;EACnC,MAAM;IACJC,KAAK;IACLC,OAAO;IACPC,aAAa;IACbC,MAAM;IACNC,KAAK;IACLC,UAAU;IACVC,OAAO;IACPC,KAAK;IACLC,UAAU;IACVC,iBAAiB;IACjBC,UAAU;IACVC,aAAa;IACbC,qBAAqB;IACrBC,YAAY;IACZC,QAAQ;IACRC,gBAAgB;IAChBC;EACF,CAAC,GAAG,IAAAC,uBAAgB,EAAClB,aAAa,CAAC;EAEnC,oBACEP,MAAA,CAAA0B,OAAA,CAAAC,aAAA,CAACxB,SAAA,CAAAyB,KAAK,MAAAC,SAAA,CAAAH,OAAA;IACJI,QAAQ,EAAC,qBAAqB;IAC9BnB,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbJ,KAAK,EAAEA,KAAM;IACbC,OAAO,EAAEA,OAAQ;IACjBe,aAAa,EAAEA,aAAc;IAC7Bd,aAAa,EAAEA;EAAc,GACzBa,gBAAgB;IACpBP,UAAU,EAAEA,UAAW;IACvBF,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAEA,KAAM;IACbF,UAAU,EAAEA,UAAW;IACvBI,iBAAiB,EAAEA,iBAAkB;IACrCC,UAAU,EAAEA,UAAW;IACvBa,gBAAgB;IAChBZ,aAAa,EAAEA,aAAc;IAC7BC,qBAAqB,EAAEA,qBAAsB;IAC7CC,YAAY,EAAEA,YAAa;IAC3BC,QAAQ,EAAEA,QAAS;IAAAU,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAA7B,YAAA;MAAA8B,UAAA;MAAAC,YAAA;IAAA;EAAA,EACpB,CAAC;AAEN,CAAC;AAACC,OAAA,CAAA/B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_patterns","_useBasePatternsStateParams","_useTableFeaturesAsync","_useBaseCollectionComponentReadyFeatures","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsTableLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","baseTableFeatures","sections","dragAndDrop","useSelector","status","data","state","useTableCollection","params","baseCollectionComponentReadyFeatures","useBaseCollectionComponentReadyFeatures","collection","dragAndDropProps","useTableDragAndDrop","baseTableFeaturesProps","useBaseTableFeatures","sectionsProps","useTableSections","createElement","Table","_extends2","columns","horizontalScroll","useNewInfiniteScrollLoader","__self","__source","fileName","lineNumber","columnNumber","AutoPatternsTable","visibleFieldIds","useMemo","map","column","id","useBasePatternsStateParams","useTableFeaturesAsync","container","useWixPatternsContainer","createCollection","useCreateCollection","useState","TableState","isReady","isSuccess","isError","exports"],"sources":["../../../../src/components/AutoPatternsTable/AutoPatternsTable.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n Table,\n TableState,\n useCreateCollection,\n useSelector,\n useTableCollection,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { TableConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useTableFeaturesAsync } from '../../hooks/useTableFeaturesAsync';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsTableContentProps {\n config: TableConfig;\n}\n\n/**\n * AutoPatternsTableLoaded - Step 4 in Table Flow\n *\n * FLOW 1: AutoPatternsCollectionComponent → AutoPatternsTable → useTableFeaturesAsync → [AutoPatternsTableLoaded] → useBaseCollectionComponentReadyFeatures → Table\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the table flow and handles:\n *\n * Key Responsibilities:\n * - Creates the table collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Extracts and applies table-specific features (baseTableFeatures, sections, dragAndDrop)\n * - Renders the final Table component with all features combined\n * - Merges all feature props into a single props object for the Table\n */\nconst AutoPatternsTableLoaded = (\n props: NonNullable<ReturnType<typeof useTableFeaturesAsync>> &\n AutoPatternsTableContentProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract loaded async features from the successful feature loading state\n const { baseTableFeatures, sections, dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create table collection state with the loaded async dependencies\n const state = useTableCollection<any>(baseStateParams.params);\n\n // STEP 5: Call shared hook that prepares final collection features\n // This hook is shared across all three flows (Table, Grid, TableGridSwitch)\n const baseCollectionComponentReadyFeatures =\n useBaseCollectionComponentReadyFeatures({\n config,\n collection: state.collection,\n asyncFeaturesState,\n baseStateParams,\n });\n\n // Extract feature-specific props from loaded features\n const dragAndDropProps = dragAndDrop?.useTableDragAndDrop?.(config);\n const baseTableFeaturesProps =\n baseTableFeatures?.useBaseTableFeatures(config);\n const sectionsProps = sections?.useTableSections(config);\n\n // FINAL STEP: Render the fully-featured Table component\n // Combines all loaded features into final table props\n return (\n <Table\n dataHook={dataHook}\n state={state}\n columns={[]}\n horizontalScroll\n useNewInfiniteScrollLoader\n {...(sectionsProps && { sections: sectionsProps })}\n {...baseTableFeaturesProps}\n {...baseCollectionComponentReadyFeatures}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsTable - Step 2 in Table Flow\n *\n * FLOW 1: AutoPatternsCollectionComponent → [AutoPatternsTable] → useTableFeaturesAsync → AutoPatternsTableLoaded → useBaseCollectionComponentReadyFeatures → Table\n *\n * This is the main table component that orchestrates the table rendering flow.\n * It handles the loading states and coordinates between async feature loading and final rendering.\n *\n * Key Responsibilities:\n * - Prepares visible field IDs from table column configuration\n * - Calls useTableFeaturesAsync (Step 3) to load table-specific async features\n * - Creates initial table state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton table during loading or AutoPatternsTableLoaded when ready\n */\nexport const AutoPatternsTable = (props: AutoPatternsTableContentProps) => {\n const { config } = props;\n\n // Extract visible field IDs from table columns for data fetching optimization\n const visibleFieldIds = useMemo(\n () => config.columns.map((column) => column.id),\n [config],\n );\n\n // Initialize base state parameters with collection config and visible fields\n const baseStateParams = useBasePatternsStateParams(config, {\n visibleFieldIds,\n });\n\n // STEP 3: Load table-specific async features (drag&drop, sections, base table features)\n const { asyncFeaturesState } = useTableFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize table state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new TableState<any, {}>({\n collection: createCollection<any, {}>(baseStateParams.params),\n container,\n }),\n );\n\n // Monitor async features loading status\n const isReady = useSelector(\n () =>\n asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError,\n );\n\n const dataHook = 'auto-patterns-table';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured table\n return (\n <AutoPatternsTableLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic table skeleton while features are loading\n return (\n <Table\n dataHook={dataHook}\n useNewInfiniteScrollLoader\n state={state}\n columns={[]}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AASA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAH,OAAA;AACA,IAAAI,wCAAA,GAAAJ,OAAA;AAA8G,IAAAK,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,SAAAR,wBAAAQ,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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MAAM,CAAC;IAC7D6B;EACF,CAAC,CACL,CAAC;;EAED;EACA,MAAMM,OAAO,GAAG,IAAAxC,qBAAW,EACzB,MACEN,kBAAkB,CAACO,MAAM,CAACwC,SAAS,IAAI/C,kBAAkB,CAACO,MAAM,CAACyC,OACrE,CAAC;EAED,MAAM9C,QAAQ,GAAG,qBAAqB;EAEtC,IAAI4C,OAAO,EAAE;IACX;IACA,oBACE7E,MAAA,CAAAc,OAAA,CAAAsC,aAAA,CAACxB,uBAAuB;MACtBK,QAAQ,EAAEA,QAAS;MACnBH,MAAM,EAAEA,MAAO;MACfE,eAAe,EAAEA,eAAgB;MACjCD,kBAAkB,EAAEA,kBAAmB;MAAA2B,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAArD,YAAA;QAAAsD,UAAA;QAAAC,YAAA;MAAA;IAAA,CACxC,CAAC;EAEN;;EAEA;EACA,oBACE9D,MAAA,CAAAc,OAAA,CAAAsC,aAAA,CAACjD,SAAA,CAAAkD,KAAK;IACJpB,QAAQ,EAAEA,QAAS;IACnBwB,0BAA0B;IAC1BjB,KAAK,EAAEA,KAAM;IACbe,OAAO,EAAE,EAAG;IAAAG,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAArD,YAAA;MAAAsD,UAAA;MAAAC,YAAA;IAAA;EAAA,CACb,CAAC;AAEN,CAAC;AAACkB,OAAA,CAAAjB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -4,24 +4,184 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports.AutoPatternsTableGridSwitch = void 0;
6
6
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
7
- var _react = _interopRequireDefault(require("react"));
7
+ var _react = _interopRequireWildcard(require("react"));
8
8
  var _patterns = require("@wix/patterns");
9
- var _useTableGridSwitchFeatures = require("../../hooks/useTableGridSwitchFeatures");
9
+ var _useBasePatternsStateParams = require("../../hooks/useBasePatternsStateParams");
10
+ var _useTableGridSwitchFeaturesAsync = require("../../hooks/useTableGridSwitchFeaturesAsync");
11
+ var _useBaseGridFeatures = require("../../hooks/useBaseGridFeatures");
12
+ var _useBaseCollectionComponentReadyFeatures = require("../../hooks/useBaseCollectionComponentReadyFeatures");
10
13
  var _jsxFileName = "/home/builduser/work/8f3ab5a55e62623a/packages/auto-patterns/dist/cjs/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.tsx";
11
- const AutoPatternsTableGridSwitch = ({
12
- configuration
13
- }) => {
14
- const props = (0, _useTableGridSwitchFeatures.useTableGridSwitchFeatures)(configuration);
14
+ 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); }
15
+ 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; }
16
+ /**
17
+ * AutoPatternsTableGridSwitchLoaded - Step 4 in TableGridSwitch Flow
18
+ *
19
+ * FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → useTableGridSwitchFeaturesAsync → [AutoPatternsTableGridSwitchLoaded] → useBaseCollectionComponentReadyFeatures → TableGridSwitch
20
+ *
21
+ * This component renders when all async features have been loaded and are ready.
22
+ * It represents the "loaded" state of the table-grid switch flow and handles:
23
+ *
24
+ * Key Responsibilities:
25
+ * - Creates the table-grid-switch collection state using loaded async features
26
+ * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation
27
+ * - Combines both table features (baseTableFeatures) and grid features (renderItem, preset, imagePlacement)
28
+ * - Extracts async features like dragAndDrop if enabled
29
+ * - Renders the final TableGridSwitch component with all features combined
30
+ * - Provides both table columns AND grid display props to support switching
31
+ */
32
+ const AutoPatternsTableGridSwitchLoaded = props => {
33
+ const {
34
+ config,
35
+ asyncFeaturesState,
36
+ baseStateParams,
37
+ dataHook
38
+ } = props;
39
+
40
+ // Extract grid-specific display features (for grid mode when user switches)
41
+ const {
42
+ renderItem,
43
+ imagePlacement,
44
+ preset
45
+ } = (0, _useBaseGridFeatures.useBaseGridFeatures)(config);
46
+
47
+ // Extract loaded async features from the successful feature loading state
48
+ const {
49
+ baseTableFeatures,
50
+ dragAndDrop
51
+ } = (0, _patterns.useSelector)(() => ({
52
+ ...asyncFeaturesState.status.data
53
+ }));
54
+
55
+ // Create table-grid-switch collection state with the loaded async dependencies
56
+ const state = (0, _patterns.useTableGridSwitchCollection)(baseStateParams.params);
57
+
58
+ // STEP 5: Call shared hook that prepares final collection features
59
+ // This hook is shared across all three flows (Table, Grid, TableGridSwitch)
60
+ const baseCollectionComponentReadyFeatures = (0, _useBaseCollectionComponentReadyFeatures.useBaseCollectionComponentReadyFeatures)({
61
+ config,
62
+ collection: state.collection,
63
+ asyncFeaturesState,
64
+ baseStateParams
65
+ });
66
+
67
+ // Extract table-grid-switch specific drag and drop props if feature is loaded
68
+ const dragAndDropProps = dragAndDrop == null || dragAndDrop.useTableGridSwitchDragAndDrop == null ? void 0 : dragAndDrop.useTableGridSwitchDragAndDrop(config);
69
+
70
+ // Extract table-specific features (for table mode when user switches)
71
+ const baseTableFeaturesProps = baseTableFeatures == null ? void 0 : baseTableFeatures.useBaseTableFeatures(config);
72
+
73
+ // FINAL STEP: Render the fully-featured TableGridSwitch component
74
+ // Combines table features, grid features, and switch functionality
15
75
  return /*#__PURE__*/_react.default.createElement(_patterns.TableGridSwitch, (0, _extends2.default)({
16
- dataHook: "auto-patterns-table-grid-switch"
17
- }, props, {
76
+ dataHook: dataHook,
77
+ preset: preset,
78
+ imagePlacement: imagePlacement,
79
+ renderItem: renderItem,
80
+ columns: [],
81
+ state: state
82
+ }, baseCollectionComponentReadyFeatures, baseTableFeaturesProps, dragAndDropProps, {
18
83
  __self: void 0,
19
84
  __source: {
20
85
  fileName: _jsxFileName,
21
- lineNumber: 15,
86
+ lineNumber: 76,
22
87
  columnNumber: 5
23
88
  }
24
89
  }));
25
90
  };
91
+
92
+ /**
93
+ * AutoPatternsTableGridSwitch - Step 2 in TableGridSwitch Flow
94
+ *
95
+ * FLOW 3: AutoPatternsCollectionComponent → [AutoPatternsTableGridSwitch] → useTableGridSwitchFeaturesAsync → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch
96
+ *
97
+ * This is the main table-grid-switch component that orchestrates the combined table/grid rendering flow.
98
+ * It handles both table and grid configurations simultaneously to support runtime switching.
99
+ *
100
+ * Key Responsibilities:
101
+ * - Merges visible field IDs from both table columns AND grid features for comprehensive data fetching
102
+ * - Extracts grid display features (renderItem, preset, imagePlacement) for grid mode
103
+ * - Calls useTableGridSwitchFeaturesAsync (Step 3) to load combined async features
104
+ * - Creates initial table-grid-switch state with basic collection
105
+ * - Monitors loading status and switches between loading/loaded states
106
+ * - Renders skeleton TableGridSwitch during loading or AutoPatternsTableGridSwitchLoaded when ready
107
+ */
108
+ const AutoPatternsTableGridSwitch = props => {
109
+ const {
110
+ config
111
+ } = props;
112
+
113
+ // Extract visible field IDs from table columns (for table mode)
114
+ const tableVisibleFieldIds = (0, _react.useMemo)(() => config.columns.map(column => column.id), [config]);
115
+
116
+ // Extract grid display features and visible field IDs (for grid mode)
117
+ const {
118
+ renderItem,
119
+ imagePlacement,
120
+ preset,
121
+ visibleFieldIds: gridVisibleFieldIds
122
+ } = (0, _useBaseGridFeatures.useBaseGridFeatures)(config);
123
+
124
+ // IMPORTANT: Merge visible fields from BOTH table AND grid to support switching
125
+ // This ensures all necessary data is loaded regardless of current view mode
126
+ const visibleFieldIds = (0, _react.useMemo)(() => Array.from(new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds])), [tableVisibleFieldIds, gridVisibleFieldIds]);
127
+
128
+ // Initialize base state parameters with collection config and combined visible fields
129
+ const baseStateParams = (0, _useBasePatternsStateParams.useBasePatternsStateParams)(config, {
130
+ visibleFieldIds
131
+ });
132
+
133
+ // STEP 3: Load table-grid-switch async features (combines table + grid features)
134
+ const {
135
+ asyncFeaturesState
136
+ } = (0, _useTableGridSwitchFeaturesAsync.useTableGridSwitchFeaturesAsync)({
137
+ config
138
+ });
139
+
140
+ // Create patterns container and collection factory
141
+ const container = (0, _patterns.useWixPatternsContainer)();
142
+ const createCollection = (0, _patterns.useCreateCollection)();
143
+
144
+ // Initialize table-grid-switch state with basic collection (used during loading)
145
+ const [state] = (0, _react.useState)(() => new _patterns.TableGridSwitchState({
146
+ collection: createCollection(baseStateParams.params),
147
+ container,
148
+ containerOverrides: {}
149
+ }));
150
+
151
+ // Monitor async features loading status
152
+ const isReady = (0, _patterns.useSelector)(() => asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError);
153
+ const dataHook = 'auto-patterns-table-grid-switch';
154
+ if (isReady) {
155
+ // STEP 4: All features loaded - render the fully-featured table-grid-switch
156
+ return /*#__PURE__*/_react.default.createElement(AutoPatternsTableGridSwitchLoaded, {
157
+ dataHook: dataHook,
158
+ config: config,
159
+ baseStateParams: baseStateParams,
160
+ asyncFeaturesState: asyncFeaturesState,
161
+ __self: void 0,
162
+ __source: {
163
+ fileName: _jsxFileName,
164
+ lineNumber: 166,
165
+ columnNumber: 7
166
+ }
167
+ });
168
+ }
169
+
170
+ // LOADING STATE: Render basic table-grid-switch skeleton while features are loading
171
+ return /*#__PURE__*/_react.default.createElement(_patterns.TableGridSwitch, {
172
+ dataHook: dataHook,
173
+ state: state,
174
+ columns: [],
175
+ preset: preset,
176
+ imagePlacement: imagePlacement,
177
+ renderItem: renderItem,
178
+ __self: void 0,
179
+ __source: {
180
+ fileName: _jsxFileName,
181
+ lineNumber: 177,
182
+ columnNumber: 5
183
+ }
184
+ });
185
+ };
26
186
  exports.AutoPatternsTableGridSwitch = AutoPatternsTableGridSwitch;
27
187
  //# sourceMappingURL=AutoPatternsTableGridSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_patterns","_useTableGridSwitchFeatures","_jsxFileName","AutoPatternsTableGridSwitch","configuration","props","useTableGridSwitchFeatures","default","createElement","TableGridSwitch","_extends2","dataHook","__self","__source","fileName","lineNumber","columnNumber","exports"],"sources":["../../../../src/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.tsx"],"sourcesContent":["import React from 'react';\nimport { TableGridSwitch } from '@wix/patterns';\nimport { TableGridSwitchConfig } from '../../types';\nimport { useTableGridSwitchFeatures } from '../../hooks/useTableGridSwitchFeatures';\n\nexport interface AutoPatternsTableGridSwitchProps {\n configuration: TableGridSwitchConfig;\n}\n\nexport const AutoPatternsTableGridSwitch = ({\n configuration,\n}: AutoPatternsTableGridSwitchProps) => {\n const props = useTableGridSwitchFeatures(configuration);\n return (\n <TableGridSwitch dataHook=\"auto-patterns-table-grid-switch\" {...props} />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,2BAAA,GAAAF,OAAA;AAAoF,IAAAG,YAAA;AAM7E,MAAMC,2BAA2B,GAAGA,CAAC;EAC1CC;AACgC,CAAC,KAAK;EACtC,MAAMC,KAAK,GAAG,IAAAC,sDAA0B,EAACF,aAAa,CAAC;EACvD,oBACEP,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACR,SAAA,CAAAS,eAAe,MAAAC,SAAA,CAAAH,OAAA;IAACI,QAAQ,EAAC;EAAiC,GAAKN,KAAK;IAAAO,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAAZ,YAAA;MAAAa,UAAA;MAAAC,YAAA;IAAA;EAAA,EAAG,CAAC;AAE7E,CAAC;AAACC,OAAA,CAAAd,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_patterns","_useBasePatternsStateParams","_useTableGridSwitchFeaturesAsync","_useBaseGridFeatures","_useBaseCollectionComponentReadyFeatures","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AutoPatternsTableGridSwitchLoaded","props","config","asyncFeaturesState","baseStateParams","dataHook","renderItem","imagePlacement","preset","useBaseGridFeatures","baseTableFeatures","dragAndDrop","useSelector","status","data","state","useTableGridSwitchCollection","params","baseCollectionComponentReadyFeatures","useBaseCollectionComponentReadyFeatures","collection","dragAndDropProps","useTableGridSwitchDragAndDrop","baseTableFeaturesProps","useBaseTableFeatures","createElement","TableGridSwitch","_extends2","columns","__self","__source","fileName","lineNumber","columnNumber","AutoPatternsTableGridSwitch","tableVisibleFieldIds","useMemo","map","column","id","visibleFieldIds","gridVisibleFieldIds","Array","from","Set","useBasePatternsStateParams","useTableGridSwitchFeaturesAsync","container","useWixPatternsContainer","createCollection","useCreateCollection","useState","TableGridSwitchState","containerOverrides","isReady","isSuccess","isError","exports"],"sources":["../../../../src/components/AutoPatternsTableGridSwitch/AutoPatternsTableGridSwitch.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport {\n TableGridSwitch,\n TableGridSwitchState,\n useCreateCollection,\n useSelector,\n useTableGridSwitchCollection,\n useWixPatternsContainer,\n} from '@wix/patterns';\nimport { TableGridSwitchConfig } from '../../types';\nimport { useBasePatternsStateParams } from '../../hooks/useBasePatternsStateParams';\nimport { useTableGridSwitchFeaturesAsync } from '../../hooks/useTableGridSwitchFeaturesAsync';\nimport { useBaseGridFeatures } from '../../hooks/useBaseGridFeatures';\nimport { useBaseCollectionComponentReadyFeatures } from '../../hooks/useBaseCollectionComponentReadyFeatures';\n\nexport interface AutoPatternsTableGridSwitchProps {\n config: TableGridSwitchConfig;\n}\n\n/**\n * AutoPatternsTableGridSwitchLoaded - Step 4 in TableGridSwitch Flow\n *\n * FLOW 3: AutoPatternsCollectionComponent → AutoPatternsTableGridSwitch → useTableGridSwitchFeaturesAsync → [AutoPatternsTableGridSwitchLoaded] → useBaseCollectionComponentReadyFeatures → TableGridSwitch\n *\n * This component renders when all async features have been loaded and are ready.\n * It represents the \"loaded\" state of the table-grid switch flow and handles:\n *\n * Key Responsibilities:\n * - Creates the table-grid-switch collection state using loaded async features\n * - Calls useBaseCollectionComponentReadyFeatures for final feature preparation\n * - Combines both table features (baseTableFeatures) and grid features (renderItem, preset, imagePlacement)\n * - Extracts async features like dragAndDrop if enabled\n * - Renders the final TableGridSwitch component with all features combined\n * - Provides both table columns AND grid display props to support switching\n */\nconst AutoPatternsTableGridSwitchLoaded = (\n props: NonNullable<ReturnType<typeof useTableGridSwitchFeaturesAsync>> &\n AutoPatternsTableGridSwitchProps & {\n baseStateParams: ReturnType<typeof useBasePatternsStateParams>;\n dataHook?: string;\n },\n) => {\n const { config, asyncFeaturesState, baseStateParams, dataHook } = props;\n\n // Extract grid-specific display features (for grid mode when user switches)\n const { renderItem, imagePlacement, preset } = useBaseGridFeatures(config);\n\n // Extract loaded async features from the successful feature loading state\n const { baseTableFeatures, dragAndDrop } = useSelector(() => ({\n ...asyncFeaturesState.status.data,\n }));\n\n // Create table-grid-switch collection state with the loaded async dependencies\n const state = useTableGridSwitchCollection<any>(baseStateParams.params);\n\n // STEP 5: Call shared hook that prepares final collection features\n // This hook is shared across all three flows (Table, Grid, TableGridSwitch)\n const baseCollectionComponentReadyFeatures =\n useBaseCollectionComponentReadyFeatures({\n config,\n collection: state.collection,\n asyncFeaturesState,\n baseStateParams,\n });\n\n // Extract table-grid-switch specific drag and drop props if feature is loaded\n const dragAndDropProps = dragAndDrop?.useTableGridSwitchDragAndDrop?.(config);\n\n // Extract table-specific features (for table mode when user switches)\n const baseTableFeaturesProps =\n baseTableFeatures?.useBaseTableFeatures(config);\n\n // FINAL STEP: Render the fully-featured TableGridSwitch component\n // Combines table features, grid features, and switch functionality\n return (\n <TableGridSwitch\n dataHook={dataHook}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n columns={[]}\n state={state}\n {...baseCollectionComponentReadyFeatures}\n {...baseTableFeaturesProps}\n {...dragAndDropProps}\n />\n );\n};\n\n/**\n * AutoPatternsTableGridSwitch - Step 2 in TableGridSwitch Flow\n *\n * FLOW 3: AutoPatternsCollectionComponent → [AutoPatternsTableGridSwitch] → useTableGridSwitchFeaturesAsync → AutoPatternsTableGridSwitchLoaded → useBaseCollectionComponentReadyFeatures → TableGridSwitch\n *\n * This is the main table-grid-switch component that orchestrates the combined table/grid rendering flow.\n * It handles both table and grid configurations simultaneously to support runtime switching.\n *\n * Key Responsibilities:\n * - Merges visible field IDs from both table columns AND grid features for comprehensive data fetching\n * - Extracts grid display features (renderItem, preset, imagePlacement) for grid mode\n * - Calls useTableGridSwitchFeaturesAsync (Step 3) to load combined async features\n * - Creates initial table-grid-switch state with basic collection\n * - Monitors loading status and switches between loading/loaded states\n * - Renders skeleton TableGridSwitch during loading or AutoPatternsTableGridSwitchLoaded when ready\n */\nexport const AutoPatternsTableGridSwitch = (\n props: AutoPatternsTableGridSwitchProps,\n) => {\n const { config } = props;\n\n // Extract visible field IDs from table columns (for table mode)\n const tableVisibleFieldIds = useMemo(\n () => config.columns.map((column) => column.id),\n [config],\n );\n\n // Extract grid display features and visible field IDs (for grid mode)\n const {\n renderItem,\n imagePlacement,\n preset,\n visibleFieldIds: gridVisibleFieldIds,\n } = useBaseGridFeatures(config);\n\n // IMPORTANT: Merge visible fields from BOTH table AND grid to support switching\n // This ensures all necessary data is loaded regardless of current view mode\n const visibleFieldIds = useMemo(\n () =>\n Array.from(new Set([...tableVisibleFieldIds, ...gridVisibleFieldIds])),\n [tableVisibleFieldIds, gridVisibleFieldIds],\n );\n\n // Initialize base state parameters with collection config and combined visible fields\n const baseStateParams = useBasePatternsStateParams(config, {\n visibleFieldIds,\n });\n\n // STEP 3: Load table-grid-switch async features (combines table + grid features)\n const { asyncFeaturesState } = useTableGridSwitchFeaturesAsync({ config });\n\n // Create patterns container and collection factory\n const container = useWixPatternsContainer();\n const createCollection = useCreateCollection();\n\n // Initialize table-grid-switch state with basic collection (used during loading)\n const [state] = useState(\n () =>\n new TableGridSwitchState<any, {}>({\n collection: createCollection<any, {}>(baseStateParams.params),\n container,\n containerOverrides: {},\n }),\n );\n\n // Monitor async features loading status\n const isReady = useSelector(\n () =>\n asyncFeaturesState.status.isSuccess || asyncFeaturesState.status.isError,\n );\n\n const dataHook = 'auto-patterns-table-grid-switch';\n\n if (isReady) {\n // STEP 4: All features loaded - render the fully-featured table-grid-switch\n return (\n <AutoPatternsTableGridSwitchLoaded\n dataHook={dataHook}\n config={config}\n baseStateParams={baseStateParams}\n asyncFeaturesState={asyncFeaturesState}\n />\n );\n }\n\n // LOADING STATE: Render basic table-grid-switch skeleton while features are loading\n return (\n <TableGridSwitch\n dataHook={dataHook}\n state={state}\n columns={[]}\n preset={preset}\n imagePlacement={imagePlacement}\n renderItem={renderItem}\n />\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AASA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,gCAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,wCAAA,GAAAL,OAAA;AAA8G,IAAAM,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,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IA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AM,EAAEA,MAAO;MACfE,eAAe,EAAEA,eAAgB;MACjCD,kBAAkB,EAAEA,kBAAmB;MAAA0B,MAAA;MAAAC,QAAA;QAAAC,QAAA,EAAApD,YAAA;QAAAqD,UAAA;QAAAC,YAAA;MAAA;IAAA,CACxC,CAAC;EAEN;;EAEA;EACA,oBACE9D,MAAA,CAAAe,OAAA,CAAAuC,aAAA,CAACnD,SAAA,CAAAoD,eAAe;IACdrB,QAAQ,EAAEA,QAAS;IACnBU,KAAK,EAAEA,KAAM;IACba,OAAO,EAAE,EAAG;IACZpB,MAAM,EAAEA,MAAO;IACfD,cAAc,EAAEA,cAAe;IAC/BD,UAAU,EAAEA,UAAW;IAAAuB,MAAA;IAAAC,QAAA;MAAAC,QAAA,EAAApD,YAAA;MAAAqD,UAAA;MAAAC,YAAA;IAAA;EAAA,CACxB,CAAC;AAEN,CAAC;AAACwB,OAAA,CAAAvB,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getCommonCollectionFeaturesAsync = getCommonCollectionFeaturesAsync;
5
+ var _pluginsDynamicImports = require("./pluginsDynamicImports");
6
+ function getCommonCollectionFeaturesAsync() {
7
+ return {
8
+ commonCollectionFeatures: () => (0, _pluginsDynamicImports.importCommonCollectionFeatures)()
9
+ };
10
+ }
11
+ //# sourceMappingURL=getCommonCollectionFeaturesAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_pluginsDynamicImports","require","getCommonCollectionFeaturesAsync","commonCollectionFeatures","importCommonCollectionFeatures"],"sources":["../../../src/hooks/getCommonCollectionFeaturesAsync.ts"],"sourcesContent":["import { importCommonCollectionFeatures } from './pluginsDynamicImports';\n\nexport function getCommonCollectionFeaturesAsync() {\n return {\n commonCollectionFeatures: () => importCommonCollectionFeatures(),\n };\n}\n"],"mappings":";;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAEO,SAASC,gCAAgCA,CAAA,EAAG;EACjD,OAAO;IACLC,wBAAwB,EAAEA,CAAA,KAAM,IAAAC,qDAA8B,EAAC;EACjE,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.getFilterComponent = getFilterComponent;
5
+ var _patterns = require("@wix/patterns");
6
+ function getFilterComponent(filter) {
7
+ switch (filter.fieldDefinition.type) {
8
+ case 'DATE':
9
+ case 'DATETIME':
10
+ return _patterns.DateRangeFilter;
11
+ case 'BOOLEAN':
12
+ return _patterns.RadioGroupFilter;
13
+ case 'NUMBER':
14
+ return _patterns.NumberRangeFilter;
15
+ case 'REFERENCE':
16
+ {
17
+ var _filter$dynamicOption;
18
+ return (filter == null || (_filter$dynamicOption = filter.dynamicOptionsFilterConfig) == null ? void 0 : _filter$dynamicOption.selectionMode) === 'single' ? _patterns.AutoCompleteFilter : _patterns.MultiSelectCollectionFilter;
19
+ }
20
+ default:
21
+ if (filter != null && filter.enumConfig) {
22
+ const {
23
+ selectionMode,
24
+ optionType,
25
+ options
26
+ } = filter.enumConfig;
27
+ const inlineComponentThreshold = 5;
28
+ let component;
29
+ if (selectionMode === 'single') {
30
+ component = options.length > inlineComponentThreshold ? _patterns.AutoCompleteFilter : _patterns.RadioGroupFilter;
31
+ if (optionType === 'select') {
32
+ component = _patterns.AutoCompleteFilter;
33
+ } else if (optionType === 'radio') {
34
+ component = _patterns.RadioGroupFilter;
35
+ }
36
+ } else {
37
+ component = options.length > inlineComponentThreshold ? _patterns.MultiSelectCheckboxFilter : _patterns.MultiInlineCheckboxFilter;
38
+ if (optionType === 'select') {
39
+ component = _patterns.MultiSelectCollectionFilter;
40
+ } else if (optionType === 'inlineCheckbox') {
41
+ component = _patterns.MultiInlineCheckboxFilter;
42
+ } else if (optionType === 'checkbox') {
43
+ component = _patterns.MultiSelectCheckboxFilter;
44
+ }
45
+ }
46
+ return component;
47
+ }
48
+ break;
49
+ }
50
+ return null;
51
+ }
52
+ //# sourceMappingURL=getFilterComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_patterns","require","getFilterComponent","filter","fieldDefinition","type","DateRangeFilter","RadioGroupFilter","NumberRangeFilter","_filter$dynamicOption","dynamicOptionsFilterConfig","selectionMode","AutoCompleteFilter","MultiSelectCollectionFilter","enumConfig","optionType","options","inlineComponentThreshold","component","length","MultiSelectCheckboxFilter","MultiInlineCheckboxFilter"],"sources":["../../../src/hooks/getFilterComponent.ts"],"sourcesContent":["import { FilterOptions } from './useFiltersState';\nimport {\n AutoCompleteFilter,\n DateRangeFilter,\n MultiInlineCheckboxFilter,\n MultiSelectCheckboxFilter,\n MultiSelectCollectionFilter,\n NumberRangeFilter,\n RadioGroupFilter,\n} from '@wix/patterns';\nimport { ElementType } from 'react';\n\nexport function getFilterComponent(filter: FilterOptions): ElementType | null {\n switch (filter.fieldDefinition.type) {\n case 'DATE':\n case 'DATETIME':\n return DateRangeFilter;\n\n case 'BOOLEAN':\n return RadioGroupFilter;\n\n case 'NUMBER':\n return NumberRangeFilter;\n\n case 'REFERENCE': {\n return filter?.dynamicOptionsFilterConfig?.selectionMode === 'single'\n ? AutoCompleteFilter\n : MultiSelectCollectionFilter;\n }\n\n default:\n if (filter?.enumConfig) {\n const { selectionMode, optionType, options } = filter.enumConfig;\n\n const inlineComponentThreshold = 5;\n\n let component;\n\n if (selectionMode === 'single') {\n component =\n options.length > inlineComponentThreshold\n ? AutoCompleteFilter\n : RadioGroupFilter;\n if (optionType === 'select') {\n component = AutoCompleteFilter;\n } else if (optionType === 'radio') {\n component = RadioGroupFilter;\n }\n } else {\n component =\n options.length > inlineComponentThreshold\n ? MultiSelectCheckboxFilter\n : MultiInlineCheckboxFilter;\n if (optionType === 'select') {\n component = MultiSelectCollectionFilter;\n } else if (optionType === 'inlineCheckbox') {\n component = MultiInlineCheckboxFilter;\n } else if (optionType === 'checkbox') {\n component = MultiSelectCheckboxFilter;\n }\n }\n\n return component;\n }\n break;\n }\n\n return null;\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,EAAE;YACpCG,SAAS,GAAGE,mCAAyB;UACvC;QACF;QAEA,OAAOF,SAAS;MAClB;MACA;EACJ;EAEA,OAAO,IAAI;AACb","ignoreList":[]}
@@ -5,13 +5,6 @@ var _exportNames = {
5
5
  useAppContext: true
6
6
  };
7
7
  exports.useAppContext = void 0;
8
- var _useTableFeatures = require("./useTableFeatures");
9
- Object.keys(_useTableFeatures).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
12
- if (key in exports && exports[key] === _useTableFeatures[key]) return;
13
- exports[key] = _useTableFeatures[key];
14
- });
15
8
  var _useFilters = require("./useFilters");
16
9
  Object.keys(_useFilters).forEach(function (key) {
17
10
  if (key === "default" || key === "__esModule") return;
@@ -19,12 +12,12 @@ Object.keys(_useFilters).forEach(function (key) {
19
12
  if (key in exports && exports[key] === _useFilters[key]) return;
20
13
  exports[key] = _useFilters[key];
21
14
  });
22
- var _useGridFeatures = require("./useGridFeatures");
23
- Object.keys(_useGridFeatures).forEach(function (key) {
15
+ var _useGridFeaturesAsync = require("./useGridFeaturesAsync");
16
+ Object.keys(_useGridFeaturesAsync).forEach(function (key) {
24
17
  if (key === "default" || key === "__esModule") return;
25
18
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
26
- if (key in exports && exports[key] === _useGridFeatures[key]) return;
27
- exports[key] = _useGridFeatures[key];
19
+ if (key in exports && exports[key] === _useGridFeaturesAsync[key]) return;
20
+ exports[key] = _useGridFeaturesAsync[key];
28
21
  });
29
22
  var _useNavigationUtils = require("./useNavigationUtils");
30
23
  Object.keys(_useNavigationUtils).forEach(function (key) {
@@ -1 +1 @@
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,gBAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,gBAAA,EAAAR,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,MAAAO,gBAAA,CAAAP,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAO,gBAAA,CAAAP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ilters","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","_useGridFeaturesAsync","_useNavigationUtils","_usePagePath","_useEntityPageHeaderTexts","_AppContext","useAppContext"],"sources":["../../../src/hooks/index.ts"],"sourcesContent":["export * from './useFilters';\nexport * from './useGridFeaturesAsync';\nexport * from './useNavigationUtils';\nexport * from './usePagePath';\nexport * from './useEntityPageHeaderTexts';\nexport { useAppContext } from '../providers/AppContext';\n"],"mappings":";;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,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,WAAA,CAAAK,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAL,WAAA,CAAAK,GAAA;AAAA;AACA,IAAAM,qBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,qBAAA,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,qBAAA,CAAAN,GAAA;EAAAK,OAAA,CAAAL,GAAA,IAAAM,qBAAA,CAAAN,GAAA;AAAA;AACA,IAAAO,mBAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,mBAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,E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