@vonage/vivid 5.23.1 → 5.24.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/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/audio-player/index.cjs +2 -2
- package/audio-player/index.js +3 -3
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/bundled/definition15.cjs +8 -7
- package/bundled/definition15.js +26 -24
- package/bundled/definition17.cjs +2 -2
- package/bundled/definition17.js +2 -2
- package/bundled/definition18.cjs +12 -83
- package/bundled/definition18.js +35 -419
- package/bundled/definition19.cjs +87 -7
- package/bundled/definition19.js +432 -16
- package/bundled/definition20.cjs +7 -37
- package/bundled/definition20.js +17 -172
- package/bundled/definition21.cjs +35 -27
- package/bundled/definition21.js +154 -154
- package/bundled/definition22.cjs +29 -6
- package/bundled/definition22.js +172 -20
- package/bundled/definition23.cjs +6 -12
- package/bundled/definition23.js +17 -32
- package/bundled/definition24.cjs +12 -39
- package/bundled/definition24.js +32 -67
- package/bundled/definition25.cjs +44 -0
- package/bundled/definition25.js +77 -0
- package/bundled/extractOptions.cjs +1 -0
- package/bundled/extractOptions.js +11 -0
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +24 -11
- package/bundled/render-in-light-dom.cjs +1 -1
- package/bundled/render-in-light-dom.js +16 -19
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +9 -1
- package/combobox/definition.cjs +1 -1
- package/combobox/definition.js +1 -1
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +29 -21
- package/country/definition.cjs +1 -1
- package/country/definition.js +1 -1
- package/country/index.cjs +1 -1
- package/country/index.js +1 -1
- package/country-group/definition.cjs +1 -1
- package/country-group/definition.js +1 -1
- package/country-group/index.cjs +1 -1
- package/country-group/index.js +2 -2
- package/custom-elements.json +3102 -2842
- package/data-grid/definition.cjs +1 -1
- package/data-grid/definition.js +1 -1
- package/data-grid/index.cjs +4 -4
- package/data-grid/index.js +5 -5
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +1 -1
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +1 -1
- package/dial-pad/definition.cjs +1 -1
- package/dial-pad/definition.js +1 -1
- package/dial-pad/index.cjs +24 -24
- package/dial-pad/index.js +120 -51
- package/dialog/definition.cjs +1 -1
- package/dialog/definition.js +1 -1
- package/divider/definition.cjs +1 -1
- package/divider/definition.js +1 -1
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/empty-state/definition.cjs +1 -1
- package/empty-state/definition.js +1 -1
- package/fab/definition.cjs +1 -1
- package/fab/definition.js +1 -1
- package/file-picker/definition.cjs +1 -1
- package/file-picker/definition.js +1 -1
- package/flag/definition.cjs +1 -1
- package/flag/definition.js +1 -1
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/header/index.cjs +3 -3
- package/header/index.js +3 -3
- package/index.cjs +200 -196
- package/index.js +53 -52
- package/kbd-key/definition.cjs +1 -1
- package/kbd-key/definition.js +1 -1
- package/kbd-shortcut/definition.cjs +1 -1
- package/kbd-shortcut/definition.js +1 -1
- package/layout/definition.cjs +1 -1
- package/layout/definition.js +1 -1
- package/lib/accordion-item/accordion-item.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +1 -1
- package/lib/alert/alert.d.ts +2 -2
- package/lib/audio-player/audio-player.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +1 -1
- package/lib/badge/badge.d.ts +1 -1
- package/lib/banner/banner.d.ts +3 -3
- package/lib/breadcrumb/breadcrumb.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/button/button.d.ts +3 -3
- package/lib/calendar-event/calendar-event.d.ts +1 -1
- package/lib/card/card.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +6 -6
- package/lib/color-picker/color-picker.d.ts +7 -7
- package/lib/combobox/combobox.d.ts +7 -7
- package/lib/components.d.ts +1 -0
- package/lib/country-group/country-group.d.ts +2 -2
- package/lib/data-grid/data-grid-cell.d.ts +4 -3
- package/lib/data-grid/data-grid-row.d.ts +3 -2
- package/lib/data-grid/data-grid.options.d.ts +5 -0
- package/lib/date-picker/date-picker.d.ts +8 -8
- package/lib/date-range-picker/date-range-picker.d.ts +4 -4
- package/lib/date-time-picker/date-time-picker.d.ts +8 -8
- package/lib/dial-pad/dial-pad.d.ts +2 -1
- package/lib/dialog/dialog.d.ts +2 -2
- package/lib/divider/divider.d.ts +1 -1
- package/lib/fab/fab.d.ts +1 -1
- package/lib/file-picker/file-picker.d.ts +7 -7
- package/lib/header/header.d.ts +1 -1
- package/lib/menu/menu.d.ts +2 -2
- package/lib/menu-item/menu-item.d.ts +3 -3
- package/lib/nav/nav.d.ts +1 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
- package/lib/nav-item/nav-item.d.ts +2 -2
- package/lib/note/note.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +9 -9
- package/lib/optgroup/definition.d.ts +3 -0
- package/lib/optgroup/index.d.ts +1 -0
- package/lib/optgroup/optgroup.d.ts +430 -0
- package/lib/optgroup/optgroup.template.d.ts +2 -0
- package/lib/optgroup/variations.browser-spec.d.ts +1 -0
- package/lib/option/option.d.ts +2 -2
- package/lib/pagination/pagination.d.ts +1 -1
- package/lib/popover/popover.d.ts +2 -2
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +1 -1
- package/lib/radio/radio.d.ts +3 -3
- package/lib/radio-group/radio-group.d.ts +1 -1
- package/lib/range-slider/range-slider.d.ts +3 -3
- package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
- package/lib/searchable-select/option-tag.d.ts +1 -1
- package/lib/searchable-select/searchable-select.d.ts +47 -47
- package/lib/select/select.d.ts +9 -9
- package/lib/selectable-box/selectable-box.d.ts +1 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
- package/lib/slider/slider.d.ts +3 -3
- package/lib/split-button/split-button.d.ts +3 -3
- package/lib/status/status.d.ts +1 -1
- package/lib/switch/switch.d.ts +2 -2
- package/lib/tab/tab.d.ts +3 -3
- package/lib/tab-panel/tab-panel.d.ts +1 -1
- package/lib/table/table-cell.d.ts +1 -1
- package/lib/table/table-header-cell.d.ts +1 -1
- package/lib/table/table-row.d.ts +1 -1
- package/lib/table/table-sorting-button.d.ts +1 -1
- package/lib/tag/tag.d.ts +3 -3
- package/lib/tag-group/tag-group.d.ts +1 -1
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +8 -8
- package/lib/text-field/text-field.d.ts +9 -9
- package/lib/time-picker/time-picker.d.ts +4 -4
- package/lib/toggletip/toggletip.d.ts +2 -2
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +2 -2
- package/lib/tree-view/tree-view.d.ts +1 -1
- package/lib/video-player/video-player.d.ts +1 -1
- package/menu/index.cjs +1 -1
- package/menu/index.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 +1 -1
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.cjs +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.cjs +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/optgroup/definition.cjs +5 -0
- package/optgroup/definition.js +2 -0
- package/optgroup/index.cjs +1 -0
- package/optgroup/index.js +4 -0
- package/package.json +6 -6
- package/pagination/definition.cjs +1 -1
- package/pagination/definition.js +1 -1
- package/platform-switch/definition.cjs +1 -1
- package/platform-switch/definition.js +1 -1
- package/popover/definition.cjs +1 -1
- package/popover/definition.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 +1 -1
- package/radio-group/definition.js +1 -1
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +4 -4
- package/rich-text-view/definition.cjs +1 -1
- package/rich-text-view/definition.js +1 -1
- package/searchable-select/definition.cjs +1 -1
- package/searchable-select/definition.js +1 -1
- package/searchable-select/index.cjs +19 -19
- package/searchable-select/index.js +60 -45
- package/select/definition.cjs +1 -1
- package/select/definition.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/shared/aria/delegates-aria.d.ts +1 -1
- package/shared/aria/host-semantics.d.ts +1 -1
- package/shared/color-picker/base-color-picker.d.ts +1 -1
- package/shared/feedback/feedback-message.d.ts +1 -1
- package/shared/feedback/mixins.d.ts +2 -2
- package/shared/foundation/button/button.d.ts +2 -2
- package/shared/foundation/form-associated/form-associated.d.ts +2 -2
- package/shared/foundation/listbox/extractOptions.d.ts +2 -0
- package/shared/foundation/listbox/listbox.d.ts +2 -0
- package/shared/patterns/affix.d.ts +2 -2
- package/shared/patterns/anchored.d.ts +2 -2
- package/shared/patterns/char-count/char-count.d.ts +1 -1
- package/shared/patterns/form-elements/form-element.d.ts +1 -1
- package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
- package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
- package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
- package/shared/patterns/kbd-shortcut.d.ts +1 -1
- package/shared/patterns/linkable.d.ts +1 -1
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +1 -1
- package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
- package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
- package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
- package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
- package/shared/picker-field/picker-field.d.ts +7 -7
- package/side-drawer/definition.cjs +1 -1
- package/side-drawer/definition.js +1 -1
- package/simple-color-picker/definition.cjs +1 -1
- package/simple-color-picker/definition.js +1 -1
- package/split-button/definition.cjs +1 -1
- package/split-button/definition.js +1 -1
- package/split-button/index.cjs +1 -0
- package/split-button/index.js +1 -0
- package/status/definition.cjs +1 -1
- package/status/definition.js +1 -1
- package/switch/definition.cjs +1 -1
- package/switch/definition.js +1 -1
- package/switch/index.cjs +6 -5
- package/switch/index.js +16 -14
- package/tab/definition.cjs +1 -1
- package/tab/definition.js +1 -1
- package/tab-panel/definition.cjs +1 -1
- package/tab-panel/definition.js +1 -1
- package/table/definition.cjs +1 -1
- package/table/definition.js +1 -1
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +1 -1
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag-group/definition.cjs +1 -1
- package/tag-group/definition.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/definition13.cjs +1 -1
- package/unbundled/definition13.js +1 -1
- package/unbundled/definition2.cjs +9 -3
- package/unbundled/definition2.js +9 -3
- package/unbundled/definition23.cjs +1 -0
- package/unbundled/definition23.js +2 -1
- package/unbundled/definition29.cjs +2 -2
- package/unbundled/definition29.js +2 -2
- package/unbundled/definition30.cjs +65 -484
- package/unbundled/definition30.js +57 -482
- package/unbundled/definition31.cjs +501 -39
- package/unbundled/definition31.js +499 -37
- package/unbundled/definition32.cjs +38 -239
- package/unbundled/definition32.js +35 -236
- package/unbundled/definition33.cjs +236 -74
- package/unbundled/definition33.js +233 -71
- package/unbundled/definition34.cjs +74 -1968
- package/unbundled/definition34.js +70 -1940
- package/unbundled/definition35.cjs +1992 -26
- package/unbundled/definition35.js +1964 -27
- package/unbundled/definition36.cjs +26 -111
- package/unbundled/definition36.js +23 -103
- package/unbundled/definition37.cjs +53 -294
- package/unbundled/definition37.js +50 -291
- package/unbundled/definition38.cjs +282 -132
- package/unbundled/definition38.js +279 -129
- package/unbundled/definition39.cjs +165 -339
- package/unbundled/definition39.js +163 -337
- package/unbundled/definition40.cjs +394 -228
- package/unbundled/definition40.js +391 -225
- package/unbundled/definition41.cjs +263 -46
- package/unbundled/definition41.js +258 -41
- package/unbundled/definition42.cjs +47 -67
- package/unbundled/definition42.js +45 -65
- package/unbundled/definition43.cjs +56 -383
- package/unbundled/definition43.js +55 -382
- package/unbundled/definition44.cjs +386 -44
- package/unbundled/definition44.js +382 -40
- package/unbundled/definition45.cjs +53 -45
- package/unbundled/definition45.js +49 -41
- package/unbundled/definition46.cjs +40 -164
- package/unbundled/definition46.js +36 -160
- package/unbundled/definition47.cjs +171 -31
- package/unbundled/definition47.js +168 -22
- package/unbundled/definition48.cjs +30 -89
- package/unbundled/definition48.js +22 -87
- package/unbundled/definition49.cjs +70 -33
- package/unbundled/definition49.js +67 -30
- package/unbundled/definition50.cjs +54 -23
- package/unbundled/definition50.js +52 -18
- package/unbundled/definition51.cjs +23 -39
- package/unbundled/definition51.js +17 -36
- package/unbundled/definition52.cjs +29 -314
- package/unbundled/definition52.js +27 -312
- package/unbundled/definition53.cjs +301 -195
- package/unbundled/definition53.js +297 -191
- package/unbundled/definition54.cjs +210 -40
- package/unbundled/definition54.js +206 -36
- package/unbundled/definition55.cjs +42 -266
- package/unbundled/definition55.js +38 -262
- package/unbundled/definition56.cjs +266 -50
- package/unbundled/definition56.js +263 -46
- package/unbundled/definition57.cjs +48 -146
- package/unbundled/definition57.js +47 -143
- package/unbundled/definition58.cjs +127 -225
- package/unbundled/definition58.js +122 -223
- package/unbundled/definition59.cjs +199 -418
- package/unbundled/definition59.js +196 -415
- package/unbundled/definition60.cjs +441 -3738
- package/unbundled/definition60.js +431 -3565
- package/unbundled/definition61.cjs +3712 -728
- package/unbundled/definition61.js +3538 -717
- package/unbundled/definition62.cjs +769 -97
- package/unbundled/definition62.js +766 -94
- package/unbundled/definition63.cjs +100 -981
- package/unbundled/definition63.js +98 -976
- package/unbundled/definition64.cjs +988 -93
- package/unbundled/definition64.js +982 -90
- package/unbundled/definition65.cjs +109 -73
- package/unbundled/definition65.js +105 -63
- package/unbundled/definition66.cjs +69 -155
- package/unbundled/definition66.js +60 -152
- package/unbundled/definition67.cjs +154 -118
- package/unbundled/definition67.js +151 -115
- package/unbundled/definition68.cjs +124 -49
- package/unbundled/definition68.js +120 -45
- package/unbundled/definition69.cjs +51 -84
- package/unbundled/definition69.js +50 -80
- package/unbundled/definition70.cjs +91 -19
- package/unbundled/definition70.js +86 -14
- package/unbundled/definition71.cjs +20 -87
- package/unbundled/definition71.js +14 -84
- package/unbundled/definition72.cjs +76 -294
- package/unbundled/definition72.js +71 -217
- package/unbundled/definition73.cjs +288 -311
- package/unbundled/definition73.js +218 -306
- package/unbundled/definition74.cjs +326 -26
- package/unbundled/definition74.js +317 -23
- package/unbundled/definition75.cjs +27 -122
- package/unbundled/definition75.js +22 -118
- package/unbundled/definition76.cjs +103 -232
- package/unbundled/definition76.js +99 -228
- package/unbundled/definition77.cjs +259 -26
- package/unbundled/definition77.js +249 -23
- package/unbundled/definition78.cjs +29 -148
- package/unbundled/definition78.js +27 -133
- package/unbundled/definition79.cjs +117 -173
- package/unbundled/definition79.js +108 -169
- package/unbundled/definition80.cjs +181 -477
- package/unbundled/definition80.js +176 -471
- package/unbundled/definition81.cjs +517 -0
- package/unbundled/definition81.js +497 -0
- package/unbundled/extractOptions.cjs +21 -0
- package/unbundled/extractOptions.js +16 -0
- package/unbundled/listbox.cjs +23 -6
- package/unbundled/listbox.js +23 -6
- package/unbundled/vivid-element.cjs +10 -1
- package/unbundled/vivid-element.js +10 -1
- package/video-player/definition.cjs +1 -1
- package/video-player/definition.js +1 -1
- package/vivid.api.json +194 -0
|
@@ -1,195 +1,109 @@
|
|
|
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
4
|
const require_dialog = require("./dialog.cjs");
|
|
6
|
-
const require_definition$1 = require("./definition9.cjs");
|
|
7
|
-
const require_anchored = require("./anchored.cjs");
|
|
8
|
-
const require_definition$2 = require("./definition27.cjs");
|
|
9
|
-
const require_base_color_picker = require("./base-color-picker.cjs");
|
|
10
5
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
11
6
|
let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
|
|
12
|
-
//#region src/lib/
|
|
13
|
-
var simple_color_picker_default = ".palette{grid-template-columns:repeat(var(--swatches-per-row,7), var(--_color-swatch-size,24px));display:grid}.swatch{background-color:var(--swatch-color);block-size:var(--_color-swatch-size,24px);color:var(--vvd-color-canvas);cursor:pointer;inline-size:var(--_color-swatch-size,24px);border-radius:4px;padding:0;position:relative}.swatch:not(.contrast){border:none}.swatch.contrast{border:1px solid var(--vvd-color-neutral-400);color:var(--vvd-color-canvas-text)}.swatch:focus-visible{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:none;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;--focus-inset:-3px}:host :host{display:var(--_popup-display,inline)}:host :host([slotted-anchor]){--_popup-display:contents}.palette{padding:var(--_color-palette-spacing,16px);gap:var(--_color-palette-gap,12px)}::part(popup-base){block-size:max-content;max-block-size:100vh;inline-size:max-content;max-inline-size:100vw;min-block-size:var(--_color-swatch-size,24px);min-inline-size:var(--_color-swatch-size,24px)}";
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region src/lib/simple-color-picker/simple-color-picker.ts
|
|
7
|
+
//#region src/lib/side-drawer/side-drawer.ts
|
|
16
8
|
/**
|
|
17
9
|
* @public
|
|
18
|
-
* @component
|
|
19
|
-
* @slot
|
|
20
|
-
* @
|
|
21
|
-
* @event {
|
|
22
|
-
* @
|
|
10
|
+
* @component side-drawer
|
|
11
|
+
* @slot - Sets assigned nodes to the side drawer itself.
|
|
12
|
+
* @slot app-content - Sets assigned nodes to the main application content, the side drawer is opened next to.
|
|
13
|
+
* @event {CustomEvent<undefined>} close - Fired when the side drawer is closed.
|
|
14
|
+
* @event {CustomEvent<undefined>} open - Fired when the side drawer is opened.
|
|
15
|
+
* @event {CustomEvent<undefined>} cancel - Fired when the user requests to close the side-drawer. You can prevent the side drawer from closing by calling `.preventDefault()` on the event.
|
|
23
16
|
*/
|
|
24
|
-
var
|
|
17
|
+
var SideDrawer = class extends require_vivid_element.VividElement {
|
|
25
18
|
constructor(..._args) {
|
|
26
19
|
super(..._args);
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
29
|
-
this
|
|
30
|
-
this
|
|
31
|
-
if (!this.open) {
|
|
32
|
-
this.#openedByKeyboard = false;
|
|
33
|
-
_microsoft_fast_element.Updates.enqueue(() => this.open = true);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
this.#handleAnchorKeydown = (event) => {
|
|
37
|
-
/* v8 ignore next -- @preserve */
|
|
38
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
39
|
-
if (!this.open) {
|
|
40
|
-
this.#openedByKeyboard = true;
|
|
41
|
-
_microsoft_fast_element.Updates.enqueue(() => this.open = true);
|
|
42
|
-
}
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
this._closeOnClickOutside = (e) => {
|
|
47
|
-
const clickedOutside = !this.contains(e.target);
|
|
48
|
-
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
49
|
-
/* v8 ignore else -- @preserve */
|
|
50
|
-
if (clickedOutside || clickedOnAnchor) this.open = false;
|
|
51
|
-
};
|
|
52
|
-
this._closeOnEscape = (e) => {
|
|
53
|
-
/* v8 ignore else -- @preserve */
|
|
54
|
-
if (e.key === "Escape") this.open = false;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/** @internal */
|
|
58
|
-
openChanged(_oldValue, newValue) {
|
|
59
|
-
this._updateListeners();
|
|
60
|
-
if (this._anchorEl) this.#updateAnchor(this._anchorEl);
|
|
61
|
-
if (newValue && this.isConnected) requestAnimationFrame(() => {
|
|
62
|
-
this._refreshCanvasColor();
|
|
63
|
-
if (this.#openedByKeyboard) {
|
|
64
|
-
const selectedIndex = this.swatches.findIndex((swatch) => swatch.value === this.value);
|
|
65
|
-
const targetIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
66
|
-
this._focusSwatchByIndex(targetIndex);
|
|
67
|
-
}
|
|
68
|
-
this.#openedByKeyboard = false;
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/** @internal */
|
|
72
|
-
_getRowLength() {
|
|
73
|
-
return this.swatchesPerRow;
|
|
20
|
+
this.alternate = false;
|
|
21
|
+
this.modal = false;
|
|
22
|
+
this.open = false;
|
|
23
|
+
this.trailing = false;
|
|
74
24
|
}
|
|
75
|
-
|
|
76
|
-
super.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
super.disconnectedCallback();
|
|
81
|
-
this._updateListeners();
|
|
82
|
-
}
|
|
83
|
-
/** @internal */
|
|
84
|
-
_updateListeners() {
|
|
85
|
-
document.removeEventListener("click", this._closeOnClickOutside);
|
|
86
|
-
document.removeEventListener("keydown", this._closeOnEscape);
|
|
87
|
-
if (this.open && this.isConnected) {
|
|
88
|
-
document.addEventListener("click", this._closeOnClickOutside);
|
|
89
|
-
document.addEventListener("keydown", this._closeOnEscape);
|
|
25
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
26
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
27
|
+
switch (name) {
|
|
28
|
+
case "open": if (this.open) this.#open();
|
|
29
|
+
else this.#close();
|
|
90
30
|
}
|
|
91
31
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return this._anchorEl ?? null;
|
|
32
|
+
#close() {
|
|
33
|
+
this.$emit("close", void 0, { bubbles: false });
|
|
95
34
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (oldValue) this.#cleanupAnchor(oldValue);
|
|
99
|
-
if (newValue) this.#setupAnchor(newValue);
|
|
100
|
-
}
|
|
101
|
-
/** @internal */
|
|
102
|
-
#updateAnchor(a) {
|
|
103
|
-
a.setAttribute("aria-expanded", this.open.toString());
|
|
104
|
-
a.setAttribute("data-expanded", this.open.toString());
|
|
35
|
+
#open() {
|
|
36
|
+
this.$emit("open", void 0, { bubbles: false });
|
|
105
37
|
}
|
|
106
38
|
/** @internal */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
39
|
+
_onKeydown(event) {
|
|
40
|
+
if (require_dialog.handleEscapeKeyAndStopPropogation(event)) {
|
|
41
|
+
this._handleCloseRequest();
|
|
42
|
+
return;
|
|
43
|
+
} else return true;
|
|
112
44
|
}
|
|
113
45
|
/** @internal */
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
a.removeAttribute("aria-haspopup");
|
|
46
|
+
_handleCloseRequest() {
|
|
47
|
+
if (this.$emit("cancel", void 0, {
|
|
48
|
+
bubbles: false,
|
|
49
|
+
cancelable: true
|
|
50
|
+
})) this.open = false;
|
|
120
51
|
}
|
|
121
|
-
/** @internal */
|
|
122
|
-
#openedByKeyboard;
|
|
123
|
-
/** @internal */
|
|
124
|
-
#openPopup;
|
|
125
|
-
/** @internal */
|
|
126
|
-
#handleAnchorKeydown;
|
|
127
52
|
};
|
|
128
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "
|
|
129
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
converter: _microsoft_fast_element.nullableNumberConverter
|
|
133
|
-
})], SimpleColorPicker.prototype, "swatchesPerRow", void 0);
|
|
53
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SideDrawer.prototype, "alternate", void 0);
|
|
54
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SideDrawer.prototype, "modal", void 0);
|
|
55
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SideDrawer.prototype, "open", void 0);
|
|
56
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], SideDrawer.prototype, "trailing", void 0);
|
|
134
57
|
//#endregion
|
|
135
|
-
//#region src/lib/
|
|
136
|
-
var
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
${
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
aria-label="${(x) => x.locale.simpleColorPicker.colorPaletteLabel}">
|
|
159
|
-
${(0, _microsoft_fast_element.repeat)((x) => x.swatches, (x) => x._renderColorSwatch(iconTag, tooltipTag), { positioning: true })}
|
|
160
|
-
</div>
|
|
161
|
-
</${popupTag}>
|
|
162
|
-
`;
|
|
163
|
-
};
|
|
58
|
+
//#region src/lib/side-drawer/side-drawer.scss?inline
|
|
59
|
+
var side_drawer_default = ":host{display:block}.side-drawer-app-content{block-size:100%}.control{--scrollbar-track-color:transparent;--scrollbar-thumb-color:color-mix(in sRGB, var(--vvd-color-neutral-950), transparent 70%);scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.control ::-webkit-scrollbar{width:4px}.control ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control ::-webkit-scrollbar-thumb{background-color:var(--scrollbar-fallback-track-color,var(--scrollbar-thumb-color));border:0;border-radius:4px}.control{z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;position:fixed;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset,280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset,280px)}@media (prefers-reduced-motion:no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text,currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}";
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/lib/side-drawer/side-drawer.template.ts
|
|
62
|
+
var sideDrawerTemplate = _microsoft_fast_element.html`
|
|
63
|
+
<div
|
|
64
|
+
class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("control", ["modal", x.modal], ["open", x.open], ["trailing", x.trailing])}"
|
|
65
|
+
?inert="${(x) => !x.open}"
|
|
66
|
+
part="base ${(x) => x.alternate ? "vvd-theme-alternate" : ""}"
|
|
67
|
+
@keydown="${(x, c) => x._onKeydown(c.event)}"
|
|
68
|
+
>
|
|
69
|
+
<slot></slot>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div class="side-drawer-app-content" ?inert="${(x) => x.open && x.modal}">
|
|
73
|
+
<slot name="app-content"></slot>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
${(0, _microsoft_fast_element.when)((x) => x.modal, _microsoft_fast_element.html`<div
|
|
77
|
+
class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("scrim", ["open", x.open])}"
|
|
78
|
+
@click="${(x) => x._handleCloseRequest()}"
|
|
79
|
+
></div>`)}
|
|
80
|
+
`;
|
|
164
81
|
//#endregion
|
|
165
|
-
//#region src/lib/
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
require_definition.iconDefinition,
|
|
169
|
-
require_definition$2.tooltipDefinition
|
|
170
|
-
], { styles: simple_color_picker_default });
|
|
82
|
+
//#region src/lib/side-drawer/definition.ts
|
|
83
|
+
/** @internal */
|
|
84
|
+
var sideDrawerDefinition = require_vivid_element.defineVividComponent("side-drawer", SideDrawer, sideDrawerTemplate, [], { styles: side_drawer_default });
|
|
171
85
|
/**
|
|
172
|
-
* Registers the
|
|
86
|
+
* Registers the side-drawer elements with the design system.
|
|
173
87
|
*
|
|
174
88
|
* @param prefix - the prefix to use for the component name
|
|
175
89
|
*/
|
|
176
|
-
var
|
|
90
|
+
var registerSideDrawer = require_vivid_element.createRegisterFunction(sideDrawerDefinition);
|
|
177
91
|
//#endregion
|
|
178
|
-
Object.defineProperty(exports, "
|
|
92
|
+
Object.defineProperty(exports, "SideDrawer", {
|
|
179
93
|
enumerable: true,
|
|
180
94
|
get: function() {
|
|
181
|
-
return
|
|
95
|
+
return SideDrawer;
|
|
182
96
|
}
|
|
183
97
|
});
|
|
184
|
-
Object.defineProperty(exports, "
|
|
98
|
+
Object.defineProperty(exports, "registerSideDrawer", {
|
|
185
99
|
enumerable: true,
|
|
186
100
|
get: function() {
|
|
187
|
-
return
|
|
101
|
+
return registerSideDrawer;
|
|
188
102
|
}
|
|
189
103
|
});
|
|
190
|
-
Object.defineProperty(exports, "
|
|
104
|
+
Object.defineProperty(exports, "sideDrawerDefinition", {
|
|
191
105
|
enumerable: true,
|
|
192
106
|
get: function() {
|
|
193
|
-
return
|
|
107
|
+
return sideDrawerDefinition;
|
|
194
108
|
}
|
|
195
109
|
});
|
|
@@ -1,177 +1,85 @@
|
|
|
1
1
|
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
|
-
import { r as Icon, t as iconDefinition } from "./definition.js";
|
|
3
2
|
import { t as __decorate } from "./decorate.js";
|
|
4
3
|
import { t as handleEscapeKeyAndStopPropogation } from "./dialog.js";
|
|
5
|
-
import {
|
|
6
|
-
import { n as anchorSlotTemplateFactory, t as Anchored } from "./anchored.js";
|
|
7
|
-
import { n as tooltipDefinition, r as Tooltip } from "./definition27.js";
|
|
8
|
-
import { t as BaseColorPicker } from "./base-color-picker.js";
|
|
9
|
-
import { Updates, attr, html, nullableNumberConverter, repeat } from "@microsoft/fast-element";
|
|
4
|
+
import { attr, html, when } from "@microsoft/fast-element";
|
|
10
5
|
import { classNames } from "@microsoft/fast-web-utilities";
|
|
11
|
-
//#region src/lib/
|
|
12
|
-
var simple_color_picker_default = ".palette{grid-template-columns:repeat(var(--swatches-per-row,7), var(--_color-swatch-size,24px));display:grid}.swatch{background-color:var(--swatch-color);block-size:var(--_color-swatch-size,24px);color:var(--vvd-color-canvas);cursor:pointer;inline-size:var(--_color-swatch-size,24px);border-radius:4px;padding:0;position:relative}.swatch:not(.contrast){border:none}.swatch.contrast{border:1px solid var(--vvd-color-neutral-400);color:var(--vvd-color-canvas-text)}.swatch:focus-visible{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:none;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;--focus-inset:-3px}:host :host{display:var(--_popup-display,inline)}:host :host([slotted-anchor]){--_popup-display:contents}.palette{padding:var(--_color-palette-spacing,16px);gap:var(--_color-palette-gap,12px)}::part(popup-base){block-size:max-content;max-block-size:100vh;inline-size:max-content;max-inline-size:100vw;min-block-size:var(--_color-swatch-size,24px);min-inline-size:var(--_color-swatch-size,24px)}";
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region src/lib/simple-color-picker/simple-color-picker.ts
|
|
6
|
+
//#region src/lib/side-drawer/side-drawer.ts
|
|
15
7
|
/**
|
|
16
8
|
* @public
|
|
17
|
-
* @component
|
|
18
|
-
* @slot
|
|
19
|
-
* @
|
|
20
|
-
* @event {
|
|
21
|
-
* @
|
|
9
|
+
* @component side-drawer
|
|
10
|
+
* @slot - Sets assigned nodes to the side drawer itself.
|
|
11
|
+
* @slot app-content - Sets assigned nodes to the main application content, the side drawer is opened next to.
|
|
12
|
+
* @event {CustomEvent<undefined>} close - Fired when the side drawer is closed.
|
|
13
|
+
* @event {CustomEvent<undefined>} open - Fired when the side drawer is opened.
|
|
14
|
+
* @event {CustomEvent<undefined>} cancel - Fired when the user requests to close the side-drawer. You can prevent the side drawer from closing by calling `.preventDefault()` on the event.
|
|
22
15
|
*/
|
|
23
|
-
var
|
|
16
|
+
var SideDrawer = class extends VividElement {
|
|
24
17
|
constructor(..._args) {
|
|
25
18
|
super(..._args);
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
28
|
-
this
|
|
29
|
-
this
|
|
30
|
-
if (!this.open) {
|
|
31
|
-
this.#openedByKeyboard = false;
|
|
32
|
-
Updates.enqueue(() => this.open = true);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
this.#handleAnchorKeydown = (event) => {
|
|
36
|
-
/* v8 ignore next -- @preserve */
|
|
37
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
38
|
-
if (!this.open) {
|
|
39
|
-
this.#openedByKeyboard = true;
|
|
40
|
-
Updates.enqueue(() => this.open = true);
|
|
41
|
-
}
|
|
42
|
-
event.preventDefault();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
this._closeOnClickOutside = (e) => {
|
|
46
|
-
const clickedOutside = !this.contains(e.target);
|
|
47
|
-
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
48
|
-
/* v8 ignore else -- @preserve */
|
|
49
|
-
if (clickedOutside || clickedOnAnchor) this.open = false;
|
|
50
|
-
};
|
|
51
|
-
this._closeOnEscape = (e) => {
|
|
52
|
-
/* v8 ignore else -- @preserve */
|
|
53
|
-
if (e.key === "Escape") this.open = false;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/** @internal */
|
|
57
|
-
openChanged(_oldValue, newValue) {
|
|
58
|
-
this._updateListeners();
|
|
59
|
-
if (this._anchorEl) this.#updateAnchor(this._anchorEl);
|
|
60
|
-
if (newValue && this.isConnected) requestAnimationFrame(() => {
|
|
61
|
-
this._refreshCanvasColor();
|
|
62
|
-
if (this.#openedByKeyboard) {
|
|
63
|
-
const selectedIndex = this.swatches.findIndex((swatch) => swatch.value === this.value);
|
|
64
|
-
const targetIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
65
|
-
this._focusSwatchByIndex(targetIndex);
|
|
66
|
-
}
|
|
67
|
-
this.#openedByKeyboard = false;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
/** @internal */
|
|
71
|
-
_getRowLength() {
|
|
72
|
-
return this.swatchesPerRow;
|
|
19
|
+
this.alternate = false;
|
|
20
|
+
this.modal = false;
|
|
21
|
+
this.open = false;
|
|
22
|
+
this.trailing = false;
|
|
73
23
|
}
|
|
74
|
-
|
|
75
|
-
super.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
super.disconnectedCallback();
|
|
80
|
-
this._updateListeners();
|
|
81
|
-
}
|
|
82
|
-
/** @internal */
|
|
83
|
-
_updateListeners() {
|
|
84
|
-
document.removeEventListener("click", this._closeOnClickOutside);
|
|
85
|
-
document.removeEventListener("keydown", this._closeOnEscape);
|
|
86
|
-
if (this.open && this.isConnected) {
|
|
87
|
-
document.addEventListener("click", this._closeOnClickOutside);
|
|
88
|
-
document.addEventListener("keydown", this._closeOnEscape);
|
|
24
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
25
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
26
|
+
switch (name) {
|
|
27
|
+
case "open": if (this.open) this.#open();
|
|
28
|
+
else this.#close();
|
|
89
29
|
}
|
|
90
30
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return this._anchorEl ?? null;
|
|
31
|
+
#close() {
|
|
32
|
+
this.$emit("close", void 0, { bubbles: false });
|
|
94
33
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (oldValue) this.#cleanupAnchor(oldValue);
|
|
98
|
-
if (newValue) this.#setupAnchor(newValue);
|
|
99
|
-
}
|
|
100
|
-
/** @internal */
|
|
101
|
-
#updateAnchor(a) {
|
|
102
|
-
a.setAttribute("aria-expanded", this.open.toString());
|
|
103
|
-
a.setAttribute("data-expanded", this.open.toString());
|
|
34
|
+
#open() {
|
|
35
|
+
this.$emit("open", void 0, { bubbles: false });
|
|
104
36
|
}
|
|
105
37
|
/** @internal */
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
38
|
+
_onKeydown(event) {
|
|
39
|
+
if (handleEscapeKeyAndStopPropogation(event)) {
|
|
40
|
+
this._handleCloseRequest();
|
|
41
|
+
return;
|
|
42
|
+
} else return true;
|
|
111
43
|
}
|
|
112
44
|
/** @internal */
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
a.removeAttribute("aria-haspopup");
|
|
45
|
+
_handleCloseRequest() {
|
|
46
|
+
if (this.$emit("cancel", void 0, {
|
|
47
|
+
bubbles: false,
|
|
48
|
+
cancelable: true
|
|
49
|
+
})) this.open = false;
|
|
119
50
|
}
|
|
120
|
-
/** @internal */
|
|
121
|
-
#openedByKeyboard;
|
|
122
|
-
/** @internal */
|
|
123
|
-
#openPopup;
|
|
124
|
-
/** @internal */
|
|
125
|
-
#handleAnchorKeydown;
|
|
126
|
-
};
|
|
127
|
-
__decorate([attr({ mode: "fromView" })], SimpleColorPicker.prototype, "placement", void 0);
|
|
128
|
-
__decorate([attr({
|
|
129
|
-
attribute: "swatches-per-row",
|
|
130
|
-
mode: "fromView",
|
|
131
|
-
converter: nullableNumberConverter
|
|
132
|
-
})], SimpleColorPicker.prototype, "swatchesPerRow", void 0);
|
|
133
|
-
//#endregion
|
|
134
|
-
//#region src/lib/simple-color-picker/simple-color-picker.template.ts
|
|
135
|
-
var getClasses = (_) => classNames("control");
|
|
136
|
-
var SimpleColorPickerTemplate = (context) => {
|
|
137
|
-
const popupTag = context.tagFor(Popup);
|
|
138
|
-
const iconTag = context.tagFor(Icon);
|
|
139
|
-
const tooltipTag = context.tagFor(Tooltip);
|
|
140
|
-
return html`
|
|
141
|
-
${anchorSlotTemplateFactory()}
|
|
142
|
-
<${popupTag}
|
|
143
|
-
class="${getClasses}"
|
|
144
|
-
:anchor="${(x) => x._anchorEl}"
|
|
145
|
-
:open="${(x) => x.open}"
|
|
146
|
-
placement="${(x) => x.placement}"
|
|
147
|
-
offset="4"
|
|
148
|
-
@keydown="${(x, { event }) => {
|
|
149
|
-
if (x.open && handleEscapeKeyAndStopPropogation(event)) return false;
|
|
150
|
-
return true;
|
|
151
|
-
}}"
|
|
152
|
-
>
|
|
153
|
-
<div class="palette" role="grid"
|
|
154
|
-
aria-rowcount="${(x) => Math.ceil(x.swatches.length / x._getRowLength())}"
|
|
155
|
-
aria-colcount="${(x) => x._getRowLength()}"
|
|
156
|
-
style="--swatches-per-row: ${(x) => x._getRowLength()};"
|
|
157
|
-
aria-label="${(x) => x.locale.simpleColorPicker.colorPaletteLabel}">
|
|
158
|
-
${repeat((x) => x.swatches, (x) => x._renderColorSwatch(iconTag, tooltipTag), { positioning: true })}
|
|
159
|
-
</div>
|
|
160
|
-
</${popupTag}>
|
|
161
|
-
`;
|
|
162
51
|
};
|
|
52
|
+
__decorate([attr({ mode: "boolean" })], SideDrawer.prototype, "alternate", void 0);
|
|
53
|
+
__decorate([attr({ mode: "boolean" })], SideDrawer.prototype, "modal", void 0);
|
|
54
|
+
__decorate([attr({ mode: "boolean" })], SideDrawer.prototype, "open", void 0);
|
|
55
|
+
__decorate([attr({ mode: "boolean" })], SideDrawer.prototype, "trailing", void 0);
|
|
163
56
|
//#endregion
|
|
164
|
-
//#region src/lib/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
57
|
+
//#region src/lib/side-drawer/definition.ts
|
|
58
|
+
/** @internal */
|
|
59
|
+
var sideDrawerDefinition = defineVividComponent("side-drawer", SideDrawer, html`
|
|
60
|
+
<div
|
|
61
|
+
class="${(x) => classNames("control", ["modal", x.modal], ["open", x.open], ["trailing", x.trailing])}"
|
|
62
|
+
?inert="${(x) => !x.open}"
|
|
63
|
+
part="base ${(x) => x.alternate ? "vvd-theme-alternate" : ""}"
|
|
64
|
+
@keydown="${(x, c) => x._onKeydown(c.event)}"
|
|
65
|
+
>
|
|
66
|
+
<slot></slot>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="side-drawer-app-content" ?inert="${(x) => x.open && x.modal}">
|
|
70
|
+
<slot name="app-content"></slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
${when((x) => x.modal, html`<div
|
|
74
|
+
class="${(x) => classNames("scrim", ["open", x.open])}"
|
|
75
|
+
@click="${(x) => x._handleCloseRequest()}"
|
|
76
|
+
></div>`)}
|
|
77
|
+
`, [], { styles: ":host{display:block}.side-drawer-app-content{block-size:100%}.control{--scrollbar-track-color:transparent;--scrollbar-thumb-color:color-mix(in sRGB, var(--vvd-color-neutral-950), transparent 70%);scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.control ::-webkit-scrollbar{width:4px}.control ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control ::-webkit-scrollbar-thumb{background-color:var(--scrollbar-fallback-track-color,var(--scrollbar-thumb-color));border:0;border-radius:4px}.control{z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;position:fixed;inset-block:0;overflow-y:auto}.control[part~=vvd-theme-alternate]{background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);color-scheme:var(--vvd-color-scheme)}.control.trailing{inset-inline-end:0}.control:not(.open).trailing{transform:translate(100%)}.control:not(.open):not(.trailing){transform:translate(-100%)}.control.open:not(.modal).trailing+.side-drawer-app-content{margin-inline-end:var(--side-drawer-app-content-offset,280px)}.control.open:not(.modal):not(.trailing)+.side-drawer-app-content{margin-inline-start:var(--side-drawer-app-content-offset,280px)}@media (prefers-reduced-motion:no-preference){.control{transition:transform .2s cubic-bezier(.4,0,.2,1)}}.scrim{background-color:var(--vvd-color-canvas-text,currentColor);opacity:.5;position:fixed;inset:0}.scrim:not(.open){display:none}" });
|
|
170
78
|
/**
|
|
171
|
-
* Registers the
|
|
79
|
+
* Registers the side-drawer elements with the design system.
|
|
172
80
|
*
|
|
173
81
|
* @param prefix - the prefix to use for the component name
|
|
174
82
|
*/
|
|
175
|
-
var
|
|
83
|
+
var registerSideDrawer = createRegisterFunction(sideDrawerDefinition);
|
|
176
84
|
//#endregion
|
|
177
|
-
export {
|
|
85
|
+
export { sideDrawerDefinition as n, SideDrawer as r, registerSideDrawer as t };
|