@orangelogic/design-system 2.0.0-29DUO2-beta-3 → 2.0.0-29IORR-beta-2

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 (307) hide show
  1. package/library/chunks/{AxisLabelRadial.CgPb7ghO.js → AxisLabelRadial.Bs1P_q_F.js} +1 -1
  2. package/library/chunks/{BaseColumnSeries.B6rG-Ylz.js → BaseColumnSeries.C7jwOxIJ.js} +1 -1
  3. package/library/chunks/{CandlestickSeries.C-YfO-57.js → CandlestickSeries.CkXGtRWE.js} +2 -2
  4. package/library/chunks/{Circle.DhoXSsjo.js → Circle.DBa5Ok8V.js} +1 -1
  5. package/library/chunks/{ColumnSeries.CZi2LBZ2.js → ColumnSeries.DGazbfza.js} +2 -2
  6. package/library/chunks/{EditableAxisLabel.CykTMTsG.js → EditableAxisLabel.wN0t_G2B.js} +2 -2
  7. package/library/chunks/{EditableLabel.BlQ7B4D0.js → EditableLabel.BWeq6fgX.js} +1 -1
  8. package/library/chunks/{Gradient.BQ0JzFEe.js → Gradient.CdcsPIru.js} +1 -1
  9. package/library/chunks/{LinearGradient.DuVS2EHe.js → LinearGradient.B1z9AGUt.js} +2 -2
  10. package/library/chunks/{Picture.DRO0jnR6.js → Picture.YSPC0l0Q.js} +1 -1
  11. package/library/chunks/{Polygon.DEO3f_qs.js → Polygon.BwMvXN2H.js} +1 -1
  12. package/library/chunks/{ProgressPie.Bryx2w1J.js → ProgressPie.DlCwXN17.js} +5 -5
  13. package/library/chunks/{RadialLabel.TyXECvYG.js → RadialLabel.DyVOf2K8.js} +1 -1
  14. package/library/chunks/{Scrollbar.DK48nKk4.js → Scrollbar.BdZVb_Z-.js} +1 -1
  15. package/library/chunks/{Slice.DbXRplXx.js → Slice.DiEswWa6.js} +1 -1
  16. package/library/chunks/{Slider.B27osQYu.js → Slider.C20No2z5.js} +1 -1
  17. package/library/chunks/{SpriteResizer.C4wFzD_x.js → SpriteResizer.DFnmcy0h.js} +1 -1
  18. package/library/chunks/{Triangle.BEmFiHyd.js → Triangle.BaOef7HV.js} +1 -1
  19. package/library/chunks/{ZoomTools.CBqjLDqb.js → ZoomTools.D5JPehoL.js} +1 -1
  20. package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
  21. package/library/chunks/{am-chart.B_OdX4Q-.js → am-chart.H2jnOzFc.js} +254 -262
  22. package/library/chunks/{animation.DfUHRQry.js → animation.7ifl4x2S.js} +4 -8
  23. package/library/chunks/array.DCtvHiLS.js +81 -0
  24. package/library/chunks/asset.D7E0-cUV.js +460 -0
  25. package/library/chunks/{button.KnE3mcyM.js → button.CauAHfdl.js} +10 -45
  26. package/library/chunks/button.styles.CKqn956w.js +5 -0
  27. package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
  28. package/library/chunks/{color-swatch-group.p3Sdqlat.js → color-swatch-group.D5BP2W3P.js} +50 -220
  29. package/library/chunks/{color-swatch.C0oPHfOu.js → color-swatch.2HS4bc3N.js} +20 -204
  30. package/library/chunks/{colorPicker.CJwbdhtn.js → colorPicker.06n6P3aK.js} +5 -5
  31. package/library/chunks/component.styles.CRO4Odto.js +5 -0
  32. package/library/chunks/confirm-popover.DmGAMS8X.js +121 -0
  33. package/library/chunks/{cropper.tSDgXKqJ.js → cropper.ZU2Dy-MM.js} +8182 -8540
  34. package/library/chunks/{dialog.DpZBbTCn.js → dialog.2UW1LNm1.js} +117 -314
  35. package/library/chunks/{dom.BQVKDNd8.js → dom.BslZF2Y_.js} +1 -1
  36. package/library/chunks/dot-pagination.DsAfSNzr.js +204 -0
  37. package/library/chunks/{endpoints.B7lcoc1N.js → endpoints.Fpyb8xvv.js} +214 -203
  38. package/library/chunks/{exporting.DCqJtW6l.js → exporting.Chnl3UWi.js} +2 -2
  39. package/library/chunks/file-on-demand.Dig_iVvx.js +1956 -0
  40. package/library/chunks/{flow.Ch1rU01m.js → flow.D2CqFQa7.js} +5 -5
  41. package/library/chunks/folder-select.BT1drT8C.js +775 -0
  42. package/library/chunks/form-control.styles.CaGWmeAS.js +5 -0
  43. package/library/chunks/{form.DgwYWi0O.js → form.CFc09rKh.js} +1 -1
  44. package/library/chunks/{gantt.rWdF_jmG.js → gantt.DSHD2gjO.js} +8 -8
  45. package/library/chunks/header.BePZwMCQ.js +170 -0
  46. package/library/chunks/{hierarchy.HoRJAu6S.js → hierarchy.DwVsMmsP.js} +5 -5
  47. package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
  48. package/library/chunks/{i18n.C0iakJkV.js → i18n.BFqTRDCA.js} +19 -12
  49. package/library/chunks/icon-button.rKe0N4VB.js +149 -0
  50. package/library/chunks/iframe.DznmlYpV.js +73 -0
  51. package/library/chunks/{image.C9avagDq.js → image.CEtCGsNL.js} +275 -488
  52. package/library/chunks/{index.D2JPKXqq.js → index.C9khsiad.js} +17 -17
  53. package/library/chunks/isObjectLike.z36Fu426.js +34 -0
  54. package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
  55. package/library/chunks/{json.DHNMAC-m.js → json.zyETMOw-.js} +3 -3
  56. package/library/chunks/{list-editor.B2mFE9f7.js → list-editor.CJ96S1Np.js} +58 -372
  57. package/library/chunks/{map.BHmZ4Crx.js → map.CqM2O6LB.js} +2 -2
  58. package/library/chunks/option.COnEtd3X.js +123 -0
  59. package/library/chunks/{overlayscrollbars.XhGWx9Zk.js → overlayscrollbars.BMav4RQ4.js} +252 -958
  60. package/library/chunks/pagination.DaD9Yul6.js +334 -0
  61. package/library/chunks/{percent.CM9cr1H3.js → percent.DuQwbCCg.js} +3 -3
  62. package/library/chunks/{radar.CQUnnhGk.js → radar.FpYl3UH5.js} +4 -4
  63. package/library/chunks/{responsive.CrX-HUow.js → responsive.BndCeSg0.js} +1 -1
  64. package/library/chunks/{sliceGrouper.iv1p8MAK.js → sliceGrouper.BsE7fGMt.js} +1 -1
  65. package/library/chunks/{stock.CU0y6a5P.js → stock.BR-ag4Pt.js} +9 -9
  66. package/library/chunks/string.BigZhczf.js +185 -0
  67. package/library/chunks/{tab-group.05PY0smt.js → tab-group.0Po0eoxR.js} +33 -584
  68. package/library/chunks/{table.DNTm_GMS.js → table.WNd284in.js} +3535 -4852
  69. package/library/chunks/{timeline.yzdwtGKM.js → timeline.DkzkmgEM.js} +5 -5
  70. package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
  71. package/library/chunks/toast.B2cJgW5u.js +71 -0
  72. package/library/chunks/transformation.CzBptarI.js +140 -0
  73. package/library/chunks/{tree.CeMLCbs-.js → tree.QCQd_cuc.js} +32 -400
  74. package/library/chunks/typography.DJC_UXgs.js +52 -0
  75. package/library/chunks/url.Cj9cIQXJ.js +27 -0
  76. package/library/chunks/{venn.BOEi13la.js → venn.D739bOV3.js} +1 -1
  77. package/library/chunks/watch.BCJD77bD.js +547 -0
  78. package/library/chunks/{wc.V-lq02JF.js → wc.DzW311D-.js} +1 -1
  79. package/library/chunks/{xy.Df1hy9ac.js → xy.DCRDfTsa.js} +10 -10
  80. package/library/components/alert.js +11 -179
  81. package/library/components/am-chart.js +3 -3
  82. package/library/components/animated-image.js +13 -101
  83. package/library/components/animation.js +3 -3
  84. package/library/components/array-line-clamp.js +8 -89
  85. package/library/components/asset-link-format.js +718 -1380
  86. package/library/components/atoms.js +18 -18
  87. package/library/components/avatar.js +6 -95
  88. package/library/components/badge.js +11 -139
  89. package/library/components/bicolor-picker.js +4 -23
  90. package/library/components/border-input-group.js +5 -26
  91. package/library/components/breadcrumb-item.js +25 -156
  92. package/library/components/breadcrumb.js +4 -22
  93. package/library/components/button-group.js +3 -28
  94. package/library/components/button.js +6 -6
  95. package/library/components/card.js +4 -126
  96. package/library/components/checkbox.js +13 -254
  97. package/library/components/color-picker.js +57 -728
  98. package/library/components/color-swatch-group.js +9 -9
  99. package/library/components/color-swatch.js +5 -5
  100. package/library/components/confirm-popover.js +6 -6
  101. package/library/components/copy-button.js +11 -256
  102. package/library/components/corner-position-input-group.js +5 -58
  103. package/library/components/cropper.js +2 -2
  104. package/library/components/details.js +6 -152
  105. package/library/components/dialog.js +6 -6
  106. package/library/components/divider.js +6 -68
  107. package/library/components/dot-pagination.js +4 -4
  108. package/library/components/dot-status.js +25 -95
  109. package/library/components/drawer.js +11 -242
  110. package/library/components/dropdown.js +49 -151
  111. package/library/components/dynamic-select.js +10 -75
  112. package/library/components/e-chart.js +8 -51
  113. package/library/components/element-clamp.js +7 -80
  114. package/library/components/file-on-demand.js +13 -13
  115. package/library/components/folder-select.js +9 -7
  116. package/library/components/format-bytes.js +1 -1
  117. package/library/components/format-date.js +3 -7
  118. package/library/components/format-number.js +1 -1
  119. package/library/components/format-time.js +4 -14
  120. package/library/components/grid-item.js +5 -172
  121. package/library/components/grid.js +5 -41
  122. package/library/components/header.js +4 -4
  123. package/library/components/hub-connection.js +2 -2
  124. package/library/components/icon-button.js +14 -679
  125. package/library/components/icon.js +9 -2449
  126. package/library/components/iframe.js +4 -4
  127. package/library/components/image-comparer.js +9 -129
  128. package/library/components/image.js +4 -4
  129. package/library/components/include.js +3 -7
  130. package/library/components/input-group.js +4 -29
  131. package/library/components/input.js +358 -966
  132. package/library/components/line-clamp.js +7 -83
  133. package/library/components/list-editor.js +9 -9
  134. package/library/components/markdown.js +2 -4
  135. package/library/components/masonry.js +24 -223
  136. package/library/components/menu-item.js +155 -445
  137. package/library/components/menu-label.js +3 -20
  138. package/library/components/menu-section.js +3 -17
  139. package/library/components/menu.js +5 -113
  140. package/library/components/molecules.js +5 -5
  141. package/library/components/mutation-observer.js +3 -7
  142. package/library/components/option.js +4 -4
  143. package/library/components/organisms.js +2 -2
  144. package/library/components/padding-input-group.js +5 -16
  145. package/library/components/pagination.js +10 -8
  146. package/library/components/popup.js +385 -682
  147. package/library/components/position-picker.js +4 -94
  148. package/library/components/progress-bar.js +19 -136
  149. package/library/components/progress-ring.js +4 -95
  150. package/library/components/qr-code.js +5 -17
  151. package/library/components/radio-button.js +5 -25
  152. package/library/components/radio-card.js +8 -176
  153. package/library/components/radio-group.js +22 -153
  154. package/library/components/radio.js +14 -171
  155. package/library/components/range.js +123 -660
  156. package/library/components/rating.js +58 -238
  157. package/library/components/relative-time.js +3 -13
  158. package/library/components/resize-observer.js +4 -8
  159. package/library/components/select.js +305 -1012
  160. package/library/components/shadow-input-group.js +5 -24
  161. package/library/components/share-option-list.js +21 -313
  162. package/library/components/sidebar.js +15 -221
  163. package/library/components/size-input-group.js +12 -77
  164. package/library/components/skeleton.js +7 -80
  165. package/library/components/space.js +6 -143
  166. package/library/components/spinner.js +7 -76
  167. package/library/components/split-panel.js +18 -125
  168. package/library/components/step.js +21 -272
  169. package/library/components/stepper-wizard.js +9 -43
  170. package/library/components/stepper.js +17 -34
  171. package/library/components/switch.js +13 -276
  172. package/library/components/tab-group.js +7 -7
  173. package/library/components/tab-panel.js +5 -32
  174. package/library/components/tab.js +11 -257
  175. package/library/components/table.js +8 -8
  176. package/library/components/tag.js +15 -166
  177. package/library/components/textarea.js +183 -504
  178. package/library/components/timecode.js +6 -25
  179. package/library/components/tooltip.js +10 -94
  180. package/library/components/tree-item.js +4 -4
  181. package/library/components/tree.js +4 -4
  182. package/library/components/typeface.js +24 -123
  183. package/library/components/types.js +37225 -47339
  184. package/library/components/typography.js +2 -2
  185. package/library/components/video.js +3875 -6263
  186. package/library/components/visually-hidden.js +3 -15
  187. package/library/package.json +4 -1
  188. package/library/packages/atoms/src/components/dialog/dialog.d.ts +10 -0
  189. package/library/packages/atoms/src/components/icon-button/icon-button.d.ts +2 -1
  190. package/library/packages/atoms/src/components/image/image.d.ts +15 -1
  191. package/library/packages/atoms/src/components/input/auto-grow-controller.d.ts +23 -0
  192. package/library/packages/atoms/src/components/input/input.d.ts +10 -2
  193. package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +4 -0
  194. package/library/packages/atoms/src/components/pagination/pagination.d.ts +32 -2
  195. package/library/packages/atoms/src/components/popup/overlay/Overlay.d.ts +10 -0
  196. package/library/packages/atoms/src/components/popup/popup.d.ts +1 -1
  197. package/library/packages/atoms/src/components/select/select.d.ts +11 -0
  198. package/library/packages/atoms/src/components/table/table.d.ts +49 -8
  199. package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
  200. package/library/packages/atoms/src/components/table/tabulator-tables/core/TabulatorFull.d.ts +1 -0
  201. package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
  202. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
  203. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/Edit.d.ts +1 -0
  204. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +40 -1
  205. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/Filter.d.ts +10 -3
  206. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/formatter-display-resolvers.d.ts +93 -0
  207. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/Group.d.ts +8 -0
  208. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupComponent.d.ts +3 -1
  209. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupLoadMore.d.ts +7 -0
  210. package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupRows.d.ts +2 -0
  211. package/library/packages/atoms/src/components/table/tabulator-tables/modules/Page/Page.d.ts +2 -2
  212. package/library/packages/atoms/src/components/textarea/textarea.d.ts +19 -4
  213. package/library/packages/atoms/src/components/video/video.d.ts +3 -1
  214. package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
  215. package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
  216. package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
  217. package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
  218. package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
  219. package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
  220. package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
  221. package/library/packages/events/src/cx-unauthorized.d.ts +10 -0
  222. package/library/packages/events/src/cx-video-format-picker-delete.d.ts +6 -0
  223. package/library/packages/events/src/cx-video-format-picker-select.d.ts +8 -0
  224. package/library/packages/events/src/events.d.ts +11 -1
  225. package/library/packages/molecules/src/cropper/cropper.d.ts +2 -0
  226. package/library/packages/molecules/src/cropper/react/Cropper.d.ts +2 -0
  227. package/library/packages/molecules/src/estimated-reading-time/estimated-reading-time.d.ts +3 -2
  228. package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +26 -0
  229. package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +46 -0
  230. package/library/packages/molecules/src/folder-select/folder-select.d.ts +25 -0
  231. package/library/packages/molecules/src/index.d.ts +1 -0
  232. package/library/packages/molecules/src/storybook/storybook.d.ts +60 -23
  233. package/library/packages/molecules/src/timeline/timeline.d.ts +14 -0
  234. package/library/packages/molecules/src/video-format-picker/video-format-picker.d.ts +55 -0
  235. package/library/packages/molecules/src/video-format-picker/video-format-picker.styles.d.ts +2 -0
  236. package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -1
  237. package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
  238. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +95 -0
  239. package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
  240. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
  241. package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
  242. package/library/packages/organisms/src/carousel/carousel.d.ts +5 -1
  243. package/library/packages/organisms/src/comment/comment.d.ts +1 -0
  244. package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
  245. package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
  246. package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
  247. package/library/packages/organisms/src/content-builder/components/folder-picker/folder-picker.d.ts +6 -0
  248. package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
  249. package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
  250. package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
  251. package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
  252. package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
  253. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
  254. package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
  255. package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
  256. package/library/packages/organisms/src/content-builder/styleController.d.ts +20 -2
  257. package/library/packages/organisms/src/index.d.ts +2 -0
  258. package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
  259. package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
  260. package/library/packages/services/src/api/asset/asset.d.ts +3 -2
  261. package/library/packages/services/src/api/asset/asset.types.d.ts +84 -0
  262. package/library/packages/services/src/api/asset/asset.utils.d.ts +9 -0
  263. package/library/packages/services/src/api/endpoints.d.ts +1 -1
  264. package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
  265. package/library/packages/tools/src/fetch-image/fetch-image.d.ts +17 -5
  266. package/library/packages/types/src/asset-click-action.d.ts +3 -1
  267. package/library/packages/types/src/bento-grid.d.ts +37 -0
  268. package/library/packages/types/src/content-builder.d.ts +27 -1
  269. package/library/packages/types/src/gallery.d.ts +0 -6
  270. package/library/packages/types/src/icon-button.d.ts +7 -0
  271. package/library/packages/types/src/menu-item.d.ts +33 -0
  272. package/library/packages/types/src/storybook.d.ts +19 -0
  273. package/library/packages/types/src/table.d.ts +37 -1
  274. package/library/packages/types/src/textarea.d.ts +4 -0
  275. package/library/packages/types/src/video-format-picker.d.ts +11 -0
  276. package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
  277. package/library/packages/utils/src/custom-element/i18n.d.ts +10 -3
  278. package/library/packages/utils/src/index.d.ts +1 -0
  279. package/library/packages/utils/src/string/string.d.ts +33 -0
  280. package/library/packages/utils/src/transformation/index.d.ts +1 -0
  281. package/library/packages/utils/src/url/url.d.ts +9 -0
  282. package/library/react-web-component.d.ts +293 -29
  283. package/library/utils.js +483 -178
  284. package/package.json +4 -1
  285. package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
  286. package/library/chunks/asset.CG_yXtWK.js +0 -288
  287. package/library/chunks/button.styles.Dl5IQLHU.js +0 -718
  288. package/library/chunks/component.styles.DMSLciL5.js +0 -71
  289. package/library/chunks/confirm-popover.zmOFI4e-.js +0 -288
  290. package/library/chunks/content-builder.D_phDrlo.js +0 -127
  291. package/library/chunks/dot-pagination.COBkyhoJ.js +0 -325
  292. package/library/chunks/file-on-demand.CbE-qsiP.js +0 -3740
  293. package/library/chunks/folder-select.Bl_WkhVE.js +0 -844
  294. package/library/chunks/form-control.styles.CUGhvlfT.js +0 -67
  295. package/library/chunks/header.BduX6KJP.js +0 -777
  296. package/library/chunks/identity.ByMq8VxU.js +0 -6
  297. package/library/chunks/iframe.BPKV2K7z.js +0 -160
  298. package/library/chunks/index.B3wJT3XS.js +0 -373
  299. package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
  300. package/library/chunks/option.DnpkE8Xi.js +0 -296
  301. package/library/chunks/pagination.C30LoTya.js +0 -341
  302. package/library/chunks/string.B_rEG27K.js +0 -160
  303. package/library/chunks/toast.BXNbwZV8.js +0 -25
  304. package/library/chunks/typography.oDzoLbZS.js +0 -149
  305. package/library/chunks/url.LjsR2sB5.js +0 -15
  306. package/library/chunks/watch.q1sEjPWL.js +0 -501
  307. /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
@@ -1,844 +0,0 @@
1
- import A from "../components/icon.js";
2
- import X from "../components/input.js";
3
- import Y from "../components/select.js";
4
- import { C as $, a as ee } from "./tree.CeMLCbs-.js";
5
- import { n as r, C as O } from "./lib-cortex-element.CVMmyPMC.js";
6
- import { h as I, F as te, b as re } from "./endpoints.B7lcoc1N.js";
7
- import { c as R } from "./component.styles.DMSLciL5.js";
8
- import { c as D } from "./custom-element.L4WJXn1j.js";
9
- import { L as w } from "./i18n.C0iakJkV.js";
10
- import { w as m } from "./watch.q1sEjPWL.js";
11
- import { x as f, i as ae } from "./lit-element.jLBm65_O.js";
12
- import { r as x } from "./state.CSDxrqLd.js";
13
- import { e as B } from "./query.BBf1UFkC.js";
14
- import { r as se } from "./choose.BTbF6BAn.js";
15
- import { C as W } from "./button.KnE3mcyM.js";
16
- import { d as le } from "./debounce.DaHuiSGU.js";
17
- import { o as y } from "./if-defined.BRoBj_Rp.js";
18
- import { c as q } from "./repeat.DbF2p5ae.js";
19
- import { n as C } from "./when.Dr1es41R.js";
20
- import ie from "../components/line-clamp.js";
21
- import oe from "../components/space.js";
22
- import { M as P } from "./asset-link-format.BSRDqHg7.js";
23
- import { g as ne } from "./template.CsJd8Pb_.js";
24
- import { e as ce } from "./class-map.BiVq-cVR.js";
25
- var v = /* @__PURE__ */ ((e) => (e.CortexPath = "Document.CortexPath", e.DocType = "CoreField.DocType", e.HasBrowserChildren = "Document.HasBrowserChildren", e.RepresentativeAssetId = "Document.DocumentDirectRepresentativeRID", e.TitleWithFallback = "CoreField.TitleWithFallback", e.rawDocSubtype = "Document.RawDocSubType", e))(v || {});
26
- const he = 50;
27
- async function V({
28
- allowedFolders: e,
29
- baseUrl: t,
30
- bearerToken: a,
31
- excludeVirtualFolders: i,
32
- folderId: l,
33
- includeDirectChild: p,
34
- limit: u = he,
35
- searchTerm: U,
36
- self: E,
37
- start: M = 0,
38
- token: Z
39
- }) {
40
- let k = [], L = p ?? !0;
41
- e && e.length > 0 && !l ? (k = e, E = !0, L = !1) : l && (k = [l]);
42
- try {
43
- return (await I.request({
44
- baseURL: t,
45
- headers: {
46
- Authorization: `Bearer ${a}`
47
- },
48
- method: "GET",
49
- params: {
50
- IncludeDirectChild: L,
51
- IncludeVirtualFolders: !i,
52
- Limit: u,
53
- ObjectRecordIDs: k,
54
- SeeThru: !!U,
55
- Self: E,
56
- Start: M,
57
- Text: U || void 0,
58
- Token: Z || void 0
59
- },
60
- paramsSerializer: {
61
- indexes: null
62
- },
63
- responseType: "json",
64
- transformResponse: [
65
- ...Array.isArray(I.defaults.transformResponse) ? I.defaults.transformResponse : [],
66
- (g, Te, _) => {
67
- if (_ !== void 0 && (_ < 200 || _ >= 300))
68
- return {
69
- data: [],
70
- hasMore: !1,
71
- totalCount: 0
72
- };
73
- if (!g || typeof g != "object")
74
- throw new Error("Invalid response format");
75
- const K = g.contentItems?.length ?? 0;
76
- return {
77
- data: g.contentItems?.map((b) => ({
78
- docType: b.fields[v.DocType] ?? "",
79
- fullPath: b.fields[v.CortexPath] ?? "",
80
- hasChildren: b.fields[v.HasBrowserChildren] === "1",
81
- id: b.recordID,
82
- isShared: b.fields[v.rawDocSubtype] === "DO_OR1ND000001913488",
83
- representativeAssetId: b.fields[v.RepresentativeAssetId] ?? "",
84
- title: b.fields[v.TitleWithFallback] ?? ""
85
- })) ?? [],
86
- hasMore: M + K < g.totalCount,
87
- totalCount: g.totalCount
88
- };
89
- }
90
- ],
91
- url: te
92
- })).data;
93
- } catch {
94
- return {
95
- data: [],
96
- hasMore: !1,
97
- totalCount: 0
98
- };
99
- }
100
- }
101
- var F = /* @__PURE__ */ ((e) => (e.Input = "input", e.Select = "select", e))(F || {}), de = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, d = (e, t, a, i) => {
102
- for (var l = i > 1 ? void 0 : i ? pe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
103
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
104
- return i && l && de(t, a, l), l;
105
- };
106
- let n = class extends O {
107
- constructor() {
108
- super(...arguments), this.localize = new w(this), this.role = "treeitem", this.folderId = "", this.hasChildren = !1, this.fullPath = "", this.docType = P.Story, this.name = "", this.representativeAssetId = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.searchTerm = "", this.api = V, this.excludeVirtualFolders = !1, this.url = "", this.data = null, this.hasMore = !1, this.loading = !1;
109
- }
110
- /**
111
- * This is used to render the cx-tree-item inside the cx-folder-item without the shadow root so that the cx-tree can query select the cx-tree-item inside
112
- */
113
- createRenderRoot() {
114
- return this;
115
- }
116
- async fetchFolders({
117
- folderId: e,
118
- start: t = 0
119
- }) {
120
- if (!this.api)
121
- return { data: [], hasMore: !1 };
122
- try {
123
- const { data: a, hasMore: i } = await this.api({
124
- baseUrl: this.baseUrl,
125
- bearerToken: this.bearerToken,
126
- excludeVirtualFolders: this.excludeVirtualFolders,
127
- folderId: e,
128
- start: t,
129
- token: this.token
130
- });
131
- return { data: a, hasMore: i };
132
- } catch {
133
- return { data: [], hasMore: !1 };
134
- }
135
- }
136
- async loadMore(e) {
137
- e.stopPropagation();
138
- const t = this.data?.length || 0;
139
- this.loading = !0;
140
- try {
141
- const { data: a, hasMore: i } = await this.fetchFolders({
142
- folderId: this.folderId,
143
- start: t
144
- });
145
- this.data = [...this.data || [], ...a], this.hasMore = i;
146
- } catch {
147
- } finally {
148
- this.loading = !1;
149
- }
150
- }
151
- async handleLazyLoad(e) {
152
- e.stopPropagation(), this.treeItem.expanded = !0;
153
- const t = this.data?.length || 0;
154
- try {
155
- const { data: a, hasMore: i } = await this.fetchFolders({
156
- folderId: this.folderId,
157
- start: t
158
- });
159
- this.data = a, this.hasMore = i;
160
- } catch {
161
- this.treeItem.expanded = !1;
162
- }
163
- }
164
- render() {
165
- return f`
166
- <cx-tree-item
167
- class=${ce({
168
- "folder-select-tree-item": !0
169
- })}
170
- data-id=${this.folderId}
171
- data-url=${y(this.url)}
172
- data-name=${y(this.name?.trim() || void 0)}
173
- data-representative-asset-id=${y(
174
- this.representativeAssetId || void 0
175
- )}
176
- role="option"
177
- ?lazy=${this.hasChildren && this.data === null}
178
- ?selected=${this.selectedValue === this.folderId}
179
- @cx-lazy-load=${this.handleLazyLoad}
180
- >
181
- <cx-space
182
- class="folder-select-tree-item__label"
183
- direction="horizontal"
184
- spacing="x-small"
185
- align-items="center"
186
- wrap="nowrap"
187
- >
188
- <cx-icon
189
- class="folder-select-tree__item__icon"
190
- name="folder"
191
- variant=${this.docType === P.Album ? "outlined" : "filled"}
192
- ></cx-icon>
193
- <cx-line-clamp lines="1" class="folder-select-tree-item__title">
194
- ${ne(this.name, this.searchTerm)}
195
- </cx-line-clamp>
196
- </cx-space>
197
- ${q(
198
- this.data || [],
199
- (e) => e.id,
200
- (e) => f`<cx-folder-select-tree-item
201
- slot="children"
202
- folder-id=${e.id}
203
- full-path=${e.fullPath}
204
- name=${e.title}
205
- representative-asset-id=${e.representativeAssetId}
206
- selected-value=${this.selectedValue}
207
- token=${this.token}
208
- bearer-token=${this.bearerToken}
209
- ?exclude-virtual-folders=${this.excludeVirtualFolders}
210
- ?has-children=${e.hasChildren}
211
- base-url=${this.baseUrl}
212
- url=${y(e.url ?? void 0)}
213
- .api=${this.api}
214
- value=${e.url}
215
- ></cx-folder-select-tree-item>`
216
- )}
217
- </cx-tree-item>
218
- ${C(
219
- this.hasMore,
220
- () => f`
221
- <div slot="children" class="load-more-button">
222
- <cx-button
223
- variant="text"
224
- @click=${this.loadMore}
225
- ?loading=${this.loading}
226
- >
227
- ${this.localize.term("more")}
228
- </cx-button>
229
- </div>
230
- `
231
- )}
232
- `;
233
- }
234
- };
235
- n.styles = [R];
236
- n.dependencies = {
237
- "cx-button": W,
238
- "cx-icon": A,
239
- "cx-line-clamp": ie,
240
- "cx-space": oe,
241
- "cx-tree-item": $
242
- };
243
- d([
244
- B("cx-tree-item")
245
- ], n.prototype, "treeItem", 2);
246
- d([
247
- r({ attribute: "folder-id", reflect: !0, type: String })
248
- ], n.prototype, "folderId", 2);
249
- d([
250
- r({ attribute: "has-children", reflect: !0, type: Boolean })
251
- ], n.prototype, "hasChildren", 2);
252
- d([
253
- r({ attribute: "full-path", reflect: !0, type: String })
254
- ], n.prototype, "fullPath", 2);
255
- d([
256
- r({ attribute: "doc-type", reflect: !0, type: String })
257
- ], n.prototype, "docType", 2);
258
- d([
259
- r({ reflect: !0, type: String })
260
- ], n.prototype, "name", 2);
261
- d([
262
- r({
263
- attribute: "representative-asset-id",
264
- reflect: !0,
265
- type: String
266
- })
267
- ], n.prototype, "representativeAssetId", 2);
268
- d([
269
- r({ attribute: "selected-value", reflect: !0, type: String })
270
- ], n.prototype, "selectedValue", 2);
271
- d([
272
- r({ reflect: !0, type: String })
273
- ], n.prototype, "token", 2);
274
- d([
275
- r({ attribute: "bearer-token", reflect: !0, type: String })
276
- ], n.prototype, "bearerToken", 2);
277
- d([
278
- r({ attribute: "base-url", reflect: !0, type: String })
279
- ], n.prototype, "baseUrl", 2);
280
- d([
281
- r({ attribute: "search-term", reflect: !0, type: String })
282
- ], n.prototype, "searchTerm", 2);
283
- d([
284
- r({ type: Function })
285
- ], n.prototype, "api", 2);
286
- d([
287
- r({
288
- attribute: "exclude-virtual-folders",
289
- reflect: !0,
290
- type: Boolean
291
- })
292
- ], n.prototype, "excludeVirtualFolders", 2);
293
- d([
294
- r({ reflect: !0, type: String })
295
- ], n.prototype, "url", 2);
296
- d([
297
- x()
298
- ], n.prototype, "data", 2);
299
- d([
300
- x()
301
- ], n.prototype, "hasMore", 2);
302
- d([
303
- x()
304
- ], n.prototype, "loading", 2);
305
- n = d([
306
- D("cx-folder-select-tree-item")
307
- ], n);
308
- var ue = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, Q = (e) => {
309
- throw TypeError(e);
310
- }, h = (e, t, a, i) => {
311
- for (var l = i > 1 ? void 0 : i ? fe(t, a) : t, p = e.length - 1, u; p >= 0; p--)
312
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
313
- return i && l && ue(t, a, l), l;
314
- }, N = (e, t, a) => t.has(e) || Q("Cannot " + a), me = (e, t, a) => (N(e, t, "read from private field"), t.get(e)), ye = (e, t, a) => t.has(e) ? Q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), xe = (e, t, a, i) => (N(e, t, "write to private field"), t.set(e, a), a), S;
315
- let c = class extends O {
316
- constructor() {
317
- super(...arguments), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.searchTerm = "", this.selectedValue = "", this.token = "", this.bearerToken = "", this.baseUrl = "", this.extraFolderId = "", this.extraFolderTitle = "", this.seeThru = !1, this.extraFolderData = null, this.api = V, this.excludeVirtualFolders = !1, this.firstFetchCallback = null, this.data = [], this.hasMore = !1, this.loading = !1, ye(this, S, !1);
318
- }
319
- get empty() {
320
- return !this.loading && this.data.length === 0;
321
- }
322
- /**
323
- * This is used to render the cx-tree inside the cx-folder-select without the shadow root so that the cx-folder-select can query select the cx-tree inside
324
- */
325
- createRenderRoot() {
326
- return this;
327
- }
328
- runFirstUpdated() {
329
- this.searchTerm = "", this.handleFetchFolders();
330
- }
331
- async handleExtraFolderIdChange() {
332
- if (!this.extraFolderId || !this.api) {
333
- this.extraFolderData = null;
334
- return;
335
- }
336
- const { data: e } = await this.api({
337
- baseUrl: this.baseUrl,
338
- bearerToken: this.bearerToken,
339
- excludeVirtualFolders: this.excludeVirtualFolders,
340
- folderId: this.extraFolderId,
341
- includeDirectChild: !1,
342
- limit: 1,
343
- searchTerm: this.searchTerm,
344
- seeThru: this.seeThru,
345
- self: !0,
346
- start: 0,
347
- token: this.token
348
- });
349
- this.extraFolderData = e[0] ?? null;
350
- }
351
- async loadMore(e) {
352
- if (!this.api)
353
- return;
354
- e.stopPropagation();
355
- const t = this.data.length;
356
- this.loading = !0;
357
- const { data: a, hasMore: i } = await this.api({
358
- baseUrl: this.baseUrl,
359
- bearerToken: this.bearerToken,
360
- excludeVirtualFolders: this.excludeVirtualFolders,
361
- folderId: "",
362
- limit: 10,
363
- searchTerm: this.searchTerm,
364
- seeThru: this.seeThru,
365
- start: t,
366
- token: this.token
367
- });
368
- this.data = [...this.data, ...a], this.hasMore = i, this.loading = !1;
369
- }
370
- async handleFetchFolders() {
371
- const { data: e, hasMore: t } = await this.fetchFolders();
372
- me(this, S) || e.length > 0 && (this.firstFetchCallback?.(e), xe(this, S, !0)), this.data = e, this.hasMore = t, this.loading = !1;
373
- }
374
- async fetchFolders() {
375
- if (!this.api)
376
- return {
377
- data: [],
378
- hasMore: !1
379
- };
380
- if (this.searchTerm.length > 0 && this.searchTerm.length < this.minQueryLength)
381
- return {
382
- data: [],
383
- hasMore: !1
384
- };
385
- this.loading = !0;
386
- const { data: e, hasMore: t } = await this.api({
387
- baseUrl: this.baseUrl,
388
- bearerToken: this.bearerToken,
389
- excludeVirtualFolders: this.excludeVirtualFolders,
390
- folderId: "",
391
- limit: 10,
392
- searchTerm: this.searchTerm,
393
- seeThru: this.seeThru,
394
- start: 0,
395
- token: this.token
396
- });
397
- return this.data = e, this.hasMore = t, this.loading = !1, {
398
- data: e,
399
- hasMore: t
400
- };
401
- }
402
- renderFolder(e) {
403
- return f`<cx-folder-select-tree-item
404
- .api=${this.api}
405
- base-url=${this.baseUrl}
406
- doc-type=${e.docType}
407
- folder-id=${e.id}
408
- full-path=${y(e.fullPath ?? void 0)}
409
- name=${e.title}
410
- search-term=${this.searchTerm}
411
- selected-value=${this.selectedValue}
412
- token=${this.token}
413
- bearer-token=${this.bearerToken}
414
- url=${y(e.url ?? void 0)}
415
- ?has-children=${e.hasChildren}
416
- ?exclude-virtual-folders=${this.excludeVirtualFolders}
417
- ></cx-folder-select-tree-item>`;
418
- }
419
- render() {
420
- return f`<cx-tree
421
- class="folder-select-tree"
422
- selection=${this.selection}
423
- force-on-change
424
- disabled-auto-expand
425
- disabled-sync-checkboxes
426
- >
427
- ${C(
428
- this.empty,
429
- () => f`<div
430
- class="folder-select-tree__empty-message"
431
- role="status"
432
- aria-live="polite"
433
- >
434
- <cx-typography variant="body3">
435
- ${this.localize.term("noResults")}
436
- </cx-typography>
437
- </div>`
438
- )}
439
- ${C(
440
- this.extraFolderData,
441
- () => f`<cx-folder-select-tree-item
442
- .api=${this.api}
443
- base-url=${this.baseUrl}
444
- doc-type=${y(this.extraFolderData?.docType ?? void 0)}
445
- folder-id=${y(this.extraFolderData?.id ?? void 0)}
446
- full-path=${y(this.extraFolderData?.fullPath ?? void 0)}
447
- name=${this.extraFolderTitle || this.extraFolderData?.title}
448
- search-term=${this.searchTerm}
449
- selected-value=${this.selectedValue}
450
- token=${this.token}
451
- bearer-token=${this.bearerToken}
452
- url=${y(this.extraFolderData?.url ?? void 0)}
453
- ?has-children=${this.extraFolderData?.hasChildren}
454
- ?exclude-virtual-folders=${this.excludeVirtualFolders}
455
- ></cx-folder-select-tree-item>`
456
- )}
457
- ${q(
458
- this.data,
459
- (e) => e.id,
460
- (e) => this.renderFolder(e)
461
- )}
462
- ${C(
463
- this.hasMore,
464
- () => f`
465
- <cx-button
466
- class="folder-select-tree__load-more"
467
- variant="text"
468
- @click=${this.loadMore}
469
- ?loading=${this.loading}
470
- >
471
- ${this.localize.term("more")}
472
- </cx-button>
473
- `
474
- )}
475
- </cx-tree>`;
476
- }
477
- };
478
- S = /* @__PURE__ */ new WeakMap();
479
- c.dependencies = {
480
- "cx-button": W,
481
- "cx-folder-select-tree-item": n,
482
- "cx-tree": ee
483
- };
484
- h([
485
- r({ attribute: "min-query-length", reflect: !0, type: Number })
486
- ], c.prototype, "minQueryLength", 2);
487
- h([
488
- r({ attribute: "selection", reflect: !0, type: String })
489
- ], c.prototype, "selection", 2);
490
- h([
491
- r({ attribute: "search-term", reflect: !0, type: String })
492
- ], c.prototype, "searchTerm", 2);
493
- h([
494
- r({ attribute: "selected-value", reflect: !0, type: String })
495
- ], c.prototype, "selectedValue", 2);
496
- h([
497
- r({ reflect: !0, type: String })
498
- ], c.prototype, "token", 2);
499
- h([
500
- r({ attribute: "bearer-token", reflect: !0, type: String })
501
- ], c.prototype, "bearerToken", 2);
502
- h([
503
- r({ attribute: "base-url", reflect: !0, type: String })
504
- ], c.prototype, "baseUrl", 2);
505
- h([
506
- r({ attribute: "extra-folder-id", reflect: !0, type: String })
507
- ], c.prototype, "extraFolderId", 2);
508
- h([
509
- r({ attribute: "extra-folder-title", reflect: !0, type: String })
510
- ], c.prototype, "extraFolderTitle", 2);
511
- h([
512
- r({ attribute: "see-thru", reflect: !0, type: Boolean })
513
- ], c.prototype, "seeThru", 2);
514
- h([
515
- x()
516
- ], c.prototype, "extraFolderData", 2);
517
- h([
518
- r({ type: Function })
519
- ], c.prototype, "api", 2);
520
- h([
521
- r({
522
- attribute: "exclude-virtual-folders",
523
- reflect: !0,
524
- type: Boolean
525
- })
526
- ], c.prototype, "excludeVirtualFolders", 2);
527
- h([
528
- r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
529
- ], c.prototype, "firstFetchCallback", 2);
530
- h([
531
- x()
532
- ], c.prototype, "data", 2);
533
- h([
534
- x()
535
- ], c.prototype, "hasMore", 2);
536
- h([
537
- x()
538
- ], c.prototype, "loading", 2);
539
- h([
540
- m("extraFolderId")
541
- ], c.prototype, "handleExtraFolderIdChange", 1);
542
- h([
543
- m("baseUrl", { waitUntilFirstUpdate: !0 }),
544
- m("token", { waitUntilFirstUpdate: !0 }),
545
- m("searchTerm", { waitUntilFirstUpdate: !0 }),
546
- m("excludeVirtualFolders", { waitUntilFirstUpdate: !0 }),
547
- le(500)
548
- ], c.prototype, "handleFetchFolders", 1);
549
- c = h([
550
- D("cx-folder-select-tree")
551
- ], c);
552
- const be = ae`
553
- :host {
554
- display: block;
555
- width: 100%;
556
- }
557
-
558
- .folder-select {
559
- display: flex;
560
- flex-direction: column;
561
- gap: var(--cx-spacing-x-small);
562
- }
563
-
564
- .folder-select-tree {
565
- overflow: auto;
566
- flex: 1;
567
- }
568
-
569
- .folder-select-tree__item__icon {
570
- color: var(--cx-color-primary);
571
- }
572
-
573
- .folder-select-tree__empty-message {
574
- font-size: var(--cx-font-size-small);
575
- color: var(--cx-color-neutral-500);
576
- padding-block: var(--cx-spacing-2x-small);
577
- padding-inline: var(--cx-spacing-small);
578
- text-align: center;
579
- cursor: default;
580
- user-select: none;
581
- }
582
-
583
- .folder-select-tree__load-more {
584
- margin-inline: var(--cx-spacing-small);
585
- }
586
-
587
- .folder-select-tree-item::part(label),
588
- .folder-select-tree-item__label,
589
- .folder-select-tree-item__title {
590
- overflow: hidden;
591
- }
592
- `;
593
- var ve = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, H = (e) => {
594
- throw TypeError(e);
595
- }, o = (e, t, a, i) => {
596
- for (var l = i > 1 ? void 0 : i ? ge(t, a) : t, p = e.length - 1, u; p >= 0; p--)
597
- (u = e[p]) && (l = (i ? u(t, a, l) : u(l)) || l);
598
- return i && l && ve(t, a, l), l;
599
- }, j = (e, t, a) => t.has(e) || H("Cannot " + a), G = (e, t, a) => (j(e, t, "read from private field"), a ? a.call(e) : t.get(e)), $e = (e, t, a) => t.has(e) ? H("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), z = (e, t, a, i) => (j(e, t, "write to private field"), t.set(e, a), a), T;
600
- let s = class extends O {
601
- constructor() {
602
- super(), this.localize = new w(this), this.minQueryLength = 1, this.selection = "single", this.variant = F.Input, this.value = "", this.name = "", this.selectedLabel = "", this.baseUrl = "", this.open = !1, this.token = "", this.bearerToken = "", this.seeThru = !1, this.api = V, this.required = !1, this.form = void 0, this.excludeVirtualFolders = !1, this.extraFolderId = "", this.extraFolderTitle = "", this.firstFetchCallback = null, this.searchTerm = "", $e(this, T), this.selectGetOptionValue = this.selectGetOptionValue.bind(this), this.selectGetOptionLabel = this.selectGetOptionLabel.bind(this), this.selectGetOptionSelected = this.selectGetOptionSelected.bind(this), this.selectFilterCallback = this.selectFilterCallback.bind(this), this.selectSetOptionSelected = this.selectSetOptionSelected.bind(this), this.updateWrappedApi();
603
- }
604
- updateWrappedApi() {
605
- if (!this.api) {
606
- z(this, T, void 0);
607
- return;
608
- }
609
- z(this, T, async (e) => {
610
- try {
611
- return await this.api(e);
612
- } catch (t) {
613
- return t instanceof re && t.response?.status === 401 && this.emit("cx-renew-token"), { data: [], hasMore: !1, totalCount: 0 };
614
- }
615
- });
616
- }
617
- handleSearchTermChange() {
618
- this.emit("cx-folder-select-search-term-change", {
619
- detail: {
620
- value: this.searchTerm
621
- }
622
- });
623
- }
624
- handleSearchTermInputChange(e) {
625
- this.searchTerm = e.target.value;
626
- }
627
- handleSearchTermSelectChange(e) {
628
- this.searchTerm = e.target.displayInput.value;
629
- }
630
- selectGetOptionValue(e) {
631
- return !e || !(e instanceof $) ? this.value : e.dataset.id || this.value;
632
- }
633
- selectGetOptionLabel(e) {
634
- return !e || !(e instanceof $) ? this.selectedLabel : e.dataset.name || this.selectedLabel;
635
- }
636
- selectGetOptionSelected(e) {
637
- if (!(!e || !(e instanceof $)))
638
- return e.selected;
639
- }
640
- selectFilterCallback(e) {
641
- return !(!e || !(e instanceof $));
642
- }
643
- selectSetOptionSelected(e, t) {
644
- if (!(!e || !(e instanceof $))) {
645
- if (t === void 0) {
646
- e.selected = !e.selected;
647
- return;
648
- }
649
- e.selected = t;
650
- }
651
- }
652
- updateFunctionProps() {
653
- this.selectEl && (this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.handleDefaultSlotChange());
654
- }
655
- handleOpenChange() {
656
- if (this.selectEl) {
657
- if (!this.open) {
658
- this.selectEl.hide();
659
- return;
660
- }
661
- this.updateFunctionProps();
662
- }
663
- }
664
- async handleVariantChange() {
665
- this.variant === F.Select && (await this.updateComplete, this.updateFunctionProps());
666
- }
667
- handleValueChange() {
668
- this.selectEl && (this.searchTerm = "", this.selectEl.getOptionValue = this.selectGetOptionValue, this.selectEl.getOptionLabel = this.selectGetOptionLabel, this.selectEl.getOptionSelected = this.selectGetOptionSelected, this.selectEl.filterCallback = this.selectFilterCallback, this.selectEl.setOptionSelected = this.selectSetOptionSelected, this.selectEl.handleDefaultSlotChange());
669
- }
670
- render() {
671
- return f`<div class="folder-select">
672
- ${se(this.variant, [
673
- [
674
- F.Input,
675
- () => f`
676
- <cx-input
677
- aria-label=${this.localize.term("searchFolders")}
678
- placeholder=${`${this.localize.term("searchFolders")}...`}
679
- value=${this.searchTerm}
680
- clearable
681
- @cx-input=${this.handleSearchTermInputChange}
682
- >
683
- <cx-icon name="search" slot="prefix"></cx-icon>
684
- </cx-input>
685
- <cx-folder-select-tree
686
- base-url=${this.baseUrl}
687
- extra-folder-id=${this.extraFolderId}
688
- extra-folder-title=${this.extraFolderTitle}
689
- min-query-length=${this.minQueryLength}
690
- search-term=${this.searchTerm}
691
- selected-value=${this.value}
692
- selection=${this.selection}
693
- token=${this.token}
694
- bearer-token=${this.bearerToken}
695
- ?exclude-virtual-folders=${this.excludeVirtualFolders}
696
- ?see-thru=${this.seeThru}
697
- .api=${G(this, T)}
698
- .firstFetchCallback=${this.firstFetchCallback}
699
- >
700
- </cx-folder-select-tree>
701
- `
702
- ],
703
- [
704
- F.Select,
705
- () => f`
706
- <cx-select
707
- clearable
708
- hoist
709
- lazy
710
- name=${this.name}
711
- value=${this.value}
712
- .form=${this.form}
713
- ?required=${this.required}
714
- @input=${this.handleSearchTermSelectChange}
715
- @cx-clear=${this.handleSearchTermSelectChange}
716
- allow-freetext
717
- >
718
- <cx-folder-select-tree
719
- base-url=${this.baseUrl}
720
- extra-folder-id=${this.extraFolderId}
721
- extra-folder-title=${this.extraFolderTitle}
722
- min-query-length=${this.minQueryLength}
723
- search-term=${this.searchTerm}
724
- selected-value=${this.value}
725
- selection=${this.selection}
726
- token=${this.token}
727
- bearer-token=${this.bearerToken}
728
- ?exclude-virtual-folders=${this.excludeVirtualFolders}
729
- ?see-thru=${this.seeThru}
730
- .api=${G(this, T)}
731
- .firstFetchCallback=${this.firstFetchCallback}
732
- >
733
- </cx-folder-select-tree>
734
- </cx-select>
735
- `
736
- ]
737
- ])}
738
- </div>`;
739
- }
740
- };
741
- T = /* @__PURE__ */ new WeakMap();
742
- s.styles = [R, be];
743
- s.dependencies = {
744
- "cx-folder-select-tree": c,
745
- "cx-icon": A,
746
- "cx-input": X,
747
- "cx-select": Y
748
- };
749
- o([
750
- B("cx-select")
751
- ], s.prototype, "selectEl", 2);
752
- o([
753
- r({ attribute: "min-query-length", reflect: !0, type: Number })
754
- ], s.prototype, "minQueryLength", 2);
755
- o([
756
- r({ attribute: "selection", reflect: !0, type: String })
757
- ], s.prototype, "selection", 2);
758
- o([
759
- r({ attribute: "variant", reflect: !0, type: String })
760
- ], s.prototype, "variant", 2);
761
- o([
762
- r({ reflect: !0, type: String })
763
- ], s.prototype, "value", 2);
764
- o([
765
- r({ reflect: !0, type: String })
766
- ], s.prototype, "name", 2);
767
- o([
768
- r({ attribute: "selected-label", reflect: !0, type: String })
769
- ], s.prototype, "selectedLabel", 2);
770
- o([
771
- r({ attribute: "base-url", reflect: !0, type: String })
772
- ], s.prototype, "baseUrl", 2);
773
- o([
774
- r({ reflect: !0, type: Boolean })
775
- ], s.prototype, "open", 2);
776
- o([
777
- r({ reflect: !1, type: String })
778
- ], s.prototype, "token", 2);
779
- o([
780
- r({ attribute: "bearer-token", reflect: !0, type: String })
781
- ], s.prototype, "bearerToken", 2);
782
- o([
783
- r({ attribute: "see-thru", reflect: !0, type: Boolean })
784
- ], s.prototype, "seeThru", 2);
785
- o([
786
- r({ type: Function })
787
- ], s.prototype, "api", 2);
788
- o([
789
- r({ reflect: !0, type: Boolean })
790
- ], s.prototype, "required", 2);
791
- o([
792
- r({ reflect: !1 })
793
- ], s.prototype, "form", 2);
794
- o([
795
- r({
796
- attribute: "exclude-virtual-folders",
797
- reflect: !0,
798
- type: Boolean
799
- })
800
- ], s.prototype, "excludeVirtualFolders", 2);
801
- o([
802
- r({
803
- attribute: "extra-folder-id",
804
- reflect: !0,
805
- type: String
806
- })
807
- ], s.prototype, "extraFolderId", 2);
808
- o([
809
- r({
810
- attribute: "extra-folder-title",
811
- reflect: !0,
812
- type: String
813
- })
814
- ], s.prototype, "extraFolderTitle", 2);
815
- o([
816
- r({ attribute: "first-fetch-callback", reflect: !1, type: Function })
817
- ], s.prototype, "firstFetchCallback", 2);
818
- o([
819
- x()
820
- ], s.prototype, "searchTerm", 2);
821
- o([
822
- m("api")
823
- ], s.prototype, "updateWrappedApi", 1);
824
- o([
825
- m("searchTerm", { waitUntilFirstUpdate: !0 })
826
- ], s.prototype, "handleSearchTermChange", 1);
827
- o([
828
- m("open")
829
- ], s.prototype, "handleOpenChange", 1);
830
- o([
831
- m("variant")
832
- ], s.prototype, "handleVariantChange", 1);
833
- o([
834
- m("selectedLabel", { waitUntilFirstUpdate: !0 }),
835
- m("value", { waitUntilFirstUpdate: !0 })
836
- ], s.prototype, "handleValueChange", 1);
837
- s = o([
838
- D("cx-folder-select")
839
- ], s);
840
- export {
841
- s as C,
842
- F,
843
- V as a
844
- };