@vonage/vivid 5.2.0 → 5.4.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 +3 -2
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +4 -2
- package/audio-player/definition.js +4 -2
- package/audio-player/index.cjs +5 -3
- package/audio-player/index.js +5 -3
- package/badge/definition.js +1 -1
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/definition.js +1 -1
- 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 +7 -7
- package/bundled/calendar-picker.template.js +118 -118
- 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 +217 -36
- 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 +23 -24
- package/bundled/definition19.js +151 -163
- 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 +3 -3
- package/bundled/definition6.js +28 -28
- 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 +5 -5
- package/bundled/definition9.js +394 -392
- 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/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +51 -36
- 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 +1 -1
- package/bundled/picker-field.template.js +4 -4
- 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/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +2159 -1162
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +15 -15
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +11 -3
- package/card/definition.js +11 -3
- 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 +8 -28
- package/combobox/definition.js +10 -30
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +60 -74
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1670 -163
- 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/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dial-pad/definition.cjs +4 -0
- package/dial-pad/definition.js +4 -0
- package/dial-pad/index.cjs +3 -3
- package/dial-pad/index.js +42 -39
- package/dialog/definition.cjs +6 -3
- package/dialog/definition.js +6 -3
- package/dialog/index.cjs +22 -19
- package/dialog/index.js +48 -45
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- 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/definition.js +1 -1
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +2 -2
- package/file-picker/definition.js +3 -3
- package/file-picker/index.cjs +1 -1
- package/file-picker/index.js +4 -4
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +7 -4
- package/index.js +3 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- 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 +3 -3
- 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 +15 -14
- package/lib/combobox/combobox.options.d.ts +1 -1
- 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 +54 -54
- package/lib/date-range-picker/date-range-picker.d.ts +28 -28
- package/lib/date-time-picker/date-time-picker.d.ts +56 -56
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +3 -3
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +14 -14
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +4 -4
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- 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 +18 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/popup/popup.d.ts +1 -1
- 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/locale.d.ts +4 -0
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +21 -18
- package/lib/select/select.d.ts +19 -17
- 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 +7 -7
- 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/tabs/tabs.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 -17
- package/lib/text-field/text-field.d.ts +19 -19
- package/lib/time-picker/time-picker.d.ts +28 -28
- 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 +17 -2
- package/locales/de-DE.js +17 -2
- package/locales/en-GB.cjs +17 -2
- package/locales/en-GB.js +17 -2
- package/locales/en-US.cjs +17 -2
- package/locales/en-US.js +17 -2
- package/locales/ja-JP.cjs +17 -2
- package/locales/ja-JP.js +17 -2
- package/locales/zh-CN.cjs +17 -2
- package/locales/zh-CN.js +17 -2
- package/menu/definition.cjs +6 -6
- package/menu/definition.js +7 -7
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +3 -3
- package/number-field/index.cjs +5 -5
- package/number-field/index.js +21 -21
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +34 -8
- 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/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- 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/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +3 -4
- package/rich-text-editor/definition.js +3 -4
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1208 -1198
- package/searchable-select/definition.cjs +106 -14
- package/searchable-select/definition.js +107 -15
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +362 -276
- package/select/definition.cjs +25 -42
- package/select/definition.js +26 -43
- 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 +3 -3
- 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/listbox/listbox.d.ts +4 -0
- 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/with-contextual-help.d.ts +6 -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 +14 -14
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
- 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 +28 -28
- package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
- package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
- package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
- package/shared/picker-field/picker-field.d.ts +14 -14
- 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 +29 -216
- package/simple-color-picker/definition.js +30 -217
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.js +1 -1
- 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/tab/definition.js +1 -1
- 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/definition.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +8 -8
- package/text-field/definition.cjs +2 -2
- package/text-field/definition.js +4 -4
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +2 -2
- package/toggletip/definition.cjs +2 -2
- package/toggletip/definition.js +3 -3
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +2 -2
- package/tree-view/definition.js +3 -3
- 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 +2 -2
- 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 +4 -4
- package/unbundled/calendar-picker.template.js +5 -5
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +3 -3
- package/unbundled/definition3.cjs +222 -140
- package/unbundled/definition3.js +220 -138
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- 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/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +3 -3
- package/unbundled/picker-field.template.js +4 -4
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.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/video-player/definition.cjs +69047 -1
- package/video-player/definition.js +69047 -1
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +1895 -1905
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +719 -224
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const vividElement = require('./vivid-element.cjs');
|
|
4
|
+
const fastElement = require('@microsoft/fast-element');
|
|
5
|
+
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
9
|
+
var result = void 0 ;
|
|
10
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
11
|
+
if (decorator = decorators[i])
|
|
12
|
+
result = (decorator(target, key, result) ) || result;
|
|
13
|
+
if (result) __defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
class Elevation extends vividElement.VividElement {
|
|
17
|
+
}
|
|
18
|
+
__decorateClass([
|
|
19
|
+
fastElement.attr
|
|
20
|
+
], Elevation.prototype, "dp");
|
|
21
|
+
__decorateClass([
|
|
22
|
+
fastElement.attr({ attribute: "no-shadow", mode: "boolean" })
|
|
23
|
+
], Elevation.prototype, "noShadow");
|
|
24
|
+
__decorateClass([
|
|
25
|
+
fastElement.attr({ attribute: "not-relative", mode: "boolean" })
|
|
26
|
+
], Elevation.prototype, "notRelative");
|
|
27
|
+
|
|
28
|
+
const styles = ":host{display:contents}.control{display:contents}.control.dp-0{--_elevation-fill: var(--_vvd-tinted-color-surface-0dp, var(--vvd-color-surface-0dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-0dp, var(--vvd-shadow-surface-0dp))}.control.dp-4{--_elevation-fill: var(--_vvd-tinted-color-surface-4dp, var(--vvd-color-surface-4dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-4dp, var(--vvd-shadow-surface-4dp))}.control.dp-8{--_elevation-fill: var(--_vvd-tinted-color-surface-8dp, var(--vvd-color-surface-8dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-8dp, var(--vvd-shadow-surface-8dp))}.control.dp-12{--_elevation-fill: var(--_vvd-tinted-color-surface-12dp, var(--vvd-color-surface-12dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-12dp, var(--vvd-shadow-surface-12dp))}.control.dp-16{--_elevation-fill: var(--_vvd-tinted-color-surface-16dp, var(--vvd-color-surface-16dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-16dp, var(--vvd-shadow-surface-16dp))}.control.dp-24{--_elevation-fill: var(--_vvd-tinted-color-surface-24dp, var(--vvd-color-surface-24dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-24dp, var(--vvd-shadow-surface-24dp))}.control:not(.dp-0,.dp-4,.dp-8,.dp-12,.dp-16,.dp-24){--_elevation-fill: var(--_vvd-tinted-color-surface-2dp, var(--vvd-color-surface-2dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-2dp, var(--vvd-shadow-surface-2dp))}.control ::slotted(*){isolation:isolate}.control ::slotted(*):before{position:absolute;z-index:-1;border-radius:inherit;background:var(--_elevation-fill);block-size:100%;content:\"\";filter:var(--_elevation-shadow);inline-size:100%;inset-block-start:0;inset-inline-start:0;transition:background-color .15s linear,filter .15s linear}.control:not(.not-relative) ::slotted(*){position:relative}.control.no-shadow ::slotted(*):before{filter:none}";
|
|
29
|
+
|
|
30
|
+
const getClasses = ({ dp, noShadow, notRelative }) => fastWebUtilities.classNames(
|
|
31
|
+
"control",
|
|
32
|
+
[`dp-${dp}`, Boolean(dp)],
|
|
33
|
+
["no-shadow", Boolean(noShadow)],
|
|
34
|
+
["not-relative", Boolean(notRelative)]
|
|
35
|
+
);
|
|
36
|
+
const elevationTemplate = fastElement.html` <div
|
|
37
|
+
class="${getClasses}"
|
|
38
|
+
part="base"
|
|
39
|
+
>
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</div>`;
|
|
42
|
+
|
|
43
|
+
const elevationDefinition = vividElement.defineVividComponent(
|
|
44
|
+
"elevation",
|
|
45
|
+
Elevation,
|
|
46
|
+
elevationTemplate,
|
|
47
|
+
[],
|
|
48
|
+
{
|
|
49
|
+
styles
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const registerElevation = vividElement.createRegisterFunction(elevationDefinition);
|
|
53
|
+
|
|
54
|
+
exports.Elevation = Elevation;
|
|
55
|
+
exports.elevationDefinition = elevationDefinition;
|
|
56
|
+
exports.registerElevation = registerElevation;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { V as VividElement, d as defineVividComponent, c as createRegisterFunction } from './vivid-element.js';
|
|
2
|
+
import { attr, html } from '@microsoft/fast-element';
|
|
3
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = void 0 ;
|
|
8
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
if (decorator = decorators[i])
|
|
10
|
+
result = (decorator(target, key, result) ) || result;
|
|
11
|
+
if (result) __defProp(target, key, result);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
class Elevation extends VividElement {
|
|
15
|
+
}
|
|
16
|
+
__decorateClass([
|
|
17
|
+
attr
|
|
18
|
+
], Elevation.prototype, "dp");
|
|
19
|
+
__decorateClass([
|
|
20
|
+
attr({ attribute: "no-shadow", mode: "boolean" })
|
|
21
|
+
], Elevation.prototype, "noShadow");
|
|
22
|
+
__decorateClass([
|
|
23
|
+
attr({ attribute: "not-relative", mode: "boolean" })
|
|
24
|
+
], Elevation.prototype, "notRelative");
|
|
25
|
+
|
|
26
|
+
const styles = ":host{display:contents}.control{display:contents}.control.dp-0{--_elevation-fill: var(--_vvd-tinted-color-surface-0dp, var(--vvd-color-surface-0dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-0dp, var(--vvd-shadow-surface-0dp))}.control.dp-4{--_elevation-fill: var(--_vvd-tinted-color-surface-4dp, var(--vvd-color-surface-4dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-4dp, var(--vvd-shadow-surface-4dp))}.control.dp-8{--_elevation-fill: var(--_vvd-tinted-color-surface-8dp, var(--vvd-color-surface-8dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-8dp, var(--vvd-shadow-surface-8dp))}.control.dp-12{--_elevation-fill: var(--_vvd-tinted-color-surface-12dp, var(--vvd-color-surface-12dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-12dp, var(--vvd-shadow-surface-12dp))}.control.dp-16{--_elevation-fill: var(--_vvd-tinted-color-surface-16dp, var(--vvd-color-surface-16dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-16dp, var(--vvd-shadow-surface-16dp))}.control.dp-24{--_elevation-fill: var(--_vvd-tinted-color-surface-24dp, var(--vvd-color-surface-24dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-24dp, var(--vvd-shadow-surface-24dp))}.control:not(.dp-0,.dp-4,.dp-8,.dp-12,.dp-16,.dp-24){--_elevation-fill: var(--_vvd-tinted-color-surface-2dp, var(--vvd-color-surface-2dp));--_elevation-shadow: var(--_vvd-tinted-shadow-surface-2dp, var(--vvd-shadow-surface-2dp))}.control ::slotted(*){isolation:isolate}.control ::slotted(*):before{position:absolute;z-index:-1;border-radius:inherit;background:var(--_elevation-fill);block-size:100%;content:\"\";filter:var(--_elevation-shadow);inline-size:100%;inset-block-start:0;inset-inline-start:0;transition:background-color .15s linear,filter .15s linear}.control:not(.not-relative) ::slotted(*){position:relative}.control.no-shadow ::slotted(*):before{filter:none}";
|
|
27
|
+
|
|
28
|
+
const getClasses = ({ dp, noShadow, notRelative }) => classNames(
|
|
29
|
+
"control",
|
|
30
|
+
[`dp-${dp}`, Boolean(dp)],
|
|
31
|
+
["no-shadow", Boolean(noShadow)],
|
|
32
|
+
["not-relative", Boolean(notRelative)]
|
|
33
|
+
);
|
|
34
|
+
const elevationTemplate = html` <div
|
|
35
|
+
class="${getClasses}"
|
|
36
|
+
part="base"
|
|
37
|
+
>
|
|
38
|
+
<slot></slot>
|
|
39
|
+
</div>`;
|
|
40
|
+
|
|
41
|
+
const elevationDefinition = defineVividComponent(
|
|
42
|
+
"elevation",
|
|
43
|
+
Elevation,
|
|
44
|
+
elevationTemplate,
|
|
45
|
+
[],
|
|
46
|
+
{
|
|
47
|
+
styles
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
const registerElevation = createRegisterFunction(elevationDefinition);
|
|
51
|
+
|
|
52
|
+
export { Elevation as E, elevationDefinition as e, registerElevation as r };
|
|
@@ -6,20 +6,35 @@ const vividElement = require('./vivid-element.cjs');
|
|
|
6
6
|
|
|
7
7
|
class DelegateAriaBehavior {
|
|
8
8
|
constructor(target, params) {
|
|
9
|
-
this.target =
|
|
10
|
-
|
|
9
|
+
this.target = null;
|
|
10
|
+
// unbind() {
|
|
11
|
+
// if (this.source === null) {
|
|
12
|
+
// return;
|
|
13
|
+
// }
|
|
14
|
+
// this.releasePropertyBindings(this.source);
|
|
15
|
+
// this.stopForwardingPropertiesToTarget(this.source);
|
|
16
|
+
// this.source = null;
|
|
17
|
+
// }
|
|
11
18
|
this.bindingBehaviours = [];
|
|
19
|
+
// private stopForwardingPropertiesToTarget(source: DelegatesAriaElement) {
|
|
20
|
+
// unsubscribeFromAriaPropertyChanges(
|
|
21
|
+
// source as AriaMixinElement,
|
|
22
|
+
// this.onSourceAriaPropertyChanged
|
|
23
|
+
// );
|
|
24
|
+
// }
|
|
12
25
|
this.onSourceAriaPropertyChanged = (source, property) => {
|
|
13
|
-
if (!this.forwardedProperties.has(property)) {
|
|
26
|
+
if (!this.forwardedProperties.has(property) || property in this.boundProperties) {
|
|
14
27
|
return;
|
|
15
28
|
}
|
|
16
29
|
this.forwardPropertyToTarget(this.target, property, source[property]);
|
|
17
30
|
};
|
|
31
|
+
this.target = target;
|
|
18
32
|
this.boundProperties = params.boundProperties;
|
|
19
33
|
this.forwardedProperties = params.forwardedProperties;
|
|
20
34
|
}
|
|
21
|
-
|
|
22
|
-
|
|
35
|
+
// private source: DelegatesAriaElement | null = null;
|
|
36
|
+
bind(controller) {
|
|
37
|
+
const source = controller.source;
|
|
23
38
|
this.bindPropertiesToTarget(source, this.boundProperties, this.target);
|
|
24
39
|
this.startForwardingPropertiesToTarget(
|
|
25
40
|
source,
|
|
@@ -27,63 +42,82 @@ class DelegateAriaBehavior {
|
|
|
27
42
|
this.target
|
|
28
43
|
);
|
|
29
44
|
}
|
|
30
|
-
unbind() {
|
|
31
|
-
if (this.source === null) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.releasePropertyBindings(this.source);
|
|
35
|
-
this.stopForwardingPropertiesToTarget(this.source);
|
|
36
|
-
this.source = null;
|
|
37
|
-
}
|
|
38
45
|
bindPropertiesToTarget(source, boundProperties, target) {
|
|
39
46
|
for (const [property, binding] of Object.entries(boundProperties)) {
|
|
40
47
|
const bindingFn = binding instanceof Function ? binding : () => binding;
|
|
41
48
|
this.bindingBehaviours.push(
|
|
42
49
|
new attributeBindingBehaviour.AttributeBindingBehavior(
|
|
43
50
|
target,
|
|
44
|
-
bindingFn,
|
|
51
|
+
fastElement.oneWay(bindingFn),
|
|
45
52
|
fastElement.Observable.isVolatileBinding(bindingFn),
|
|
46
53
|
vividElement.ariaAttributeName(property)
|
|
47
54
|
)
|
|
48
55
|
);
|
|
49
56
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
57
|
+
for (const behavior of this.bindingBehaviours) {
|
|
58
|
+
behavior.bind({
|
|
59
|
+
source,
|
|
60
|
+
context: source.$fastController.context
|
|
61
|
+
});
|
|
62
|
+
}
|
|
55
63
|
}
|
|
64
|
+
// private releasePropertyBindings(source: DelegatesAriaElement) {
|
|
65
|
+
// for (const behavior of this.bindingBehaviours) {
|
|
66
|
+
// (behavior as any).unbind(); // TODO: fix type
|
|
67
|
+
// }
|
|
68
|
+
// this.bindingBehaviours = [];
|
|
69
|
+
// }
|
|
56
70
|
startForwardingPropertiesToTarget(source, delegatedProperties, target) {
|
|
57
71
|
for (const key of delegatedProperties) {
|
|
58
|
-
|
|
72
|
+
if (!(key in this.boundProperties)) {
|
|
73
|
+
this.forwardPropertyToTarget(target, key, source[key]);
|
|
74
|
+
}
|
|
59
75
|
}
|
|
60
|
-
vividElement.subscribeToAriaPropertyChanges(
|
|
61
|
-
}
|
|
62
|
-
stopForwardingPropertiesToTarget(source) {
|
|
63
|
-
vividElement.unsubscribeFromAriaPropertyChanges(
|
|
76
|
+
vividElement.subscribeToAriaPropertyChanges(
|
|
64
77
|
source,
|
|
65
78
|
this.onSourceAriaPropertyChanged
|
|
66
79
|
);
|
|
67
80
|
}
|
|
68
81
|
forwardPropertyToTarget(target, property, value) {
|
|
69
|
-
|
|
82
|
+
if (value === null || value === void 0 || value === false) {
|
|
83
|
+
target.removeAttribute(vividElement.ariaAttributeName(property));
|
|
84
|
+
} else {
|
|
85
|
+
target.setAttribute(vividElement.ariaAttributeName(property), String(value));
|
|
86
|
+
}
|
|
70
87
|
}
|
|
71
88
|
}
|
|
72
89
|
|
|
90
|
+
class DelegateAriaDirective extends fastElement.StatelessAttachedAttributeDirective {
|
|
91
|
+
constructor(boundProperties, forwardedProperties) {
|
|
92
|
+
super("vvd-delegate-aria");
|
|
93
|
+
this.boundProperties = boundProperties;
|
|
94
|
+
this.forwardedProperties = forwardedProperties;
|
|
95
|
+
/**
|
|
96
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
97
|
+
*/
|
|
98
|
+
this.targetNodeId = "";
|
|
99
|
+
}
|
|
100
|
+
bind(controller) {
|
|
101
|
+
const targetElement = controller.targets[this.targetNodeId];
|
|
102
|
+
const behavior = new DelegateAriaBehavior(
|
|
103
|
+
targetElement,
|
|
104
|
+
// Pass the target element as target
|
|
105
|
+
{
|
|
106
|
+
boundProperties: this.boundProperties,
|
|
107
|
+
forwardedProperties: this.forwardedProperties
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
behavior.bind(controller);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
fastElement.HTMLDirective.define(DelegateAriaDirective);
|
|
73
114
|
function delegateAria(boundProperties = {}, options = {}) {
|
|
74
115
|
const forwardedProperties = new Set(
|
|
75
116
|
(options.onlySpecified ? [] : vividElement.ariaMixinProperties).filter(
|
|
76
117
|
(p) => !(p in boundProperties)
|
|
77
118
|
)
|
|
78
119
|
);
|
|
79
|
-
return new
|
|
80
|
-
"vvd-delegate-aria",
|
|
81
|
-
DelegateAriaBehavior,
|
|
82
|
-
{
|
|
83
|
-
boundProperties,
|
|
84
|
-
forwardedProperties
|
|
85
|
-
}
|
|
86
|
-
);
|
|
120
|
+
return new DelegateAriaDirective(boundProperties, forwardedProperties);
|
|
87
121
|
}
|
|
88
122
|
const DelegatesAria = (Base) => {
|
|
89
123
|
class DelegatesAriaElement extends Base {
|
|
@@ -1,23 +1,38 @@
|
|
|
1
|
-
import { Observable,
|
|
1
|
+
import { oneWay, Observable, StatelessAttachedAttributeDirective, HTMLDirective } from '@microsoft/fast-element';
|
|
2
2
|
import { A as AttributeBindingBehavior } from './attribute-binding-behaviour.js';
|
|
3
|
-
import { a as ariaAttributeName, s as subscribeToAriaPropertyChanges,
|
|
3
|
+
import { a as ariaAttributeName, s as subscribeToAriaPropertyChanges, b as ariaMixinProperties } from './vivid-element.js';
|
|
4
4
|
|
|
5
5
|
class DelegateAriaBehavior {
|
|
6
6
|
constructor(target, params) {
|
|
7
|
-
this.target =
|
|
8
|
-
|
|
7
|
+
this.target = null;
|
|
8
|
+
// unbind() {
|
|
9
|
+
// if (this.source === null) {
|
|
10
|
+
// return;
|
|
11
|
+
// }
|
|
12
|
+
// this.releasePropertyBindings(this.source);
|
|
13
|
+
// this.stopForwardingPropertiesToTarget(this.source);
|
|
14
|
+
// this.source = null;
|
|
15
|
+
// }
|
|
9
16
|
this.bindingBehaviours = [];
|
|
17
|
+
// private stopForwardingPropertiesToTarget(source: DelegatesAriaElement) {
|
|
18
|
+
// unsubscribeFromAriaPropertyChanges(
|
|
19
|
+
// source as AriaMixinElement,
|
|
20
|
+
// this.onSourceAriaPropertyChanged
|
|
21
|
+
// );
|
|
22
|
+
// }
|
|
10
23
|
this.onSourceAriaPropertyChanged = (source, property) => {
|
|
11
|
-
if (!this.forwardedProperties.has(property)) {
|
|
24
|
+
if (!this.forwardedProperties.has(property) || property in this.boundProperties) {
|
|
12
25
|
return;
|
|
13
26
|
}
|
|
14
27
|
this.forwardPropertyToTarget(this.target, property, source[property]);
|
|
15
28
|
};
|
|
29
|
+
this.target = target;
|
|
16
30
|
this.boundProperties = params.boundProperties;
|
|
17
31
|
this.forwardedProperties = params.forwardedProperties;
|
|
18
32
|
}
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
// private source: DelegatesAriaElement | null = null;
|
|
34
|
+
bind(controller) {
|
|
35
|
+
const source = controller.source;
|
|
21
36
|
this.bindPropertiesToTarget(source, this.boundProperties, this.target);
|
|
22
37
|
this.startForwardingPropertiesToTarget(
|
|
23
38
|
source,
|
|
@@ -25,63 +40,82 @@ class DelegateAriaBehavior {
|
|
|
25
40
|
this.target
|
|
26
41
|
);
|
|
27
42
|
}
|
|
28
|
-
unbind() {
|
|
29
|
-
if (this.source === null) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
this.releasePropertyBindings(this.source);
|
|
33
|
-
this.stopForwardingPropertiesToTarget(this.source);
|
|
34
|
-
this.source = null;
|
|
35
|
-
}
|
|
36
43
|
bindPropertiesToTarget(source, boundProperties, target) {
|
|
37
44
|
for (const [property, binding] of Object.entries(boundProperties)) {
|
|
38
45
|
const bindingFn = binding instanceof Function ? binding : () => binding;
|
|
39
46
|
this.bindingBehaviours.push(
|
|
40
47
|
new AttributeBindingBehavior(
|
|
41
48
|
target,
|
|
42
|
-
bindingFn,
|
|
49
|
+
oneWay(bindingFn),
|
|
43
50
|
Observable.isVolatileBinding(bindingFn),
|
|
44
51
|
ariaAttributeName(property)
|
|
45
52
|
)
|
|
46
53
|
);
|
|
47
54
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
for (const behavior of this.bindingBehaviours) {
|
|
56
|
+
behavior.bind({
|
|
57
|
+
source,
|
|
58
|
+
context: source.$fastController.context
|
|
59
|
+
});
|
|
60
|
+
}
|
|
53
61
|
}
|
|
62
|
+
// private releasePropertyBindings(source: DelegatesAriaElement) {
|
|
63
|
+
// for (const behavior of this.bindingBehaviours) {
|
|
64
|
+
// (behavior as any).unbind(); // TODO: fix type
|
|
65
|
+
// }
|
|
66
|
+
// this.bindingBehaviours = [];
|
|
67
|
+
// }
|
|
54
68
|
startForwardingPropertiesToTarget(source, delegatedProperties, target) {
|
|
55
69
|
for (const key of delegatedProperties) {
|
|
56
|
-
|
|
70
|
+
if (!(key in this.boundProperties)) {
|
|
71
|
+
this.forwardPropertyToTarget(target, key, source[key]);
|
|
72
|
+
}
|
|
57
73
|
}
|
|
58
|
-
subscribeToAriaPropertyChanges(
|
|
59
|
-
}
|
|
60
|
-
stopForwardingPropertiesToTarget(source) {
|
|
61
|
-
unsubscribeFromAriaPropertyChanges(
|
|
74
|
+
subscribeToAriaPropertyChanges(
|
|
62
75
|
source,
|
|
63
76
|
this.onSourceAriaPropertyChanged
|
|
64
77
|
);
|
|
65
78
|
}
|
|
66
79
|
forwardPropertyToTarget(target, property, value) {
|
|
67
|
-
|
|
80
|
+
if (value === null || value === void 0 || value === false) {
|
|
81
|
+
target.removeAttribute(ariaAttributeName(property));
|
|
82
|
+
} else {
|
|
83
|
+
target.setAttribute(ariaAttributeName(property), String(value));
|
|
84
|
+
}
|
|
68
85
|
}
|
|
69
86
|
}
|
|
70
87
|
|
|
88
|
+
class DelegateAriaDirective extends StatelessAttachedAttributeDirective {
|
|
89
|
+
constructor(boundProperties, forwardedProperties) {
|
|
90
|
+
super("vvd-delegate-aria");
|
|
91
|
+
this.boundProperties = boundProperties;
|
|
92
|
+
this.forwardedProperties = forwardedProperties;
|
|
93
|
+
/**
|
|
94
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
95
|
+
*/
|
|
96
|
+
this.targetNodeId = "";
|
|
97
|
+
}
|
|
98
|
+
bind(controller) {
|
|
99
|
+
const targetElement = controller.targets[this.targetNodeId];
|
|
100
|
+
const behavior = new DelegateAriaBehavior(
|
|
101
|
+
targetElement,
|
|
102
|
+
// Pass the target element as target
|
|
103
|
+
{
|
|
104
|
+
boundProperties: this.boundProperties,
|
|
105
|
+
forwardedProperties: this.forwardedProperties
|
|
106
|
+
}
|
|
107
|
+
);
|
|
108
|
+
behavior.bind(controller);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
HTMLDirective.define(DelegateAriaDirective);
|
|
71
112
|
function delegateAria(boundProperties = {}, options = {}) {
|
|
72
113
|
const forwardedProperties = new Set(
|
|
73
114
|
(options.onlySpecified ? [] : ariaMixinProperties).filter(
|
|
74
115
|
(p) => !(p in boundProperties)
|
|
75
116
|
)
|
|
76
117
|
);
|
|
77
|
-
return new
|
|
78
|
-
"vvd-delegate-aria",
|
|
79
|
-
DelegateAriaBehavior,
|
|
80
|
-
{
|
|
81
|
-
boundProperties,
|
|
82
|
-
forwardedProperties
|
|
83
|
-
}
|
|
84
|
-
);
|
|
118
|
+
return new DelegateAriaDirective(boundProperties, forwardedProperties);
|
|
85
119
|
}
|
|
86
120
|
const DelegatesAria = (Base) => {
|
|
87
121
|
class DelegatesAriaElement extends Base {
|
|
@@ -133,7 +133,7 @@ const FormAssociated = (Base) => {
|
|
|
133
133
|
if (this.proxy instanceof HTMLElement) {
|
|
134
134
|
this.proxy.disabled = this.disabled;
|
|
135
135
|
}
|
|
136
|
-
fastElement.
|
|
136
|
+
fastElement.Updates.enqueue(() => this.classList.toggle("disabled", this.disabled));
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* @internal
|
|
@@ -150,7 +150,7 @@ const FormAssociated = (Base) => {
|
|
|
150
150
|
if (this.proxy instanceof HTMLElement) {
|
|
151
151
|
this.proxy.required = this.required;
|
|
152
152
|
}
|
|
153
|
-
fastElement.
|
|
153
|
+
fastElement.Updates.enqueue(() => this.classList.toggle("required", this.required));
|
|
154
154
|
this.validate();
|
|
155
155
|
}
|
|
156
156
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { attr, emptyArray,
|
|
1
|
+
import { attr, emptyArray, Updates } from '@microsoft/fast-element';
|
|
2
2
|
import { keyEnter } from '@microsoft/fast-web-utilities';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -131,7 +131,7 @@ const FormAssociated = (Base) => {
|
|
|
131
131
|
if (this.proxy instanceof HTMLElement) {
|
|
132
132
|
this.proxy.disabled = this.disabled;
|
|
133
133
|
}
|
|
134
|
-
|
|
134
|
+
Updates.enqueue(() => this.classList.toggle("disabled", this.disabled));
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* @internal
|
|
@@ -148,7 +148,7 @@ const FormAssociated = (Base) => {
|
|
|
148
148
|
if (this.proxy instanceof HTMLElement) {
|
|
149
149
|
this.proxy.required = this.required;
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
Updates.enqueue(() => this.classList.toggle("required", this.required));
|
|
152
152
|
this.validate();
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
@@ -6,51 +6,76 @@ const attributeBindingBehaviour = require('./attribute-binding-behaviour.cjs');
|
|
|
6
6
|
|
|
7
7
|
class HostSemanticsBehavior {
|
|
8
8
|
constructor(target, params) {
|
|
9
|
-
this.target =
|
|
9
|
+
this.target = null;
|
|
10
|
+
// unbind(controller: ViewController) {
|
|
11
|
+
// const source = controller.source as HostSemanticsElement;
|
|
12
|
+
// this.releasePropertyBindings(source);
|
|
13
|
+
// }
|
|
10
14
|
this.bindingBehaviours = [];
|
|
15
|
+
this.target = target;
|
|
11
16
|
this.boundProperties = params.boundProperties;
|
|
12
17
|
}
|
|
13
|
-
bind(
|
|
18
|
+
bind(controller) {
|
|
19
|
+
const source = controller.source;
|
|
14
20
|
if (this.target !== source) {
|
|
15
21
|
throw new Error("Target element must be the same as the source element");
|
|
16
22
|
}
|
|
17
23
|
this.bindPropertiesToTarget(source, this.boundProperties, this.target);
|
|
18
24
|
}
|
|
19
|
-
unbind(source) {
|
|
20
|
-
this.releasePropertyBindings(source);
|
|
21
|
-
}
|
|
22
25
|
bindPropertiesToTarget(source, boundProperties, target) {
|
|
23
26
|
for (const [property, binding] of Object.entries(boundProperties)) {
|
|
24
27
|
const bindingFn = binding instanceof Function ? binding : (x) => x[property] ?? binding;
|
|
25
28
|
this.bindingBehaviours.push(
|
|
26
29
|
new attributeBindingBehaviour.AttributeBindingBehavior(
|
|
27
30
|
target,
|
|
28
|
-
bindingFn,
|
|
31
|
+
fastElement.oneWay(bindingFn),
|
|
29
32
|
true,
|
|
30
33
|
vividElement.ariaAttributeName(property)
|
|
31
34
|
)
|
|
32
35
|
);
|
|
33
36
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
for (const behavior of this.bindingBehaviours) {
|
|
38
|
+
behavior.bind({
|
|
39
|
+
source,
|
|
40
|
+
context: source.$fastController.context
|
|
41
|
+
});
|
|
42
|
+
}
|
|
39
43
|
}
|
|
44
|
+
// private releasePropertyBindings(source: HostSemanticsElement) {
|
|
45
|
+
// for (const behavior of this.bindingBehaviours) {
|
|
46
|
+
// (behavior as any).unbind();
|
|
47
|
+
// }
|
|
48
|
+
// this.bindingBehaviours = [];
|
|
49
|
+
// }
|
|
40
50
|
}
|
|
41
51
|
|
|
52
|
+
class HostSemanticsDirective extends fastElement.StatelessAttachedAttributeDirective {
|
|
53
|
+
constructor(boundProperties) {
|
|
54
|
+
super("vvd-host-semantics");
|
|
55
|
+
this.boundProperties = boundProperties;
|
|
56
|
+
/**
|
|
57
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
58
|
+
*/
|
|
59
|
+
this.targetNodeId = "";
|
|
60
|
+
}
|
|
61
|
+
bind(controller) {
|
|
62
|
+
const targetElement = controller.targets[this.targetNodeId];
|
|
63
|
+
const behavior = new HostSemanticsBehavior(
|
|
64
|
+
targetElement,
|
|
65
|
+
// Pass the target element as target
|
|
66
|
+
{
|
|
67
|
+
boundProperties: this.boundProperties,
|
|
68
|
+
forwardedProperties: new Set(
|
|
69
|
+
vividElement.ariaMixinProperties.filter((p) => !(p in this.boundProperties))
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
behavior.bind(controller);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
fastElement.HTMLDirective.define(HostSemanticsDirective);
|
|
42
77
|
function applyHostSemantics(boundProperties = {}) {
|
|
43
|
-
|
|
44
|
-
vividElement.ariaMixinProperties.filter((p) => !(p in boundProperties))
|
|
45
|
-
);
|
|
46
|
-
return new fastElement.AttachedBehaviorHTMLDirective(
|
|
47
|
-
"vvd-host-semantics",
|
|
48
|
-
HostSemanticsBehavior,
|
|
49
|
-
{
|
|
50
|
-
boundProperties,
|
|
51
|
-
forwardedProperties
|
|
52
|
-
}
|
|
53
|
-
);
|
|
78
|
+
return new HostSemanticsDirective(boundProperties);
|
|
54
79
|
}
|
|
55
80
|
const HostSemantics = (Base) => {
|
|
56
81
|
class HostSemanticsElement extends Base {
|
|
@@ -1,54 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { oneWay, StatelessAttachedAttributeDirective, HTMLDirective } from '@microsoft/fast-element';
|
|
2
2
|
import { a as ariaAttributeName, b as ariaMixinProperties } from './vivid-element.js';
|
|
3
3
|
import { A as AttributeBindingBehavior } from './attribute-binding-behaviour.js';
|
|
4
4
|
|
|
5
5
|
class HostSemanticsBehavior {
|
|
6
6
|
constructor(target, params) {
|
|
7
|
-
this.target =
|
|
7
|
+
this.target = null;
|
|
8
|
+
// unbind(controller: ViewController) {
|
|
9
|
+
// const source = controller.source as HostSemanticsElement;
|
|
10
|
+
// this.releasePropertyBindings(source);
|
|
11
|
+
// }
|
|
8
12
|
this.bindingBehaviours = [];
|
|
13
|
+
this.target = target;
|
|
9
14
|
this.boundProperties = params.boundProperties;
|
|
10
15
|
}
|
|
11
|
-
bind(
|
|
16
|
+
bind(controller) {
|
|
17
|
+
const source = controller.source;
|
|
12
18
|
if (this.target !== source) {
|
|
13
19
|
throw new Error("Target element must be the same as the source element");
|
|
14
20
|
}
|
|
15
21
|
this.bindPropertiesToTarget(source, this.boundProperties, this.target);
|
|
16
22
|
}
|
|
17
|
-
unbind(source) {
|
|
18
|
-
this.releasePropertyBindings(source);
|
|
19
|
-
}
|
|
20
23
|
bindPropertiesToTarget(source, boundProperties, target) {
|
|
21
24
|
for (const [property, binding] of Object.entries(boundProperties)) {
|
|
22
25
|
const bindingFn = binding instanceof Function ? binding : (x) => x[property] ?? binding;
|
|
23
26
|
this.bindingBehaviours.push(
|
|
24
27
|
new AttributeBindingBehavior(
|
|
25
28
|
target,
|
|
26
|
-
bindingFn,
|
|
29
|
+
oneWay(bindingFn),
|
|
27
30
|
true,
|
|
28
31
|
ariaAttributeName(property)
|
|
29
32
|
)
|
|
30
33
|
);
|
|
31
34
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
for (const behavior of this.bindingBehaviours) {
|
|
36
|
+
behavior.bind({
|
|
37
|
+
source,
|
|
38
|
+
context: source.$fastController.context
|
|
39
|
+
});
|
|
40
|
+
}
|
|
37
41
|
}
|
|
42
|
+
// private releasePropertyBindings(source: HostSemanticsElement) {
|
|
43
|
+
// for (const behavior of this.bindingBehaviours) {
|
|
44
|
+
// (behavior as any).unbind();
|
|
45
|
+
// }
|
|
46
|
+
// this.bindingBehaviours = [];
|
|
47
|
+
// }
|
|
38
48
|
}
|
|
39
49
|
|
|
50
|
+
class HostSemanticsDirective extends StatelessAttachedAttributeDirective {
|
|
51
|
+
constructor(boundProperties) {
|
|
52
|
+
super("vvd-host-semantics");
|
|
53
|
+
this.boundProperties = boundProperties;
|
|
54
|
+
/**
|
|
55
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
56
|
+
*/
|
|
57
|
+
this.targetNodeId = "";
|
|
58
|
+
}
|
|
59
|
+
bind(controller) {
|
|
60
|
+
const targetElement = controller.targets[this.targetNodeId];
|
|
61
|
+
const behavior = new HostSemanticsBehavior(
|
|
62
|
+
targetElement,
|
|
63
|
+
// Pass the target element as target
|
|
64
|
+
{
|
|
65
|
+
boundProperties: this.boundProperties,
|
|
66
|
+
forwardedProperties: new Set(
|
|
67
|
+
ariaMixinProperties.filter((p) => !(p in this.boundProperties))
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
behavior.bind(controller);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
HTMLDirective.define(HostSemanticsDirective);
|
|
40
75
|
function applyHostSemantics(boundProperties = {}) {
|
|
41
|
-
|
|
42
|
-
ariaMixinProperties.filter((p) => !(p in boundProperties))
|
|
43
|
-
);
|
|
44
|
-
return new AttachedBehaviorHTMLDirective(
|
|
45
|
-
"vvd-host-semantics",
|
|
46
|
-
HostSemanticsBehavior,
|
|
47
|
-
{
|
|
48
|
-
boundProperties,
|
|
49
|
-
forwardedProperties
|
|
50
|
-
}
|
|
51
|
-
);
|
|
76
|
+
return new HostSemanticsDirective(boundProperties);
|
|
52
77
|
}
|
|
53
78
|
const HostSemantics = (Base) => {
|
|
54
79
|
class HostSemanticsElement extends Base {
|