@sps-woodland/core 8.56.1 → 8.56.3

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 (289) hide show
  1. package/lib/action-bar/action-bar/ActionBar.js +44 -59
  2. package/lib/action-bar/action-bar/ActionBar.ve.js +4 -11
  3. package/lib/action-bar/action-bar-additional-content/ActionBarAdditionalContent.js +14 -22
  4. package/lib/action-bar/index.js +54 -74
  5. package/lib/action-bar/index.umd.cjs +1 -1
  6. package/lib/action-bar/style.css +2 -1
  7. package/lib/add-to-list/add-to-list/AddToList.css.d.ts.map +1 -1
  8. package/lib/add-to-list/add-to-list/AddToList.d.ts.map +1 -1
  9. package/lib/add-to-list/add-to-list/AddToList.js +220 -295
  10. package/lib/add-to-list/add-to-list/AddToList.ve.js +79 -24
  11. package/lib/add-to-list/add-to-list/ItemsList.d.ts.map +1 -1
  12. package/lib/add-to-list/add-to-list/ItemsList.js +42 -66
  13. package/lib/add-to-list/add-to-list/ListItem.js +24 -50
  14. package/lib/add-to-list/index.js +393 -444
  15. package/lib/add-to-list/index.umd.cjs +1 -1
  16. package/lib/add-to-list/style.css +2 -1
  17. package/lib/buttons/button/Button.css.d.ts.map +1 -1
  18. package/lib/buttons/button/Button.js +95 -121
  19. package/lib/buttons/button/Button.ve.js +150 -9
  20. package/lib/buttons/index.js +281 -171
  21. package/lib/buttons/index.umd.cjs +1 -1
  22. package/lib/buttons/style.css +2 -1
  23. package/lib/cards/card/Card.css.d.ts.map +1 -1
  24. package/lib/cards/card/Card.js +19 -27
  25. package/lib/cards/card/Card.ve.js +4 -4
  26. package/lib/cards/card-footer/CardFooter.js +12 -13
  27. package/lib/cards/card-footer/CardFooter.ve.js +4 -4
  28. package/lib/cards/card-header/CardHeader.js +12 -13
  29. package/lib/cards/card-header/CardHeader.ve.js +4 -4
  30. package/lib/cards/card-title/CardTitle.js +11 -12
  31. package/lib/cards/card-title/CardTitle.ve.js +4 -4
  32. package/lib/cards/index.js +52 -52
  33. package/lib/cards/index.umd.cjs +1 -1
  34. package/lib/cards/style.css +2 -1
  35. package/lib/column-manager/column-manager/ColumnManager.d.ts.map +1 -1
  36. package/lib/column-manager/column-manager/ColumnManager.js +95 -112
  37. package/lib/column-manager/column-manager/useColumnManager.js +59 -48
  38. package/lib/column-manager/index.js +2 -5
  39. package/lib/components/icon/Icon.ve.js +15 -5
  40. package/lib/components/icon/icons/sprite.svg.js +4 -4
  41. package/lib/content-row/content-row/ContentRow.js +146 -173
  42. package/lib/content-row/content-row/ContentRow.ve.js +105 -18
  43. package/lib/content-row/content-row-col/ContentRowCol.js +37 -48
  44. package/lib/content-row/content-row-col/ContentRowCol.ve.js +49 -6
  45. package/lib/content-row/content-row-expansion/ContentRowExpansion.js +16 -24
  46. package/lib/content-row/index.js +407 -318
  47. package/lib/content-row/index.umd.cjs +1 -1
  48. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.js +24 -39
  49. package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +13 -5
  50. package/lib/content-row/style.css +2 -1
  51. package/lib/content-tiles/content-tile/ContentTile.css.d.ts.map +1 -1
  52. package/lib/content-tiles/content-tile/ContentTile.js +71 -60
  53. package/lib/content-tiles/content-tile/ContentTile.ve.js +36 -14
  54. package/lib/content-tiles/content-tile-list/ContentTileList.js +12 -13
  55. package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +4 -5
  56. package/lib/content-tiles/index.js +156 -118
  57. package/lib/content-tiles/index.umd.cjs +1 -1
  58. package/lib/content-tiles/style.css +2 -1
  59. package/lib/core.css +2 -1
  60. package/lib/dropdowns/dropdown/Dropdown.css.d.ts.map +1 -1
  61. package/lib/dropdowns/dropdown/Dropdown.js +56 -68
  62. package/lib/dropdowns/dropdown/Dropdown.ve.js +37 -8
  63. package/lib/dropdowns/index.js +171 -171
  64. package/lib/dropdowns/index.umd.cjs +1 -1
  65. package/lib/dropdowns/option-list/Option.css.d.ts.map +1 -1
  66. package/lib/dropdowns/option-list/Option.js +14 -18
  67. package/lib/dropdowns/option-list/Option.ve.js +4 -5
  68. package/lib/dropdowns/option-list/OptionList.js +28 -44
  69. package/lib/dropdowns/option-list/OptionList.ve.js +4 -5
  70. package/lib/dropdowns/style.css +2 -1
  71. package/lib/editable-table/EditableTable.js +68 -85
  72. package/lib/editable-table/index.js +1 -4
  73. package/lib/feedback-block/FeedbackBlock.js +40 -35
  74. package/lib/feedback-block/FeedbackBlock.ve.js +56 -7
  75. package/lib/feedback-block/index.js +132 -85
  76. package/lib/feedback-block/index.umd.cjs +1 -1
  77. package/lib/feedback-block/style.css +2 -1
  78. package/lib/file-upload/file-upload/FileUpload.js +164 -202
  79. package/lib/file-upload/file-upload/FileUpload.ve.js +84 -18
  80. package/lib/file-upload/file-upload/mime-type.enum.js +106 -106
  81. package/lib/file-upload/index.js +390 -353
  82. package/lib/file-upload/index.umd.cjs +1 -1
  83. package/lib/file-upload/style.css +2 -1
  84. package/lib/filter-tiles/filter-tile/FilterTile.css.d.ts.map +1 -1
  85. package/lib/filter-tiles/filter-tile/FilterTile.d.ts.map +1 -1
  86. package/lib/filter-tiles/filter-tile/FilterTile.js +41 -33
  87. package/lib/filter-tiles/filter-tile/FilterTile.ve.js +51 -9
  88. package/lib/filter-tiles/filter-tile-set/FilterTileSet.js +12 -15
  89. package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +4 -4
  90. package/lib/filter-tiles/index.js +142 -94
  91. package/lib/filter-tiles/index.umd.cjs +1 -1
  92. package/lib/filter-tiles/style.css +2 -1
  93. package/lib/focused-task/focused-task/FocusedTask.js +52 -74
  94. package/lib/focused-task/focused-task/FocusedTask.ve.js +13 -12
  95. package/lib/focused-task/focused-task/useFocusedTask.js +20 -18
  96. package/lib/focused-task/focused-task-actions/FocusedTaskActions.js +12 -13
  97. package/lib/focused-task/index.js +127 -144
  98. package/lib/focused-task/index.umd.cjs +1 -1
  99. package/lib/focused-task/style.css +2 -1
  100. package/lib/growler/Growler.js +78 -90
  101. package/lib/growler/Growler.ve.js +23 -12
  102. package/lib/growler/GrowlerListProvider.js +38 -39
  103. package/lib/growler/Sonner.ve.js +17 -12
  104. package/lib/growler/index.js +249 -274
  105. package/lib/growler/index.umd.cjs +1 -1
  106. package/lib/growler/sonner.js +73 -102
  107. package/lib/growler/style.css +2 -1
  108. package/lib/index.js +520 -501
  109. package/lib/index.umd.cjs +4 -4
  110. package/lib/insight-card/InsightCard.js +90 -84
  111. package/lib/insight-card/InsightCard.ve.js +148 -15
  112. package/lib/insight-card/InsightCardSet.js +12 -12
  113. package/lib/insight-card/index.js +269 -141
  114. package/lib/insight-card/index.umd.cjs +1 -1
  115. package/lib/insight-card/style.css +2 -1
  116. package/lib/key-value-set/index.js +97 -87
  117. package/lib/key-value-set/index.umd.cjs +1 -1
  118. package/lib/key-value-set/key-value-set/KeyValueSet.js +17 -21
  119. package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +10 -5
  120. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.js +25 -21
  121. package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +13 -6
  122. package/lib/key-value-set/style.css +2 -1
  123. package/lib/list-bar/advanced-search/AdvancedSearch.js +51 -54
  124. package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +30 -8
  125. package/lib/list-bar/index.js +305 -301
  126. package/lib/list-bar/index.umd.cjs +1 -1
  127. package/lib/list-bar/list-bar/InputGroupWrapper.js +10 -19
  128. package/lib/list-bar/list-bar/ListBar.js +105 -121
  129. package/lib/list-bar/list-bar/ListBar.ve.js +13 -17
  130. package/lib/list-bar/list-bar/ListBarSearch.js +20 -21
  131. package/lib/list-bar/list-bar/ListBarSearchInfo.js +8 -12
  132. package/lib/list-bar/list-bar/ListBarSortBy.js +28 -38
  133. package/lib/list-bar/search-results-bar/SearchResultsBar.js +38 -28
  134. package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +4 -11
  135. package/lib/list-bar/style.css +2 -1
  136. package/lib/matrix/index.js +79 -87
  137. package/lib/matrix/index.umd.cjs +1 -1
  138. package/lib/matrix/matrix/Matrix.js +18 -26
  139. package/lib/matrix/matrix/Matrix.ve.js +4 -7
  140. package/lib/matrix/matrix-body/MatrixBody.js +10 -13
  141. package/lib/matrix/matrix-cell/MatrixCell.js +23 -18
  142. package/lib/matrix/matrix-head/MatrixHead.js +10 -13
  143. package/lib/matrix/matrix-header/MatrixHeader.js +20 -23
  144. package/lib/matrix/matrix-row/MatrixRow.js +10 -13
  145. package/lib/matrix/style.css +2 -1
  146. package/lib/modal/index.js +197 -187
  147. package/lib/modal/index.umd.cjs +1 -1
  148. package/lib/modal/modal/Modal.js +90 -108
  149. package/lib/modal/modal/Modal.ve.js +43 -13
  150. package/lib/modal/modal/useModal.js +19 -24
  151. package/lib/modal/modal-footer/ModalFooter.js +11 -12
  152. package/lib/modal/style.css +2 -1
  153. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +49 -0
  154. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/index.browser.js +8 -10
  155. package/lib/node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/url-alphabet/index.js +4 -4
  156. package/lib/page-title/heading-level/HeadingLevel.js +8 -12
  157. package/lib/page-title/index.js +33 -40
  158. package/lib/page-title/index.umd.cjs +1 -1
  159. package/lib/page-title/page-subtitle/PageSubtitle.js +13 -18
  160. package/lib/page-title/page-subtitle/PageSubtitle.ve.js +4 -5
  161. package/lib/page-title/page-title/PageTitle.js +15 -19
  162. package/lib/page-title/page-title/PageTitle.ve.js +4 -7
  163. package/lib/page-title/style.css +2 -1
  164. package/lib/photo/index.js +174 -173
  165. package/lib/photo/index.umd.cjs +1 -1
  166. package/lib/photo/photo/Photo.js +72 -81
  167. package/lib/photo/photo/Photo.ve.js +21 -7
  168. package/lib/photo/photo-carousel/PhotoCarousel.css.d.ts.map +1 -1
  169. package/lib/photo/photo-carousel/PhotoCarousel.d.ts.map +1 -1
  170. package/lib/photo/photo-carousel/PhotoCarousel.js +36 -47
  171. package/lib/photo/photo-carousel/PhotoCarousel.ve.js +13 -9
  172. package/lib/photo/style.css +2 -1
  173. package/lib/product-bar/hooks/usePriorityPlus.js +88 -104
  174. package/lib/product-bar/index.js +372 -395
  175. package/lib/product-bar/index.umd.cjs +1 -1
  176. package/lib/product-bar/product-bar/ProductBar.js +77 -103
  177. package/lib/product-bar/product-bar/ProductBar.ve.js +46 -15
  178. package/lib/product-bar/product-bar-name/ProductBarName.js +37 -40
  179. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.js +48 -70
  180. package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +4 -8
  181. package/lib/product-bar/product-bar-tab/ProductBarTab.js +28 -26
  182. package/lib/product-bar/slack-link/SlackLink.js +26 -30
  183. package/lib/product-bar/slack-link/SlackLink.ve.js +4 -5
  184. package/lib/product-bar/style.css +2 -1
  185. package/lib/product-bar-vertical/index.js +240 -251
  186. package/lib/product-bar-vertical/index.umd.cjs +1 -1
  187. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.js +42 -61
  188. package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +53 -23
  189. package/lib/product-bar-vertical/product-bar-vertical-header/ProductBarVerticalHeader.js +30 -42
  190. package/lib/product-bar-vertical/product-bar-vertical-item/ProductBarVerticalItem.js +71 -89
  191. package/lib/product-bar-vertical/product-bar-vertical-section/ProductBarVerticalSection.js +22 -29
  192. package/lib/product-bar-vertical/style.css +2 -1
  193. package/lib/progress-indicators/index.js +372 -255
  194. package/lib/progress-indicators/index.umd.cjs +1 -1
  195. package/lib/progress-indicators/progress-bar/ProgressBar.js +66 -110
  196. package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +66 -13
  197. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.js +34 -54
  198. package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +136 -8
  199. package/lib/progress-indicators/progress-ring/ProgressRing.js +45 -52
  200. package/lib/progress-indicators/style.css +2 -1
  201. package/lib/rich-text-editor/index.js +556 -582
  202. package/lib/rich-text-editor/index.umd.cjs +11 -11
  203. package/lib/rich-text-editor/rich-text-editor/RTELinkModal.js +29 -33
  204. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.css.d.ts.map +1 -1
  205. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.js +23 -37
  206. package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +13 -6
  207. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.js +68 -77
  208. package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +21 -8
  209. package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +14 -20
  210. package/lib/rich-text-editor/rich-text-editor/hooks/useMdToHtml.js +14 -20
  211. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEContent.js +33 -27
  212. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEObserver.js +79 -88
  213. package/lib/rich-text-editor/rich-text-editor/hooks/useRTESelectionListener.js +28 -36
  214. package/lib/rich-text-editor/rich-text-editor/hooks/useRTEToolbarButtons.js +195 -211
  215. package/lib/rich-text-editor/rich-text-editor/icons/BOLD.svg.js +4 -4
  216. package/lib/rich-text-editor/rich-text-editor/icons/INDENT.svg.js +4 -4
  217. package/lib/rich-text-editor/rich-text-editor/icons/ITALICS.svg.js +4 -4
  218. package/lib/rich-text-editor/rich-text-editor/icons/LINK.svg.js +4 -4
  219. package/lib/rich-text-editor/rich-text-editor/icons/ORDERED_LIST.svg.js +4 -4
  220. package/lib/rich-text-editor/rich-text-editor/icons/OUTDENT.svg.js +4 -4
  221. package/lib/rich-text-editor/rich-text-editor/icons/REDO.svg.js +4 -4
  222. package/lib/rich-text-editor/rich-text-editor/icons/UNDO.svg.js +4 -4
  223. package/lib/rich-text-editor/rich-text-editor/icons/UNLINK.svg.js +4 -4
  224. package/lib/rich-text-editor/rich-text-editor/icons/UNORDERED_LIST.svg.js +4 -4
  225. package/lib/rich-text-editor/rich-text-editor/utils/flattenListItemParagraphs.js +12 -12
  226. package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +20 -19
  227. package/lib/rich-text-editor/rich-text-editor/utils/utils.js +11 -15
  228. package/lib/rich-text-editor/style.css +2 -1
  229. package/lib/scrollable-container/ScrollableContainer.js +18 -27
  230. package/lib/scrollable-container/ScrollableContainer.ve.js +4 -4
  231. package/lib/scrollable-container/index.js +20 -27
  232. package/lib/scrollable-container/index.umd.cjs +1 -1
  233. package/lib/scrollable-container/style.css +2 -1
  234. package/lib/side-nav/index.js +190 -216
  235. package/lib/side-nav/index.umd.cjs +1 -1
  236. package/lib/side-nav/side-nav/SideNav.css.d.ts.map +1 -1
  237. package/lib/side-nav/side-nav/SideNav.js +43 -60
  238. package/lib/side-nav/side-nav/SideNav.ve.js +22 -16
  239. package/lib/side-nav/side-nav/navContext.js +7 -7
  240. package/lib/side-nav/side-nav-header/SideNavHeader.js +14 -15
  241. package/lib/side-nav/side-nav-item/SideNavItem.d.ts.map +1 -1
  242. package/lib/side-nav/side-nav-item/SideNavItem.js +68 -82
  243. package/lib/side-nav/side-nav-section/SideNavSection.js +16 -26
  244. package/lib/side-nav/style.css +2 -1
  245. package/lib/sorting-header/caret/caret.ve.js +13 -5
  246. package/lib/sorting-header/index.js +269 -243
  247. package/lib/sorting-header/index.umd.cjs +1 -1
  248. package/lib/sorting-header/sorting-header/SortingHeader.js +110 -124
  249. package/lib/sorting-header/sorting-header/SortingHeader.ve.js +30 -6
  250. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.css.d.ts +2 -0
  251. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.css.d.ts.map +1 -1
  252. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.d.ts.map +1 -1
  253. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.js +69 -75
  254. package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +21 -5
  255. package/lib/sorting-header/style.css +2 -1
  256. package/lib/style.css +2 -1
  257. package/lib/tabs/index.js +255 -200
  258. package/lib/tabs/index.umd.cjs +1 -1
  259. package/lib/tabs/style.css +2 -1
  260. package/lib/tabs/tab/Tab.css.d.ts.map +1 -1
  261. package/lib/tabs/tab/Tab.js +24 -27
  262. package/lib/tabs/tab/Tab.ve.js +76 -6
  263. package/lib/tabs/tab-panel/TabPanel.d.ts.map +1 -1
  264. package/lib/tabs/tab-panel/TabPanel.js +16 -23
  265. package/lib/tabs/tabs/Tabs.css.d.ts +1 -0
  266. package/lib/tabs/tabs/Tabs.css.d.ts.map +1 -1
  267. package/lib/tabs/tabs/Tabs.js +101 -112
  268. package/lib/tabs/tabs/Tabs.ve.js +13 -10
  269. package/lib/tags/clickable-tag/ClickableTag.css.d.ts +1 -1
  270. package/lib/tags/clickable-tag/ClickableTag.css.d.ts.map +1 -1
  271. package/lib/tags/clickable-tag/ClickableTag.d.ts.map +1 -1
  272. package/lib/tags/clickable-tag/ClickableTag.js +86 -70
  273. package/lib/tags/clickable-tag/ClickableTag.ve.js +66 -9
  274. package/lib/tags/index.js +342 -179
  275. package/lib/tags/index.umd.cjs +1 -1
  276. package/lib/tags/split-tag/SplitTag.css.d.ts.map +1 -1
  277. package/lib/tags/split-tag/SplitTag.js +49 -30
  278. package/lib/tags/split-tag/SplitTag.ve.js +35 -9
  279. package/lib/tags/style.css +2 -1
  280. package/lib/tags/tag/Tag.js +42 -38
  281. package/lib/tags/tag/Tag.ve.js +41 -6
  282. package/lib/utils/cl.js +5 -5
  283. package/lib/zero-state/ZeroState.js +36 -29
  284. package/lib/zero-state/ZeroState.ve.js +29 -11
  285. package/lib/zero-state/index.js +103 -78
  286. package/lib/zero-state/index.umd.cjs +1 -1
  287. package/lib/zero-state/style.css +2 -1
  288. package/package.json +12 -12
  289. package/lib/node_modules/.pnpm/@vanilla-extract_recipes@0.2.5_@vanilla-extract_css@1.17.4/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js +0 -57
@@ -1,250 +1,276 @@
1
- import * as n from "react";
2
- import { Metadata as x, cl as C, SortDirection as y, getScrollParent as L, selectChildren as T, modChildren as W } from "@sps-woodland/core";
3
- import { lockToAnimationFrames as G } from "@spscommerce/utils";
4
- function H(e, a, r) {
5
- return a in e ? Object.defineProperty(e, a, {
6
- value: r,
7
- enumerable: !0,
8
- configurable: !0,
9
- writable: !0
10
- }) : e[a] = r, e;
1
+ import * as e from "react";
2
+ import { Metadata as t, SortDirection as n, cl as r, getScrollParent as i, modChildren as a, selectChildren as o } from "@sps-woodland/core";
3
+ import { lockToAnimationFrames as s } from "@spscommerce/utils";
4
+ import { useWoodlandLanguage as c } from "@spscommerce/i18n";
5
+ //#region ../../../node_modules/.pnpm/@vanilla-extract+recipes@0.2.5_@vanilla-extract+css@1.21.2/node_modules/@vanilla-extract/recipes/createRuntimeFn/dist/vanilla-extract-recipes-createRuntimeFn.esm.js
6
+ function l(e, t, n) {
7
+ return t in e ? Object.defineProperty(e, t, {
8
+ value: n,
9
+ enumerable: !0,
10
+ configurable: !0,
11
+ writable: !0
12
+ }) : e[t] = n, e;
11
13
  }
12
- function A(e, a) {
13
- var r = Object.keys(e);
14
- if (Object.getOwnPropertySymbols) {
15
- var t = Object.getOwnPropertySymbols(e);
16
- a && (t = t.filter(function(l) {
17
- return Object.getOwnPropertyDescriptor(e, l).enumerable;
18
- })), r.push.apply(r, t);
19
- }
20
- return r;
14
+ function u(e, t) {
15
+ var n = Object.keys(e);
16
+ if (Object.getOwnPropertySymbols) {
17
+ var r = Object.getOwnPropertySymbols(e);
18
+ t && (r = r.filter(function(t) {
19
+ return Object.getOwnPropertyDescriptor(e, t).enumerable;
20
+ })), n.push.apply(n, r);
21
+ }
22
+ return n;
21
23
  }
22
- function D(e) {
23
- for (var a = 1; a < arguments.length; a++) {
24
- var r = arguments[a] != null ? arguments[a] : {};
25
- a % 2 ? A(Object(r), !0).forEach(function(t) {
26
- H(e, t, r[t]);
27
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : A(Object(r)).forEach(function(t) {
28
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
29
- });
30
- }
31
- return e;
24
+ function d(e) {
25
+ for (var t = 1; t < arguments.length; t++) {
26
+ var n = arguments[t] == null ? {} : arguments[t];
27
+ t % 2 ? u(Object(n), !0).forEach(function(t) {
28
+ l(e, t, n[t]);
29
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : u(Object(n)).forEach(function(t) {
30
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
31
+ });
32
+ }
33
+ return e;
32
34
  }
33
- var F = (e, a, r) => {
34
- for (var t of Object.keys(e)) {
35
- var l;
36
- if (e[t] !== ((l = a[t]) !== null && l !== void 0 ? l : r[t]))
37
- return !1;
38
- }
39
- return !0;
40
- }, O = (e) => (a) => {
41
- var r = e.defaultClassName, t = D(D({}, e.defaultVariants), a);
42
- for (var l in t) {
43
- var c, o = (c = t[l]) !== null && c !== void 0 ? c : e.defaultVariants[l];
44
- if (o != null) {
45
- var u = o;
46
- typeof u == "boolean" && (u = u === !0 ? "true" : "false");
47
- var m = (
48
- // @ts-expect-error
49
- e.variantClassNames[l][u]
50
- );
51
- m && (r += " " + m);
52
- }
53
- }
54
- for (var [i, p] of e.compoundVariants)
55
- F(i, t, e.defaultVariants) && (r += " " + p);
56
- return r;
57
- }, I = O({ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf0", variantClassNames: { up: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf1" }, down: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf2" } }, defaultVariants: {}, compoundVariants: [] }), R = O({ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id0", variantClassNames: { disabled: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id1" }, active: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id2" }, __autoLayout: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id3", false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id4" } }, defaultVariants: { disabled: !1, active: !1, __autoLayout: !1 }, compoundVariants: [] });
58
- function B({
59
- className: e,
60
- sortKey: a,
61
- sort: r,
62
- sortDisabled: t,
63
- onSortChange: l,
64
- onClick: c,
65
- children: o,
66
- style: u,
67
- widthPx: m,
68
- widthRem: i,
69
- __autoLayout: p = !1,
70
- ..._
71
- }) {
72
- const d = n.useMemo(() => {
73
- const E = !!a && !t && Array.isArray(r) && r.find((b) => b.key === a);
74
- return E ? E.direction : void 0;
75
- }, [r, a, t]), S = m ? m / 16 : i, v = S ? { ...u, width: `${S}rem` } : u, N = (E) => {
76
- a && !t && l && l([
77
- {
78
- key: a,
79
- direction: d === y.ASCENDING ? y.DESCENDING : y.ASCENDING
80
- }
81
- ]), c && c(E);
82
- };
83
- return p ? /* @__PURE__ */ n.createElement(
84
- "td",
85
- {
86
- className: C(
87
- e,
88
- R({ disabled: t, active: !!d, __autoLayout: p }),
89
- d && I({
90
- up: d === y.ASCENDING,
91
- down: d === y.DESCENDING
92
- })
93
- ),
94
- onClick: N,
95
- style: v,
96
- ..._
97
- },
98
- o
99
- ) : /* @__PURE__ */ n.createElement(
100
- "div",
101
- {
102
- className: C(
103
- e,
104
- R({ disabled: t, active: !!d, __autoLayout: p }),
105
- d && I({
106
- up: d === y.ASCENDING,
107
- down: d === y.DESCENDING
108
- })
109
- ),
110
- onClick: N,
111
- style: v,
112
- ..._
113
- },
114
- o
115
- );
35
+ var f = (e, t, n) => {
36
+ for (var r of Object.keys(e)) if (e[r] !== (t[r] ?? n[r])) return !1;
37
+ return !0;
38
+ }, p = (e) => (t) => {
39
+ var n = e.defaultClassName, r = d(d({}, e.defaultVariants), t);
40
+ for (var i in r) {
41
+ var a = r[i] ?? e.defaultVariants[i];
42
+ if (a != null) {
43
+ var o = a;
44
+ typeof o == "boolean" && (o = o === !0 ? "true" : "false");
45
+ var s = e.variantClassNames[i][o];
46
+ s && (n += " " + s);
47
+ }
48
+ }
49
+ for (var [c, l] of e.compoundVariants) f(c, r, e.defaultVariants) && (n += " " + l);
50
+ return n;
51
+ }, m = p({
52
+ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf0",
53
+ variantClassNames: {
54
+ up: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf1" },
55
+ down: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf2" }
56
+ },
57
+ defaultVariants: {},
58
+ compoundVariants: []
59
+ }), h = p({
60
+ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id0",
61
+ variantClassNames: {
62
+ disabled: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id1" },
63
+ active: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id2" },
64
+ __autoLayout: {
65
+ true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id3",
66
+ false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id4"
67
+ }
68
+ },
69
+ defaultVariants: {
70
+ disabled: !1,
71
+ active: !1,
72
+ __autoLayout: !1
73
+ },
74
+ compoundVariants: []
75
+ }), g = "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id5", _ = "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id6";
76
+ //#endregion
77
+ //#region src/sorting-header/sorting-header-cell/SortingHeaderCell.tsx
78
+ function v({ className: t, sortKey: i, sort: a, sortDisabled: o, onSortChange: s, onClick: l, children: u, style: d, widthPx: f, widthRem: p, __autoLayout: v = !1, ...y }) {
79
+ let b = e.useMemo(() => {
80
+ let e = !!i && !o && Array.isArray(a) && a.find((e) => e.key === i);
81
+ return e ? e.direction : void 0;
82
+ }, [
83
+ a,
84
+ i,
85
+ o
86
+ ]), { t: x } = c(), S = f ? f / 16 : p, C = S ? {
87
+ ...d,
88
+ width: `${S}rem`
89
+ } : d, w = (e) => {
90
+ i && !o && s && s([{
91
+ key: i,
92
+ direction: b === n.ASCENDING ? n.DESCENDING : n.ASCENDING
93
+ }]), l && l(e);
94
+ }, T = !!i && !!s && !o, E = "none";
95
+ b === n.ASCENDING ? E = "ascending" : b === n.DESCENDING && (E = "descending");
96
+ let D = null;
97
+ !v && b && (D = /* @__PURE__ */ e.createElement("span", { className: _ }, " ", b === n.ASCENDING ? x("sortingHeader.sortedAscending", { defaultValue: "sorted ascending" }) : x("sortingHeader.sortedDescending", { defaultValue: "sorted descending" })));
98
+ let O = T ? /* @__PURE__ */ e.createElement("button", {
99
+ type: "button",
100
+ className: g
101
+ }, u, D) : /* @__PURE__ */ e.createElement(e.Fragment, null, u, D);
102
+ return v ? /* @__PURE__ */ e.createElement("td", {
103
+ className: r(t, h({
104
+ disabled: o,
105
+ active: !!b,
106
+ __autoLayout: v
107
+ }), b && m({
108
+ up: b === n.ASCENDING,
109
+ down: b === n.DESCENDING
110
+ })),
111
+ onClick: w,
112
+ style: C,
113
+ role: "columnheader",
114
+ "aria-sort": T ? E : void 0,
115
+ ...y
116
+ }, O) : /* @__PURE__ */ e.createElement("div", {
117
+ className: r(t, h({
118
+ disabled: o,
119
+ active: !!b,
120
+ __autoLayout: v
121
+ }), b && m({
122
+ up: b === n.ASCENDING,
123
+ down: b === n.DESCENDING
124
+ })),
125
+ onClick: w,
126
+ style: C,
127
+ ...y
128
+ }, O);
116
129
  }
117
- x.set(B, {
118
- name: "Sorting Header Cell",
119
- props: {
120
- sortKey: { type: "string" },
121
- sort: { type: "SortedColumn[]" },
122
- sortDisabled: { type: "boolean" },
123
- onSortChange: { type: "SortChangeHandler" },
124
- widthPx: { type: "number" },
125
- widthRem: { type: "number" }
126
- }
130
+ t.set(v, {
131
+ name: "Sorting Header Cell",
132
+ props: {
133
+ sortKey: { type: "string" },
134
+ sort: { type: "SortedColumn[]" },
135
+ sortDisabled: { type: "boolean" },
136
+ onSortChange: { type: "SortChangeHandler" },
137
+ widthPx: { type: "number" },
138
+ widthRem: { type: "number" }
139
+ }
127
140
  });
128
- var k = O({ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu0", variantClassNames: { pinned: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu1", false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu2" }, scrollParentIsWindow: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu3", false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu4" }, __autoLayout: { true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu5", false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu6" } }, defaultVariants: { pinned: !1, scrollParentIsWindow: !1, __autoLayout: !1 }, compoundVariants: [[{ pinned: !0, scrollParentIsWindow: !0 }, "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu7"]] }), M = "pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu8";
129
- function Y({
130
- sort: e,
131
- onSortChange: a,
132
- children: r,
133
- className: t,
134
- pinSortingHeader: l = !1,
135
- __autoLayout: c = !1,
136
- ...o
137
- }) {
138
- const [u, m] = n.useState(!1), i = n.useRef(null), p = n.useRef(null), _ = n.useRef({
139
- height: "",
140
- width: "",
141
- unpinAtTop: 0,
142
- unpinAtBottom: 0,
143
- cellWidths: []
144
- }), d = n.useCallback(() => i.current && L(i.current) || window, []), S = n.useCallback((s) => {
145
- const f = s || d();
146
- return f.scrollY || f.scrollTop || 0;
147
- }, []), v = n.useCallback(
148
- (s) => {
149
- if (l && i.current) {
150
- const f = s || d(), g = S(f), w = c ? i.current.parentElement?.parentElement?.getBoundingClientRect() : i.current.parentElement?.getBoundingClientRect();
151
- if (w) {
152
- const h = i.current.getBoundingClientRect();
153
- _.current.height = `${h.height}px`, _.current.width = `${h.width}px`, f === window ? (_.current.unpinAtBottom = w.bottom + g - h.height * 2, _.current.unpinAtTop = h.top + g - h.height) : (_.current.unpinAtBottom = w.bottom + g - h.height * 2, _.current.unpinAtTop = w.top + g), _.current.cellWidths = [], i.current.childNodes.forEach((j, V) => {
154
- j instanceof HTMLElement && (_.current.cellWidths[V] = `${j.getBoundingClientRect().width}px`);
155
- });
156
- }
157
- }
158
- },
159
- [l]
160
- ), N = n.useCallback(() => {
161
- p.current && (p.current.style.width = _.current.width, p.current.style.height = _.current.height, p.current.childNodes.forEach((s, f) => {
162
- s instanceof HTMLElement && (s.style.width = _.current.cellWidths[f] || "");
163
- }));
164
- }, []);
165
- n.useLayoutEffect(() => {
166
- v();
167
- }), n.useLayoutEffect(() => {
168
- let s;
169
- const f = d();
170
- return l ? (s = G(() => {
171
- v(f);
172
- const { unpinAtTop: g, unpinAtBottom: w } = _.current, h = S(f);
173
- g && w && (h >= g && h <= w ? (m(!0), i.current && (i.current.style.visibility = "hidden")) : (m(!1), i.current && (i.current.style.visibility = "visible")));
174
- }), f.addEventListener("scroll", s), s()) : i.current && (i.current.style.visibility = "visible"), () => {
175
- s && f.removeEventListener("scroll", s);
176
- };
177
- }, [l, v]), n.useLayoutEffect(() => {
178
- let s;
179
- return u && (s = () => {
180
- v(), N();
181
- }, window.addEventListener("resize", s), s()), () => {
182
- s && window.removeEventListener("resize", s);
183
- };
184
- }, [u, v, N]);
185
- const [E] = T(r, [{ type: B }]), b = W(E, () => [{ sort: e, onSortChange: a }]), P = d() === window;
186
- if (c) {
187
- const s = /* @__PURE__ */ n.createElement("tr", null, /* @__PURE__ */ n.createElement("td", { className: C(M), colSpan: 100 }));
188
- return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
189
- "tr",
190
- {
191
- ref: i,
192
- className: C(
193
- k({ pinned: !1, scrollParentIsWindow: P, __autoLayout: c }),
194
- t
195
- ),
196
- ...o
197
- },
198
- b
199
- ), s, u && /* @__PURE__ */ n.createElement(
200
- "tr",
201
- {
202
- ref: p,
203
- className: C(
204
- t,
205
- k({ pinned: !0, scrollParentIsWindow: P, __autoLayout: c })
206
- ),
207
- ...o,
208
- id: o.id ? `pinned-${o.id}` : void 0,
209
- "data-testid": o["data-testid"] ? `pinned-${o["data-testid"]}` : void 0
210
- },
211
- b
212
- ));
213
- }
214
- return /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(
215
- "div",
216
- {
217
- ref: i,
218
- className: C(
219
- t,
220
- k({ pinned: !1, scrollParentIsWindow: P, __autoLayout: c })
221
- ),
222
- ...o
223
- },
224
- b
225
- ), u && /* @__PURE__ */ n.createElement(
226
- "div",
227
- {
228
- ref: p,
229
- className: C(
230
- t,
231
- k({ pinned: !0, scrollParentIsWindow: P, __autoLayout: c })
232
- ),
233
- ...o,
234
- id: o.id ? `pinned-${o.id}` : void 0,
235
- "data-testid": o["data-testid"] ? `pinned-${o["data-testid"]}` : void 0
236
- },
237
- b
238
- ));
141
+ //#endregion
142
+ //#region src/sorting-header/sorting-header/SortingHeader.css.ts
143
+ var y = p({
144
+ defaultClassName: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu0",
145
+ variantClassNames: {
146
+ pinned: {
147
+ true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu1",
148
+ false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu2"
149
+ },
150
+ scrollParentIsWindow: {
151
+ true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu3",
152
+ false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu4"
153
+ },
154
+ __autoLayout: {
155
+ true: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu5",
156
+ false: "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu6"
157
+ }
158
+ },
159
+ defaultVariants: {
160
+ pinned: !1,
161
+ scrollParentIsWindow: !1,
162
+ __autoLayout: !1
163
+ },
164
+ compoundVariants: [[{
165
+ pinned: !0,
166
+ scrollParentIsWindow: !0
167
+ }, "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu7"]]
168
+ }), b = "pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu8";
169
+ //#endregion
170
+ //#region src/sorting-header/sorting-header/SortingHeader.tsx
171
+ function x({ sort: t, onSortChange: n, children: c, className: l, pinSortingHeader: u = !1, __autoLayout: d = !1, ...f }) {
172
+ let [p, m] = e.useState(!1), h = e.useRef(null), g = e.useRef(null), _ = e.useRef({
173
+ height: "",
174
+ width: "",
175
+ unpinAtTop: 0,
176
+ unpinAtBottom: 0,
177
+ cellWidths: []
178
+ }), x = e.useCallback(() => h.current && i(h.current) || window, []), S = e.useCallback((e) => {
179
+ let t = e || x();
180
+ return t.scrollY || t.scrollTop || 0;
181
+ }, []), C = e.useCallback((e) => {
182
+ if (u && h.current) {
183
+ let t = e || x(), n = S(t), r = d ? h.current.parentElement?.parentElement?.getBoundingClientRect() : h.current.parentElement?.getBoundingClientRect();
184
+ if (r) {
185
+ let e = h.current.getBoundingClientRect();
186
+ _.current.height = `${e.height}px`, _.current.width = `${e.width}px`, t === window ? (_.current.unpinAtBottom = r.bottom + n - e.height * 2, _.current.unpinAtTop = e.top + n - e.height) : (_.current.unpinAtBottom = r.bottom + n - e.height * 2, _.current.unpinAtTop = r.top + n), _.current.cellWidths = [], h.current.childNodes.forEach((e, t) => {
187
+ e instanceof HTMLElement && (_.current.cellWidths[t] = `${e.getBoundingClientRect().width}px`);
188
+ });
189
+ }
190
+ }
191
+ }, [u]), w = e.useCallback(() => {
192
+ g.current && (g.current.style.width = _.current.width, g.current.style.height = _.current.height, g.current.childNodes.forEach((e, t) => {
193
+ e instanceof HTMLElement && (e.style.width = _.current.cellWidths[t] || "");
194
+ }));
195
+ }, []);
196
+ e.useLayoutEffect(() => {
197
+ C();
198
+ }), e.useLayoutEffect(() => {
199
+ let e, t = x();
200
+ return u ? (e = s(() => {
201
+ C(t);
202
+ let { unpinAtTop: e, unpinAtBottom: n } = _.current, r = S(t);
203
+ e && n && (r >= e && r <= n ? (m(!0), h.current && (h.current.style.visibility = "hidden")) : (m(!1), h.current && (h.current.style.visibility = "visible")));
204
+ }), t.addEventListener("scroll", e), e()) : h.current && (h.current.style.visibility = "visible"), () => {
205
+ e && t.removeEventListener("scroll", e);
206
+ };
207
+ }, [u, C]), e.useLayoutEffect(() => {
208
+ let e;
209
+ return p && (e = () => {
210
+ C(), w();
211
+ }, window.addEventListener("resize", e), e()), () => {
212
+ e && window.removeEventListener("resize", e);
213
+ };
214
+ }, [
215
+ p,
216
+ C,
217
+ w
218
+ ]);
219
+ let [T] = o(c, [{ type: v }]), E = a(T, () => [{
220
+ sort: t,
221
+ onSortChange: n
222
+ }]), D = x() === window;
223
+ if (d) {
224
+ let t = /* @__PURE__ */ e.createElement("tr", null, /* @__PURE__ */ e.createElement("td", {
225
+ className: r(b),
226
+ colSpan: 100
227
+ }));
228
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("tr", {
229
+ ref: h,
230
+ className: r(y({
231
+ pinned: !1,
232
+ scrollParentIsWindow: D,
233
+ __autoLayout: d
234
+ }), l),
235
+ ...f
236
+ }, E), t, p && /* @__PURE__ */ e.createElement("tr", {
237
+ ref: g,
238
+ className: r(l, y({
239
+ pinned: !0,
240
+ scrollParentIsWindow: D,
241
+ __autoLayout: d
242
+ })),
243
+ ...f,
244
+ id: f.id ? `pinned-${f.id}` : void 0,
245
+ "data-testid": f["data-testid"] ? `pinned-${f["data-testid"]}` : void 0
246
+ }, E));
247
+ }
248
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
249
+ ref: h,
250
+ className: r(l, y({
251
+ pinned: !1,
252
+ scrollParentIsWindow: D,
253
+ __autoLayout: d
254
+ })),
255
+ ...f
256
+ }, E), p && /* @__PURE__ */ e.createElement("div", {
257
+ ref: g,
258
+ className: r(l, y({
259
+ pinned: !0,
260
+ scrollParentIsWindow: D,
261
+ __autoLayout: d
262
+ })),
263
+ ...f,
264
+ id: f.id ? `pinned-${f.id}` : void 0,
265
+ "data-testid": f["data-testid"] ? `pinned-${f["data-testid"]}` : void 0
266
+ }, E));
239
267
  }
240
- x.set(Y, {
241
- name: "Sorting Header",
242
- props: {
243
- sort: { type: "SortedColumn[]" },
244
- onSortChange: { type: "SortChangeHandler" }
245
- }
268
+ t.set(x, {
269
+ name: "Sorting Header",
270
+ props: {
271
+ sort: { type: "SortedColumn[]" },
272
+ onSortChange: { type: "SortChangeHandler" }
273
+ }
246
274
  });
247
- export {
248
- Y as SortingHeader,
249
- B as SortingHeaderCell
250
- };
275
+ //#endregion
276
+ export { x as SortingHeader, v as SortingHeaderCell };
@@ -1 +1 @@
1
- (function(m,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils"],b):(m=typeof globalThis<"u"?globalThis:m||self,b(m.SortingHeader={},m.react,m.spsWoodlandCore,m.spscommerceUtils))})(this,(function(m,b,a,H){"use strict";function V(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const i=V(b);function W(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function A(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(_){return Object.getOwnPropertyDescriptor(e,_).enumerable})),n.push.apply(n,t)}return n}function I(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?A(Object(n),!0).forEach(function(t){W(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var L=(e,r,n)=>{for(var t of Object.keys(e)){var _;if(e[t]!==((_=r[t])!==null&&_!==void 0?_:n[t]))return!1}return!0},D=e=>r=>{var n=e.defaultClassName,t=I(I({},e.defaultVariants),r);for(var _ in t){var u,l=(u=t[_])!==null&&u!==void 0?u:e.defaultVariants[_];if(l!=null){var p=l;typeof p=="boolean"&&(p=p===!0?"true":"false");var v=e.variantClassNames[_][p];v&&(n+=" "+v)}}for(var[o,f]of e.compoundVariants)L(o,t,e.defaultVariants)&&(n+=" "+f);return n},R=D({defaultClassName:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf0",variantClassNames:{up:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf1"},down:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_ax8xqf2"}},defaultVariants:{},compoundVariants:[]}),T=D({defaultClassName:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id0",variantClassNames:{disabled:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id1"},active:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id2"},__autoLayout:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id3",false:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_11ho8id4"}},defaultVariants:{disabled:!1,active:!1,__autoLayout:!1},compoundVariants:[]});function k({className:e,sortKey:r,sort:n,sortDisabled:t,onSortChange:_,onClick:u,children:l,style:p,widthPx:v,widthRem:o,__autoLayout:f=!1,...d}){const c=i.useMemo(()=>{const S=!!r&&!t&&Array.isArray(n)&&n.find(E=>E.key===r);return S?S.direction:void 0},[n,r,t]),P=v?v/16:o,w=P?{...p,width:`${P}rem`}:p,O=S=>{r&&!t&&_&&_([{key:r,direction:c===a.SortDirection.ASCENDING?a.SortDirection.DESCENDING:a.SortDirection.ASCENDING}]),u&&u(S)};return f?i.createElement("td",{className:a.cl(e,T({disabled:t,active:!!c,__autoLayout:f}),c&&R({up:c===a.SortDirection.ASCENDING,down:c===a.SortDirection.DESCENDING})),onClick:O,style:w,...d},l):i.createElement("div",{className:a.cl(e,T({disabled:t,active:!!c,__autoLayout:f}),c&&R({up:c===a.SortDirection.ASCENDING,down:c===a.SortDirection.DESCENDING})),onClick:O,style:w,...d},l)}a.Metadata.set(k,{name:"Sorting Header Cell",props:{sortKey:{type:"string"},sort:{type:"SortedColumn[]"},sortDisabled:{type:"boolean"},onSortChange:{type:"SortChangeHandler"},widthPx:{type:"number"},widthRem:{type:"number"}}});var j=D({defaultClassName:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu0",variantClassNames:{pinned:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu1",false:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu2"},scrollParentIsWindow:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu3",false:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu4"},__autoLayout:{true:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu5",false:"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu6"}},defaultVariants:{pinned:!1,scrollParentIsWindow:!1,__autoLayout:!1},compoundVariants:[[{pinned:!0,scrollParentIsWindow:!0},"pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu7"]]}),G="pkg_sps-woodland_core__family_sorting-header__version_8_56_1__hash_1jpcvsu8";function x({sort:e,onSortChange:r,children:n,className:t,pinSortingHeader:_=!1,__autoLayout:u=!1,...l}){const[p,v]=i.useState(!1),o=i.useRef(null),f=i.useRef(null),d=i.useRef({height:"",width:"",unpinAtTop:0,unpinAtBottom:0,cellWidths:[]}),c=i.useCallback(()=>o.current&&a.getScrollParent(o.current)||window,[]),P=i.useCallback(s=>{const h=s||c();return h.scrollY||h.scrollTop||0},[]),w=i.useCallback(s=>{if(_&&o.current){const h=s||c(),y=P(h),C=u?o.current.parentElement?.parentElement?.getBoundingClientRect():o.current.parentElement?.getBoundingClientRect();if(C){const g=o.current.getBoundingClientRect();d.current.height=`${g.height}px`,d.current.width=`${g.width}px`,h===window?(d.current.unpinAtBottom=C.bottom+y-g.height*2,d.current.unpinAtTop=g.top+y-g.height):(d.current.unpinAtBottom=C.bottom+y-g.height*2,d.current.unpinAtTop=C.top+y),d.current.cellWidths=[],o.current.childNodes.forEach((B,M)=>{B instanceof HTMLElement&&(d.current.cellWidths[M]=`${B.getBoundingClientRect().width}px`)})}}},[_]),O=i.useCallback(()=>{f.current&&(f.current.style.width=d.current.width,f.current.style.height=d.current.height,f.current.childNodes.forEach((s,h)=>{s instanceof HTMLElement&&(s.style.width=d.current.cellWidths[h]||"")}))},[]);i.useLayoutEffect(()=>{w()}),i.useLayoutEffect(()=>{let s;const h=c();return _?(s=H.lockToAnimationFrames(()=>{w(h);const{unpinAtTop:y,unpinAtBottom:C}=d.current,g=P(h);y&&C&&(g>=y&&g<=C?(v(!0),o.current&&(o.current.style.visibility="hidden")):(v(!1),o.current&&(o.current.style.visibility="visible")))}),h.addEventListener("scroll",s),s()):o.current&&(o.current.style.visibility="visible"),()=>{s&&h.removeEventListener("scroll",s)}},[_,w]),i.useLayoutEffect(()=>{let s;return p&&(s=()=>{w(),O()},window.addEventListener("resize",s),s()),()=>{s&&window.removeEventListener("resize",s)}},[p,w,O]);const[S]=a.selectChildren(n,[{type:k}]),E=a.modChildren(S,()=>[{sort:e,onSortChange:r}]),N=c()===window;if(u){const s=i.createElement("tr",null,i.createElement("td",{className:a.cl(G),colSpan:100}));return i.createElement(i.Fragment,null,i.createElement("tr",{ref:o,className:a.cl(j({pinned:!1,scrollParentIsWindow:N,__autoLayout:u}),t),...l},E),s,p&&i.createElement("tr",{ref:f,className:a.cl(t,j({pinned:!0,scrollParentIsWindow:N,__autoLayout:u})),...l,id:l.id?`pinned-${l.id}`:void 0,"data-testid":l["data-testid"]?`pinned-${l["data-testid"]}`:void 0},E))}return i.createElement(i.Fragment,null,i.createElement("div",{ref:o,className:a.cl(t,j({pinned:!1,scrollParentIsWindow:N,__autoLayout:u})),...l},E),p&&i.createElement("div",{ref:f,className:a.cl(t,j({pinned:!0,scrollParentIsWindow:N,__autoLayout:u})),...l,id:l.id?`pinned-${l.id}`:void 0,"data-testid":l["data-testid"]?`pinned-${l["data-testid"]}`:void 0},E))}a.Metadata.set(x,{name:"Sorting Header",props:{sort:{type:"SortedColumn[]"},onSortChange:{type:"SortChangeHandler"}}}),m.SortingHeader=x,m.SortingHeaderCell=k,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils"),require("@spscommerce/i18n")):typeof define==`function`&&define.amd?define([`exports`,`react`,`@sps-woodland/core`,`@spscommerce/utils`,`@spscommerce/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SortingHeader={},e.react,e.spsWoodlandCore,e.spscommerceUtils,e.spscommerceI18n))})(this,function(e,t,n,r,i){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=c(t),a=0,l=i.length,d;a<l;a++)d=i[a],!u.call(e,d)&&d!==n&&o(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(r=s(t,d))||r.enumerable});return e};t=((e,t,n)=>(n=e==null?{}:a(l(e)),d(t||!e||!e.__esModule||!u.call(e,`default`)?o(n,`default`,{value:e,enumerable:!0}):n,e)))(t,1);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p(Object(n),!0).forEach(function(t){f(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=(e,t,n)=>{for(var r of Object.keys(e))if(e[r]!==(t[r]??n[r]))return!1;return!0},g=e=>t=>{var n=e.defaultClassName,r=m(m({},e.defaultVariants),t);for(var i in r){var a=r[i]??e.defaultVariants[i];if(a!=null){var o=a;typeof o==`boolean`&&(o=o===!0?`true`:`false`);var s=e.variantClassNames[i][o];s&&(n+=` `+s)}}for(var[c,l]of e.compoundVariants)h(c,r,e.defaultVariants)&&(n+=` `+l);return n},_=g({defaultClassName:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf0`,variantClassNames:{up:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf1`},down:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_ax8xqf2`}},defaultVariants:{},compoundVariants:[]}),v=g({defaultClassName:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id0`,variantClassNames:{disabled:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id1`},active:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id2`},__autoLayout:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id3`,false:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id4`}},defaultVariants:{disabled:!1,active:!1,__autoLayout:!1},compoundVariants:[]}),y=`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id5`,b=`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_11ho8id6`;function x({className:e,sortKey:r,sort:a,sortDisabled:o,onSortChange:s,onClick:c,children:l,style:u,widthPx:d,widthRem:f,__autoLayout:p=!1,...m}){let h=t.useMemo(()=>{let e=!!r&&!o&&Array.isArray(a)&&a.find(e=>e.key===r);return e?e.direction:void 0},[a,r,o]),{t:g}=(0,i.useWoodlandLanguage)(),x=d?d/16:f,S=x?{...u,width:`${x}rem`}:u,C=e=>{r&&!o&&s&&s([{key:r,direction:h===n.SortDirection.ASCENDING?n.SortDirection.DESCENDING:n.SortDirection.ASCENDING}]),c&&c(e)},w=!!r&&!!s&&!o,T=`none`;h===n.SortDirection.ASCENDING?T=`ascending`:h===n.SortDirection.DESCENDING&&(T=`descending`);let E=null;!p&&h&&(E=t.createElement(`span`,{className:b},` `,h===n.SortDirection.ASCENDING?g(`sortingHeader.sortedAscending`,{defaultValue:`sorted ascending`}):g(`sortingHeader.sortedDescending`,{defaultValue:`sorted descending`})));let D=w?t.createElement(`button`,{type:`button`,className:y},l,E):t.createElement(t.Fragment,null,l,E);return p?t.createElement(`td`,{className:(0,n.cl)(e,v({disabled:o,active:!!h,__autoLayout:p}),h&&_({up:h===n.SortDirection.ASCENDING,down:h===n.SortDirection.DESCENDING})),onClick:C,style:S,role:`columnheader`,"aria-sort":w?T:void 0,...m},D):t.createElement(`div`,{className:(0,n.cl)(e,v({disabled:o,active:!!h,__autoLayout:p}),h&&_({up:h===n.SortDirection.ASCENDING,down:h===n.SortDirection.DESCENDING})),onClick:C,style:S,...m},D)}n.Metadata.set(x,{name:`Sorting Header Cell`,props:{sortKey:{type:`string`},sort:{type:`SortedColumn[]`},sortDisabled:{type:`boolean`},onSortChange:{type:`SortChangeHandler`},widthPx:{type:`number`},widthRem:{type:`number`}}});var S=g({defaultClassName:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu0`,variantClassNames:{pinned:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu1`,false:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu2`},scrollParentIsWindow:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu3`,false:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu4`},__autoLayout:{true:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu5`,false:`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu6`}},defaultVariants:{pinned:!1,scrollParentIsWindow:!1,__autoLayout:!1},compoundVariants:[[{pinned:!0,scrollParentIsWindow:!0},`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu7`]]}),C=`pkg_sps-woodland_core__family_sorting-header__version_8_56_3__hash_1jpcvsu8`;function w({sort:e,onSortChange:i,children:a,className:o,pinSortingHeader:s=!1,__autoLayout:c=!1,...l}){let[u,d]=t.useState(!1),f=t.useRef(null),p=t.useRef(null),m=t.useRef({height:``,width:``,unpinAtTop:0,unpinAtBottom:0,cellWidths:[]}),h=t.useCallback(()=>f.current&&(0,n.getScrollParent)(f.current)||window,[]),g=t.useCallback(e=>{let t=e||h();return t.scrollY||t.scrollTop||0},[]),_=t.useCallback(e=>{if(s&&f.current){let t=e||h(),n=g(t),r=c?f.current.parentElement?.parentElement?.getBoundingClientRect():f.current.parentElement?.getBoundingClientRect();if(r){let e=f.current.getBoundingClientRect();m.current.height=`${e.height}px`,m.current.width=`${e.width}px`,t===window?(m.current.unpinAtBottom=r.bottom+n-e.height*2,m.current.unpinAtTop=e.top+n-e.height):(m.current.unpinAtBottom=r.bottom+n-e.height*2,m.current.unpinAtTop=r.top+n),m.current.cellWidths=[],f.current.childNodes.forEach((e,t)=>{e instanceof HTMLElement&&(m.current.cellWidths[t]=`${e.getBoundingClientRect().width}px`)})}}},[s]),v=t.useCallback(()=>{p.current&&(p.current.style.width=m.current.width,p.current.style.height=m.current.height,p.current.childNodes.forEach((e,t)=>{e instanceof HTMLElement&&(e.style.width=m.current.cellWidths[t]||``)}))},[]);t.useLayoutEffect(()=>{_()}),t.useLayoutEffect(()=>{let e,t=h();return s?(e=(0,r.lockToAnimationFrames)(()=>{_(t);let{unpinAtTop:e,unpinAtBottom:n}=m.current,r=g(t);e&&n&&(r>=e&&r<=n?(d(!0),f.current&&(f.current.style.visibility=`hidden`)):(d(!1),f.current&&(f.current.style.visibility=`visible`)))}),t.addEventListener(`scroll`,e),e()):f.current&&(f.current.style.visibility=`visible`),()=>{e&&t.removeEventListener(`scroll`,e)}},[s,_]),t.useLayoutEffect(()=>{let e;return u&&(e=()=>{_(),v()},window.addEventListener(`resize`,e),e()),()=>{e&&window.removeEventListener(`resize`,e)}},[u,_,v]);let[y]=(0,n.selectChildren)(a,[{type:x}]),b=(0,n.modChildren)(y,()=>[{sort:e,onSortChange:i}]),w=h()===window;if(c){let e=t.createElement(`tr`,null,t.createElement(`td`,{className:(0,n.cl)(C),colSpan:100}));return t.createElement(t.Fragment,null,t.createElement(`tr`,{ref:f,className:(0,n.cl)(S({pinned:!1,scrollParentIsWindow:w,__autoLayout:c}),o),...l},b),e,u&&t.createElement(`tr`,{ref:p,className:(0,n.cl)(o,S({pinned:!0,scrollParentIsWindow:w,__autoLayout:c})),...l,id:l.id?`pinned-${l.id}`:void 0,"data-testid":l[`data-testid`]?`pinned-${l[`data-testid`]}`:void 0},b))}return t.createElement(t.Fragment,null,t.createElement(`div`,{ref:f,className:(0,n.cl)(o,S({pinned:!1,scrollParentIsWindow:w,__autoLayout:c})),...l},b),u&&t.createElement(`div`,{ref:p,className:(0,n.cl)(o,S({pinned:!0,scrollParentIsWindow:w,__autoLayout:c})),...l,id:l.id?`pinned-${l.id}`:void 0,"data-testid":l[`data-testid`]?`pinned-${l[`data-testid`]}`:void 0},b))}n.Metadata.set(w,{name:`Sorting Header`,props:{sort:{type:`SortedColumn[]`},onSortChange:{type:`SortChangeHandler`}}}),e.SortingHeader=w,e.SortingHeaderCell=x});