@vonage/vivid 5.1.0 → 5.3.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-item/definition.cjs +2 -1
- package/accordion-item/definition.js +2 -1
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +41 -6
- package/audio-player/definition.js +41 -6
- package/audio-player/index.cjs +27 -25
- package/audio-player/index.js +88 -62
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +21 -21
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +66 -37
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +17 -14
- package/bundled/definition19.js +85 -77
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +6 -6
- package/bundled/definition6.js +34 -31
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +1 -1
- package/bundled/definition9.js +1 -1
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +43 -31
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +18 -13
- package/bundled/picker-field.template.js +45 -37
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +2126 -1172
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +17 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +6 -6
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +10 -2
- package/card/definition.js +10 -2
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +13 -6
- package/combobox/definition.js +14 -7
- package/combobox/index.cjs +15 -11
- package/combobox/index.js +82 -75
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1621 -325
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +55 -1
- package/dial-pad/definition.js +56 -2
- package/dial-pad/index.cjs +21 -18
- package/dial-pad/index.js +138 -104
- package/dialog/definition.cjs +4 -1
- package/dialog/definition.js +4 -1
- package/dialog/index.cjs +21 -18
- package/dialog/index.js +43 -40
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +16 -7
- package/file-picker/definition.js +17 -8
- package/file-picker/index.cjs +12 -9
- package/file-picker/index.js +103 -93
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +4 -0
- package/index.js +1 -0
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +6 -2
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +495 -78
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +906 -894
- package/lib/date-range-picker/date-range-picker.d.ts +596 -590
- package/lib/date-time-picker/date-time-picker.d.ts +907 -895
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +2 -2
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +495 -78
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +5 -4
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +19 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +521 -104
- package/lib/select/select.d.ts +484 -67
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +6 -6
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -16
- package/lib/text-field/text-field.d.ts +19 -18
- package/lib/time-picker/time-picker.d.ts +579 -573
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +15 -3
- package/locales/de-DE.js +15 -3
- package/locales/en-GB.cjs +15 -3
- package/locales/en-GB.js +15 -3
- package/locales/en-US.cjs +15 -3
- package/locales/en-US.js +15 -3
- package/locales/ja-JP.cjs +15 -3
- package/locales/ja-JP.js +15 -3
- package/locales/zh-CN.cjs +15 -3
- package/locales/zh-CN.js +15 -3
- package/menu/definition.cjs +8 -4
- package/menu/definition.js +9 -5
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +3 -3
- package/number-field/definition.js +4 -4
- package/number-field/index.cjs +8 -8
- package/number-field/index.js +41 -40
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +5 -5
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +2 -2
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/definition.cjs +30 -21
- package/searchable-select/definition.js +31 -22
- package/searchable-select/index.cjs +28 -25
- package/searchable-select/index.js +149 -140
- package/select/definition.cjs +15 -7
- package/select/definition.js +16 -8
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +2 -2
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +454 -451
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +600 -594
- package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
- package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
- package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
- package/shared/picker-field/picker-field.d.ts +495 -78
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +28 -215
- package/simple-color-picker/definition.js +29 -216
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +4 -4
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +9 -9
- package/text-field/definition.cjs +3 -3
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +2 -2
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +2 -2
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +3 -3
- package/unbundled/calendar-picker.template.js +4 -4
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +2 -2
- package/unbundled/definition3.cjs +2 -1
- package/unbundled/definition3.js +2 -1
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +13 -5
- package/unbundled/picker-field.template.js +14 -6
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/unbundled/with-contextual-help.cjs +11 -0
- package/unbundled/with-contextual-help.js +11 -0
- package/video-player/definition.cjs +69007 -1
- package/video-player/definition.js +69007 -1
- package/video-player/index.cjs +35 -35
- package/video-player/index.js +1358 -1384
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +347 -69
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export declare class AttributeBindingBehavior implements
|
|
1
|
+
import { type Binding, type Subscriber, type ViewBehavior, type ViewController } from '@microsoft/fast-element';
|
|
2
|
+
export declare class AttributeBindingBehavior implements ViewBehavior, Subscriber {
|
|
3
3
|
private target;
|
|
4
4
|
private binding;
|
|
5
5
|
private isBindingVolatile;
|
|
@@ -8,8 +8,7 @@ export declare class AttributeBindingBehavior implements Behavior, Subscriber {
|
|
|
8
8
|
private source;
|
|
9
9
|
private context;
|
|
10
10
|
private bindingObserver?;
|
|
11
|
-
bind(
|
|
12
|
-
unbind(): void;
|
|
11
|
+
bind(controller: ViewController): void;
|
|
13
12
|
handleChange(): void;
|
|
14
13
|
updateTarget(value: unknown): void;
|
|
15
14
|
}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AddViewBehaviorFactory, type Binding, type BindingDirective, type CaptureType, type Expression, HTMLDirective, type Subscriber, type ViewBehavior, type ViewBehaviorFactory, type ViewController, type ViewTemplate } from '@microsoft/fast-element';
|
|
2
2
|
import type { VividElement } from '../foundation/vivid-element/vivid-element';
|
|
3
|
-
export declare class RenderInLightDomBehaviour<TSource extends VividElement> implements
|
|
3
|
+
export declare class RenderInLightDomBehaviour<TSource extends VividElement> implements ViewBehavior, Subscriber {
|
|
4
4
|
private source;
|
|
5
5
|
private view?;
|
|
6
6
|
private insertionPoint?;
|
|
7
7
|
private templateBindingObserver;
|
|
8
8
|
private context?;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
handleChange(): void;
|
|
9
|
+
private controller?;
|
|
10
|
+
constructor(directive: RenderInLightDomDirective<TSource>);
|
|
11
|
+
bind(controller: ViewController): void;
|
|
12
|
+
handleChange(source: any, args: any): void;
|
|
13
13
|
private instantiateTemplate;
|
|
14
14
|
}
|
|
15
|
-
export declare class RenderInLightDomDirective<TSource extends VividElement>
|
|
16
|
-
readonly templateBinding: Binding<TSource,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
constructor(templateBinding: Binding<TSource,
|
|
15
|
+
export declare class RenderInLightDomDirective<TSource extends VividElement> implements HTMLDirective, ViewBehaviorFactory, BindingDirective {
|
|
16
|
+
readonly templateBinding: Binding<TSource, ViewTemplate>;
|
|
17
|
+
readonly dataBinding: Binding<TSource, ViewTemplate>;
|
|
18
|
+
targetNodeId: string;
|
|
19
|
+
constructor(templateBinding: Binding<TSource, ViewTemplate>);
|
|
20
|
+
createHTML(add: AddViewBehaviorFactory): string;
|
|
20
21
|
createBehavior(): RenderInLightDomBehaviour<TSource>;
|
|
21
22
|
}
|
|
22
|
-
export declare function renderInLightDOM<TSource extends VividElement>(templateOrTemplateBinding:
|
|
23
|
+
export declare function renderInLightDOM<TSource extends VividElement = VividElement, TParent = any>(templateOrTemplateBinding: ViewTemplate<any, TSource> | Expression<TSource, ViewTemplate<any, TSource>, TParent> | Binding<TSource, ViewTemplate<any, TSource>, TParent>): CaptureType<TSource, TParent>;
|
package/side-drawer/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const r=require("../bundled/vivid-element.cjs"),p=require("../bundled/index.cjs"),
|
|
1
|
+
"use strict";const r=require("../bundled/vivid-element.cjs"),p=require("../bundled/index.cjs"),v=require("../bundled/when.cjs"),d=require("../bundled/class-names.cjs");var b=Object.defineProperty,l=(e,o,t,i)=>{for(var a=void 0,s=e.length-1,c;s>=0;s--)(c=e[s])&&(a=c(o,t,a)||a);return a&&b(o,t,a),a};class n extends r.VividElement{constructor(){super(...arguments),this.alternate=!1,this.modal=!1,this.open=!1,this.trailing=!1}attributeChangedCallback(o,t,i){switch(super.attributeChangedCallback(o,t,i),o){case"open":this.open?this.#o():this.#e()}}#e(){this.$emit("close",void 0,{bubbles:!1})}#o(){this.$emit("open",void 0,{bubbles:!1})}_onKeydown(o){if(p.handleEscapeKeyAndStopPropogation(o)){this._handleCloseRequest();return}else return!0}_handleCloseRequest(){this.$emit("cancel",void 0,{bubbles:!1,cancelable:!0})&&(this.open=!1)}}l([r.attr({mode:"boolean"})],n.prototype,"alternate");l([r.attr({mode:"boolean"})],n.prototype,"modal");l([r.attr({mode:"boolean"})],n.prototype,"open");l([r.attr({mode:"boolean"})],n.prototype,"trailing");const m=":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%)}.control{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{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.control{position:fixed;z-index:1;background-color:var(--vvd-color-canvas);color:var(--vvd-color-canvas-text);inline-size:280px;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}",u=({modal:e,open:o,trailing:t})=>d.classNames("control",["modal",e],["open",o],["trailing",t]),h=({open:e})=>d.classNames("scrim",["open",e]),f=r.html`
|
|
2
2
|
<div
|
|
3
3
|
class="${u}"
|
|
4
4
|
?inert="${e=>!e.open}"
|
package/side-drawer/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { V as v, a as n, h as d, c as b, d as m } from "../bundled/vivid-element.js";
|
|
2
2
|
import { h } from "../bundled/index.js";
|
|
3
|
-
import { c as p } from "../bundled/class-names.js";
|
|
4
3
|
import { w as f } from "../bundled/when.js";
|
|
4
|
+
import { c as p } from "../bundled/class-names.js";
|
|
5
5
|
var u = Object.defineProperty, l = (o, e, r, i) => {
|
|
6
6
|
for (var t = void 0, s = o.length - 1, c; s >= 0; s--)
|
|
7
7
|
(c = o[s]) && (t = c(e, r, t) || t);
|
|
@@ -7,44 +7,11 @@ const popup_definition = require('../unbundled/definition4.cjs');
|
|
|
7
7
|
const icon_definition = require('../icon/definition.cjs');
|
|
8
8
|
const fastElement = require('@microsoft/fast-element');
|
|
9
9
|
const anchored = require('../unbundled/anchored.cjs');
|
|
10
|
-
const
|
|
11
|
-
const localized = require('../unbundled/localized.cjs');
|
|
12
|
-
const formElement = require('../unbundled/form-element.cjs');
|
|
10
|
+
const baseColorPicker = require('../unbundled/base-color-picker.cjs');
|
|
13
11
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
14
12
|
const index = require('../unbundled/index.cjs');
|
|
15
13
|
|
|
16
|
-
const styles = "
|
|
17
|
-
|
|
18
|
-
function parseHexColor(input) {
|
|
19
|
-
if (!input) return null;
|
|
20
|
-
const hex = input.trim().replace(/^#/, "");
|
|
21
|
-
if (/^[0-9a-fA-F]{6}$/.test(hex)) return hex.toLowerCase();
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
function getLuminance(hexColor) {
|
|
25
|
-
const hex = parseHexColor(hexColor);
|
|
26
|
-
if (!hex) return 0;
|
|
27
|
-
const r = parseInt(hex.slice(0, 2), 16) / 255;
|
|
28
|
-
const g = parseInt(hex.slice(2, 4), 16) / 255;
|
|
29
|
-
const b = parseInt(hex.slice(4, 6), 16) / 255;
|
|
30
|
-
const sR = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
|
|
31
|
-
const sG = g <= 0.03928 ? g / 12.92 : Math.pow((g + 0.055) / 1.055, 2.4);
|
|
32
|
-
const sB = b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);
|
|
33
|
-
return 0.2126 * sR + 0.7152 * sG + 0.0722 * sB;
|
|
34
|
-
}
|
|
35
|
-
function getContrastRatio(color1, color2) {
|
|
36
|
-
const lum1 = getLuminance(color1);
|
|
37
|
-
const lum2 = getLuminance(color2);
|
|
38
|
-
const brightest = Math.max(lum1, lum2);
|
|
39
|
-
const darkest = Math.min(lum1, lum2);
|
|
40
|
-
return (brightest + 0.05) / (darkest + 0.05);
|
|
41
|
-
}
|
|
42
|
-
function getCSSCustomProperty(propertyName, element) {
|
|
43
|
-
if (!element) {
|
|
44
|
-
element = document.querySelector(".vvd-root") || document.documentElement;
|
|
45
|
-
}
|
|
46
|
-
return getComputedStyle(element).getPropertyValue(propertyName).trim();
|
|
47
|
-
}
|
|
14
|
+
const styles = ".palette{display:grid;grid-template-columns:repeat(var(--swatches-per-row, 7),var(--_color-swatch-size, 24px))}.swatch{position:relative;padding:0;border:none;border-radius:4px;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)}.swatch.contrast{color:var(--vvd-color-canvas-text)}.swatch:focus-visible{outline:none;box-shadow:0 0 0 4px color-mix(in srgb,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;--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;inline-size:max-content;max-block-size:100vh;max-inline-size:100vw;min-block-size:var(--_color-swatch-size, 24px);min-inline-size:var(--_color-swatch-size, 24px)}";
|
|
48
15
|
|
|
49
16
|
var __defProp = Object.defineProperty;
|
|
50
17
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -55,28 +22,16 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
55
22
|
if (result) __defProp(target, key, result);
|
|
56
23
|
return result;
|
|
57
24
|
};
|
|
58
|
-
class SimpleColorPicker extends
|
|
59
|
-
anchored.Anchored(formElement.FormElement(formAssociated.FormAssociated(vividElement.VividElement)))
|
|
60
|
-
) {
|
|
25
|
+
class SimpleColorPicker extends anchored.Anchored(baseColorPicker.BaseColorPicker(vividElement.VividElement)) {
|
|
61
26
|
constructor() {
|
|
62
27
|
super(...arguments);
|
|
63
|
-
/**
|
|
64
|
-
* @internal
|
|
65
|
-
*/
|
|
66
|
-
this.proxy = document.createElement("input");
|
|
67
|
-
this.open = false;
|
|
68
28
|
this.placement = "top-start";
|
|
69
|
-
this.swatches = [];
|
|
70
29
|
this.swatchesPerRow = 7;
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
this._canvasColor = "";
|
|
75
30
|
/**
|
|
76
31
|
* @internal
|
|
77
32
|
*/
|
|
78
33
|
this.#openPopup = () => {
|
|
79
|
-
if (!this.open) fastElement.
|
|
34
|
+
if (!this.open) fastElement.Updates.enqueue(() => this.open = true);
|
|
80
35
|
};
|
|
81
36
|
/**
|
|
82
37
|
* @internal
|
|
@@ -84,7 +39,7 @@ class SimpleColorPicker extends localized.Localized(
|
|
|
84
39
|
this.#handleAnchorKeydown = (event) => {
|
|
85
40
|
if (event.key === "Enter" || event.key === " ") {
|
|
86
41
|
if (!this.open) {
|
|
87
|
-
fastElement.
|
|
42
|
+
fastElement.Updates.enqueue(() => this.open = true);
|
|
88
43
|
}
|
|
89
44
|
event.preventDefault();
|
|
90
45
|
}
|
|
@@ -92,7 +47,7 @@ class SimpleColorPicker extends localized.Localized(
|
|
|
92
47
|
/**
|
|
93
48
|
* @internal
|
|
94
49
|
*/
|
|
95
|
-
this
|
|
50
|
+
this._closeOnClickOutside = (e) => {
|
|
96
51
|
const clickedOutside = !this.contains(e.target);
|
|
97
52
|
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
98
53
|
if (clickedOutside || clickedOnAnchor) this.open = false;
|
|
@@ -100,108 +55,17 @@ class SimpleColorPicker extends localized.Localized(
|
|
|
100
55
|
/**
|
|
101
56
|
* @internal
|
|
102
57
|
*/
|
|
103
|
-
this
|
|
58
|
+
this._closeOnEscape = (e) => {
|
|
104
59
|
if (e.key === "Escape") {
|
|
105
60
|
this.open = false;
|
|
106
61
|
}
|
|
107
62
|
};
|
|
108
|
-
/**
|
|
109
|
-
* @internal
|
|
110
|
-
*/
|
|
111
|
-
this._handleSwatchSelection = (swatch) => {
|
|
112
|
-
if (this.value === swatch.value) {
|
|
113
|
-
this.value = "";
|
|
114
|
-
} else {
|
|
115
|
-
this.value = swatch.value;
|
|
116
|
-
}
|
|
117
|
-
this.$emit("change");
|
|
118
|
-
this.open = false;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* @internal
|
|
122
|
-
*/
|
|
123
|
-
this._handleSwatchKeydown = (event, swatch, index) => {
|
|
124
|
-
const rowLength = this.swatchesPerRow;
|
|
125
|
-
const totalCells = this.swatches.length;
|
|
126
|
-
const currentRow = Math.floor(index / rowLength);
|
|
127
|
-
const currentCol = index % rowLength;
|
|
128
|
-
const totalRows = Math.ceil(totalCells / rowLength);
|
|
129
|
-
switch (event.key) {
|
|
130
|
-
case "ArrowRight":
|
|
131
|
-
if (currentCol < rowLength - 1 && index + 1 < totalCells) {
|
|
132
|
-
this.#focusSwatchByIndex(index + 1);
|
|
133
|
-
}
|
|
134
|
-
return false;
|
|
135
|
-
case "ArrowLeft":
|
|
136
|
-
if (currentCol > 0) {
|
|
137
|
-
this.#focusSwatchByIndex(index - 1);
|
|
138
|
-
}
|
|
139
|
-
return false;
|
|
140
|
-
case "ArrowDown":
|
|
141
|
-
if (currentRow < totalRows - 1 && index + rowLength < totalCells) {
|
|
142
|
-
this.#focusSwatchByIndex(index + rowLength);
|
|
143
|
-
}
|
|
144
|
-
return false;
|
|
145
|
-
case "ArrowUp":
|
|
146
|
-
if (currentRow > 0) {
|
|
147
|
-
this.#focusSwatchByIndex(index - rowLength);
|
|
148
|
-
}
|
|
149
|
-
return false;
|
|
150
|
-
case "PageDown": {
|
|
151
|
-
const lastRowStart = (totalRows - 1) * rowLength;
|
|
152
|
-
const targetIndex = Math.min(lastRowStart + currentCol, totalCells - 1);
|
|
153
|
-
if (index !== targetIndex) {
|
|
154
|
-
this.#focusSwatchByIndex(targetIndex);
|
|
155
|
-
}
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
case "PageUp": {
|
|
159
|
-
const targetIndex = Math.min(currentCol, totalCells - 1);
|
|
160
|
-
if (index !== targetIndex) {
|
|
161
|
-
this.#focusSwatchByIndex(targetIndex);
|
|
162
|
-
}
|
|
163
|
-
return false;
|
|
164
|
-
}
|
|
165
|
-
case "Home":
|
|
166
|
-
if (event.ctrlKey) {
|
|
167
|
-
this.#focusSwatchByIndex(0);
|
|
168
|
-
} else {
|
|
169
|
-
this.#focusSwatchByIndex(currentRow * rowLength);
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
case "End":
|
|
173
|
-
if (event.ctrlKey) {
|
|
174
|
-
this.#focusSwatchByIndex(totalCells - 1);
|
|
175
|
-
} else {
|
|
176
|
-
const rowEnd = Math.min(
|
|
177
|
-
(currentRow + 1) * rowLength - 1,
|
|
178
|
-
totalCells - 1
|
|
179
|
-
);
|
|
180
|
-
this.#focusSwatchByIndex(rowEnd);
|
|
181
|
-
}
|
|
182
|
-
return false;
|
|
183
|
-
case "Enter":
|
|
184
|
-
case " ":
|
|
185
|
-
this._handleSwatchSelection(swatch);
|
|
186
|
-
this.#returnFocusToAnchor();
|
|
187
|
-
return false;
|
|
188
|
-
case "Escape":
|
|
189
|
-
this.open = false;
|
|
190
|
-
this.#returnFocusToAnchor();
|
|
191
|
-
return false;
|
|
192
|
-
case "Tab":
|
|
193
|
-
this.open = false;
|
|
194
|
-
return true;
|
|
195
|
-
default:
|
|
196
|
-
return true;
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
63
|
}
|
|
200
64
|
/**
|
|
201
65
|
* @internal
|
|
202
66
|
*/
|
|
203
67
|
openChanged() {
|
|
204
|
-
this
|
|
68
|
+
this._updateListeners();
|
|
205
69
|
if (this._anchorEl) {
|
|
206
70
|
this.#updateAnchor(this._anchorEl);
|
|
207
71
|
}
|
|
@@ -212,43 +76,40 @@ class SimpleColorPicker extends localized.Localized(
|
|
|
212
76
|
(swatch) => swatch.value === this.value
|
|
213
77
|
);
|
|
214
78
|
const targetIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
215
|
-
this
|
|
79
|
+
this._focusSwatchByIndex(targetIndex);
|
|
216
80
|
});
|
|
217
81
|
}
|
|
218
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
_getRowLength() {
|
|
87
|
+
return this.swatchesPerRow;
|
|
88
|
+
}
|
|
219
89
|
connectedCallback() {
|
|
220
90
|
super.connectedCallback();
|
|
221
|
-
this
|
|
222
|
-
this._refreshCanvasColor();
|
|
91
|
+
this._updateListeners();
|
|
223
92
|
}
|
|
224
93
|
disconnectedCallback() {
|
|
225
94
|
super.disconnectedCallback();
|
|
226
|
-
this
|
|
95
|
+
this._updateListeners();
|
|
227
96
|
}
|
|
228
97
|
/**
|
|
229
98
|
* @internal
|
|
230
99
|
*/
|
|
231
|
-
|
|
232
|
-
document.removeEventListener("click", this
|
|
233
|
-
document.removeEventListener("keydown", this
|
|
100
|
+
_updateListeners() {
|
|
101
|
+
document.removeEventListener("click", this._closeOnClickOutside);
|
|
102
|
+
document.removeEventListener("keydown", this._closeOnEscape);
|
|
234
103
|
if (this.open && this.isConnected) {
|
|
235
|
-
document.addEventListener("click", this
|
|
236
|
-
document.addEventListener("keydown", this
|
|
104
|
+
document.addEventListener("click", this._closeOnClickOutside);
|
|
105
|
+
document.addEventListener("keydown", this._closeOnEscape);
|
|
237
106
|
}
|
|
238
107
|
}
|
|
239
108
|
/**
|
|
240
109
|
* @internal
|
|
241
110
|
*/
|
|
242
|
-
|
|
243
|
-
this.
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* @internal
|
|
247
|
-
*/
|
|
248
|
-
_applyContrastClass(swatchColor, threshold = 3) {
|
|
249
|
-
if (!swatchColor || !this._canvasColor) return false;
|
|
250
|
-
const ratio = getContrastRatio(swatchColor, this._canvasColor);
|
|
251
|
-
return ratio < threshold;
|
|
111
|
+
_getFocusReturnEl() {
|
|
112
|
+
return this._anchorEl ?? null;
|
|
252
113
|
}
|
|
253
114
|
/**
|
|
254
115
|
* @internal
|
|
@@ -285,32 +146,10 @@ class SimpleColorPicker extends localized.Localized(
|
|
|
285
146
|
}
|
|
286
147
|
#openPopup;
|
|
287
148
|
#handleAnchorKeydown;
|
|
288
|
-
#closeOnClickOutside;
|
|
289
|
-
#closeOnEscape;
|
|
290
|
-
/**
|
|
291
|
-
* @internal
|
|
292
|
-
*/
|
|
293
|
-
#focusSwatchByIndex(index) {
|
|
294
|
-
if (index < 0 || index >= this.swatches.length) return;
|
|
295
|
-
const element = this.shadowRoot?.querySelectorAll('[role="gridcell"]')?.[index];
|
|
296
|
-
element?.focus();
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* @internal
|
|
300
|
-
*/
|
|
301
|
-
#returnFocusToAnchor() {
|
|
302
|
-
fastElement.DOM.queueUpdate(() => this._anchorEl?.focus());
|
|
303
|
-
}
|
|
304
149
|
}
|
|
305
|
-
__decorateClass([
|
|
306
|
-
fastElement.attr({ mode: "boolean" })
|
|
307
|
-
], SimpleColorPicker.prototype, "open");
|
|
308
150
|
__decorateClass([
|
|
309
151
|
fastElement.attr({ mode: "fromView" })
|
|
310
152
|
], SimpleColorPicker.prototype, "placement");
|
|
311
|
-
__decorateClass([
|
|
312
|
-
fastElement.observable
|
|
313
|
-
], SimpleColorPicker.prototype, "swatches");
|
|
314
153
|
__decorateClass([
|
|
315
154
|
fastElement.attr({
|
|
316
155
|
attribute: "swatches-per-row",
|
|
@@ -340,39 +179,13 @@ const SimpleColorPickerTemplate = (context) => {
|
|
|
340
179
|
}}"
|
|
341
180
|
>
|
|
342
181
|
<div class="palette" role="grid"
|
|
343
|
-
aria-rowcount="${(x) => Math.ceil(x.swatches.length / x.
|
|
344
|
-
aria-colcount="${(x) => x.
|
|
345
|
-
style="--swatches-per-row: ${(x) => x.
|
|
182
|
+
aria-rowcount="${(x) => Math.ceil(x.swatches.length / x._getRowLength())}"
|
|
183
|
+
aria-colcount="${(x) => x._getRowLength()}"
|
|
184
|
+
style="--swatches-per-row: ${(x) => x._getRowLength()};"
|
|
346
185
|
aria-label="${(x) => x.locale.simpleColorPicker.colorPaletteLabel}">
|
|
347
186
|
${fastElement.repeat(
|
|
348
187
|
(x) => x.swatches,
|
|
349
|
-
|
|
350
|
-
<button
|
|
351
|
-
class="swatch ${(x, c) => fastWebUtilities.classNames(
|
|
352
|
-
c.parent.value === x.value ? "selected" : "",
|
|
353
|
-
c.parent._applyContrastClass(x.value) ? "contrast" : ""
|
|
354
|
-
)}"
|
|
355
|
-
role="gridcell"
|
|
356
|
-
style="--swatch-color: ${(x) => x.value};"
|
|
357
|
-
tabindex="${(x, c) => c.index === 0 ? "0" : "-1"}"
|
|
358
|
-
aria-label="${(x, c) => c.parent.locale.simpleColorPicker.colorSwatchLabel(
|
|
359
|
-
x.value,
|
|
360
|
-
x.label,
|
|
361
|
-
c.parent.value === x.value
|
|
362
|
-
)}"
|
|
363
|
-
@click="${(x, c) => c.parent._handleSwatchSelection(x)}"
|
|
364
|
-
@keydown="${(x, c) => c.parent._handleSwatchKeydown(
|
|
365
|
-
c.event,
|
|
366
|
-
x,
|
|
367
|
-
c.index
|
|
368
|
-
)}"
|
|
369
|
-
>
|
|
370
|
-
${fastElement.when(
|
|
371
|
-
(x, c) => c.parent.value === x.value,
|
|
372
|
-
fastElement.html`<${iconTag} size="-6" name="check-solid" aria-hidden="true"></${iconTag}>`
|
|
373
|
-
)}
|
|
374
|
-
</button>
|
|
375
|
-
`,
|
|
188
|
+
(x) => x._renderColorSwatch(iconTag),
|
|
376
189
|
{ positioning: true }
|
|
377
190
|
)}
|
|
378
191
|
</div>
|