@orangelogic/design-system 2.60.0 → 2.61.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 (248) hide show
  1. package/library/apps/cortex/src/types.d.ts +2 -0
  2. package/library/chunks/_baseRest.ClTMQtN1.js +67 -0
  3. package/library/chunks/{_baseUniq.BUihBa8c.js → _baseUniq.Df-fLIBx.js} +53 -56
  4. package/library/chunks/{amazon_s3.DeaMdPPn.js → amazon_s3.BEMtqafk.js} +1 -1
  5. package/library/chunks/animate.El-MpOws.js +37 -0
  6. package/library/chunks/animation-registry.HmpwNuGH.js +34 -0
  7. package/library/chunks/{animation.B7d72NVK.js → animation.DfUHRQry.js} +10 -8
  8. package/library/chunks/array.DCtvHiLS.js +81 -0
  9. package/library/chunks/asset.CG_yXtWK.js +288 -0
  10. package/library/chunks/{browser.Va59Ix3P.js → browser.BHOCIF_A.js} +18 -16
  11. package/library/chunks/{button.CtCSNRB3.js → button.P71VJ5xh.js} +75 -74
  12. package/library/chunks/{button.styles.C8AIO8fd.js → button.styles.Dl5IQLHU.js} +1 -1
  13. package/library/chunks/{capitalize.CNStXZBq.js → capitalize.WSkCXkNE.js} +1 -1
  14. package/library/chunks/{chatbot.sm4Rph1v.js → chatbot.BmpIu59L.js} +2 -2
  15. package/library/chunks/{class-map.CoZTSvbM.js → class-map.BiVq-cVR.js} +1 -1
  16. package/library/chunks/{color-swatch-group.qJevXs50.js → color-swatch-group.DlLmydlB.js} +116 -127
  17. package/library/chunks/color-swatch.Bpb_hW2H.js +407 -0
  18. package/library/chunks/color.vLD2sNTs.js +164 -0
  19. package/library/chunks/{component.styles.CI-v8BZa.js → component.styles.DMSLciL5.js} +1 -1
  20. package/library/chunks/{confirm-popover.D2TF1x6K.js → confirm-popover.C1uA36JR.js} +15 -13
  21. package/library/chunks/{content-builder.WranV3P4.js → content-builder.Bf7kqzDI.js} +1 -1
  22. package/library/chunks/converters.DkDtLstb.js +11 -0
  23. package/library/chunks/{cropper.aA0v16xS.js → cropper.BraEEykE.js} +5004 -5024
  24. package/library/chunks/custom-element.L4WJXn1j.js +14 -0
  25. package/library/chunks/debounce.DaHuiSGU.js +15 -0
  26. package/library/chunks/{default-value.CIKAvD5l.js → default-value.COZopaet.js} +1 -1
  27. package/library/chunks/{dialog.B1TORO6S.js → dialog.C_75RVVz.js} +52 -49
  28. package/library/chunks/{directive-helpers.DBHob-_L.js → directive-helpers.Dm4rc594.js} +1 -1
  29. package/library/chunks/dom.CZrJ64Dm.js +92 -0
  30. package/library/chunks/{dot-pagination.8f2oX_ge.js → dot-pagination.CoCIJsHC.js} +24 -22
  31. package/library/chunks/{endpoints.BgyupJys.js → endpoints.B7lcoc1N.js} +1 -3
  32. package/library/chunks/{file-on-demand.Cwgabdyw.js → file-on-demand.B2jNilAj.js} +1829 -1544
  33. package/library/chunks/{folder-select.DiWCwR-T.js → folder-select.CSEQxIXF.js} +380 -255
  34. package/library/chunks/{form-control.styles.NE2Q-quE.js → form-control.styles.CUGhvlfT.js} +1 -1
  35. package/library/chunks/{form.B8u0ywni.js → form.CO12-VK0.js} +1 -1
  36. package/library/chunks/{guard.BDP4A85K.js → guard.D4axKaMo.js} +1 -1
  37. package/library/chunks/{header.B_FD8uLt.js → header.Bd3G0-oA.js} +11 -9
  38. package/library/chunks/{hub-connection.CxfaT11o.js → hub-connection.BxT2b7Nq.js} +4 -3
  39. package/library/chunks/{i18n.BP2FRO1v.js → i18n.DrzK7TPf.js} +54 -7
  40. package/library/chunks/identity.ByMq8VxU.js +6 -0
  41. package/library/chunks/{if-defined.MfEgpxEN.js → if-defined.BRoBj_Rp.js} +1 -1
  42. package/library/chunks/{iframe.DZm7FiCl.js → iframe.UCj6Ze2A.js} +18 -16
  43. package/library/chunks/{image.Ycf8RudS.js → image.DZCRhE3G.js} +82 -79
  44. package/library/chunks/image.mbpyiQpQ.js +82 -0
  45. package/library/chunks/index.S0wy3rzm.js +373 -0
  46. package/library/chunks/isObjectLike.D3cpZO39.js +81 -0
  47. package/library/chunks/{isSymbol.L0C2ND_U.js → isSymbol.huJ_Cvxt.js} +1 -1
  48. package/library/chunks/lib-cortex-element.CVMmyPMC.js +146 -0
  49. package/library/chunks/{list-editor.COkw5JKG.js → list-editor.CrLntuM7.js} +75 -79
  50. package/library/chunks/{custom-element.vnXBMQxc.js → lit-element.jLBm65_O.js} +123 -277
  51. package/library/chunks/{live.LdB9xEhp.js → live.SCz6M8Gs.js} +2 -2
  52. package/library/chunks/{mailchimp.BjbPJfd-.js → mailchimp.Bs6uJVsf.js} +1 -1
  53. package/library/chunks/{modal.BqNLxgs1.js → modal.U1QltQKe.js} +25 -19
  54. package/library/chunks/{option.D9KJhzHs.js → option.D1u5-cTt.js} +21 -19
  55. package/library/chunks/{orangelogic.BgbQXkBv.js → orangelogic.TdFfoPUN.js} +1 -1
  56. package/library/chunks/{overlayscrollbars.aFuRG5Rs.js → overlayscrollbars.XhGWx9Zk.js} +1 -1
  57. package/library/chunks/{pagination.C2FN4fmO.js → pagination.BI3LONVU.js} +17 -15
  58. package/library/chunks/{ref.BaCjlzLO.js → ref.bzeTdX0K.js} +2 -2
  59. package/library/chunks/{repeat.CauKaXyy.js → repeat.DbF2p5ae.js} +2 -2
  60. package/library/chunks/responsive.CA6dcNiM.js +17 -0
  61. package/library/chunks/{scroll.DwPiX2Ox.js → scroll.xtO5yojm.js} +3 -2
  62. package/library/chunks/{slot.DJLm4Dig.js → slot.j5oheLJC.js} +12 -4
  63. package/library/chunks/{state.Cw55xXlb.js → state.CSDxrqLd.js} +1 -1
  64. package/library/chunks/{static.BjNkqt7_.js → static.UA3G1Deq.js} +1 -1
  65. package/library/chunks/string.Cp_XNbnV.js +160 -0
  66. package/library/chunks/{style-map.CZovMmo_.js → style-map.llVFPd__.js} +1 -1
  67. package/library/chunks/{tab-group.5fLnWflv.js → tab-group.DxSlcWK0.js} +20 -18
  68. package/library/chunks/{table.BAr8KKc6.js → table.CY-iMTWV.js} +457 -505
  69. package/library/chunks/template.CsJd8Pb_.js +20 -0
  70. package/library/chunks/time.D_uFZqqe.js +118 -0
  71. package/library/chunks/{toString.CL_lYXbK.js → toString.CRT5zqEU.js} +3 -3
  72. package/library/chunks/toast.BXNbwZV8.js +25 -0
  73. package/library/chunks/{tree.CUfvIDyA.js → tree.CNbrP8cY.js} +33 -36
  74. package/library/chunks/{typography.BFpl0WMA.js → typography.oDzoLbZS.js} +16 -14
  75. package/library/chunks/{unsafe-html.DyO9_Rsq.js → unsafe-html.Dff7-rCx.js} +1 -1
  76. package/library/chunks/url.LjsR2sB5.js +15 -0
  77. package/library/chunks/user-agent.D9aPuOyL.js +4 -0
  78. package/library/chunks/watch.q1sEjPWL.js +501 -0
  79. package/library/components/alert.js +38 -35
  80. package/library/components/animated-image.js +25 -23
  81. package/library/components/animation.js +7 -5
  82. package/library/components/array-line-clamp.d.ts +3 -0
  83. package/library/components/array-line-clamp.js +195 -0
  84. package/library/components/asset-link-format.js +223 -212
  85. package/library/components/atoms.js +164 -162
  86. package/library/components/avatar.js +28 -26
  87. package/library/components/badge.js +10 -8
  88. package/library/components/bicolor-picker.js +21 -19
  89. package/library/components/border-input-group.js +11 -9
  90. package/library/components/breadcrumb-item.js +14 -12
  91. package/library/components/breadcrumb.js +24 -22
  92. package/library/components/button-group.js +26 -24
  93. package/library/components/button.js +14 -13
  94. package/library/components/card.js +28 -19
  95. package/library/components/checkbox.js +29 -23
  96. package/library/components/color-picker.js +19 -17
  97. package/library/components/color-swatch-group.js +20 -17
  98. package/library/components/color-swatch.js +16 -13
  99. package/library/components/confirm-popover.js +11 -9
  100. package/library/components/copy-button.js +15 -13
  101. package/library/components/corner-position-input-group.js +13 -11
  102. package/library/components/cortex-element.d.ts +3 -0
  103. package/library/components/cortex-element.js +5 -0
  104. package/library/components/cropper.js +7 -5
  105. package/library/components/details.js +23 -20
  106. package/library/components/dialog.js +19 -16
  107. package/library/components/divider.js +13 -11
  108. package/library/components/dot-pagination.js +11 -9
  109. package/library/components/dot-status.js +10 -8
  110. package/library/components/drawer.js +63 -51
  111. package/library/components/dropdown.js +29 -26
  112. package/library/components/dynamic-select.js +12 -10
  113. package/library/components/element-clamp.js +28 -25
  114. package/library/components/file-on-demand.js +21 -20
  115. package/library/components/folder-select.js +12 -10
  116. package/library/components/format-bytes.js +11 -10
  117. package/library/components/format-date.js +11 -9
  118. package/library/components/format-number.js +16 -15
  119. package/library/components/format-time.js +118 -9
  120. package/library/components/grid-item.js +48 -46
  121. package/library/components/grid.js +31 -29
  122. package/library/components/header.js +10 -9
  123. package/library/components/hub-connection.js +6 -5
  124. package/library/components/icon-button.js +20 -18
  125. package/library/components/icon.js +17 -15
  126. package/library/components/iframe.js +10 -8
  127. package/library/components/image-comparer.js +27 -25
  128. package/library/components/image.js +14 -11
  129. package/library/components/include.js +26 -24
  130. package/library/components/input-group.js +15 -13
  131. package/library/components/input.js +23 -21
  132. package/library/components/line-clamp.js +12 -10
  133. package/library/components/list-editor.js +17 -15
  134. package/library/components/markdown.js +80 -78
  135. package/library/components/masonry.js +46 -44
  136. package/library/components/menu-item.js +151 -136
  137. package/library/components/menu-label.js +15 -13
  138. package/library/components/menu-section.js +18 -16
  139. package/library/components/menu.js +10 -8
  140. package/library/components/molecules.js +5 -5
  141. package/library/components/mutation-observer.js +12 -10
  142. package/library/components/option.js +10 -8
  143. package/library/components/organisms.js +2 -2
  144. package/library/components/padding-input-group.js +30 -28
  145. package/library/components/pagination.js +14 -12
  146. package/library/components/popup.js +3296 -9
  147. package/library/components/position-picker.js +12 -10
  148. package/library/components/progress-bar.js +13 -11
  149. package/library/components/progress-ring.js +15 -13
  150. package/library/components/qr-code.js +54 -52
  151. package/library/components/radio-button.js +19 -17
  152. package/library/components/radio-card.js +14 -12
  153. package/library/components/radio-group.js +20 -18
  154. package/library/components/radio.js +15 -13
  155. package/library/components/range.js +25 -23
  156. package/library/components/rating.js +17 -15
  157. package/library/components/relative-time.js +16 -14
  158. package/library/components/resize-observer.js +21 -19
  159. package/library/components/select.js +1442 -25
  160. package/library/components/shadow-input-group.js +19 -17
  161. package/library/components/share-option-list.js +20 -18
  162. package/library/components/sidebar.js +14 -12
  163. package/library/components/size-input-group.js +35 -33
  164. package/library/components/skeleton.js +12 -10
  165. package/library/components/space.js +12 -10
  166. package/library/components/spinner.js +17 -15
  167. package/library/components/split-panel.js +15 -13
  168. package/library/components/step.js +18 -16
  169. package/library/components/stepper-wizard.js +11 -9
  170. package/library/components/stepper.js +13 -11
  171. package/library/components/switch.js +21 -19
  172. package/library/components/tab-group.js +15 -13
  173. package/library/components/tab-panel.js +20 -18
  174. package/library/components/tab.js +18 -16
  175. package/library/components/table.js +69 -67
  176. package/library/components/tag.js +11 -9
  177. package/library/components/textarea.js +20 -18
  178. package/library/components/timecode.js +98 -8
  179. package/library/components/tooltip.js +24 -21
  180. package/library/components/tree-item.js +14 -11
  181. package/library/components/tree.js +12 -10
  182. package/library/components/typeface.js +13 -11
  183. package/library/components/types.js +15487 -15444
  184. package/library/components/typography.js +6 -4
  185. package/library/components/video.js +13 -11
  186. package/library/components/visually-hidden.js +15 -13
  187. package/library/events.d.ts +1 -0
  188. package/library/events.js +1 -0
  189. package/library/package.json +11 -2
  190. package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.d.ts +45 -0
  191. package/library/packages/atoms/src/components/array-line-clamp/array-line-clamp.styles.d.ts +2 -0
  192. package/library/packages/atoms/src/components/checkbox/checkbox.d.ts +2 -0
  193. package/library/packages/atoms/src/components/drawer/drawer.d.ts +7 -1
  194. package/library/packages/atoms/src/components/include/include.d.ts +1 -0
  195. package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +2 -0
  196. package/library/packages/atoms/src/components/tree/tree.d.ts +0 -4
  197. package/library/packages/atoms/src/index.d.ts +1 -0
  198. package/library/packages/events/src/cx-file-on-demand-load-more.d.ts +8 -0
  199. package/library/packages/events/src/cx-file-on-demand-pin.d.ts +8 -0
  200. package/library/packages/events/src/cx-file-on-demand-unpin.d.ts +8 -0
  201. package/library/packages/events/src/cx-folder-select-search-term-change.d.ts +8 -0
  202. package/library/packages/events/src/cx-share-option-list-item-selected.d.ts +8 -0
  203. package/library/packages/events/src/events.d.ts +6 -2
  204. package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +2 -0
  205. package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
  206. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
  207. package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +1 -0
  208. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +8 -0
  209. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +1 -0
  210. package/library/packages/molecules/src/folder-select/folder-select.d.ts +6 -1
  211. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +3 -7
  212. package/library/packages/organisms/src/content-builder/styleController.d.ts +8 -8
  213. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.d.ts +80 -0
  214. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.styles.d.ts +2 -0
  215. package/library/packages/organisms/src/file-on-demand/components/file-on-demand-pinned-status.ts/file-on-demand-pinned-status.d.ts +44 -0
  216. package/library/packages/organisms/src/file-on-demand/file-on-demand.constants.d.ts +1 -0
  217. package/library/packages/organisms/src/file-on-demand/file-on-demand.d.ts +11 -18
  218. package/library/packages/organisms/src/file-on-demand/file-on-demand.utils.d.ts +6 -0
  219. package/library/packages/services/src/api/folder/folder.d.ts +4 -8
  220. package/library/packages/services/src/api/folder/folder.types.d.ts +2 -1
  221. package/library/packages/types/src/file-on-demand.d.ts +4 -0
  222. package/library/packages/types/src/folder-select.d.ts +9 -2
  223. package/library/packages/utils/src/custom-element/i18n.d.ts +40 -2
  224. package/library/packages/utils/src/drag-scroll/drag-scroll.d.ts +22 -0
  225. package/library/packages/utils/src/drag-scroll/index.d.ts +1 -0
  226. package/library/packages/utils/src/font/font.d.ts +26 -0
  227. package/library/packages/utils/src/font/index.d.ts +1 -0
  228. package/library/packages/utils/src/history-manager/history-manager.d.ts +13 -0
  229. package/library/packages/utils/src/history-manager/index.d.ts +1 -0
  230. package/library/packages/utils/src/index.d.ts +45 -0
  231. package/library/packages/utils/src/template/index.d.ts +1 -0
  232. package/library/packages/utils/src/template/template.d.ts +3 -0
  233. package/library/react-web-component.d.ts +418 -360
  234. package/library/utils.d.ts +1 -0
  235. package/library/utils.js +180 -0
  236. package/package.json +11 -2
  237. package/library/chunks/animation-registry.DavRkTTr.js +0 -69
  238. package/library/chunks/asset.Ba-CxnNM.js +0 -309
  239. package/library/chunks/color-swatch.DUe3iLLo.js +0 -558
  240. package/library/chunks/dom.C0OFx7ND.js +0 -78
  241. package/library/chunks/format-time.BW6-ZWCX.js +0 -226
  242. package/library/chunks/isObjectLike.z36Fu426.js +0 -34
  243. package/library/chunks/popup._w5T7x8f.js +0 -3307
  244. package/library/chunks/select.DfO4de04.js +0 -1441
  245. package/library/chunks/string.BCk3SmdZ.js +0 -144
  246. package/library/chunks/timecode.D7XTiQ_3.js +0 -105
  247. package/library/chunks/watch.BCJD77bD.js +0 -547
  248. package/library/packages/events/src/cx-load-more.d.ts +0 -8
@@ -1,10 +1,12 @@
1
- import { i as p, n as c, C as g, x as d, c as y } from "../chunks/custom-element.vnXBMQxc.js";
2
- import { c as x } from "../chunks/component.styles.CI-v8BZa.js";
3
- import { w as m } from "../chunks/watch.BCJD77bD.js";
4
- import { r as h } from "../chunks/state.Cw55xXlb.js";
5
- import { e as f } from "../chunks/query.BBf1UFkC.js";
1
+ import { n as c, C as p } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
+ import { c as g } from "../chunks/component.styles.DMSLciL5.js";
3
+ import { c as y } from "../chunks/custom-element.L4WJXn1j.js";
4
+ import { w as m } from "../chunks/watch.q1sEjPWL.js";
5
+ import { i as f, x as d } from "../chunks/lit-element.jLBm65_O.js";
6
+ import { r as h } from "../chunks/state.CSDxrqLd.js";
7
+ import { e as x } from "../chunks/query.BBf1UFkC.js";
6
8
  import u from "./icon.js";
7
- const v = p`
9
+ const v = f`
8
10
  :host {
9
11
  --control-box-size: 3rem;
10
12
  --icon-size: calc(var(--control-box-size) * 0.625);
@@ -63,12 +65,12 @@ const v = p`
63
65
  display: none;
64
66
  }
65
67
  `;
66
- var b = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, a = (t, i, r, n) => {
67
- for (var o = n > 1 ? void 0 : n ? _(i, r) : i, s = t.length - 1, l; s >= 0; s--)
68
- (l = t[s]) && (o = (n ? l(i, r, o) : l(o)) || o);
68
+ var b = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, t = (a, i, r, n) => {
69
+ for (var o = n > 1 ? void 0 : n ? _(i, r) : i, s = a.length - 1, l; s >= 0; s--)
70
+ (l = a[s]) && (o = (n ? l(i, r, o) : l(o)) || o);
69
71
  return n && o && b(i, r, o), o;
70
72
  };
71
- let e = class extends g {
73
+ let e = class extends p {
72
74
  constructor() {
73
75
  super(...arguments), this.isLoaded = !1;
74
76
  }
@@ -76,8 +78,8 @@ let e = class extends g {
76
78
  this.play = !this.play;
77
79
  }
78
80
  handleLoad() {
79
- const t = document.createElement("canvas"), { height: i, width: r } = this.animatedImage;
80
- t.width = r, t.height = i, t.getContext("2d").drawImage(this.animatedImage, 0, 0, r, i), this.frozenFrame = t.toDataURL("image/gif"), this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0);
81
+ const a = document.createElement("canvas"), { height: i, width: r } = this.animatedImage;
82
+ a.width = r, a.height = i, a.getContext("2d").drawImage(this.animatedImage, 0, 0, r, i), this.frozenFrame = a.toDataURL("image/gif"), this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0);
81
83
  }
82
84
  handleError() {
83
85
  this.emit("cx-error");
@@ -122,33 +124,33 @@ let e = class extends g {
122
124
  `;
123
125
  }
124
126
  };
125
- e.styles = [x, v];
127
+ e.styles = [g, v];
126
128
  e.dependencies = { "cx-icon": u };
127
- a([
128
- f(".animated-image__animated")
129
+ t([
130
+ x(".animated-image__animated")
129
131
  ], e.prototype, "animatedImage", 2);
130
- a([
132
+ t([
131
133
  h()
132
134
  ], e.prototype, "frozenFrame", 2);
133
- a([
135
+ t([
134
136
  h()
135
137
  ], e.prototype, "isLoaded", 2);
136
- a([
138
+ t([
137
139
  c()
138
140
  ], e.prototype, "src", 2);
139
- a([
141
+ t([
140
142
  c()
141
143
  ], e.prototype, "alt", 2);
142
- a([
144
+ t([
143
145
  c({ reflect: !0, type: Boolean })
144
146
  ], e.prototype, "play", 2);
145
- a([
147
+ t([
146
148
  m("play", { waitUntilFirstUpdate: !0 })
147
149
  ], e.prototype, "handlePlayChange", 1);
148
- a([
150
+ t([
149
151
  m("src")
150
152
  ], e.prototype, "handleSrcChange", 1);
151
- e = a([
153
+ e = t([
152
154
  y("cx-animated-image")
153
155
  ], e);
154
156
  export {
@@ -1,8 +1,10 @@
1
- import "../chunks/custom-element.vnXBMQxc.js";
2
- import "../chunks/component.styles.CI-v8BZa.js";
3
- import "../chunks/watch.BCJD77bD.js";
1
+ import "../chunks/lib-cortex-element.CVMmyPMC.js";
2
+ import "../chunks/component.styles.DMSLciL5.js";
3
+ import "../chunks/custom-element.L4WJXn1j.js";
4
+ import "../chunks/watch.q1sEjPWL.js";
5
+ import "../chunks/lit-element.jLBm65_O.js";
4
6
  import "../chunks/query-async.CTgXGyQ5.js";
5
- import { C as a } from "../chunks/animation.B7d72NVK.js";
7
+ import { C as f } from "../chunks/animation.DfUHRQry.js";
6
8
  export {
7
- a as default
9
+ f as default
8
10
  };
@@ -0,0 +1,3 @@
1
+ export * from '../packages/atoms/src/components/array-line-clamp/array-line-clamp'
2
+ import _default from '../packages/atoms/src/components/array-line-clamp/array-line-clamp'
3
+ export default _default
@@ -0,0 +1,195 @@
1
+ import { n as h, C as y } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
+ import { c as g } from "../chunks/component.styles.DMSLciL5.js";
3
+ import { c as w } from "../chunks/custom-element.L4WJXn1j.js";
4
+ import { w as u } from "../chunks/watch.q1sEjPWL.js";
5
+ import { i as x, E as C, x as m } from "../chunks/lit-element.jLBm65_O.js";
6
+ import { r as v } from "../chunks/state.CSDxrqLd.js";
7
+ import { e as f } from "../chunks/query.BBf1UFkC.js";
8
+ import { o as b } from "../chunks/style-map.llVFPd__.js";
9
+ import { n as M } from "../chunks/when.Dr1es41R.js";
10
+ import E from "./line-clamp.js";
11
+ import L from "./resize-observer.js";
12
+ import S from "./tag.js";
13
+ const A = x`
14
+ .array-clamp {
15
+ display: flex;
16
+ align-items: center;
17
+ flex-wrap: nowrap;
18
+ flex-grow: 1;
19
+ flex-shrink: 1;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .array-clamp__items-container {
24
+ display: flex;
25
+ align-items: center;
26
+ flex-wrap: nowrap;
27
+ flex-grow: 1;
28
+ flex-shrink: 1;
29
+ overflow: hidden;
30
+ min-width: 0;
31
+ width: 100%;
32
+ }
33
+
34
+ .array-clamp__items-container ::slotted(.array-clamp__item) {
35
+ white-space: nowrap;
36
+ flex-shrink: 0;
37
+ }
38
+
39
+ .array-clamp__items-container ::slotted(.array-clamp__item:not(:last-child))::after {
40
+ content: var(--array-clamp-separator, ', ');
41
+ white-space: pre;
42
+ }
43
+
44
+ .array-clamp__items-container ::slotted(.array-clamp__item.clamped) {
45
+ display: none;
46
+ }
47
+
48
+ .array-clamp__items-container ::slotted(.array-clamp__item.array-clamp__last-visible) {
49
+ display: -webkit-box;
50
+ -webkit-box-orient: vertical;
51
+ -webkit-line-clamp: 1;
52
+ overflow: hidden;
53
+ text-overflow: ellipsis;
54
+ white-space: normal;
55
+ min-width: 0;
56
+ flex-shrink: 1;
57
+ }
58
+
59
+ .array-clamp__indicator {
60
+ flex-shrink: 0;
61
+ }
62
+
63
+ .array-clamp__indicator::part(base) {
64
+ max-width: 4rem;
65
+ min-width: 2rem;
66
+ overflow-wrap: break-word;
67
+ }
68
+ `;
69
+ var R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, o = (e, a, s, r) => {
70
+ for (var t = r > 1 ? void 0 : r ? z(a, s) : a, i = e.length - 1, n; i >= 0; i--)
71
+ (n = e[i]) && (t = (r ? n(a, s, t) : n(t)) || t);
72
+ return r && t && R(a, s, t), t;
73
+ };
74
+ const P = "array-clamp__item", p = "array-clamp__last-visible", d = "clamped";
75
+ let l = class extends y {
76
+ constructor() {
77
+ super(...arguments), this.separator = ", ", this.tooltipSeparator = "", this.clampedMap = /* @__PURE__ */ new Map();
78
+ }
79
+ get totalClamped() {
80
+ return Array.from(this.clampedMap.values()).filter(Boolean).length;
81
+ }
82
+ get totalVisible() {
83
+ const e = this.slotEl?.assignedElements({ flatten: !0 }).length ?? 0;
84
+ return Math.max(0, e - this.totalClamped);
85
+ }
86
+ get hiddenChildrenStr() {
87
+ const e = this.slotEl;
88
+ if (!e)
89
+ return "";
90
+ const a = e.assignedElements({ flatten: !0 }), s = this.tooltipSeparator || this.separator;
91
+ return a.map((r, t) => this.clampedMap.get(t) ? r.textContent?.trim() ?? "" : "").filter(Boolean).join(s);
92
+ }
93
+ applyItemClasses() {
94
+ const e = this.slotEl;
95
+ if (!e)
96
+ return;
97
+ const a = e.assignedElements({ flatten: !0 }), s = this.totalVisible;
98
+ a.forEach((r, t) => {
99
+ r.classList.add(P), this.clampedMap.get(t) ? (r.classList.add(d), r.classList.remove(p)) : (r.classList.remove(d), t === a.length - 1 || t === s - 1 && s > 0 ? r.classList.add(p) : r.classList.remove(p));
100
+ });
101
+ }
102
+ handleSlotChange() {
103
+ const e = this.containerEl, a = this.slotEl;
104
+ if (!e || !a)
105
+ return;
106
+ const s = a.assignedElements({ flatten: !0 });
107
+ if (s.length === 0) {
108
+ this.clampedMap = /* @__PURE__ */ new Map();
109
+ return;
110
+ }
111
+ const r = e.clientWidth;
112
+ let t = 0;
113
+ const i = /* @__PURE__ */ new Map();
114
+ let n = !1;
115
+ s.forEach((_, c) => {
116
+ n ? i.set(c, !0) : (t += _.offsetWidth, t > r && (n = !0, i.set(c, !0)));
117
+ }), this.clampedMap = i, this.requestUpdate("clampedMap");
118
+ }
119
+ handleResize(e) {
120
+ const { entries: a } = e.detail;
121
+ a.length === 0 || a[0].target !== this.containerEl || this.handleSlotChange();
122
+ }
123
+ runFirstUpdated() {
124
+ this.applyItemClasses();
125
+ }
126
+ handleClampedMapChange() {
127
+ this.applyItemClasses();
128
+ }
129
+ render() {
130
+ return m`
131
+ <div
132
+ class="array-clamp"
133
+ style=${b({
134
+ "--array-clamp-separator": `'${String(this.separator).replaceAll("'", String.raw`\'`)}'`
135
+ })}
136
+ >
137
+ <cx-resize-observer @cx-resize=${this.handleResize}>
138
+ <div class="array-clamp__items-container" part="container">
139
+ <slot @slotchange=${this.handleSlotChange}></slot>
140
+ ${M(
141
+ this.totalClamped > 0,
142
+ () => m`
143
+ <cx-tag
144
+ variant="neutral"
145
+ size="small"
146
+ pill
147
+ class="array-clamp__indicator"
148
+ part="indicator"
149
+ >
150
+ <cx-line-clamp
151
+ tooltip=${this.hiddenChildrenStr}
152
+ lines="1"
153
+ >
154
+ +${this.totalClamped}
155
+ </cx-line-clamp>
156
+ </cx-tag>
157
+ `,
158
+ () => C
159
+ )}
160
+ </div>
161
+ </cx-resize-observer>
162
+ </div>
163
+ `;
164
+ }
165
+ };
166
+ l.styles = [g, A];
167
+ l.dependencies = {
168
+ "cx-line-clamp": E,
169
+ "cx-resize-observer": L,
170
+ "cx-tag": S
171
+ };
172
+ o([
173
+ f(".array-clamp__items-container")
174
+ ], l.prototype, "containerEl", 2);
175
+ o([
176
+ f("slot")
177
+ ], l.prototype, "slotEl", 2);
178
+ o([
179
+ h({ type: String })
180
+ ], l.prototype, "separator", 2);
181
+ o([
182
+ h({ attribute: "tooltip-separator", type: String })
183
+ ], l.prototype, "tooltipSeparator", 2);
184
+ o([
185
+ v()
186
+ ], l.prototype, "clampedMap", 2);
187
+ o([
188
+ u("clampedMap")
189
+ ], l.prototype, "handleClampedMapChange", 1);
190
+ l = o([
191
+ w("cx-array-line-clamp")
192
+ ], l);
193
+ export {
194
+ l as default
195
+ };