@vonage/vivid 5.17.0 → 5.18.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.
- package/accordion/definition.cjs +6 -6
- package/accordion/definition.js +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +2 -2
- package/accordion-item/definition.cjs +5 -5
- package/accordion-item/definition.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +2 -2
- package/alert/definition.cjs +5 -5
- package/alert/definition.js +1 -1
- package/alert/index.cjs +2 -2
- package/alert/index.js +6 -5
- package/audio-player/definition.cjs +5 -5
- package/audio-player/definition.js +1 -1
- package/audio-player/index.cjs +1 -1
- package/audio-player/index.js +2 -1
- package/avatar/definition.cjs +5 -5
- package/avatar/definition.js +1 -1
- package/avatar/index.cjs +3 -3
- package/avatar/index.js +6 -5
- package/badge/definition.cjs +5 -5
- package/badge/definition.js +1 -1
- package/badge/index.cjs +1 -4
- package/badge/index.js +4 -20
- package/banner/definition.cjs +5 -5
- package/banner/definition.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +5 -4
- package/breadcrumb-item/definition.cjs +4 -4
- package/breadcrumb-item/definition.js +1 -1
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -0
- package/bundled/affix.cjs +1 -1
- package/bundled/affix.js +5 -5
- package/bundled/definition11.cjs +2 -2
- package/bundled/definition11.js +5 -5
- package/bundled/definition12.cjs +3 -3
- package/bundled/definition12.js +5 -5
- package/bundled/definition13.cjs +2 -2
- package/bundled/definition13.js +4 -4
- package/bundled/definition15.cjs +3 -3
- package/bundled/definition15.js +7 -7
- package/bundled/definition17.cjs +3 -3
- package/bundled/definition17.js +8 -8
- package/bundled/definition18.cjs +2 -2
- package/bundled/definition18.js +6 -6
- package/bundled/definition2.cjs +3 -14
- package/bundled/definition2.js +15 -48
- package/bundled/definition20.cjs +5 -5
- package/bundled/definition20.js +8 -8
- package/bundled/definition22.cjs +4 -39
- package/bundled/definition22.js +18 -70
- package/bundled/definition23.cjs +12 -0
- package/bundled/definition23.js +37 -0
- package/bundled/definition24.cjs +39 -0
- package/bundled/definition24.js +72 -0
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +9 -6
- package/bundled/definition4.cjs +2 -2
- package/bundled/definition4.js +5 -5
- package/bundled/definition6.cjs +11 -11
- package/bundled/definition6.js +45 -29
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +1 -0
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +7 -7
- package/bundled/numberConverter.cjs +12 -0
- package/bundled/numberConverter.js +38 -0
- package/bundled/picker-field.template.cjs +2 -1
- package/bundled/picker-field.template.js +2 -1
- package/bundled/utils.cjs +1 -0
- package/bundled/utils.js +1420 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/button/definition.cjs +5 -5
- package/button/definition.js +1 -1
- package/button/index.cjs +1 -1
- package/button/index.js +1 -1
- package/card/definition.cjs +5 -5
- package/card/definition.js +1 -1
- package/card/index.cjs +4 -4
- package/card/index.js +7 -6
- package/checkbox/definition.cjs +5 -5
- package/checkbox/definition.js +1 -1
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +1 -1
- package/color-picker/definition.cjs +5 -5
- package/color-picker/definition.js +1 -1
- package/color-picker/index.cjs +7 -7
- package/color-picker/index.js +55 -54
- package/combobox/definition.cjs +5 -5
- package/combobox/definition.js +1 -1
- package/combobox/index.cjs +2 -2
- package/combobox/index.js +8 -7
- package/contextual-help/definition.cjs +5 -5
- package/contextual-help/definition.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/country/definition.cjs +5 -5
- package/country/definition.js +1 -1
- package/country/index.cjs +1 -12
- package/country/index.js +4 -1216
- package/country-group/definition.cjs +6 -0
- package/country-group/definition.js +3 -0
- package/country-group/index.cjs +43 -0
- package/country-group/index.js +166 -0
- package/custom-elements.json +1112 -450
- package/data-grid/definition.cjs +9 -9
- package/data-grid/definition.js +2 -2
- package/data-grid/index.cjs +4 -4
- package/data-grid/index.js +47 -46
- package/date-picker/definition.cjs +5 -5
- package/date-picker/definition.js +2 -2
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/date-range-picker/definition.cjs +5 -5
- package/date-range-picker/definition.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-time-picker/definition.cjs +5 -5
- package/date-time-picker/definition.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +1 -1
- package/dial-pad/definition.cjs +5 -5
- package/dial-pad/definition.js +2 -2
- package/dial-pad/index.cjs +4 -4
- package/dial-pad/index.js +9 -8
- package/dialog/definition.cjs +5 -5
- package/dialog/definition.js +2 -2
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +12 -11
- package/divider/definition.cjs +1 -1
- package/divider/definition.js +1 -1
- package/empty-state/definition.cjs +5 -5
- package/empty-state/definition.js +2 -2
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +6 -5
- package/fab/definition.cjs +5 -5
- package/fab/definition.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +5 -4
- package/file-picker/definition.cjs +5 -5
- package/file-picker/definition.js +2 -2
- package/file-picker/index.cjs +6 -6
- package/file-picker/index.js +9 -8
- package/flag/definition.cjs +6 -0
- package/flag/definition.js +3 -0
- package/flag/index.cjs +10 -0
- package/flag/index.js +61 -0
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +1 -0
- package/icon/definition.js +1 -0
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -0
- package/index.cjs +183 -174
- package/index.js +48 -45
- package/layout/definition.cjs +1 -1
- package/layout/definition.js +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/components.d.ts +2 -0
- package/lib/country/countries-data.d.ts +1 -0
- package/lib/country/{country-code-to-flag-icon.d.ts → utils.d.ts} +0 -3
- package/lib/country-group/country-group.d.ts +829 -0
- package/lib/country-group/country-group.template.d.ts +3 -0
- package/lib/country-group/definition.d.ts +3 -0
- package/lib/country-group/index.d.ts +1 -0
- package/lib/country-group/locale.d.ts +3 -0
- package/lib/date-picker/date-picker.d.ts +4 -0
- package/lib/date-range-picker/date-range-picker.d.ts +2 -0
- package/lib/date-time-picker/date-time-picker.d.ts +4 -0
- package/lib/flag/definition.d.ts +3 -0
- package/lib/flag/flag.d.ts +8 -0
- package/lib/flag/flag.template.d.ts +3 -0
- package/lib/flag/index.d.ts +1 -0
- package/lib/icon/icon.d.ts +1 -2
- package/lib/searchable-select/option-tag.d.ts +3 -1
- package/lib/searchable-select/searchable-select.d.ts +3 -1
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/time-picker/time-picker.d.ts +2 -0
- package/locales/de-DE.cjs +1 -0
- package/locales/de-DE.js +1 -0
- package/locales/en-GB.cjs +1 -0
- package/locales/en-GB.js +1 -0
- package/locales/en-US.cjs +1 -0
- package/locales/en-US.js +1 -0
- package/locales/ja-JP.cjs +1 -0
- package/locales/ja-JP.js +1 -0
- package/locales/zh-CN.cjs +1 -0
- package/locales/zh-CN.js +1 -0
- package/menu/definition.cjs +5 -5
- package/menu/definition.js +1 -1
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/definition.cjs +6 -6
- package/menu-item/definition.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav/definition.cjs +1 -1
- package/nav/definition.js +1 -1
- package/nav-disclosure/definition.cjs +5 -5
- package/nav-disclosure/definition.js +2 -2
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +6 -5
- package/nav-item/definition.cjs +5 -5
- package/nav-item/definition.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +5 -4
- package/note/definition.cjs +5 -5
- package/note/definition.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +5 -4
- package/number-field/definition.cjs +5 -5
- package/number-field/definition.js +2 -2
- package/number-field/index.cjs +2 -2
- package/number-field/index.js +6 -5
- package/option/definition.cjs +5 -5
- package/option/definition.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +4 -4
- package/pagination/definition.cjs +5 -5
- package/pagination/definition.js +2 -2
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popover/definition.cjs +5 -5
- package/popover/definition.js +2 -2
- package/popover/index.cjs +4 -4
- package/popover/index.js +7 -6
- package/popup/definition.cjs +4 -4
- package/popup/definition.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/definition.cjs +1 -1
- package/progress/definition.js +1 -1
- package/radio/definition.cjs +1 -1
- package/radio/definition.js +1 -1
- package/radio-group/definition.cjs +5 -5
- package/radio-group/definition.js +2 -2
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/definition.cjs +5 -5
- package/range-slider/definition.js +2 -2
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +22 -19
- package/rich-text-editor/definition.cjs +32 -32
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +2 -2
- package/rich-text-view/definition.cjs +1 -1
- package/rich-text-view/definition.js +1 -1
- package/searchable-select/definition.cjs +4 -4
- package/searchable-select/definition.js +2 -2
- package/searchable-select/index.cjs +6 -4
- package/searchable-select/index.js +76 -73
- package/select/definition.cjs +5 -5
- package/select/definition.js +2 -2
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/definition.cjs +5 -5
- package/selectable-box/definition.js +2 -2
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/icon/utils.d.ts +1 -0
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +1 -0
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +1 -0
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1 -0
- package/shared/picker-field/mixins/single-date-picker.d.ts +1 -0
- package/shared/picker-field/mixins/single-value-picker.d.ts +1 -0
- package/shared/picker-field/mixins/time-selection-picker.d.ts +1 -0
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +2 -0
- package/shared/picker-field/picker-field.d.ts +2 -0
- package/side-drawer/definition.cjs +1 -1
- package/side-drawer/definition.js +1 -1
- package/simple-color-picker/definition.cjs +5 -5
- package/simple-color-picker/definition.js +2 -2
- package/simple-color-picker/index.cjs +2 -2
- package/simple-color-picker/index.js +6 -5
- package/slider/definition.cjs +5 -5
- package/slider/definition.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/definition.cjs +5 -5
- package/split-button/definition.js +2 -2
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +7 -6
- package/status/definition.cjs +5 -5
- package/status/definition.js +2 -2
- package/status/index.cjs +2 -2
- package/status/index.js +5 -4
- package/switch/definition.cjs +5 -5
- package/switch/definition.js +2 -2
- package/switch/index.cjs +2 -2
- package/switch/index.js +6 -5
- package/tab/definition.cjs +5 -5
- package/tab/definition.js +2 -2
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/definition.cjs +1 -1
- package/tab-panel/definition.js +1 -1
- package/table/definition.cjs +17 -17
- package/table/definition.js +2 -2
- package/table/index.cjs +3 -3
- package/table/index.js +6 -5
- package/tabs/definition.cjs +6 -6
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/definition.cjs +5 -5
- package/tag/definition.js +2 -2
- package/tag/index.cjs +4 -4
- package/tag/index.js +6 -5
- package/tag-group/definition.cjs +1 -1
- package/tag-group/definition.js +1 -1
- package/text-area/definition.cjs +5 -5
- package/text-area/definition.js +2 -2
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/definition.cjs +5 -5
- package/text-field/definition.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/definition.cjs +4 -4
- package/time-picker/definition.js +2 -2
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +5 -5
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +5 -5
- package/tooltip/definition.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/definition.cjs +5 -5
- package/tree-item/definition.js +2 -2
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/definition.cjs +5 -5
- package/tree-view/definition.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/unbundled/definition11.cjs +6 -0
- package/unbundled/definition11.js +6 -0
- package/unbundled/definition14.cjs +1 -0
- package/unbundled/definition14.js +1 -0
- package/unbundled/definition2.cjs +5 -75
- package/unbundled/definition2.js +1 -71
- package/unbundled/definition28.cjs +1 -0
- package/unbundled/definition28.js +1 -0
- package/unbundled/definition31.cjs +2 -1189
- package/unbundled/definition31.js +1 -1188
- package/unbundled/definition32.cjs +207 -1835
- package/unbundled/definition32.js +203 -1807
- package/unbundled/definition33.cjs +83 -311
- package/unbundled/definition33.js +79 -235
- package/unbundled/definition34.cjs +1887 -25
- package/unbundled/definition34.js +1857 -24
- package/unbundled/definition35.cjs +315 -121
- package/unbundled/definition35.js +236 -114
- package/unbundled/definition36.cjs +25 -405
- package/unbundled/definition36.js +22 -397
- package/unbundled/definition37.cjs +47 -142
- package/unbundled/definition37.js +44 -139
- package/unbundled/definition38.cjs +345 -330
- package/unbundled/definition38.js +343 -328
- package/unbundled/definition39.cjs +183 -235
- package/unbundled/definition39.js +181 -233
- package/unbundled/definition40.cjs +377 -47
- package/unbundled/definition40.js +372 -42
- package/unbundled/definition41.cjs +256 -57
- package/unbundled/definition41.js +255 -56
- package/unbundled/definition42.cjs +45 -432
- package/unbundled/definition42.js +41 -428
- package/unbundled/definition43.cjs +63 -49
- package/unbundled/definition43.js +61 -47
- package/unbundled/definition44.cjs +438 -30
- package/unbundled/definition44.js +434 -25
- package/unbundled/definition45.cjs +46 -84
- package/unbundled/definition45.js +43 -81
- package/unbundled/definition46.cjs +29 -54
- package/unbundled/definition46.js +24 -50
- package/unbundled/definition47.cjs +93 -21
- package/unbundled/definition47.js +91 -16
- package/unbundled/definition48.cjs +49 -33
- package/unbundled/definition48.js +46 -30
- package/unbundled/definition49.cjs +22 -347
- package/unbundled/definition49.js +16 -344
- package/unbundled/definition50.cjs +34 -211
- package/unbundled/definition50.js +30 -207
- package/unbundled/definition51.cjs +282 -242
- package/unbundled/definition51.js +275 -235
- package/unbundled/definition52.cjs +211 -51
- package/unbundled/definition52.js +209 -48
- package/unbundled/definition53.cjs +275 -131
- package/unbundled/definition53.js +272 -127
- package/unbundled/definition54.cjs +50 -261
- package/unbundled/definition54.js +48 -260
- package/unbundled/definition55.cjs +126 -443
- package/unbundled/definition55.js +123 -441
- package/unbundled/definition56.cjs +234 -3596
- package/unbundled/definition56.js +229 -3428
- package/unbundled/definition57.cjs +407 -728
- package/unbundled/definition57.js +405 -726
- package/unbundled/definition58.cjs +3618 -106
- package/unbundled/definition58.js +3449 -100
- package/unbundled/definition59.cjs +624 -868
- package/unbundled/definition59.js +619 -863
- package/unbundled/definition60.cjs +106 -108
- package/unbundled/definition60.js +102 -104
- package/unbundled/definition61.cjs +1040 -71
- package/unbundled/definition61.js +1035 -65
- package/unbundled/definition62.cjs +105 -169
- package/unbundled/definition62.js +101 -165
- package/unbundled/definition63.cjs +70 -113
- package/unbundled/definition63.js +65 -109
- package/unbundled/definition64.cjs +181 -53
- package/unbundled/definition64.js +178 -50
- package/unbundled/definition65.cjs +109 -76
- package/unbundled/definition65.js +109 -75
- package/unbundled/definition66.cjs +58 -21
- package/unbundled/definition66.js +55 -15
- package/unbundled/definition67.cjs +81 -74
- package/unbundled/definition67.js +79 -73
- package/unbundled/definition68.cjs +19 -344
- package/unbundled/definition68.js +14 -335
- package/unbundled/definition69.cjs +88 -26
- package/unbundled/definition69.js +85 -22
- package/unbundled/definition7.cjs +18 -3
- package/unbundled/definition7.js +18 -3
- package/unbundled/definition70.cjs +330 -111
- package/unbundled/definition70.js +320 -108
- package/unbundled/definition71.cjs +26 -271
- package/unbundled/definition71.js +21 -267
- package/unbundled/definition72.cjs +134 -27
- package/unbundled/definition72.js +125 -25
- package/unbundled/definition73.cjs +245 -113
- package/unbundled/definition73.js +242 -104
- package/unbundled/definition74.cjs +28 -212
- package/unbundled/definition74.js +26 -202
- package/unbundled/definition75.cjs +117 -479
- package/unbundled/definition75.js +109 -475
- package/unbundled/definition76.cjs +232 -0
- package/unbundled/definition76.js +213 -0
- package/unbundled/definition77.cjs +533 -0
- package/unbundled/definition77.js +513 -0
- package/unbundled/numberConverter.cjs +91 -0
- package/unbundled/numberConverter.js +74 -0
- package/unbundled/picker-field.template.cjs +2 -0
- package/unbundled/picker-field.template.js +2 -0
- package/unbundled/utils.cjs +1439 -0
- package/unbundled/utils.js +1428 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +1 -1
- package/video-player/definition.js +1 -1
- package/vivid.api.json +513 -0
- /package/{lib/icon/icon.placeholder.d.ts → shared/icon/icon-placeholder.d.ts} +0 -0
|
@@ -1,149 +1,147 @@
|
|
|
1
1
|
require("./chunk.cjs");
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_decorate = require("./decorate.cjs");
|
|
4
|
-
const
|
|
5
|
-
const require_enums = require("./enums.cjs");
|
|
6
|
-
const require_definition = require("./definition23.cjs");
|
|
7
|
-
const require_definition$1 = require("./definition53.cjs");
|
|
4
|
+
const require_slottable_request = require("./slottable-request.cjs");
|
|
8
5
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
9
|
-
let
|
|
10
|
-
//#region src/lib/
|
|
11
|
-
var
|
|
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}";
|
|
12
9
|
//#endregion
|
|
13
|
-
//#region src/lib/
|
|
10
|
+
//#region src/lib/rich-text-view/rich-text-view.ts
|
|
14
11
|
/**
|
|
15
12
|
* @public
|
|
16
|
-
* @component
|
|
17
|
-
* @
|
|
18
|
-
* @event {CustomEvent<undefined>} change - Fired when the checked state changes
|
|
19
|
-
* @testAction check check #control
|
|
20
|
-
* @testAction uncheck uncheck #control
|
|
21
|
-
* @testQuery checked checked true
|
|
22
|
-
* @testQuery unchecked checked false
|
|
23
|
-
* @testRef control nestedShadow [data-vvd-component].control div.control
|
|
13
|
+
* @component rich-text-view
|
|
14
|
+
* @dynamicSlot `@vonage/vivid#RteChildSlotProps` child - Used for custom rendered children.
|
|
24
15
|
*/
|
|
25
|
-
var
|
|
16
|
+
var RichTextView = class extends require_vivid_element.VividElement {
|
|
26
17
|
constructor(..._args) {
|
|
27
18
|
super(..._args);
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.
|
|
32
|
-
this.disabled = false;
|
|
19
|
+
this._slotCounter = 0;
|
|
20
|
+
this._slottedChildren = /* @__PURE__ */ new Set();
|
|
21
|
+
this._slotRequests = /* @__PURE__ */ new Set();
|
|
22
|
+
this._contentElement = null;
|
|
33
23
|
}
|
|
34
24
|
/**
|
|
35
25
|
* @internal
|
|
36
26
|
*/
|
|
37
|
-
|
|
38
|
-
if (this.
|
|
39
|
-
if (
|
|
40
|
-
this.
|
|
41
|
-
|
|
27
|
+
viewChanged(oldView, newView) {
|
|
28
|
+
if (oldView) this._removeStyles();
|
|
29
|
+
if (newView) this._addStyles(newView);
|
|
30
|
+
this._updateView();
|
|
31
|
+
}
|
|
32
|
+
_addStyles(view) {
|
|
33
|
+
const config = view[require_slottable_request.impl].config[require_slottable_request.impl];
|
|
34
|
+
this._styles = new _microsoft_fast_element.ElementStyles(require_slottable_request.sortedContributions(config.features.flatMap((f) => f.getStyles())));
|
|
35
|
+
this._styles.addStylesTo(this.shadowRoot);
|
|
36
|
+
}
|
|
37
|
+
_removeStyles() {
|
|
38
|
+
if (this._styles) {
|
|
39
|
+
this._styles.removeStylesFrom(this.shadowRoot);
|
|
40
|
+
this._styles = void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_cleanupLightDom() {
|
|
44
|
+
for (const el of this._slottedChildren) this.removeChild(el);
|
|
45
|
+
for (const slotName of this._slotRequests) require_slottable_request.dispatchSlottableRequest(this, "child", slotName, require_slottable_request.removeSymbol);
|
|
46
|
+
this._slottedChildren.clear();
|
|
47
|
+
this._slotRequests.clear();
|
|
48
|
+
this._slotCounter = 0;
|
|
49
|
+
}
|
|
50
|
+
_updateView() {
|
|
51
|
+
if (!this._contentElement) return;
|
|
52
|
+
this._contentElement.innerHTML = "";
|
|
53
|
+
this._cleanupLightDom();
|
|
54
|
+
if (this.view) this._contentElement.appendChild(this._renderView(this.view));
|
|
55
|
+
}
|
|
56
|
+
_renderView(rteView) {
|
|
57
|
+
const ctx = rteView[require_slottable_request.impl];
|
|
58
|
+
if (rteView.type === "node" && rteView.node.type === "doc") rteView = rteView.children;
|
|
59
|
+
if (rteView.type === "fragment") {
|
|
60
|
+
const frag = document.createDocumentFragment();
|
|
61
|
+
for (const child of rteView.content) frag.appendChild(this._renderView(child));
|
|
62
|
+
return frag;
|
|
63
|
+
}
|
|
64
|
+
const customRenderedView = ctx.options.renderChildView?.(rteView) ?? false;
|
|
65
|
+
if (customRenderedView) return this._handleCustomRender(rteView, customRenderedView);
|
|
66
|
+
else return this._renderDefault(rteView);
|
|
67
|
+
}
|
|
68
|
+
_handleCustomRender(rteView, customResult) {
|
|
69
|
+
const slotName = `child-view-${this._slotCounter++}`;
|
|
70
|
+
const slot = document.createElement("slot");
|
|
71
|
+
slot.setAttribute("name", slotName);
|
|
72
|
+
if (customResult === true) {
|
|
73
|
+
this._slotRequests.add(slotName);
|
|
74
|
+
require_slottable_request.dispatchSlottableRequest(this, "child", slotName, { view: rteView });
|
|
75
|
+
} else {
|
|
76
|
+
const { dom, contentDom = dom } = customResult;
|
|
77
|
+
const nestedView = document.createElement(this.tagName);
|
|
78
|
+
nestedView.view = rteView.children;
|
|
79
|
+
contentDom.appendChild(nestedView);
|
|
80
|
+
dom.setAttribute("slot", slotName);
|
|
81
|
+
this.appendChild(dom);
|
|
82
|
+
this._slottedChildren.add(dom);
|
|
83
|
+
}
|
|
84
|
+
return slot;
|
|
85
|
+
}
|
|
86
|
+
_renderDefault(view) {
|
|
87
|
+
const schema = view[require_slottable_request.impl].config[require_slottable_request.impl].schema;
|
|
88
|
+
if (view.type === "node" && view.node.type === "text") return document.createTextNode(view.node.text);
|
|
89
|
+
const item = view.type === "node" ? view.node : view.mark;
|
|
90
|
+
const pmItem = view.type === "node" ? prosemirror_model.Node.fromJSON(schema, item) : prosemirror_model.Mark.fromJSON(schema, item);
|
|
91
|
+
const spec = pmItem instanceof prosemirror_model.Node ? pmItem.type.spec.toDOM(pmItem) : pmItem.type.spec.toDOM(pmItem, true);
|
|
92
|
+
const { dom, contentDOM = dom } = prosemirror_model.DOMSerializer.renderSpec(document, spec);
|
|
93
|
+
const childrenRendered = this._renderView(view.children);
|
|
94
|
+
contentDOM.appendChild(childrenRendered);
|
|
95
|
+
return dom;
|
|
42
96
|
}
|
|
43
97
|
/**
|
|
44
98
|
* @internal
|
|
45
99
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
100
|
+
connectedCallback() {
|
|
101
|
+
super.connectedCallback();
|
|
102
|
+
this._updateView();
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
disconnectedCallback() {
|
|
108
|
+
super.disconnectedCallback();
|
|
109
|
+
this._removeStyles();
|
|
110
|
+
this._cleanupLightDom();
|
|
50
111
|
}
|
|
51
112
|
};
|
|
52
|
-
require_decorate.__decorate([
|
|
53
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
54
|
-
attribute: "clickable-box",
|
|
55
|
-
mode: "boolean"
|
|
56
|
-
})], SelectableBox.prototype, "clickableBox", void 0);
|
|
57
|
-
require_decorate.__decorate([_microsoft_fast_element.attr], SelectableBox.prototype, "connotation", void 0);
|
|
58
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "control-type" })], SelectableBox.prototype, "controlType", void 0);
|
|
59
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
60
|
-
attribute: "control-placement",
|
|
61
|
-
mode: "fromView"
|
|
62
|
-
})], SelectableBox.prototype, "controlPlacement", void 0);
|
|
63
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SelectableBox.prototype, "tight", void 0);
|
|
64
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SelectableBox.prototype, "disabled", void 0);
|
|
113
|
+
require_decorate.__decorate([_microsoft_fast_element.observable], RichTextView.prototype, "view", void 0);
|
|
65
114
|
//#endregion
|
|
66
|
-
//#region src/lib/
|
|
67
|
-
var
|
|
68
|
-
function handleControlChange(x) {
|
|
69
|
-
if (!x.clickableBox) x._handleCheckedChange();
|
|
70
|
-
}
|
|
71
|
-
function checkbox(context) {
|
|
72
|
-
const checkboxTag = context.tagFor(require_definition.Checkbox);
|
|
73
|
-
return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => x.controlType !== "radio", _microsoft_fast_element.html`
|
|
74
|
-
<${checkboxTag}
|
|
75
|
-
${require_delegates_aria.delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
76
|
-
@change="${(x) => handleControlChange(x)}"
|
|
77
|
-
class="control checkbox ${(x) => x.controlPlacement}"
|
|
78
|
-
connotation="${(x) => x.connotation === "cta" ? require_enums.Connotation.CTA : require_enums.Connotation.Accent}"
|
|
79
|
-
:checked="${(x) => x.checked}"
|
|
80
|
-
?disabled="${(x) => x.disabled}"
|
|
81
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
82
|
-
></${checkboxTag}>`)} `;
|
|
83
|
-
}
|
|
84
|
-
function radio(context) {
|
|
85
|
-
const radioTag = context.tagFor(require_definition$1.Radio);
|
|
86
|
-
return _microsoft_fast_element.html`${(0, _microsoft_fast_element.when)((x) => x.controlType === "radio", _microsoft_fast_element.html`
|
|
87
|
-
<${radioTag}
|
|
88
|
-
${require_delegates_aria.delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
89
|
-
@change="${(x) => handleControlChange(x)}"
|
|
90
|
-
class="control radio ${(x) => x.controlPlacement}"
|
|
91
|
-
connotation="${(x) => x.connotation === "cta" ? require_enums.Connotation.CTA : require_enums.Connotation.Accent}"
|
|
92
|
-
:checked="${(x) => x.checked}"
|
|
93
|
-
?disabled="${(x) => x.disabled}"
|
|
94
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
95
|
-
></${radioTag}>`)} `;
|
|
96
|
-
}
|
|
97
|
-
var SelectableBoxTemplate = (context) => {
|
|
98
|
-
return _microsoft_fast_element.html`<template>
|
|
99
|
-
<div
|
|
100
|
-
class="${getClasses}"
|
|
101
|
-
tabindex="${(x) => x.clickableBox && !x.disabled ? "0" : null}"
|
|
102
|
-
${require_delegates_aria.delegateAria({
|
|
103
|
-
role: (x) => x.clickableBox ? "button" : null,
|
|
104
|
-
ariaPressed: (x) => x.clickableBox ? x.checked ? "true" : "false" : null,
|
|
105
|
-
ariaLabel: (x) => x.clickableBox ? x.ariaLabel : null,
|
|
106
|
-
ariaDisabled: (x) => x.clickableBox && x.disabled ? "true" : null
|
|
107
|
-
})}
|
|
108
|
-
@keydown="${(x, c) => x._handleKeydown(c.event)}"
|
|
109
|
-
@click="${(x) => x.clickableBox ? x._handleCheckedChange() : null}"
|
|
110
|
-
>
|
|
111
|
-
${checkbox(context)} ${radio(context)}
|
|
112
|
-
<slot></slot>
|
|
113
|
-
</div>
|
|
114
|
-
</template>`;
|
|
115
|
-
};
|
|
115
|
+
//#region src/lib/rich-text-view/rich-text-view.template.ts
|
|
116
|
+
var RichTextViewTemplate = () => _microsoft_fast_element.html`<div class="content rich-text" ${(0, _microsoft_fast_element.ref)("_contentElement")}></div>`;
|
|
116
117
|
//#endregion
|
|
117
|
-
//#region src/lib/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
*/
|
|
121
|
-
var selectableBoxDefinition = require_vivid_element.defineVividComponent("selectable-box", SelectableBox, SelectableBoxTemplate, [require_definition.checkboxDefinition, require_definition$1.radioDefinition], {
|
|
122
|
-
styles: selectable_box_default,
|
|
118
|
+
//#region src/lib/rich-text-view/definition.ts
|
|
119
|
+
var richTextViewDefinition = require_vivid_element.defineVividComponent("rich-text-view", RichTextView, RichTextViewTemplate, [], {
|
|
120
|
+
styles: rich_text_view_default,
|
|
123
121
|
shadowOptions: { delegatesFocus: true }
|
|
124
122
|
});
|
|
125
123
|
/**
|
|
126
|
-
* Registers the
|
|
124
|
+
* Registers the rich-text-view element with the design system.
|
|
127
125
|
*
|
|
128
126
|
* @param prefix - the prefix to use for the component name
|
|
129
127
|
*/
|
|
130
|
-
var
|
|
128
|
+
var registerRichTextView = require_vivid_element.createRegisterFunction(richTextViewDefinition);
|
|
131
129
|
//#endregion
|
|
132
|
-
Object.defineProperty(exports, "
|
|
130
|
+
Object.defineProperty(exports, "RichTextView", {
|
|
133
131
|
enumerable: true,
|
|
134
132
|
get: function() {
|
|
135
|
-
return
|
|
133
|
+
return RichTextView;
|
|
136
134
|
}
|
|
137
135
|
});
|
|
138
|
-
Object.defineProperty(exports, "
|
|
136
|
+
Object.defineProperty(exports, "registerRichTextView", {
|
|
139
137
|
enumerable: true,
|
|
140
138
|
get: function() {
|
|
141
|
-
return
|
|
139
|
+
return registerRichTextView;
|
|
142
140
|
}
|
|
143
141
|
});
|
|
144
|
-
Object.defineProperty(exports, "
|
|
142
|
+
Object.defineProperty(exports, "richTextViewDefinition", {
|
|
145
143
|
enumerable: true,
|
|
146
144
|
get: function() {
|
|
147
|
-
return
|
|
145
|
+
return richTextViewDefinition;
|
|
148
146
|
}
|
|
149
147
|
});
|
|
@@ -1,131 +1,129 @@
|
|
|
1
1
|
import { o as defineVividComponent, s as createRegisterFunction, t as VividElement } from "./vivid-element.js";
|
|
2
2
|
import { t as __decorate } from "./decorate.js";
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { classNames } from "@microsoft/fast-web-utilities";
|
|
9
|
-
//#region src/lib/selectable-box/selectable-box.scss?inline
|
|
10
|
-
var selectable_box_default = ":host{display:flex}.base.connotation-cta{--_connotation-color-firm-all:var(--vvd-selectable-box-cta-firm-all,var(--vvd-color-cta-600));--_connotation-color-pale:var(--vvd-selectable-box-cta-pale,var(--vvd-color-cta-300));--_connotation-color-fierce:var(--vvd-selectable-box-cta-fierce,var(--vvd-color-cta-700));--_connotation-color-faint:var(--vvd-selectable-box-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-selectable-box-cta-soft,var(--vvd-color-cta-100))}.base:not(.connotation-cta){--_connotation-color-firm-all:var(--vvd-selectable-box-accent-firm-all,var(--vvd-color-neutral-600));--_connotation-color-pale:var(--vvd-selectable-box-accent-pale,var(--vvd-color-neutral-300));--_connotation-color-fierce:var(--vvd-selectable-box-accent-fierce,var(--vvd-color-neutral-700));--_connotation-color-faint:var(--vvd-selectable-box-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-selectable-box-accent-soft,var(--vvd-color-neutral-100))}.base{--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-pale)}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-firm-all)}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--_connotation-color-firm-all)}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:var(--_connotation-color-pale)}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:var(--_connotation-color-firm-all)}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm-all);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:var(--_connotation-color-firm-all)}.base:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:var(--vvd-color-neutral-100)}.base{--control-offset:calc(var(--selectable-box-spacing,16px) + 36px);padding:var(--selectable-box-spacing,16px);border:1px solid var(--_appearance-color-outline);background-color:var(--_appearance-color-fill);text-align:start;border-radius:8px;inline-size:100%;position:relative}.base.control-placement-end-stacked,.base.control-placement-start-stacked{padding-block-start:var(--control-offset)}.base.control-placement-start{padding-inline-start:var(--control-offset)}.base.control-placement-end{padding-inline-end:var(--control-offset)}.base:focus-visible{--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))}.base.tight{min-height:calc(var(--selectable-box-spacing,16px) * 2 + 22px);padding:0;overflow:hidden}.base.selected{background-color:var(--selectable-box-checked-bg,var(--_appearance-color-fill))}.base.clickable{cursor:pointer}.control{position:absolute;inset-block-start:var(--selectable-box-spacing,16px)}.control.start-stacked,.control.start{inset-inline-start:var(--selectable-box-spacing,16px)}.control.end-stacked,.control.end{inset-inline-end:var(--selectable-box-spacing,16px)}";
|
|
3
|
+
import { c as impl, n as removeSymbol, s as sortedContributions, t as dispatchSlottableRequest } from "./slottable-request.js";
|
|
4
|
+
import { ElementStyles, html, observable, ref } from "@microsoft/fast-element";
|
|
5
|
+
import { DOMSerializer, Mark, Node } from "prosemirror-model";
|
|
6
|
+
//#region src/lib/rich-text-view/rich-text-view.scss?inline
|
|
7
|
+
var rich_text_view_default = ":host{display:contents}.content{overflow-wrap:break-word;white-space:break-spaces;display:contents}";
|
|
11
8
|
//#endregion
|
|
12
|
-
//#region src/lib/
|
|
9
|
+
//#region src/lib/rich-text-view/rich-text-view.ts
|
|
13
10
|
/**
|
|
14
11
|
* @public
|
|
15
|
-
* @component
|
|
16
|
-
* @
|
|
17
|
-
* @event {CustomEvent<undefined>} change - Fired when the checked state changes
|
|
18
|
-
* @testAction check check #control
|
|
19
|
-
* @testAction uncheck uncheck #control
|
|
20
|
-
* @testQuery checked checked true
|
|
21
|
-
* @testQuery unchecked checked false
|
|
22
|
-
* @testRef control nestedShadow [data-vvd-component].control div.control
|
|
12
|
+
* @component rich-text-view
|
|
13
|
+
* @dynamicSlot `@vonage/vivid#RteChildSlotProps` child - Used for custom rendered children.
|
|
23
14
|
*/
|
|
24
|
-
var
|
|
15
|
+
var RichTextView = class extends VividElement {
|
|
25
16
|
constructor(..._args) {
|
|
26
17
|
super(..._args);
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this.
|
|
30
|
-
this.
|
|
31
|
-
this.disabled = false;
|
|
18
|
+
this._slotCounter = 0;
|
|
19
|
+
this._slottedChildren = /* @__PURE__ */ new Set();
|
|
20
|
+
this._slotRequests = /* @__PURE__ */ new Set();
|
|
21
|
+
this._contentElement = null;
|
|
32
22
|
}
|
|
33
23
|
/**
|
|
34
24
|
* @internal
|
|
35
25
|
*/
|
|
36
|
-
|
|
37
|
-
if (this.
|
|
38
|
-
if (
|
|
39
|
-
this.
|
|
40
|
-
|
|
26
|
+
viewChanged(oldView, newView) {
|
|
27
|
+
if (oldView) this._removeStyles();
|
|
28
|
+
if (newView) this._addStyles(newView);
|
|
29
|
+
this._updateView();
|
|
30
|
+
}
|
|
31
|
+
_addStyles(view) {
|
|
32
|
+
const config = view[impl].config[impl];
|
|
33
|
+
this._styles = new ElementStyles(sortedContributions(config.features.flatMap((f) => f.getStyles())));
|
|
34
|
+
this._styles.addStylesTo(this.shadowRoot);
|
|
35
|
+
}
|
|
36
|
+
_removeStyles() {
|
|
37
|
+
if (this._styles) {
|
|
38
|
+
this._styles.removeStylesFrom(this.shadowRoot);
|
|
39
|
+
this._styles = void 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
_cleanupLightDom() {
|
|
43
|
+
for (const el of this._slottedChildren) this.removeChild(el);
|
|
44
|
+
for (const slotName of this._slotRequests) dispatchSlottableRequest(this, "child", slotName, removeSymbol);
|
|
45
|
+
this._slottedChildren.clear();
|
|
46
|
+
this._slotRequests.clear();
|
|
47
|
+
this._slotCounter = 0;
|
|
48
|
+
}
|
|
49
|
+
_updateView() {
|
|
50
|
+
if (!this._contentElement) return;
|
|
51
|
+
this._contentElement.innerHTML = "";
|
|
52
|
+
this._cleanupLightDom();
|
|
53
|
+
if (this.view) this._contentElement.appendChild(this._renderView(this.view));
|
|
54
|
+
}
|
|
55
|
+
_renderView(rteView) {
|
|
56
|
+
const ctx = rteView[impl];
|
|
57
|
+
if (rteView.type === "node" && rteView.node.type === "doc") rteView = rteView.children;
|
|
58
|
+
if (rteView.type === "fragment") {
|
|
59
|
+
const frag = document.createDocumentFragment();
|
|
60
|
+
for (const child of rteView.content) frag.appendChild(this._renderView(child));
|
|
61
|
+
return frag;
|
|
62
|
+
}
|
|
63
|
+
const customRenderedView = ctx.options.renderChildView?.(rteView) ?? false;
|
|
64
|
+
if (customRenderedView) return this._handleCustomRender(rteView, customRenderedView);
|
|
65
|
+
else return this._renderDefault(rteView);
|
|
66
|
+
}
|
|
67
|
+
_handleCustomRender(rteView, customResult) {
|
|
68
|
+
const slotName = `child-view-${this._slotCounter++}`;
|
|
69
|
+
const slot = document.createElement("slot");
|
|
70
|
+
slot.setAttribute("name", slotName);
|
|
71
|
+
if (customResult === true) {
|
|
72
|
+
this._slotRequests.add(slotName);
|
|
73
|
+
dispatchSlottableRequest(this, "child", slotName, { view: rteView });
|
|
74
|
+
} else {
|
|
75
|
+
const { dom, contentDom = dom } = customResult;
|
|
76
|
+
const nestedView = document.createElement(this.tagName);
|
|
77
|
+
nestedView.view = rteView.children;
|
|
78
|
+
contentDom.appendChild(nestedView);
|
|
79
|
+
dom.setAttribute("slot", slotName);
|
|
80
|
+
this.appendChild(dom);
|
|
81
|
+
this._slottedChildren.add(dom);
|
|
82
|
+
}
|
|
83
|
+
return slot;
|
|
84
|
+
}
|
|
85
|
+
_renderDefault(view) {
|
|
86
|
+
const schema = view[impl].config[impl].schema;
|
|
87
|
+
if (view.type === "node" && view.node.type === "text") return document.createTextNode(view.node.text);
|
|
88
|
+
const item = view.type === "node" ? view.node : view.mark;
|
|
89
|
+
const pmItem = view.type === "node" ? Node.fromJSON(schema, item) : Mark.fromJSON(schema, item);
|
|
90
|
+
const spec = pmItem instanceof Node ? pmItem.type.spec.toDOM(pmItem) : pmItem.type.spec.toDOM(pmItem, true);
|
|
91
|
+
const { dom, contentDOM = dom } = DOMSerializer.renderSpec(document, spec);
|
|
92
|
+
const childrenRendered = this._renderView(view.children);
|
|
93
|
+
contentDOM.appendChild(childrenRendered);
|
|
94
|
+
return dom;
|
|
41
95
|
}
|
|
42
96
|
/**
|
|
43
97
|
* @internal
|
|
44
98
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
99
|
+
connectedCallback() {
|
|
100
|
+
super.connectedCallback();
|
|
101
|
+
this._updateView();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
disconnectedCallback() {
|
|
107
|
+
super.disconnectedCallback();
|
|
108
|
+
this._removeStyles();
|
|
109
|
+
this._cleanupLightDom();
|
|
49
110
|
}
|
|
50
111
|
};
|
|
51
|
-
__decorate([
|
|
52
|
-
__decorate([attr({
|
|
53
|
-
attribute: "clickable-box",
|
|
54
|
-
mode: "boolean"
|
|
55
|
-
})], SelectableBox.prototype, "clickableBox", void 0);
|
|
56
|
-
__decorate([attr], SelectableBox.prototype, "connotation", void 0);
|
|
57
|
-
__decorate([attr({ attribute: "control-type" })], SelectableBox.prototype, "controlType", void 0);
|
|
58
|
-
__decorate([attr({
|
|
59
|
-
attribute: "control-placement",
|
|
60
|
-
mode: "fromView"
|
|
61
|
-
})], SelectableBox.prototype, "controlPlacement", void 0);
|
|
62
|
-
__decorate([attr({ mode: "boolean" })], SelectableBox.prototype, "tight", void 0);
|
|
63
|
-
__decorate([attr({ mode: "boolean" })], SelectableBox.prototype, "disabled", void 0);
|
|
112
|
+
__decorate([observable], RichTextView.prototype, "view", void 0);
|
|
64
113
|
//#endregion
|
|
65
|
-
//#region src/lib/
|
|
66
|
-
var
|
|
67
|
-
function handleControlChange(x) {
|
|
68
|
-
if (!x.clickableBox) x._handleCheckedChange();
|
|
69
|
-
}
|
|
70
|
-
function checkbox(context) {
|
|
71
|
-
const checkboxTag = context.tagFor(Checkbox);
|
|
72
|
-
return html`${when((x) => x.controlType !== "radio", html`
|
|
73
|
-
<${checkboxTag}
|
|
74
|
-
${delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
75
|
-
@change="${(x) => handleControlChange(x)}"
|
|
76
|
-
class="control checkbox ${(x) => x.controlPlacement}"
|
|
77
|
-
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
78
|
-
:checked="${(x) => x.checked}"
|
|
79
|
-
?disabled="${(x) => x.disabled}"
|
|
80
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
81
|
-
></${checkboxTag}>`)} `;
|
|
82
|
-
}
|
|
83
|
-
function radio(context) {
|
|
84
|
-
const radioTag = context.tagFor(Radio);
|
|
85
|
-
return html`${when((x) => x.controlType === "radio", html`
|
|
86
|
-
<${radioTag}
|
|
87
|
-
${delegateAria({ ariaLabel: (x) => !x.clickableBox && x.ariaLabel ? x.ariaLabel : null }, { onlySpecified: true })}
|
|
88
|
-
@change="${(x) => handleControlChange(x)}"
|
|
89
|
-
class="control radio ${(x) => x.controlPlacement}"
|
|
90
|
-
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
91
|
-
:checked="${(x) => x.checked}"
|
|
92
|
-
?disabled="${(x) => x.disabled}"
|
|
93
|
-
inert="${(x) => x.clickableBox ? true : null}"
|
|
94
|
-
></${radioTag}>`)} `;
|
|
95
|
-
}
|
|
96
|
-
var SelectableBoxTemplate = (context) => {
|
|
97
|
-
return html`<template>
|
|
98
|
-
<div
|
|
99
|
-
class="${getClasses}"
|
|
100
|
-
tabindex="${(x) => x.clickableBox && !x.disabled ? "0" : null}"
|
|
101
|
-
${delegateAria({
|
|
102
|
-
role: (x) => x.clickableBox ? "button" : null,
|
|
103
|
-
ariaPressed: (x) => x.clickableBox ? x.checked ? "true" : "false" : null,
|
|
104
|
-
ariaLabel: (x) => x.clickableBox ? x.ariaLabel : null,
|
|
105
|
-
ariaDisabled: (x) => x.clickableBox && x.disabled ? "true" : null
|
|
106
|
-
})}
|
|
107
|
-
@keydown="${(x, c) => x._handleKeydown(c.event)}"
|
|
108
|
-
@click="${(x) => x.clickableBox ? x._handleCheckedChange() : null}"
|
|
109
|
-
>
|
|
110
|
-
${checkbox(context)} ${radio(context)}
|
|
111
|
-
<slot></slot>
|
|
112
|
-
</div>
|
|
113
|
-
</template>`;
|
|
114
|
-
};
|
|
114
|
+
//#region src/lib/rich-text-view/rich-text-view.template.ts
|
|
115
|
+
var RichTextViewTemplate = () => html`<div class="content rich-text" ${ref("_contentElement")}></div>`;
|
|
115
116
|
//#endregion
|
|
116
|
-
//#region src/lib/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*/
|
|
120
|
-
var selectableBoxDefinition = defineVividComponent("selectable-box", SelectableBox, SelectableBoxTemplate, [checkboxDefinition, radioDefinition], {
|
|
121
|
-
styles: selectable_box_default,
|
|
117
|
+
//#region src/lib/rich-text-view/definition.ts
|
|
118
|
+
var richTextViewDefinition = defineVividComponent("rich-text-view", RichTextView, RichTextViewTemplate, [], {
|
|
119
|
+
styles: rich_text_view_default,
|
|
122
120
|
shadowOptions: { delegatesFocus: true }
|
|
123
121
|
});
|
|
124
122
|
/**
|
|
125
|
-
* Registers the
|
|
123
|
+
* Registers the rich-text-view element with the design system.
|
|
126
124
|
*
|
|
127
125
|
* @param prefix - the prefix to use for the component name
|
|
128
126
|
*/
|
|
129
|
-
var
|
|
127
|
+
var registerRichTextView = createRegisterFunction(richTextViewDefinition);
|
|
130
128
|
//#endregion
|
|
131
|
-
export {
|
|
129
|
+
export { richTextViewDefinition as n, RichTextView as r, registerRichTextView as t };
|