@vonage/vivid 5.24.0 → 5.25.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 (331) hide show
  1. package/README.md +1 -1
  2. package/avatar/index.cjs +10 -10
  3. package/avatar/index.js +4 -3
  4. package/breadcrumb-item/index.cjs +9 -5
  5. package/breadcrumb-item/index.js +11 -6
  6. package/bundled/affix.cjs +1 -1
  7. package/bundled/affix.js +1 -1
  8. package/bundled/definition10.cjs +2 -1
  9. package/bundled/definition10.js +3 -2
  10. package/bundled/definition11.cjs +4 -4
  11. package/bundled/definition11.js +4 -3
  12. package/bundled/definition12.cjs +1 -1
  13. package/bundled/definition12.js +1 -0
  14. package/bundled/definition15.cjs +5 -5
  15. package/bundled/definition15.js +4 -3
  16. package/bundled/definition17.cjs +7 -7
  17. package/bundled/definition17.js +22 -109
  18. package/bundled/definition18.cjs +3 -3
  19. package/bundled/definition18.js +9 -31
  20. package/bundled/definition19.cjs +19 -19
  21. package/bundled/definition19.js +3 -2
  22. package/bundled/definition21.cjs +8 -8
  23. package/bundled/definition21.js +5 -4
  24. package/bundled/definition22.cjs +2 -2
  25. package/bundled/definition22.js +2 -2
  26. package/bundled/definition24.cjs +4 -4
  27. package/bundled/definition24.js +4 -3
  28. package/bundled/definition25.cjs +3 -3
  29. package/bundled/definition25.js +32 -28
  30. package/bundled/definition3.cjs +5 -5
  31. package/bundled/definition3.js +10 -40
  32. package/bundled/definition4.cjs +6 -6
  33. package/bundled/definition4.js +4 -3
  34. package/bundled/definition6.cjs +11 -11
  35. package/bundled/definition6.js +4 -3
  36. package/bundled/definition9.cjs +12 -6
  37. package/bundled/definition9.js +66 -43
  38. package/bundled/extractOptions.cjs +1 -1
  39. package/bundled/extractOptions.js +2 -2
  40. package/bundled/icon.cjs +1 -0
  41. package/bundled/icon.js +34 -0
  42. package/bundled/listbox.cjs +1 -1
  43. package/bundled/listbox.js +5 -2
  44. package/bundled/mixins.cjs +8 -8
  45. package/bundled/mixins.js +4 -3
  46. package/bundled/optgroup.cjs +1 -0
  47. package/bundled/optgroup.js +27 -0
  48. package/bundled/option.cjs +1 -0
  49. package/bundled/option.js +93 -0
  50. package/bundled/vivid-element.cjs +1 -1
  51. package/bundled/vivid-element.js +1 -1
  52. package/card/index.cjs +22 -22
  53. package/card/index.js +4 -3
  54. package/color-picker/index.cjs +18 -18
  55. package/color-picker/index.js +4 -3
  56. package/combobox/index.cjs +7 -7
  57. package/combobox/index.js +4 -2
  58. package/custom-elements.json +4159 -3847
  59. package/data-grid/index.cjs +24 -24
  60. package/data-grid/index.js +4 -3
  61. package/dial-pad/index.cjs +21 -21
  62. package/dial-pad/index.js +4 -3
  63. package/dialog/index.cjs +14 -14
  64. package/dialog/index.js +4 -3
  65. package/empty-state/index.cjs +3 -3
  66. package/empty-state/index.js +4 -3
  67. package/file-picker/index.cjs +7 -7
  68. package/file-picker/index.js +4 -3
  69. package/icon/definition.cjs +2 -1
  70. package/icon/definition.js +2 -1
  71. package/index.cjs +148 -141
  72. package/index.js +41 -37
  73. package/lib/accordion-item/accordion-item.d.ts +1 -0
  74. package/lib/combobox/combobox.d.ts +1 -1
  75. package/lib/components.d.ts +1 -0
  76. package/lib/dial-pad/dial-pad.d.ts +0 -1
  77. package/lib/listbox/definition.d.ts +3 -0
  78. package/lib/listbox/index.d.ts +1 -0
  79. package/lib/listbox/listbox.d.ts +1302 -0
  80. package/lib/listbox/listbox.template.d.ts +3 -0
  81. package/lib/listbox/variations.browser-spec.d.ts +1 -0
  82. package/lib/menu/menu.d.ts +0 -1
  83. package/lib/number-field/number-field.d.ts +0 -1
  84. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  85. package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
  86. package/lib/tag-name-map.d.ts +2 -1
  87. package/lib/text-field/text-field.d.ts +1 -0
  88. package/lib/toggletip/toggletip.d.ts +1 -0
  89. package/lib/tooltip/tooltip.d.ts +1 -0
  90. package/listbox/definition.cjs +5 -0
  91. package/listbox/definition.js +2 -0
  92. package/listbox/index.cjs +11 -0
  93. package/listbox/index.js +540 -0
  94. package/nav/definition.cjs +1 -1
  95. package/nav/definition.js +1 -1
  96. package/nav-disclosure/definition.cjs +1 -1
  97. package/nav-disclosure/definition.js +1 -1
  98. package/nav-disclosure/index.cjs +4 -4
  99. package/nav-disclosure/index.js +4 -3
  100. package/nav-item/definition.cjs +1 -1
  101. package/nav-item/definition.js +1 -1
  102. package/note/definition.cjs +1 -1
  103. package/note/definition.js +1 -1
  104. package/number-field/definition.cjs +1 -1
  105. package/number-field/definition.js +1 -1
  106. package/optgroup/definition.cjs +2 -1
  107. package/optgroup/definition.js +2 -1
  108. package/option/definition.cjs +2 -1
  109. package/option/definition.js +2 -1
  110. package/package.json +8 -7
  111. package/pagination/definition.cjs +1 -1
  112. package/pagination/definition.js +1 -1
  113. package/platform-switch/definition.cjs +1 -1
  114. package/platform-switch/definition.js +1 -1
  115. package/popover/definition.cjs +1 -1
  116. package/popover/definition.js +1 -1
  117. package/popover/index.cjs +5 -5
  118. package/popover/index.js +4 -3
  119. package/progress/definition.cjs +1 -1
  120. package/progress/definition.js +1 -1
  121. package/radio/definition.cjs +1 -1
  122. package/radio/definition.js +1 -1
  123. package/radio-group/definition.cjs +1 -1
  124. package/radio-group/definition.js +1 -1
  125. package/range-slider/definition.cjs +1 -1
  126. package/range-slider/definition.js +1 -1
  127. package/rich-text-editor/definition.cjs +1 -1
  128. package/rich-text-editor/definition.js +1 -1
  129. package/rich-text-editor/index.cjs +13 -13
  130. package/rich-text-editor/index.js +22 -19
  131. package/rich-text-view/definition.cjs +1 -1
  132. package/rich-text-view/definition.js +1 -1
  133. package/searchable-select/definition.cjs +1 -1
  134. package/searchable-select/definition.js +1 -1
  135. package/searchable-select/index.cjs +23 -23
  136. package/searchable-select/index.js +10 -7
  137. package/select/definition.cjs +1 -1
  138. package/select/definition.js +1 -1
  139. package/selectable-box/definition.cjs +1 -1
  140. package/selectable-box/definition.js +1 -1
  141. package/shared/listbox/commands.d.ts +17 -0
  142. package/shared/listbox/move.d.ts +6 -0
  143. package/shared/listbox/options.d.ts +12 -0
  144. package/shared/listbox/selection.d.ts +28 -0
  145. package/shared/listbox/state.d.ts +26 -0
  146. package/shared/listbox/typeahead.d.ts +8 -0
  147. package/shared/listbox/with-options-filter.d.ts +440 -0
  148. package/shared/listbox/with-options.d.ts +862 -0
  149. package/side-drawer/definition.cjs +1 -1
  150. package/side-drawer/definition.js +1 -1
  151. package/simple-color-picker/definition.cjs +1 -1
  152. package/simple-color-picker/definition.js +1 -1
  153. package/simple-color-picker/index.cjs +6 -6
  154. package/simple-color-picker/index.js +4 -3
  155. package/split-button/definition.cjs +1 -1
  156. package/split-button/definition.js +1 -1
  157. package/status/definition.cjs +1 -1
  158. package/status/definition.js +1 -1
  159. package/switch/definition.cjs +1 -1
  160. package/switch/definition.js +1 -1
  161. package/tab/definition.cjs +1 -1
  162. package/tab/definition.js +1 -1
  163. package/tab-panel/definition.cjs +1 -1
  164. package/tab-panel/definition.js +1 -1
  165. package/table/definition.cjs +1 -1
  166. package/table/definition.js +1 -1
  167. package/table/index.cjs +13 -13
  168. package/table/index.js +4 -3
  169. package/tabs/definition.cjs +1 -1
  170. package/tabs/definition.js +1 -1
  171. package/tag/definition.cjs +1 -1
  172. package/tag/definition.js +1 -1
  173. package/tag/index.cjs +11 -11
  174. package/tag/index.js +4 -3
  175. package/tag-group/definition.cjs +1 -1
  176. package/tag-group/definition.js +1 -1
  177. package/text-area/definition.cjs +1 -1
  178. package/text-area/definition.js +1 -1
  179. package/time-picker/definition.cjs +1 -1
  180. package/time-picker/definition.js +1 -1
  181. package/tree-item/definition.cjs +1 -1
  182. package/tree-item/definition.js +1 -1
  183. package/tree-view/definition.cjs +1 -1
  184. package/tree-view/definition.js +1 -1
  185. package/unbundled/affix.cjs +2 -2
  186. package/unbundled/affix.js +1 -1
  187. package/unbundled/base-progress.cjs +1 -1
  188. package/unbundled/base-progress.js +1 -1
  189. package/unbundled/button.cjs +2 -2
  190. package/unbundled/button.js +2 -2
  191. package/unbundled/definition.cjs +2 -65
  192. package/unbundled/definition.js +4 -61
  193. package/unbundled/definition11.cjs +4 -3
  194. package/unbundled/definition11.js +3 -2
  195. package/unbundled/definition12.cjs +3 -2
  196. package/unbundled/definition12.js +3 -2
  197. package/unbundled/definition14.cjs +2 -1
  198. package/unbundled/definition14.js +2 -1
  199. package/unbundled/definition17.cjs +9 -4
  200. package/unbundled/definition17.js +9 -4
  201. package/unbundled/definition2.cjs +7 -2
  202. package/unbundled/definition2.js +8 -3
  203. package/unbundled/definition21.cjs +2 -1
  204. package/unbundled/definition21.js +2 -1
  205. package/unbundled/definition23.cjs +2 -1
  206. package/unbundled/definition23.js +2 -1
  207. package/unbundled/definition24.cjs +6 -4
  208. package/unbundled/definition24.js +6 -4
  209. package/unbundled/definition25.cjs +2 -1
  210. package/unbundled/definition25.js +2 -1
  211. package/unbundled/definition26.cjs +7 -4
  212. package/unbundled/definition26.js +7 -4
  213. package/unbundled/definition27.cjs +39 -5
  214. package/unbundled/definition27.js +40 -6
  215. package/unbundled/definition28.cjs +4 -3
  216. package/unbundled/definition28.js +4 -3
  217. package/unbundled/definition29.cjs +5 -168
  218. package/unbundled/definition29.js +11 -162
  219. package/unbundled/definition30.cjs +2 -63
  220. package/unbundled/definition30.js +5 -54
  221. package/unbundled/definition31.cjs +5 -3
  222. package/unbundled/definition31.js +5 -3
  223. package/unbundled/definition32.cjs +2 -1
  224. package/unbundled/definition32.js +2 -1
  225. package/unbundled/definition35.cjs +2 -1
  226. package/unbundled/definition35.js +2 -1
  227. package/unbundled/definition37.cjs +1 -1
  228. package/unbundled/definition37.js +1 -1
  229. package/unbundled/definition39.cjs +1 -1
  230. package/unbundled/definition39.js +1 -1
  231. package/unbundled/definition40.cjs +4 -2
  232. package/unbundled/definition40.js +4 -2
  233. package/unbundled/definition41.cjs +11 -6
  234. package/unbundled/definition41.js +11 -6
  235. package/unbundled/definition42.cjs +5 -4
  236. package/unbundled/definition42.js +5 -4
  237. package/unbundled/definition44.cjs +3 -2
  238. package/unbundled/definition44.js +3 -2
  239. package/unbundled/definition45.cjs +2 -2
  240. package/unbundled/definition45.js +2 -2
  241. package/unbundled/definition49.cjs +583 -79
  242. package/unbundled/definition49.js +579 -76
  243. package/unbundled/definition50.cjs +71 -33
  244. package/unbundled/definition50.js +67 -29
  245. package/unbundled/definition51.cjs +54 -23
  246. package/unbundled/definition51.js +52 -18
  247. package/unbundled/definition52.cjs +23 -39
  248. package/unbundled/definition52.js +17 -36
  249. package/unbundled/definition53.cjs +29 -314
  250. package/unbundled/definition53.js +27 -312
  251. package/unbundled/definition54.cjs +302 -195
  252. package/unbundled/definition54.js +298 -191
  253. package/unbundled/definition55.cjs +210 -40
  254. package/unbundled/definition55.js +206 -36
  255. package/unbundled/definition56.cjs +42 -266
  256. package/unbundled/definition56.js +38 -262
  257. package/unbundled/definition57.cjs +270 -50
  258. package/unbundled/definition57.js +267 -46
  259. package/unbundled/definition58.cjs +48 -146
  260. package/unbundled/definition58.js +47 -143
  261. package/unbundled/definition59.cjs +127 -225
  262. package/unbundled/definition59.js +122 -223
  263. package/unbundled/definition6.cjs +2 -1
  264. package/unbundled/definition6.js +2 -1
  265. package/unbundled/definition60.cjs +199 -418
  266. package/unbundled/definition60.js +196 -415
  267. package/unbundled/definition61.cjs +442 -3738
  268. package/unbundled/definition61.js +432 -3565
  269. package/unbundled/definition62.cjs +3717 -730
  270. package/unbundled/definition62.js +3544 -720
  271. package/unbundled/definition63.cjs +770 -97
  272. package/unbundled/definition63.js +767 -94
  273. package/unbundled/definition64.cjs +100 -999
  274. package/unbundled/definition64.js +98 -994
  275. package/unbundled/definition65.cjs +991 -93
  276. package/unbundled/definition65.js +985 -90
  277. package/unbundled/definition66.cjs +109 -73
  278. package/unbundled/definition66.js +105 -63
  279. package/unbundled/definition67.cjs +69 -155
  280. package/unbundled/definition67.js +60 -152
  281. package/unbundled/definition68.cjs +155 -119
  282. package/unbundled/definition68.js +151 -115
  283. package/unbundled/definition69.cjs +124 -49
  284. package/unbundled/definition69.js +120 -45
  285. package/unbundled/definition70.cjs +51 -85
  286. package/unbundled/definition70.js +50 -81
  287. package/unbundled/definition71.cjs +91 -19
  288. package/unbundled/definition71.js +86 -14
  289. package/unbundled/definition72.cjs +20 -87
  290. package/unbundled/definition72.js +14 -84
  291. package/unbundled/definition73.cjs +77 -294
  292. package/unbundled/definition73.js +72 -217
  293. package/unbundled/definition74.cjs +289 -311
  294. package/unbundled/definition74.js +219 -306
  295. package/unbundled/definition75.cjs +326 -26
  296. package/unbundled/definition75.js +317 -23
  297. package/unbundled/definition76.cjs +27 -122
  298. package/unbundled/definition76.js +22 -118
  299. package/unbundled/definition77.cjs +105 -232
  300. package/unbundled/definition77.js +101 -228
  301. package/unbundled/definition78.cjs +259 -26
  302. package/unbundled/definition78.js +249 -23
  303. package/unbundled/definition79.cjs +29 -148
  304. package/unbundled/definition79.js +27 -133
  305. package/unbundled/definition80.cjs +118 -173
  306. package/unbundled/definition80.js +109 -169
  307. package/unbundled/definition81.cjs +181 -477
  308. package/unbundled/definition81.js +176 -471
  309. package/unbundled/definition82.cjs +517 -0
  310. package/unbundled/definition82.js +497 -0
  311. package/unbundled/extractOptions.cjs +5 -5
  312. package/unbundled/extractOptions.js +2 -2
  313. package/unbundled/icon.cjs +67 -0
  314. package/unbundled/icon.js +61 -0
  315. package/unbundled/linkable.cjs +1 -1
  316. package/unbundled/linkable.js +1 -1
  317. package/unbundled/listbox.cjs +8 -3
  318. package/unbundled/listbox.js +7 -2
  319. package/unbundled/mixins.cjs +2 -1
  320. package/unbundled/mixins.js +2 -1
  321. package/unbundled/optgroup.cjs +66 -0
  322. package/unbundled/optgroup.js +54 -0
  323. package/unbundled/option.cjs +176 -0
  324. package/unbundled/option.js +164 -0
  325. package/unbundled/time-selection-picker.template.cjs +1 -1
  326. package/unbundled/time-selection-picker.template.js +1 -1
  327. package/unbundled/vivid-element.cjs +1 -1
  328. package/unbundled/vivid-element.js +1 -1
  329. package/video-player/definition.cjs +1 -1
  330. package/video-player/definition.js +1 -1
  331. package/vivid.api.json +336 -193
@@ -1,1040 +1,141 @@
1
1
  require("./chunk.cjs");
2
2
  const require_vivid_element = require("./vivid-element.cjs");
3
- const require_definition = require("./definition.cjs");
4
3
  const require_decorate = require("./decorate.cjs");
5
- const require_affix = require("./affix.cjs");
6
- const require_delegates_aria = require("./delegates-aria.cjs");
7
- const require_definition$1 = require("./definition5.cjs");
8
- const require_form_associated = require("./form-associated.cjs");
9
- const require_localized = require("./localized.cjs");
10
- const require_definition$2 = require("./definition6.cjs");
11
- const require_definition$3 = require("./definition9.cjs");
12
- const require_divider = require("./divider.cjs");
13
- const require_mixins = require("./mixins.cjs");
14
- const require_form_element = require("./form-element.cjs");
15
- const require_with_error_text = require("./with-error-text.cjs");
16
- const require_with_success_text = require("./with-success-text.cjs");
17
- const require_with_contextual_help = require("./with-contextual-help.cjs");
18
- const require_definition$4 = require("./definition29.cjs");
19
- const require_definition$5 = require("./definition30.cjs");
20
- const require_extractOptions = require("./extractOptions.cjs");
21
- const require_definition$6 = require("./definition36.cjs");
22
- const require_scrollIntoView = require("./scrollIntoView.cjs");
4
+ const require_slottable_request = require("./slottable-request.cjs");
23
5
  let _microsoft_fast_element = require("@microsoft/fast-element");
24
- let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
25
- //#region src/lib/searchable-select/searchable-select.scss?inline
26
- var searchable_select_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}.chevron{font:var(--vvd-typography-base-extended);flex-shrink:0;display:flex;transform:rotate(0)}@media (prefers-reduced-motion:no-preference){.chevron{transition:transform .2s}}:host([data-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:not(.disabled) .chevron{cursor:pointer}.disabled .chevron{color:var(--_low-ink-color);cursor:not-allowed}:host(:focus-visible){outline:none}:host{--_low-ink-color:var(--vvd-color-neutral-600);inline-size:300px;display:inline-block}:host([disabled]){--_low-ink-color:var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{flex-direction:column;gap:4px;display:flex}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.selection-count{color:var(--_low-ink-color);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary:var(--vvd-searchable-select-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-searchable-select-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-searchable-select-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-intermediate:var(--vvd-searchable-select-accent-intermediate,var(--vvd-color-neutral-500));--_connotation-color-faint:var(--vvd-searchable-select-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-searchable-select-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-firm:var(--vvd-searchable-select-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-fierce:var(--vvd-searchable-select-accent-fierce,var(--vvd-color-neutral-700));--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-500)}.fieldset.appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.fieldset:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-700)}.fieldset:hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.fieldset.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-700)}.fieldset.hover:where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.fieldset:disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.fieldset:disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.fieldset.disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.fieldset.disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.fieldset.readonly:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:var(--vvd-color-neutral-400)}.fieldset.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.fieldset.error:where(:not(.disabled,:disabled)){--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-alert-50);--_appearance-color-outline:var(--vvd-color-alert-500)}.fieldset.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-alert-50);--_appearance-color-outline:transparent}.fieldset.success:where(:not(.disabled,:disabled)){--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-success-50);--_appearance-color-outline:var(--vvd-color-success-500)}.fieldset.success:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-success-50);--_appearance-color-outline:transparent}.fieldset{--_searchable-select-block-size:24px;--_searchable-select-padding-block:8px;--_searchable-select-padding-inline:16px;--_searchable-select-icon-size:20px;--_searchable-select-border-radius:8px;--_searchable-select-gap:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);justify-content:space-between;align-items:center;gap:var(--_searchable-select-gap);padding-block:var(--_searchable-select-padding-block);padding-inline:var(--_searchable-select-padding-inline);transition:box-shadow .2s,background-color .2s;display:flex}.fieldset.size-condensed{--_searchable-select-block-size:20px;--_searchable-select-padding-block:6px;--_searchable-select-padding-inline:12px;--_searchable-select-gap:6px}.fieldset.size-condensed:not(.shape-pill){--_searchable-select-border-radius:4px}@supports selector(:has(*)){.fieldset:not(.has-highlighted-option):has(input:focus){box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent}}@supports not selector(:has(*)){.fieldset:not(.has-highlighted-option):focus-within{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent}}:host(:not([shape=pill])) .fieldset{border-radius:var(--_searchable-select-border-radius)}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{gap:var(--_searchable-select-gap);min-block-size:var(--_searchable-select-block-size);flex-direction:column;flex:1;display:flex;overflow:hidden}.tag-row{gap:var(--_searchable-select-gap);inline-size:100%;display:flex}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;block-size:var(--_searchable-select-block-size);font:var(--vvd-typography-base);background:0 0;border:none;outline:none;flex:1;min-inline-size:min(100px,40%);max-inline-size:100%}.contains-only-input input:not(:focus){opacity:0;pointer-events:none;block-size:0;inline-size:0;min-inline-size:0;position:absolute}.listbox{max-block-size:var(--searchable-select-height,408px);--_suppressable-focus-shadow:none;--_suppressable-focus-outline:none;--_suppressable-focus-outline-offset:0;flex-direction:column;gap:2px;padding:4px;display:flex;overflow-y:auto}.empty-message{color:var(--vvd-color-neutral-300);font:var(--vvd-typography-base);text-align:center;justify-content:center;align-items:center;min-block-size:40px;display:flex}::part(popup-base){inline-size:max-content;min-inline-size:var(--_searchable-select-fixed-width,100%)}slot[name=icon]{font-size:var(--_searchable-select-icon-size)}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.divider{margin-block:10px;margin-inline:12px}";
6
+ let prosemirror_model = require("prosemirror-model");
7
+ //#region src/lib/rich-text-view/rich-text-view.scss?inline
8
+ var rich_text_view_default = ":host{display:contents}.content{overflow-wrap:break-word;white-space:break-spaces;display:contents}";
27
9
  //#endregion
28
- //#region src/lib/searchable-select/option-tag.scss?inline
29
- var option_tag_default = ":host{display:block}.base.connotation-cta{--_connotation-color-contrast:var(--vvd-option-tag-cta-contrast,var(--vvd-color-cta-800))}.base:not(.connotation-cta){--_connotation-color-contrast:var(--vvd-option-tag-accent-contrast,var(--vvd-color-neutral-800))}.base{--_option-tag-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16));box-sizing:border-box;background-color:var(--fill-color);block-size:var(--_option-tag-block-size);box-shadow:inset 0 0 0 1px var(--outline-color);color:var(--text-color);font:var(--vvd-typography-base-bold);user-select:none;align-items:center;column-gap:8px;max-inline-size:100%;padding-inline:8px;display:flex;position:relative}.base.size-condensed{--_option-tag-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 20));padding-inline:4px}.base:not(.disabled){--text-color:var(--_connotation-color-contrast);--fill-color:var(--_connotation-color-soft);--outline-color:transparent}@supports (background-color:color-mix(in srgb, black 50%, white)){.base:not(.disabled){--fill-color:color-mix(in sRGB, var(--_connotation-color-contrast), transparent 87.5%)}}.base.disabled{--text-color:var(--vvd-color-neutral-300);--fill-color:var(--vvd-color-neutral-200);--outline-color:transparent}@supports (background-color:color-mix(in srgb, black 50%, white)){.base.disabled{--fill-color:color-mix(in sRGB, var(--vvd-color-neutral-800), transparent 87.5%)}}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.label{text-overflow:ellipsis;white-space:nowrap;max-inline-size:100%;overflow:hidden}slot[name=icon]{font-size:calc(var(--_option-tag-block-size) / 1.5);line-height:1}.icon-placeholder{inline-size:calc(var(--_option-tag-block-size) / 1.5)}.remove-button{border-radius:inherit;cursor:pointer;outline:none;align-items:center;display:flex}.disabled .remove-button{pointer-events:none}.remove-button:focus-visible:before{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));z-index:1;border-radius:inherit;content:\"\";pointer-events:none;display:block;position:absolute;inset:0}";
30
- //#endregion
31
- //#region src/lib/searchable-select/searchable-select.ts
32
- var TagGapPx = 8;
33
- var InputMinWidthPx = 100;
34
- var PageSize = 10;
35
- var isFormAssociatedTryingToSetFormValue = (value) => typeof value === "string";
10
+ //#region src/lib/rich-text-view/rich-text-view.ts
36
11
  /**
37
12
  * @public
38
- * @component searchable-select
39
- * @slot - Holds the available options.
40
- * @slot icon - The preferred way to add an icon to the control.
41
- * @slot meta - Slot to add meta content to the control.
42
- * @slot helper-text - Describes how to use the component. Alternative to the `helper-text` attribute.
43
- * @slot no-options - Message that appears when no options are available.
44
- * @slot no-matches - Message that appears when no options match the search query.
45
- * @slot loading-options - Message that appears there are no options to display and the component is in a loading state.
46
- * @event {CustomEvent<undefined>} input - Fired when the selected options change
47
- * @event {CustomEvent<undefined>} search-text-change - Fired when the search text changes
48
- * @event {CustomEvent<undefined>} change - Fired when the selected options change
49
- * @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
50
- * @vueModel values values input,@lazy:change `event.currentTarget.values`
51
- * @testAction selectOptionByValue selectOptionByValue
52
- * @testAction selectOptionByText selectOptionByText
53
- * @testQuery values values
54
- * @testQuery selectedOptions selectedOptionsText
13
+ * @component rich-text-view
14
+ * @dynamicSlot `@vonage/vivid#RteChildSlotProps` child - Used for custom rendered children.
55
15
  */
56
- var SearchableSelect = class extends require_with_contextual_help.WithContextualHelp(require_mixins.WithFeedback(require_with_error_text.WithErrorText(require_with_success_text.WithSuccessText(require_form_element.FormElement(require_delegates_aria.DelegatesAria(require_affix.AffixIconWithTrailing(require_localized.Localized(require_form_associated.FormAssociated(require_vivid_element.VividElement))))))))) {
16
+ var RichTextView = class extends require_vivid_element.VividElement {
57
17
  constructor(..._args) {
58
18
  super(..._args);
59
- this.fixedDropdown = false;
60
- this.open = false;
61
- this.multiple = false;
62
- this.externalTags = false;
63
- this.maxLines = null;
64
- this.values = [];
65
- this.initialValues = [];
66
- this._currentSearchText = null;
67
- this._areOptionsInitialized = false;
68
- this.#slottedOptionsChangeHandler = { handleChange: (source, _) => {
69
- if (source.selected && !this.values.includes(source.value)) this.values = [...this.values, source.value];
70
- else if (!source.selected && this.values.includes(source.value)) this.values = this.values.filter((option) => option !== source.value);
71
- } };
72
- this.#clonedTagIcons = /* @__PURE__ */ new Map();
73
- this._filteredOptions = [];
74
- this._filteredEnabledOptions = [];
75
- this.loading = false;
76
- this._highlightedOptionIndex = null;
77
- this._numElidedTags = 0;
78
- this._tagRows = [];
79
- this._lastTagRow = [];
80
- this.clearable = false;
81
- this.maxSelected = null;
82
- this._slottedDisabledOptions = [];
83
- this.enableSelectAll = false;
84
- this.proxy = document.createElement("input");
85
- this.setFormValue = (value, state) => {
86
- if (isFormAssociatedTryingToSetFormValue(value)) return;
87
- super.setFormValue(value, state);
88
- };
89
- this._changeDescription = "";
90
- this.#resizeObserver = new ResizeObserver(() => {
91
- this.#updateTagLayout();
92
- });
93
- this.#onOptgroupChange = () => {
94
- /* v8 ignore else */
95
- if (this._slottedElements) this._slottedElementsChanged();
96
- };
97
- }
98
- /** @internal */
99
- openChanged() {
100
- if (!this.open) this.#transitionHighlightedOptionTo(null);
101
- }
102
- /** @internal */
103
- valuesChanged() {
104
- if (!this._areOptionsInitialized) return;
105
- if (!this.multiple && this.values.length > 1) {
106
- this.values = [this.values[0]];
107
- return;
108
- }
109
- if (this.values.some((value) => !this.#isValidValue(value))) {
110
- this.values = this.values.filter((value) => this.#isValidValue(value));
111
- return;
112
- }
113
- this.value = this.values.length ? this.values[0] : "";
114
- this.#updateSelectionLimit();
115
- this.#updateSelectedOnSlottedOptions();
116
- if (this.$fastController.isConnected) this.#updateTagLayout();
117
- this.#updateFormValue();
118
- }
119
- #updateValuesThroughUserInteraction(newValues) {
120
- this.values = newValues;
121
- this.$emit("change", void 0, { bubbles: false });
122
- this.$emit("input", void 0, { bubbles: false });
123
- }
124
- #updateValuesWhileMaintainingOrder(newValues) {
125
- const oldSet = new Set(this.values);
126
- const newSet = new Set(newValues);
127
- this.values = [...this.values].filter((v) => newSet.has(v)).concat([...newValues].filter((v) => !oldSet.has(v)));
128
- }
129
- /** @internal */
130
- initialValuesChanged() {
131
- if (!this.dirtyValue) {
132
- this.values = this.initialValues;
133
- this.dirtyValue = false;
134
- }
135
- }
136
- #isValidValue(value) {
137
- return this._slottedOptions.some((option) => option.value === value);
138
- }
139
- /** @internal */
140
- valueChanged(prev, next) {
141
- super.valueChanged(prev, next);
142
- if (!this._areOptionsInitialized) return;
143
- const isValidValue = this._slottedOptions.some((option) => option.value === next);
144
- if (this.values[0] !== next) this.values = isValidValue ? [next] : [];
145
- }
146
- get selectedIndex() {
147
- if (this.values.length) return this._slottedOptions.findIndex((option) => option.value === this.values[0]);
148
- else return -1;
149
- }
150
- set selectedIndex(index) {
151
- this.value = this._slottedOptions[index]?.value ?? "";
152
- }
153
- get options() {
154
- return [...this._slottedOptions];
155
- }
156
- get selectedOptions() {
157
- return this._slottedOptions.filter((option) => this.values.includes(option.value));
158
- }
159
- /** @internal */
160
- _currentSearchTextChanged() {
161
- this.#updateFilteredOptions();
162
- this.$emit("search-text-change", void 0, {
163
- bubbles: false,
164
- composed: false
165
- });
166
- }
167
- /** Read-only property containing the current search text. */
168
- get searchText() {
169
- return this._currentSearchText ?? "";
170
- }
171
- /** @internal */
172
- get _inputValue() {
173
- return this._currentSearchText ?? (!this.multiple && this.value !== "" ? this.#textForValue(this.value) ?? "" : "");
174
- }
175
- /** @internal */
176
- _onInputInput(event) {
177
- this._currentSearchText = event.target.value;
178
- }
179
- /** @internal */
180
- _onInputFocus(_) {
181
- this.#updateFilteredOptions();
182
- }
183
- /** @internal */
184
- _onInputBlur(_) {
185
- this.open = false;
186
- this._currentSearchText = null;
187
- this._changeDescription = "";
188
- }
189
- /** @internal */
190
- _onInputKeydown(e) {
191
- if (e.ctrlKey || e.shiftKey) return true;
192
- switch (e.key) {
193
- case "Enter":
194
- this.#selectHighlightedOption();
195
- if (this._inputValue === "") this.open = !this.open;
196
- return false;
197
- case "Escape":
198
- this.open = false;
199
- break;
200
- case "Home":
201
- if (!this.open) {
202
- this.open = true;
203
- break;
204
- }
205
- this.#highlightFirstOption();
206
- return false;
207
- case "End":
208
- if (!this.open) {
209
- this.open = true;
210
- break;
211
- }
212
- this.#highlightLastOption();
213
- return false;
214
- case "PageUp":
215
- if (!this.open) {
216
- this.open = true;
217
- break;
218
- }
219
- this.#highlightPrevPage();
220
- return false;
221
- case "PageDown":
222
- if (!this.open) {
223
- this.open = true;
224
- break;
225
- }
226
- this.#highlightNextPage();
227
- return false;
228
- case "ArrowUp":
229
- if (!this.open) {
230
- this.open = true;
231
- break;
232
- }
233
- this.#highlightPreviousOption();
234
- return false;
235
- case "ArrowDown":
236
- if (!this.open) {
237
- this.open = true;
238
- break;
239
- }
240
- this.#highlightNextOption();
241
- return false;
242
- case "ArrowLeft":
243
- if (this.multiple && this._inputValue === "" && this.values.length && !this.externalTags) {
244
- this.#moveTagFocusTo(this.#nextTagIndexLeft(this.values.length));
245
- return false;
246
- }
247
- return true;
248
- case "Backspace":
249
- if (this.multiple && this._inputValue === "" && this.values.length) {
250
- this._onTagRemoved(this.values[this.values.length - 1]);
251
- return false;
252
- }
253
- return true;
254
- default:
255
- /* v8 ignore next -- @preserve */
256
- if (!this.open) this.open = true;
257
- return true;
258
- }
259
- return true;
260
- }
261
- /** @internal */
262
- _slottedElementsChanged() {
263
- this._slottedOptions = require_extractOptions.extractOptions(this._slottedElements);
264
- }
265
- /** @internal */
266
- _slottedOptionsChanged(oldValue, newValue) {
267
- const hasSlottedOptions = Boolean(this.querySelectorAll(`:not([slot])`).length);
268
- if (!newValue.length && hasSlottedOptions) return;
269
- this._areOptionsInitialized = true;
270
- if (oldValue) {
271
- this._slottedDisabledOptions = [];
272
- for (const option of oldValue) _microsoft_fast_element.Observable.getNotifier(option).unsubscribe(this.#slottedOptionsChangeHandler, "selected");
273
- }
274
- /* v8 ignore else -- @preserve */
275
- if (newValue) for (const option of newValue) {
276
- option._displayCheckmark = true;
277
- _microsoft_fast_element.Observable.getNotifier(option).subscribe(this.#slottedOptionsChangeHandler, "selected");
278
- }
279
- const values = [];
280
- for (const option of this._slottedOptions) {
281
- if (option.selected || option.value === this.value || this.values.includes(option.value)) values.push(option.value);
282
- if (option.disabled) this._slottedDisabledOptions.push(option);
283
- }
284
- this.#updateValuesWhileMaintainingOrder(values);
285
- this.#updateFilteredOptions();
286
- this.#updateSelectionLimit();
287
- }
288
- #slottedOptionsChangeHandler;
289
- #updateSelectedOnSlottedOptions() {
290
- for (const option of this._slottedOptions) {
291
- option.selected = this.values.includes(option.value);
292
- this.#updateClonedTagIconOfOption(option);
293
- }
294
- }
295
- #handleOptionInteraction(option) {
296
- const value = option.value;
297
- let newValues;
298
- let shouldClearSearchText = false;
299
- const isSelection = !this.values.includes(value);
300
- if (this.multiple) {
301
- if (isSelection) newValues = [...this.values, value];
302
- else newValues = this.values.filter((option) => option !== value);
303
- shouldClearSearchText = true;
304
- } else {
305
- if (isSelection) {
306
- newValues = [value];
307
- shouldClearSearchText = true;
308
- } else newValues = [];
309
- this.open = false;
310
- }
311
- this.#updateValuesThroughUserInteraction(newValues);
312
- const optionMessage = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option._getAccessibleName()) : this.locale.searchableSelect.optionDeselectedMessage(option._getAccessibleName());
313
- const maxSelectedMessage = this.multiple && this.maxSelected && this.maxSelected >= 1 ? this.locale.searchableSelect.maxSelectedMessage(this.values.length, this.maxSelected) : "";
314
- this._changeDescription = `${optionMessage} ${maxSelectedMessage}`;
315
- if (shouldClearSearchText) this._currentSearchText = null;
316
- }
317
- #clonedTagIcons;
318
- #tagIconOfOption(option) {
319
- return option.querySelector("[slot=\"tag-icon\"]");
320
- }
321
- /** @internal */
322
- _tagIconSlotName(value) {
323
- return `_tag-icon-${this.values.indexOf(value)}`;
324
- }
325
- #updateClonedTagIconOfOption(option) {
326
- if (option.selected && this.#tagIconOfOption(option)) {
327
- let clone = this.#clonedTagIcons.get(option);
328
- /* v8 ignore else -- @preserve */
329
- if (!clone) {
330
- clone = this.#tagIconOfOption(option).cloneNode(true);
331
- this.#clonedTagIcons.set(option, clone);
332
- }
333
- clone.slot = this._tagIconSlotName(option.value);
334
- this.appendChild(clone);
19
+ this._slotCounter = 0;
20
+ this._slottedChildren = /* @__PURE__ */ new Set();
21
+ this._slotRequests = /* @__PURE__ */ new Set();
22
+ this._contentElement = null;
23
+ }
24
+ /** @internal */
25
+ viewChanged(oldView, newView) {
26
+ if (oldView) this._removeStyles();
27
+ if (newView) this._addStyles(newView);
28
+ this._updateView();
29
+ }
30
+ _addStyles(view) {
31
+ const config = view[require_slottable_request.impl].config[require_slottable_request.impl];
32
+ this._styles = new _microsoft_fast_element.ElementStyles(require_slottable_request.sortedContributions(config.features.flatMap((f) => f.getStyles())));
33
+ this._styles.addStylesTo(this.shadowRoot);
34
+ }
35
+ _removeStyles() {
36
+ if (this._styles) {
37
+ this._styles.removeStylesFrom(this.shadowRoot);
38
+ this._styles = void 0;
39
+ }
40
+ }
41
+ _cleanupLightDom() {
42
+ for (const el of this._slottedChildren) this.removeChild(el);
43
+ for (const slotName of this._slotRequests) require_slottable_request.dispatchSlottableRequest(this, "child", slotName, require_slottable_request.removeSymbol);
44
+ this._slottedChildren.clear();
45
+ this._slotRequests.clear();
46
+ this._slotCounter = 0;
47
+ }
48
+ _updateView() {
49
+ if (!this._contentElement) return;
50
+ this._contentElement.innerHTML = "";
51
+ this._cleanupLightDom();
52
+ if (this.view) this._contentElement.appendChild(this._renderView(this.view));
53
+ }
54
+ _renderView(rteView) {
55
+ const ctx = rteView[require_slottable_request.impl];
56
+ if (rteView.type === "node" && rteView.node.type === "doc") rteView = rteView.children;
57
+ if (rteView.type === "fragment") {
58
+ const frag = document.createDocumentFragment();
59
+ for (const child of rteView.content) frag.appendChild(this._renderView(child));
60
+ return frag;
61
+ }
62
+ const customRenderedView = ctx.options.renderChildView?.(rteView) ?? false;
63
+ if (customRenderedView) return this._handleCustomRender(rteView, customRenderedView);
64
+ else return this._renderDefault(rteView);
65
+ }
66
+ _handleCustomRender(rteView, customResult) {
67
+ const slotName = `child-view-${this._slotCounter++}`;
68
+ const slot = document.createElement("slot");
69
+ slot.setAttribute("name", slotName);
70
+ if (customResult === true) {
71
+ this._slotRequests.add(slotName);
72
+ require_slottable_request.dispatchSlottableRequest(this, "child", slotName, { view: rteView });
335
73
  } else {
336
- const clone = this.#clonedTagIcons.get(option);
337
- if (clone) {
338
- clone.remove();
339
- this.#clonedTagIcons.delete(option);
340
- }
341
- }
342
- }
343
- /** @internal */
344
- optionFilterChanged() {
345
- this.#updateFilteredOptions();
346
- }
347
- /** @internal */
348
- loadingChanged(_oldValue, newValue) {
349
- this._changeDescription = this.locale.searchableSelect.loadingOptionsMessage;
350
- if (_oldValue && !newValue) this._changeDescription = "";
351
- }
352
- #updateFilteredOptions() {
353
- const newFilteredOptions = [];
354
- const optionFilter = this.optionFilter ?? ((option, searchText) => option.text.toLowerCase().includes(searchText.toLowerCase()));
355
- for (const option of this._slottedOptions ?? []) {
356
- option._vvdSearchText = this.searchText;
357
- const matches = !this.searchText || optionFilter(option, this.searchText);
358
- option._isNotMatching = !matches;
359
- if (!option.hidden && matches) newFilteredOptions.push(option);
360
- }
361
- /* v8 ignore next -- _slottedElements not yet set if filtering is triggered before slot initialises */
362
- for (const el of this._slottedElements ?? []) if (require_definition$5.isOptgroup(el)) {
363
- const hasVisibleOption = Array.from(el.children).some((child) => require_definition$4.isListboxOption(child) && !child._isNotMatching && !child.hidden);
364
- el.style.display = hasVisibleOption ? "" : "none";
365
- }
366
- this.#transitionHighlightedOptionTo(null);
367
- this._filteredOptions = newFilteredOptions;
368
- const enabled = newFilteredOptions.filter((o) => !o.disabled);
369
- if (this._selectAllOption) this._filteredEnabledOptions = [this._selectAllOption, ...enabled];
370
- else this._filteredEnabledOptions = enabled;
371
- }
372
- #transitionHighlightedOptionTo(index) {
373
- if (typeof this._highlightedOptionIndex === "number") {
374
- const prevOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
375
- prevOption._highlighted = false;
376
- }
377
- if (typeof index === "number") if (!this._filteredEnabledOptions.length) index = null;
378
- else index = Math.max(0, Math.min(this._filteredEnabledOptions.length - 1, index));
379
- this._highlightedOptionIndex = index;
380
- if (typeof this._highlightedOptionIndex === "number") {
381
- const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
382
- highlightedOption._highlighted = true;
383
- require_scrollIntoView.scrollIntoView(highlightedOption, this._listbox, "nearest");
384
- this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(highlightedOption._getAccessibleName(), this._highlightedOptionIndex + 1, this._filteredEnabledOptions.length, highlightedOption.selected);
385
- }
386
- }
387
- #selectHighlightedOption() {
388
- if (this._highlightedOptionIndex === null) return;
389
- const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
390
- if (highlightedOption.getAttribute("data-select-all") !== null) {
391
- this._toggleSelectAll();
392
- return;
393
- }
394
- this.#handleOptionInteraction(highlightedOption);
395
- }
396
- #highlightFirstOption() {
397
- this.#transitionHighlightedOptionTo(0);
398
- }
399
- #highlightLastOption() {
400
- this.#transitionHighlightedOptionTo(this._filteredEnabledOptions.length - 1);
401
- }
402
- #highlightPrevPage() {
403
- this.#transitionHighlightedOptionTo((this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - PageSize);
404
- }
405
- #highlightNextPage() {
406
- this.#transitionHighlightedOptionTo((this._highlightedOptionIndex ?? -1) + PageSize);
407
- }
408
- #highlightPreviousOption() {
409
- this.#transitionHighlightedOptionTo((this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - 1);
410
- }
411
- #highlightNextOption() {
412
- this.#transitionHighlightedOptionTo((this._highlightedOptionIndex ?? -1) + 1);
413
- }
414
- /** @internal */
415
- _tagLabelForValue(value) {
416
- return this._slottedOptions.find((option) => option.value === value).label;
417
- }
418
- /** @internal */
419
- _tagConnotationForValue(value) {
420
- return this._slottedOptions.find((option) => option.value === value).tagConnotation;
74
+ const { dom, contentDom = dom } = customResult;
75
+ const nestedView = document.createElement(this.tagName);
76
+ nestedView.view = rteView.children;
77
+ contentDom.appendChild(nestedView);
78
+ dom.setAttribute("slot", slotName);
79
+ this.appendChild(dom);
80
+ this._slottedChildren.add(dom);
81
+ }
82
+ return slot;
83
+ }
84
+ _renderDefault(view) {
85
+ const schema = view[require_slottable_request.impl].config[require_slottable_request.impl].schema;
86
+ if (view.type === "node" && view.node.type === "text") return document.createTextNode(view.node.text);
87
+ const item = view.type === "node" ? view.node : view.mark;
88
+ const pmItem = view.type === "node" ? prosemirror_model.Node.fromJSON(schema, item) : prosemirror_model.Mark.fromJSON(schema, item);
89
+ const spec = pmItem instanceof prosemirror_model.Node ? pmItem.type.spec.toDOM(pmItem) : pmItem.type.spec.toDOM(pmItem, true);
90
+ const { dom, contentDOM = dom } = prosemirror_model.DOMSerializer.renderSpec(document, spec);
91
+ const childrenRendered = this._renderView(view.children);
92
+ contentDOM.appendChild(childrenRendered);
93
+ return dom;
421
94
  }
422
95
  /** @internal */
423
- _isTagDisabled(value) {
424
- const option = this._slottedOptions.find((option) => option.value === value);
425
- return this.disabled || option.disabled;
426
- }
427
- #textForValue(value) {
428
- return (this._slottedOptions?.find((option) => option.value === value))?.label;
429
- }
430
- /** @internal */
431
- #measureTagWidth(label, removable, hasIcon) {
432
- const tag = document.createElement(this._optionTagTagName);
433
- tag.label = label;
434
- tag.removable = removable;
435
- tag.style.cssText = "position: absolute; visibility: hidden;";
436
- tag.hasIconPlaceholder = hasIcon;
437
- this.shadowRoot.appendChild(tag);
438
- const width = tag.getBoundingClientRect().width;
439
- tag.remove();
440
- return width;
441
- }
442
- #updateTagLayout() {
443
- if (!this.multiple) {
444
- this._numElidedTags = 0;
445
- this._tagRows = [];
446
- this._lastTagRow = [];
447
- return;
448
- }
449
- if (this.externalTags) {
450
- this._numElidedTags = this.values.length;
451
- this._tagRows = [];
452
- this._lastTagRow = [];
453
- return;
454
- }
455
- const rowWidth = this._contentArea.getBoundingClientRect().width;
456
- const rows = [[]];
457
- let currentRowIndex = 0;
458
- let currentRowWidth = InputMinWidthPx;
459
- let i;
460
- for (i = this.values.length - 1; i >= 0; i--) {
461
- const isLastRow = this.maxLines && currentRowIndex === this.maxLines - 1;
462
- const tagWidth = this.#measureTagWidth(this._tagLabelForValue(this.values[i]), true, this.#tagIconOfOption(this.selectedOptions[i]) !== null);
463
- const entry = {
464
- value: this.values[i],
465
- width: tagWidth
466
- };
467
- let elidedTagCounterWidth = 0;
468
- if (isLastRow) {
469
- const numElidedTags = i;
470
- if (numElidedTags) elidedTagCounterWidth = TagGapPx + this.#measureTagWidth(numElidedTags.toString(), false, false);
471
- }
472
- if (currentRowWidth + TagGapPx + tagWidth + elidedTagCounterWidth > rowWidth) {
473
- if (isLastRow) if (i === this.values.length - 1) {
474
- rows[currentRowIndex].unshift(entry);
475
- currentRowWidth += TagGapPx + tagWidth;
476
- } else break;
477
- else {
478
- rows.push([]);
479
- currentRowIndex++;
480
- rows[currentRowIndex].unshift(entry);
481
- currentRowWidth = tagWidth;
482
- }
483
- continue;
484
- }
485
- rows[currentRowIndex].unshift(entry);
486
- currentRowWidth += TagGapPx + tagWidth;
487
- }
488
- this._numElidedTags = i + 1;
489
- rows.reverse();
490
- for (let i = 0; i < rows.length - 1; i++) {
491
- let lineWidth = rows[i].map((e) => e.width).reduce((a, b) => a + b, 0) + (rows[i].length - 1) * TagGapPx;
492
- if (i === 0 && this._numElidedTags) lineWidth += TagGapPx + this.#measureTagWidth(this._numElidedTags.toString(), false, false);
493
- while (rows[i + 1].length && lineWidth + TagGapPx + rows[i + 1][0].width <= rowWidth) {
494
- const nextTag = rows[i + 1].shift();
495
- rows[i].push(nextTag);
496
- lineWidth += TagGapPx + nextTag.width;
497
- }
498
- }
499
- const rowValues = rows.map((line) => line.map((entry) => entry.value));
500
- this._tagRows = rowValues.slice(0, -1);
501
- this._lastTagRow = rowValues.slice(-1)[0];
502
- }
503
- /** @internal */
504
- _onTagRemoved(value) {
505
- this.#updateValuesThroughUserInteraction(this.values.filter((option) => option !== value));
506
- this.#updateFilteredOptions();
507
- }
508
- /** @internal */
509
- _onTagKeydown(event) {
510
- const tagIndex = parseInt(event.target.dataset.index);
511
- switch (event.key) {
512
- case "Backspace":
513
- case "Delete":
514
- case "Enter":
515
- case " ":
516
- this._onTagRemoved(this.values[tagIndex]);
517
- _microsoft_fast_element.Updates.process();
518
- this.#moveTagFocusTo(this.#nextTagIndexForRemoved(tagIndex));
519
- break;
520
- case "ArrowLeft":
521
- this.#moveTagFocusTo(this.#nextTagIndexLeft(tagIndex) ?? tagIndex);
522
- break;
523
- case "ArrowRight":
524
- this.#moveTagFocusTo(this.#nextTagIndexRight(tagIndex));
525
- break;
526
- }
527
- return true;
528
- }
529
- #moveTagFocusTo(index) {
530
- if (index === null) this._input.focus();
531
- else this.shadowRoot.querySelector(`[data-index="${index}"]`)?.focus();
532
- }
533
- #nextTagIndexLeft(index) {
534
- if (!this.values.length) return null;
535
- for (let i = index - 1; i >= 0; i--) if (!this._isTagDisabled(this.values[i])) return i;
536
- return null;
537
- }
538
- #nextTagIndexRight(index) {
539
- if (!this.values.length) return null;
540
- for (let i = index + 1; i < this.values.length; i++) if (!this._isTagDisabled(this.values[i])) return i;
541
- return null;
542
- }
543
- #nextTagIndexForRemoved(index) {
544
- return this.#nextTagIndexRight(index - 1) ?? this.#nextTagIndexLeft(index);
545
- }
546
- /** @internal */
547
- _onListboxClick(e) {
548
- if (this.disabled) return;
549
- const capturedOption = e.target.closest(`option,[role=option],[data-vvd-component=option]`);
550
- if (capturedOption?.getAttribute("data-select-all") !== null) {
551
- this._toggleSelectAll();
552
- return;
553
- }
554
- if (capturedOption && !capturedOption.disabled) this.#handleOptionInteraction(capturedOption);
555
- }
556
- /** @internal */
557
- get _shouldShowClearButton() {
558
- return this.clearable && this.values.length > 0;
559
- }
560
- /** @internal */
561
- _onClearButtonClick() {
562
- this.#updateValuesThroughUserInteraction(this.selectedOptions.filter((option) => option.disabled).map((option) => option.value));
563
- }
564
- /** @internal */
565
- maxSelectedChanged() {
566
- this.#updateSelectionLimit();
567
- }
568
- #updateSelectionLimit() {
569
- if (!this.multiple || !this._slottedOptions || typeof this.maxSelected !== "number" || this.maxSelected <= 0) return;
570
- const options = this._slottedOptions.filter((option) => !this._slottedDisabledOptions.includes(option));
571
- if (this.values.length >= this.maxSelected) {
572
- const unselectedOptions = options.filter((option) => !this.selectedOptions.includes(option));
573
- for (const option of unselectedOptions) option.disabled = true;
574
- } else for (const option of options) option.disabled = false;
575
- }
576
- /** @internal */
577
- get _hasSelectionCount() {
578
- return this.multiple && this.maxSelected && this.maxSelected >= 1;
579
- }
580
- /** @internal */
581
- get _selectableOptions() {
582
- return this._slottedOptions?.filter((o) => !this._slottedDisabledOptions.includes(o) && !o.disabled) ?? [];
583
- }
584
- /** @internal */
585
- get _selectAllLabel() {
586
- return this._isAllSelected ? this.deselectAllText ?? this.locale.searchableSelect.deselectAllLabel : this.selectAllText ?? this.locale.searchableSelect.selectAllLabel;
587
- }
588
- /** @internal */
589
- get _isAllSelected() {
590
- const selectedValues = this.values;
591
- if (!this.multiple || !this._slottedOptions) return false;
592
- const selectable = this._selectableOptions;
593
- if (selectable.length === 0) return false;
594
- const selected = new Set(selectedValues);
595
- return selectable.every((o) => selected.has(o.value));
596
- }
597
- /** @internal */
598
- _toggleSelectAll() {
599
- const selectableValues = this._selectableOptions.map((o) => o.value);
600
- if (this._isAllSelected) {
601
- const updatedValues = this.values.filter((v) => !selectableValues.includes(v));
602
- this.#updateValuesThroughUserInteraction(updatedValues);
603
- this._changeDescription = this.locale.searchableSelect.deselectedAllMessage;
604
- return;
605
- }
606
- const missingValues = selectableValues.filter((v) => !this.values.includes(v));
607
- const updatedValues = [...this.values, ...missingValues];
608
- this.#updateValuesThroughUserInteraction(updatedValues);
609
- this._changeDescription = this.locale.searchableSelect.selectedAllMessage;
610
- }
611
- #determineInitialValues() {
612
- return this.initialValues.length ? this.initialValues : this.initialValue ? [this.initialValue] : [];
613
- }
614
- /** @internal */
615
- nameChanged(previous, next) {
616
- super.nameChanged(previous, next);
617
- this.#updateFormValue();
618
- }
619
- #updateFormValue() {
620
- if (!this.name) this.setFormValue(null);
621
- else {
622
- const formData = new FormData();
623
- for (const value of this.values) formData.append(this.name, value);
624
- this.setFormValue(formData);
625
- }
626
- }
627
- /** @internal */
628
- formResetCallback() {
629
- super.formResetCallback();
630
- this.#updateValuesThroughUserInteraction(this.#determineInitialValues());
631
- }
632
- #resizeObserver;
633
- /** @internal */
634
- _onFieldsetClick(e) {
635
- if (this.disabled) return;
636
- if (!e.defaultPrevented) {
637
- this._input.focus();
638
- this.open = true;
639
- }
640
- }
641
- /** @internal */
642
- _onChevronClick() {
643
- if (this.open) {
644
- this.open = false;
645
- return false;
646
- }
647
- return true;
648
- }
649
96
  connectedCallback() {
650
97
  super.connectedCallback();
651
- if (!this.values.length) this.values = this.#determineInitialValues();
652
- this.#resizeObserver.observe(this._contentArea);
653
- this.addEventListener("optgroup-change", this.#onOptgroupChange);
98
+ this._updateView();
654
99
  }
100
+ /** @internal */
655
101
  disconnectedCallback() {
656
102
  super.disconnectedCallback();
657
- this.removeEventListener("optgroup-change", this.#onOptgroupChange);
658
- this.#resizeObserver.disconnect();
659
- }
660
- #onOptgroupChange;
661
- /** @internal */
662
- validate() {
663
- super.validate(this._input ?? void 0);
664
- }
665
- /** @internal */
666
- focus(options) {
667
- this._input?.focus(options);
668
- }
669
- /** @internal */
670
- _onMouseDown(event) {
671
- const originalTarget = event.composedPath()[0];
672
- if (!event.defaultPrevented && originalTarget !== this._input && !this._isFromContextualHelp(event)) {
673
- this._input.focus();
674
- return false;
675
- }
676
- return true;
677
- }
678
- };
679
- require_decorate.__decorate([_microsoft_fast_element.attr], SearchableSelect.prototype, "appearance", void 0);
680
- require_decorate.__decorate([_microsoft_fast_element.attr], SearchableSelect.prototype, "shape", void 0);
681
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)()], SearchableSelect.prototype, "scale", void 0);
682
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
683
- mode: "boolean",
684
- attribute: "fixed-dropdown"
685
- })], SearchableSelect.prototype, "fixedDropdown", void 0);
686
- require_decorate.__decorate([_microsoft_fast_element.attr], SearchableSelect.prototype, "placeholder", void 0);
687
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SearchableSelect.prototype, "open", void 0);
688
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SearchableSelect.prototype, "multiple", void 0);
689
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
690
- attribute: "external-tags",
691
- mode: "boolean"
692
- })], SearchableSelect.prototype, "externalTags", void 0);
693
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
694
- attribute: "max-lines",
695
- converter: _microsoft_fast_element.nullableNumberConverter
696
- })], SearchableSelect.prototype, "maxLines", void 0);
697
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "values", void 0);
698
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "initialValues", void 0);
699
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_input", void 0);
700
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_currentSearchText", void 0);
701
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_slottedElements", void 0);
702
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_slottedOptions", void 0);
703
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "optionFilter", void 0);
704
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_filteredOptions", void 0);
705
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_filteredEnabledOptions", void 0);
706
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SearchableSelect.prototype, "loading", void 0);
707
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_highlightedOptionIndex", void 0);
708
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_contentArea", void 0);
709
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_numElidedTags", void 0);
710
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_tagRows", void 0);
711
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_lastTagRow", void 0);
712
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_listbox", void 0);
713
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SearchableSelect.prototype, "clearable", void 0);
714
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
715
- attribute: "max-selected",
716
- converter: _microsoft_fast_element.nullableNumberConverter
717
- })], SearchableSelect.prototype, "maxSelected", void 0);
718
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_slottedDisabledOptions", void 0);
719
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
720
- attribute: "enable-select-all",
721
- mode: "boolean"
722
- })], SearchableSelect.prototype, "enableSelectAll", void 0);
723
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "select-all-text" })], SearchableSelect.prototype, "selectAllText", void 0);
724
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "deselect-all-text" })], SearchableSelect.prototype, "deselectAllText", void 0);
725
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_selectAllOption", void 0);
726
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_changeDescription", void 0);
727
- require_decorate.__decorate([_microsoft_fast_element.observable], SearchableSelect.prototype, "_anchor", void 0);
728
- //#endregion
729
- //#region src/lib/searchable-select/option-tag.ts
730
- var OptionTag = class extends require_localized.Localized(require_vivid_element.VividElement) {
731
- constructor(..._args) {
732
- super(..._args);
733
- this.removable = false;
734
- this.disabled = false;
735
- this.hasIconPlaceholder = false;
736
- }
737
- /** @internal */
738
- _onClickRemove() {
739
- this.$emit("remove", void 0, { bubbles: false });
103
+ this._removeStyles();
104
+ this._cleanupLightDom();
740
105
  }
741
106
  };
742
- require_decorate.__decorate([_microsoft_fast_element.attr], OptionTag.prototype, "shape", void 0);
743
- require_decorate.__decorate([_microsoft_fast_element.observable], OptionTag.prototype, "connotation", void 0);
744
- require_decorate.__decorate([_microsoft_fast_element.attr], OptionTag.prototype, "label", void 0);
745
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], OptionTag.prototype, "removable", void 0);
746
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], OptionTag.prototype, "disabled", void 0);
747
- require_decorate.__decorate([_microsoft_fast_element.observable], OptionTag.prototype, "hasIconPlaceholder", void 0);
748
- require_decorate.__decorate([(0, _microsoft_fast_element.attr)()], OptionTag.prototype, "scale", void 0);
107
+ require_decorate.__decorate([_microsoft_fast_element.observable], RichTextView.prototype, "view", void 0);
749
108
  //#endregion
750
- //#region src/lib/searchable-select/searchable-select.template.ts
751
- function renderLabel() {
752
- return _microsoft_fast_element.html`
753
- <label for="control" class="label" id="label"> ${(x) => x.label} </label>
754
- `;
755
- }
756
- function renderSelectionCount() {
757
- return _microsoft_fast_element.html`
758
- <span
759
- id="selection-count"
760
- class="selection-count"
761
- aria-label="${(x) => x.locale.searchableSelect.maxSelectedMessage(x.values.length, x.maxSelected)}"
762
- >(${(x) => `${x.values.length}/${x.maxSelected}`})</span
763
- >
764
- `;
765
- }
766
- var tagTemplateFactory = (context, getComponent) => {
767
- const optionTagTag = context.tagFor(OptionTag);
768
- return _microsoft_fast_element.html`
769
- <div class="tag-wrapper">
770
- <${optionTagTag}
771
- class="tag"
772
- tabindex="-1"
773
- data-index="${(x, c) => getComponent(c).values.indexOf(x)}"
774
- removable
775
- :label="${(x, c) => getComponent(c)._tagLabelForValue(x)}"
776
- :shape="${(_, c) => getComponent(c).shape}"
777
- :connotation="${(x, c) => getComponent(c)._tagConnotationForValue(x)}"
778
- :scale="${(_, c) => getComponent(c).scale}"
779
- ?disabled="${(x, c) => getComponent(c)._isTagDisabled(x)}"
780
- @remove="${(x, c) => getComponent(c)._onTagRemoved(x)}"
781
- @keydown="${(_, c) => getComponent(c)._onTagKeydown(c.event)}"
782
- @mousedown="${() => false}">
783
- <slot slot="icon" name="${(x, c) => getComponent(c)._tagIconSlotName(x)}"></slot>
784
- </${optionTagTag}>
785
- </div>
786
- `;
787
- };
788
- var elidedTagTemplateFactory = (context, getComponent) => {
789
- const optionTagTag = context.tagFor(OptionTag);
790
- return _microsoft_fast_element.html`
791
- <${optionTagTag}
792
- class="tag"
793
- tabindex="-1"
794
- :label="${(x, c) => getComponent(x, c)._numElidedTags.toString()}"
795
- :shape="${(x, c) => getComponent(x, c).shape}"
796
- :scale="${(x, c) => getComponent(x, c).scale}"
797
- ?disabled="${(x, c) => getComponent(x, c).disabled}"
798
- @mousedown="${() => false}">
799
- </${optionTagTag}>
800
- `;
801
- };
802
- function renderFieldset(context) {
803
- const buttonTag = context.tagFor(require_definition$2.Button);
804
- const progressRingTag = context.tagFor(require_definition$1.ProgressRing);
805
- const affixIconTemplate = require_affix.affixIconTemplateFactory(context);
806
- const chevronTemplate = require_definition$2.chevronTemplateFactory(context);
807
- const tagTemplate = tagTemplateFactory(context, (c) => c.parent);
808
- const nestedTagTemplate = tagTemplateFactory(context, (c) => c.parentContext.parent);
809
- const elidedTagTemplate = elidedTagTemplateFactory(context, (x, _) => x);
810
- const nestedElidedTagTemplate = elidedTagTemplateFactory(context, (_, c) => c.parent);
811
- return _microsoft_fast_element.html`
812
- <div
813
- class="fieldset ${(x) => (0, _microsoft_fast_web_utilities.classNames)(["disabled", x.disabled], [`appearance-${x.appearance}`, Boolean(x.appearance)], [`shape-${x.shape}`, Boolean(x.shape)], [`size-${x.scale}`, Boolean(x.scale)], ["error", Boolean(x.errorValidationMessage)], ["success", !!x.successText], ["has-highlighted-option", x._highlightedOptionIndex !== null])}"
814
- @click="${(x, c) => x._onFieldsetClick(c.event)}"
815
- ${(0, _microsoft_fast_element.ref)("_anchor")}
816
- >
817
- ${(x) => affixIconTemplate(x.icon, require_affix.IconWrapper.Slot)}
818
- <div class="content-area" ${(0, _microsoft_fast_element.ref)("_contentArea")}>
819
- ${(0, _microsoft_fast_element.repeat)((x) => x._tagRows, _microsoft_fast_element.html`
820
- <div class="tag-row">
821
- ${(0, _microsoft_fast_element.when)((_, c) => c.isFirst && c.parent._numElidedTags, nestedElidedTagTemplate)}
822
- ${(0, _microsoft_fast_element.repeat)((x) => x, nestedTagTemplate)}
823
- </div>
824
- `, { positioning: true })}
825
- <div
826
- class="tag-row ${(x) => (0, _microsoft_fast_web_utilities.classNames)(["contains-only-input", x._tagRows.length > 0 && x._lastTagRow.length === 0])}"
827
- >
828
- ${(0, _microsoft_fast_element.when)((x) => x._tagRows.length === 0 && x._numElidedTags, elidedTagTemplate)}
829
- ${(0, _microsoft_fast_element.repeat)((x) => x._lastTagRow, tagTemplate)}
830
- <input
831
- id="control"
832
- class="control"
833
- autocomplete="off"
834
- ${require_delegates_aria.delegateAria({
835
- role: "combobox",
836
- ariaAutoComplete: "list",
837
- ariaHasPopup: "listbox",
838
- ariaExpanded: (x) => x.open,
839
- ariaControls: "listbox",
840
- ariaDescribedBy: (x) => `${x._feedbackDescribedBy} ${x.multiple && x.maxSelected && x.maxSelected >= 1 ? "selection-count" : null}`
841
- })}
842
- placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
843
- type="text"
844
- ?disabled="${(x) => x.disabled}"
845
- :value="${(x) => x._inputValue}"
846
- @input="${(x, c) => {
847
- x._onInputInput(c.event);
848
- c.event.stopPropagation();
849
- }}"
850
- @change="${(_, c) => {
851
- c.event.stopPropagation();
852
- }}"
853
- @focus="${(x, c) => x._onInputFocus(c.event)}"
854
- @blur="${(x, c) => x._onInputBlur(c.event)}"
855
- @keydown="${(x, c) => x._onInputKeydown(c.event)}"
856
- ${(0, _microsoft_fast_element.ref)("_input")}
857
- />
858
- </div>
859
- </div>
860
- <slot name="meta"></slot>
861
- ${(0, _microsoft_fast_element.when)((x) => x._shouldShowClearButton, _microsoft_fast_element.html`<${buttonTag}
862
- aria-label="${(x) => x.locale.searchableSelect.clearButtonLabel}"
863
- @click="${(x) => x._onClearButtonClick()}"
864
- @mousedown="${() => false}"
865
- ?disabled="${(x) => x.disabled}"
866
- :shape="${(x) => x.shape}"
867
- size="super-condensed"
868
- icon="close-line"
869
- appearance="ghost-light"
870
- tabindex="0"
871
- ></${buttonTag}>`)}
872
- <div @mousedown="${() => false}" @click="${(x) => x._onChevronClick()}">
873
- ${(0, _microsoft_fast_element.when)((x) => x.loading, _microsoft_fast_element.html`<${progressRingTag} indeterminate size="-6" aria-hidden="true"></${progressRingTag}>`)}
874
- ${(0, _microsoft_fast_element.when)((x) => !x.loading, chevronTemplate)}
875
- </div>
876
- </div>
877
- `;
878
- }
879
- function setFixedDropdownVarWidth(x) {
880
- return x.open && x.fixedDropdown ? `--_searchable-select-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
881
- }
882
- function renderSelectAll(context) {
883
- const optionTag = context.tagFor(require_definition$4.ListboxOption);
884
- const dividerTag = context.tagFor(require_divider.Divider);
885
- return _microsoft_fast_element.html`
886
- <${optionTag}
887
- data-select-all
888
- tabindex="-1"
889
- :text="${(x) => x._selectAllLabel}"
890
- :selected="${(x) => x._isAllSelected}"
891
- :_displayCheckmark="${() => true}"
892
- ?disabled="${(x) => x._selectableOptions.length === 0}"
893
- ${(0, _microsoft_fast_element.ref)("_selectAllOption")}>
894
- </${optionTag}>
895
- <${dividerTag} class="divider"></${dividerTag}>
896
- `;
897
- }
898
- function renderControl(context) {
899
- const popupTag = context.tagFor(require_definition$3.Popup);
900
- return _microsoft_fast_element.html`
901
- <div class="label-wrapper" ?hidden=${(x) => !x.label && !x._hasContextualHelp && !x._hasSelectionCount}>
902
- ${(0, _microsoft_fast_element.when)((x) => x.label || x._hasSelectionCount, _microsoft_fast_element.html`
903
- <div>
904
- ${(0, _microsoft_fast_element.when)((x) => x.label, renderLabel())}
905
- ${(0, _microsoft_fast_element.when)((x) => x._hasSelectionCount, renderSelectionCount())}
906
- </div>
907
- `)}
908
- <slot name="contextual-help" ${(0, _microsoft_fast_element.slotted)("_contextualHelpSlottedContent")}></slot>
909
- </div>
910
- <span aria-live="assertive" aria-relevant="text" class="visually-hidden">
911
- ${(x) => x._changeDescription}
912
- </span>
913
- <div>
914
- ${renderFieldset(context)}
915
- <div class="popup-wrapper">
916
- <${popupTag}
917
- :anchor="${(x) => x._anchor}"
918
- :open="${(x) => x.open}"
919
- class="popup"
920
- placement="bottom-start"
921
- style="${setFixedDropdownVarWidth}"
922
- strategy="${(x) => x.fixedDropdown ? "fixed" : "absolute"}">
923
- <div
924
- class="listbox"
925
- role="listbox"
926
- aria-multiselectable="${(x) => x.multiple}"
927
- aria-required="${(x) => x.required}"
928
- ${(0, _microsoft_fast_element.ref)("_listbox")}
929
- @click="${(x, c) => x._onListboxClick(c.event)}"
930
- @mousedown="${() => false}"
931
- >
932
- ${(0, _microsoft_fast_element.when)((x) => x.enableSelectAll && x.multiple && !x.maxSelected, renderSelectAll(context))}
933
- <slot
934
- ${(0, _microsoft_fast_element.slotted)({
935
- filter: ((n) => require_definition$4.isListboxOption(n) || require_definition$5.isOptgroup(n)),
936
- flatten: true,
937
- property: "_slottedElements"
938
- })}>
939
- </slot>
940
- ${(0, _microsoft_fast_element.when)((x) => x._filteredOptions.length === 0, _microsoft_fast_element.html`<div class="empty-message">
941
- ${(0, _microsoft_fast_element.when)((x) => x.loading, _microsoft_fast_element.html`<slot name="loading-options">
942
- ${(x) => x.locale.searchableSelect.loadingOptionsMessage}
943
- </slot>`)}
944
- ${(0, _microsoft_fast_element.when)((x) => !x.loading && x.searchText === "", _microsoft_fast_element.html`<slot name="no-options">
945
- ${(x) => x.locale.searchableSelect.noOptionsMessage}
946
- </slot>`)}
947
- ${(0, _microsoft_fast_element.when)((x) => !x.loading && x.searchText !== "", _microsoft_fast_element.html`<slot name="no-matches">
948
- ${(x) => x.locale.searchableSelect.noMatchesMessage}
949
- </slot>`)}
950
- </div>`)}
951
- </div>
952
- </${popupTag}>
953
- </div>
954
- </div>
955
- `;
956
- }
957
- var SearchableSelectTemplate = (context) => {
958
- const optionTagName = context.tagFor(OptionTag, true);
959
- return _microsoft_fast_element.html`
960
- <template
961
- :_optionTagTagName="${() => optionTagName}"
962
- @mousedown="${(x, c) => x._onMouseDown(c.event)}"
963
- >
964
- <div class="control-wrapper">
965
- ${renderControl(context)} ${(x) => x._getFeedbackTemplate(context)}
966
- </div>
967
- </template>
968
- `;
969
- };
970
- //#endregion
971
- //#region src/lib/searchable-select/option-tag.template.ts
972
- function renderRemoveButton(iconTag) {
973
- return _microsoft_fast_element.html`
974
- <span
975
- class="remove-button"
976
- aria-label="${(x) => x.locale.searchableSelect.removeTagButtonLabel(x.label)}"
977
- role="button"
978
- tabindex="${(x) => x.disabled ? null : 0}"
979
- @click="${(x) => x._onClickRemove()}"
980
- >
981
- <${iconTag} name="close-line"></${iconTag}>
982
- </span>
983
- `;
984
- }
985
- var optionTagTemplate = (context) => {
986
- const iconTag = context.tagFor(require_definition.Icon);
987
- return _microsoft_fast_element.html`<span
988
- class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", ["disabled", x.disabled], ["removable", x.removable], [`shape-${x.shape}`, Boolean(x.shape)], [`connotation-${x.connotation}`, Boolean(x.connotation)], [`size-${x.scale}`, Boolean(x.scale)])}"
989
- aria-disabled="${(x) => x.disabled}"
990
- >
991
- <slot name="icon" aria-hidden="true">
992
- ${(0, _microsoft_fast_element.when)((x) => x.hasIconPlaceholder, _microsoft_fast_element.html`<div class="icon-placeholder"></div>`)}
993
- </slot>
994
- ${(0, _microsoft_fast_element.when)((x) => x.label, (x) => _microsoft_fast_element.html`<span class="label">${x.label}</span>`)}
995
- ${(0, _microsoft_fast_element.when)((x) => x.removable, renderRemoveButton(iconTag))}
996
- </span>`;
997
- };
109
+ //#region src/lib/rich-text-view/rich-text-view.template.ts
110
+ var RichTextViewTemplate = () => _microsoft_fast_element.html`<div class="content rich-text" ${(0, _microsoft_fast_element.ref)("_contentElement")}></div>`;
998
111
  //#endregion
999
- //#region src/lib/searchable-select/definition.ts
1000
- var optionTagDefinition = require_vivid_element.defineVividComponent("option-tag", OptionTag, optionTagTemplate, [require_definition.iconDefinition], {
1001
- styles: [option_tag_default],
112
+ //#region src/lib/rich-text-view/definition.ts
113
+ var richTextViewDefinition = require_vivid_element.defineVividComponent("rich-text-view", RichTextView, RichTextViewTemplate, [], {
114
+ styles: rich_text_view_default,
1002
115
  shadowOptions: { delegatesFocus: true }
1003
116
  });
1004
- /** @internal */
1005
- var searchableSelectDefinition = require_vivid_element.defineVividComponent("searchable-select", SearchableSelect, SearchableSelectTemplate, [
1006
- require_definition$2.buttonDefinition,
1007
- require_definition$3.popupDefinition,
1008
- require_definition.iconDefinition,
1009
- optionTagDefinition,
1010
- require_definition$1.progressRingDefinition,
1011
- require_mixins.feedbackMessageDefinition,
1012
- require_definition$4.listboxOptionDefinition,
1013
- require_definition$5.optgroupDefinition,
1014
- require_definition$6.dividerDefinition
1015
- ], { styles: searchable_select_default });
1016
117
  /**
1017
- * Registers the searchable-select element with the design system.
118
+ * Registers the rich-text-view element with the design system.
1018
119
  *
1019
120
  * @param prefix - the prefix to use for the component name
1020
121
  */
1021
- var registerSearchableSelect = require_vivid_element.createRegisterFunction(searchableSelectDefinition);
122
+ var registerRichTextView = require_vivid_element.createRegisterFunction(richTextViewDefinition);
1022
123
  //#endregion
1023
- Object.defineProperty(exports, "SearchableSelect", {
124
+ Object.defineProperty(exports, "RichTextView", {
1024
125
  enumerable: true,
1025
126
  get: function() {
1026
- return SearchableSelect;
127
+ return RichTextView;
1027
128
  }
1028
129
  });
1029
- Object.defineProperty(exports, "registerSearchableSelect", {
130
+ Object.defineProperty(exports, "registerRichTextView", {
1030
131
  enumerable: true,
1031
132
  get: function() {
1032
- return registerSearchableSelect;
133
+ return registerRichTextView;
1033
134
  }
1034
135
  });
1035
- Object.defineProperty(exports, "searchableSelectDefinition", {
136
+ Object.defineProperty(exports, "richTextViewDefinition", {
1036
137
  enumerable: true,
1037
138
  get: function() {
1038
- return searchableSelectDefinition;
139
+ return richTextViewDefinition;
1039
140
  }
1040
141
  });