@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
package/unbundled/listbox.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fastElement = require('@microsoft/fast-element');
|
|
4
4
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
5
|
-
const
|
|
5
|
+
const option_definition = require('./definition3.cjs');
|
|
6
6
|
const vividElement = require('./vivid-element.cjs');
|
|
7
7
|
|
|
8
8
|
var __defProp = Object.defineProperty;
|
|
@@ -55,14 +55,6 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
55
55
|
get firstSelectedOption() {
|
|
56
56
|
return this.selectedOptions[0] ?? null;
|
|
57
57
|
}
|
|
58
|
-
/**
|
|
59
|
-
* Returns true if there is one or more selectable option.
|
|
60
|
-
*
|
|
61
|
-
* @internal
|
|
62
|
-
*/
|
|
63
|
-
get hasSelectableOptions() {
|
|
64
|
-
return this.options.length > 0 && !this.options.every((o) => o.disabled);
|
|
65
|
-
}
|
|
66
58
|
/**
|
|
67
59
|
* The number of options.
|
|
68
60
|
*
|
|
@@ -81,8 +73,19 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
81
73
|
return this._options;
|
|
82
74
|
}
|
|
83
75
|
set options(value) {
|
|
76
|
+
const prev = this._options;
|
|
84
77
|
this._options = value;
|
|
85
78
|
fastElement.Observable.notify(this, "options");
|
|
79
|
+
if (this.$fastController.isConnected) {
|
|
80
|
+
const newSelectedIndex = this._newDefaultSelectedIndex(
|
|
81
|
+
prev,
|
|
82
|
+
value,
|
|
83
|
+
this.selectedIndex
|
|
84
|
+
);
|
|
85
|
+
if (newSelectedIndex !== null) {
|
|
86
|
+
this.selectedIndex = newSelectedIndex;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
86
89
|
}
|
|
87
90
|
static {
|
|
88
91
|
/**
|
|
@@ -91,7 +94,7 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
91
94
|
* @param n - element to filter
|
|
92
95
|
* @public
|
|
93
96
|
*/
|
|
94
|
-
this.slottedOptionFilter = (n) =>
|
|
97
|
+
this.slottedOptionFilter = (n) => option_definition.isListboxOption(n) && !n.hidden;
|
|
95
98
|
}
|
|
96
99
|
static {
|
|
97
100
|
/**
|
|
@@ -156,34 +159,11 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
156
159
|
const re = new RegExp(`^${pattern}`, "gi");
|
|
157
160
|
return this.options.filter((o) => o.text.trim().match(re));
|
|
158
161
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
*
|
|
165
|
-
* @internal
|
|
166
|
-
*/
|
|
167
|
-
getSelectableIndex(prev, next) {
|
|
168
|
-
const direction = prev > next ? -1 : 1;
|
|
169
|
-
const potentialDirection = prev + direction;
|
|
170
|
-
let nextSelectableOption = null;
|
|
171
|
-
switch (direction) {
|
|
172
|
-
case -1: {
|
|
173
|
-
nextSelectableOption = this.options.reduceRight(
|
|
174
|
-
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2,
|
|
175
|
-
nextSelectableOption
|
|
176
|
-
);
|
|
177
|
-
break;
|
|
178
|
-
}
|
|
179
|
-
case 1: {
|
|
180
|
-
nextSelectableOption = this.options.reduce(
|
|
181
|
-
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2,
|
|
182
|
-
nextSelectableOption
|
|
183
|
-
);
|
|
184
|
-
break;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
162
|
+
getNextSelectableIndex(fromIndex) {
|
|
163
|
+
const nextSelectableOption = this.options.reduce(
|
|
164
|
+
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index >= fromIndex ? thisOption : nextSelectableOption2,
|
|
165
|
+
null
|
|
166
|
+
);
|
|
187
167
|
return this.options.indexOf(nextSelectableOption);
|
|
188
168
|
}
|
|
189
169
|
/**
|
|
@@ -301,18 +281,17 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
301
281
|
* @internal
|
|
302
282
|
*/
|
|
303
283
|
selectedIndexChanged(prev, next) {
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
if (this.options[this.selectedIndex]?.disabled && typeof prev === "number") {
|
|
309
|
-
const selectableIndex = this.getSelectableIndex(prev, next);
|
|
310
|
-
const newNext = selectableIndex > -1 ? selectableIndex : prev;
|
|
311
|
-
this.selectedIndex = newNext;
|
|
284
|
+
const validNext = this._validSelectedIndex(next);
|
|
285
|
+
if (next !== validNext) {
|
|
286
|
+
this.selectedIndex = validNext;
|
|
312
287
|
return;
|
|
313
288
|
}
|
|
314
289
|
this.setSelectedOptions();
|
|
315
290
|
}
|
|
291
|
+
_validSelectedIndex(index) {
|
|
292
|
+
const outOfRange = index > this.options.length - 1 || index < -1;
|
|
293
|
+
return outOfRange ? -1 : index;
|
|
294
|
+
}
|
|
316
295
|
/**
|
|
317
296
|
* Updates the selectedness of each option when the list of selected options changes.
|
|
318
297
|
*
|
|
@@ -367,13 +346,18 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
367
346
|
this.selectedIndex = this.selectedIndex - 1;
|
|
368
347
|
}
|
|
369
348
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
349
|
+
/// For this options change, determine if selectedIndex should change based on defaultSelected. Otherwise, returns null.
|
|
350
|
+
_newDefaultSelectedIndex(prev, next, currentSelectedIndex) {
|
|
351
|
+
for (const [index, newOption] of next.entries()) {
|
|
352
|
+
if (this._isDefaultSelected(newOption) && !prev.includes(newOption)) {
|
|
353
|
+
return index;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return null;
|
|
357
|
+
}
|
|
358
|
+
/// Whether an option should be considered defaultSelected
|
|
359
|
+
_isDefaultSelected(option) {
|
|
360
|
+
return option.defaultSelected;
|
|
377
361
|
}
|
|
378
362
|
/**
|
|
379
363
|
* Sets an option as selected and gives it focus.
|
|
@@ -381,11 +365,9 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
381
365
|
* @public
|
|
382
366
|
*/
|
|
383
367
|
setSelectedOptions() {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
this.focusAndScrollOptionIntoView();
|
|
388
|
-
}
|
|
368
|
+
this.selectedOptions = this.selectedIndex !== -1 ? [this.options[this.selectedIndex]] : [];
|
|
369
|
+
this._activeDescendant = this.firstSelectedOption?.id ?? "";
|
|
370
|
+
this.focusAndScrollOptionIntoView();
|
|
389
371
|
}
|
|
390
372
|
/**
|
|
391
373
|
* Updates the list of options and resets the selected option when the slotted option content changes.
|
|
@@ -394,7 +376,7 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
394
376
|
*/
|
|
395
377
|
slottedOptionsChanged(_, next) {
|
|
396
378
|
this.options = next.reduce((options, item) => {
|
|
397
|
-
if (
|
|
379
|
+
if (option_definition.isListboxOption(item)) {
|
|
398
380
|
options.push(item);
|
|
399
381
|
}
|
|
400
382
|
return options;
|
|
@@ -407,10 +389,6 @@ const _Listbox = class _Listbox extends vividElement.VividElement {
|
|
|
407
389
|
option.ariaPosInSet = `${index + 1}`;
|
|
408
390
|
option.ariaSetSize = setSize;
|
|
409
391
|
});
|
|
410
|
-
if (this.$fastController.isConnected) {
|
|
411
|
-
this.setSelectedOptions();
|
|
412
|
-
this.setDefaultSelectedOption();
|
|
413
|
-
}
|
|
414
392
|
}
|
|
415
393
|
/**
|
|
416
394
|
* Updates the filtered list of options when the typeahead buffer changes.
|
package/unbundled/listbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable, attr, observable } from '@microsoft/fast-element';
|
|
2
2
|
import { keySpace, keyEscape, keyEnter, keyTab, keyEnd, keyArrowUp, keyArrowDown, keyHome, findLastIndex, uniqueId } from '@microsoft/fast-web-utilities';
|
|
3
|
-
import { i as isListboxOption } from './
|
|
3
|
+
import { i as isListboxOption } from './definition3.js';
|
|
4
4
|
import { V as VividElement } from './vivid-element.js';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
@@ -53,14 +53,6 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
53
53
|
get firstSelectedOption() {
|
|
54
54
|
return this.selectedOptions[0] ?? null;
|
|
55
55
|
}
|
|
56
|
-
/**
|
|
57
|
-
* Returns true if there is one or more selectable option.
|
|
58
|
-
*
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
get hasSelectableOptions() {
|
|
62
|
-
return this.options.length > 0 && !this.options.every((o) => o.disabled);
|
|
63
|
-
}
|
|
64
56
|
/**
|
|
65
57
|
* The number of options.
|
|
66
58
|
*
|
|
@@ -79,8 +71,19 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
79
71
|
return this._options;
|
|
80
72
|
}
|
|
81
73
|
set options(value) {
|
|
74
|
+
const prev = this._options;
|
|
82
75
|
this._options = value;
|
|
83
76
|
Observable.notify(this, "options");
|
|
77
|
+
if (this.$fastController.isConnected) {
|
|
78
|
+
const newSelectedIndex = this._newDefaultSelectedIndex(
|
|
79
|
+
prev,
|
|
80
|
+
value,
|
|
81
|
+
this.selectedIndex
|
|
82
|
+
);
|
|
83
|
+
if (newSelectedIndex !== null) {
|
|
84
|
+
this.selectedIndex = newSelectedIndex;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
84
87
|
}
|
|
85
88
|
static {
|
|
86
89
|
/**
|
|
@@ -154,34 +157,11 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
154
157
|
const re = new RegExp(`^${pattern}`, "gi");
|
|
155
158
|
return this.options.filter((o) => o.text.trim().match(re));
|
|
156
159
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
*
|
|
163
|
-
* @internal
|
|
164
|
-
*/
|
|
165
|
-
getSelectableIndex(prev, next) {
|
|
166
|
-
const direction = prev > next ? -1 : 1;
|
|
167
|
-
const potentialDirection = prev + direction;
|
|
168
|
-
let nextSelectableOption = null;
|
|
169
|
-
switch (direction) {
|
|
170
|
-
case -1: {
|
|
171
|
-
nextSelectableOption = this.options.reduceRight(
|
|
172
|
-
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2,
|
|
173
|
-
nextSelectableOption
|
|
174
|
-
);
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case 1: {
|
|
178
|
-
nextSelectableOption = this.options.reduce(
|
|
179
|
-
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2,
|
|
180
|
-
nextSelectableOption
|
|
181
|
-
);
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
160
|
+
getNextSelectableIndex(fromIndex) {
|
|
161
|
+
const nextSelectableOption = this.options.reduce(
|
|
162
|
+
(nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index >= fromIndex ? thisOption : nextSelectableOption2,
|
|
163
|
+
null
|
|
164
|
+
);
|
|
185
165
|
return this.options.indexOf(nextSelectableOption);
|
|
186
166
|
}
|
|
187
167
|
/**
|
|
@@ -299,18 +279,17 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
299
279
|
* @internal
|
|
300
280
|
*/
|
|
301
281
|
selectedIndexChanged(prev, next) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
if (this.options[this.selectedIndex]?.disabled && typeof prev === "number") {
|
|
307
|
-
const selectableIndex = this.getSelectableIndex(prev, next);
|
|
308
|
-
const newNext = selectableIndex > -1 ? selectableIndex : prev;
|
|
309
|
-
this.selectedIndex = newNext;
|
|
282
|
+
const validNext = this._validSelectedIndex(next);
|
|
283
|
+
if (next !== validNext) {
|
|
284
|
+
this.selectedIndex = validNext;
|
|
310
285
|
return;
|
|
311
286
|
}
|
|
312
287
|
this.setSelectedOptions();
|
|
313
288
|
}
|
|
289
|
+
_validSelectedIndex(index) {
|
|
290
|
+
const outOfRange = index > this.options.length - 1 || index < -1;
|
|
291
|
+
return outOfRange ? -1 : index;
|
|
292
|
+
}
|
|
314
293
|
/**
|
|
315
294
|
* Updates the selectedness of each option when the list of selected options changes.
|
|
316
295
|
*
|
|
@@ -365,13 +344,18 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
365
344
|
this.selectedIndex = this.selectedIndex - 1;
|
|
366
345
|
}
|
|
367
346
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
347
|
+
/// For this options change, determine if selectedIndex should change based on defaultSelected. Otherwise, returns null.
|
|
348
|
+
_newDefaultSelectedIndex(prev, next, currentSelectedIndex) {
|
|
349
|
+
for (const [index, newOption] of next.entries()) {
|
|
350
|
+
if (this._isDefaultSelected(newOption) && !prev.includes(newOption)) {
|
|
351
|
+
return index;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
/// Whether an option should be considered defaultSelected
|
|
357
|
+
_isDefaultSelected(option) {
|
|
358
|
+
return option.defaultSelected;
|
|
375
359
|
}
|
|
376
360
|
/**
|
|
377
361
|
* Sets an option as selected and gives it focus.
|
|
@@ -379,11 +363,9 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
379
363
|
* @public
|
|
380
364
|
*/
|
|
381
365
|
setSelectedOptions() {
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
this.focusAndScrollOptionIntoView();
|
|
386
|
-
}
|
|
366
|
+
this.selectedOptions = this.selectedIndex !== -1 ? [this.options[this.selectedIndex]] : [];
|
|
367
|
+
this._activeDescendant = this.firstSelectedOption?.id ?? "";
|
|
368
|
+
this.focusAndScrollOptionIntoView();
|
|
387
369
|
}
|
|
388
370
|
/**
|
|
389
371
|
* Updates the list of options and resets the selected option when the slotted option content changes.
|
|
@@ -405,10 +387,6 @@ const _Listbox = class _Listbox extends VividElement {
|
|
|
405
387
|
option.ariaPosInSet = `${index + 1}`;
|
|
406
388
|
option.ariaSetSize = setSize;
|
|
407
389
|
});
|
|
408
|
-
if (this.$fastController.isConnected) {
|
|
409
|
-
this.setSelectedOptions();
|
|
410
|
-
this.setDefaultSelectedOption();
|
|
411
|
-
}
|
|
412
390
|
}
|
|
413
391
|
/**
|
|
414
392
|
* Updates the filtered list of options when the typeahead buffer changes.
|
package/unbundled/mixins.cjs
CHANGED
|
@@ -64,35 +64,39 @@ const feedbackMessageDefinition = vividElement.defineVividComponent(
|
|
|
64
64
|
);
|
|
65
65
|
|
|
66
66
|
class RenderInLightDomBehaviour {
|
|
67
|
-
constructor(
|
|
67
|
+
constructor(directive) {
|
|
68
68
|
this.source = null;
|
|
69
|
-
this.templateBindingObserver =
|
|
70
|
-
templateBinding,
|
|
69
|
+
this.templateBindingObserver = directive.templateBinding.createObserver(
|
|
71
70
|
this,
|
|
72
|
-
|
|
71
|
+
directive
|
|
73
72
|
);
|
|
74
73
|
}
|
|
75
|
-
bind(
|
|
76
|
-
this.source = source;
|
|
77
|
-
this.context = context;
|
|
74
|
+
bind(controller) {
|
|
75
|
+
this.source = controller.source;
|
|
76
|
+
this.context = controller.context;
|
|
77
|
+
this.controller = controller;
|
|
78
78
|
if (!this.insertionPoint) {
|
|
79
79
|
this.insertionPoint = document.createComment("");
|
|
80
|
-
source.appendChild(this.insertionPoint);
|
|
80
|
+
this.source.appendChild(this.insertionPoint);
|
|
81
81
|
}
|
|
82
|
-
this.
|
|
83
|
-
|
|
84
|
-
unbind() {
|
|
85
|
-
this.source = null;
|
|
86
|
-
this.view.unbind();
|
|
87
|
-
this.templateBindingObserver.disconnect();
|
|
82
|
+
this.templateBindingObserver.bind(controller);
|
|
83
|
+
this.handleChange(this.source, this.templateBindingObserver);
|
|
88
84
|
}
|
|
85
|
+
// unbind(): void {
|
|
86
|
+
// this.source = null;
|
|
87
|
+
// if (this.view) {
|
|
88
|
+
// this.view.unbind();
|
|
89
|
+
// }
|
|
90
|
+
// // The observer will be automatically cleaned up when the behavior is destroyed
|
|
91
|
+
// }
|
|
89
92
|
/**
|
|
90
93
|
* Handles change of the template itself.
|
|
91
94
|
*/
|
|
92
|
-
handleChange() {
|
|
93
|
-
this.
|
|
94
|
-
this.templateBindingObserver.
|
|
95
|
-
|
|
95
|
+
handleChange(source, args) {
|
|
96
|
+
if (args === this.templateBindingObserver) {
|
|
97
|
+
const template = this.templateBindingObserver.bind(this.controller);
|
|
98
|
+
this.instantiateTemplate(template);
|
|
99
|
+
}
|
|
96
100
|
}
|
|
97
101
|
instantiateTemplate(template) {
|
|
98
102
|
if (this.view) {
|
|
@@ -103,22 +107,25 @@ class RenderInLightDomBehaviour {
|
|
|
103
107
|
this.view.insertBefore(this.insertionPoint);
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
|
-
class RenderInLightDomDirective
|
|
110
|
+
class RenderInLightDomDirective {
|
|
107
111
|
constructor(templateBinding) {
|
|
108
|
-
|
|
112
|
+
/**
|
|
113
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
114
|
+
*/
|
|
115
|
+
this.targetNodeId = "";
|
|
109
116
|
this.templateBinding = templateBinding;
|
|
110
|
-
this.
|
|
111
|
-
|
|
117
|
+
this.dataBinding = templateBinding;
|
|
118
|
+
}
|
|
119
|
+
createHTML(add) {
|
|
120
|
+
return fastElement.Markup.comment(add(this));
|
|
112
121
|
}
|
|
113
122
|
createBehavior() {
|
|
114
|
-
return new RenderInLightDomBehaviour(
|
|
115
|
-
this.templateBinding,
|
|
116
|
-
this.isTemplateBindingVolatile
|
|
117
|
-
);
|
|
123
|
+
return new RenderInLightDomBehaviour(this);
|
|
118
124
|
}
|
|
119
125
|
}
|
|
126
|
+
fastElement.HTMLDirective.define(RenderInLightDomDirective);
|
|
120
127
|
function renderInLightDOM(templateOrTemplateBinding) {
|
|
121
|
-
const templateBinding =
|
|
128
|
+
const templateBinding = fastElement.normalizeBinding(templateOrTemplateBinding);
|
|
122
129
|
return new RenderInLightDomDirective(templateBinding);
|
|
123
130
|
}
|
|
124
131
|
|
package/unbundled/mixins.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html, when, attr,
|
|
1
|
+
import { html, when, attr, normalizeBinding, Markup, HTMLDirective, observable, slotted } from '@microsoft/fast-element';
|
|
2
2
|
import { v4 } from 'uuid';
|
|
3
3
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { iconDefinition, VwcIconElement as Icon } from '../icon/definition.js';
|
|
@@ -62,35 +62,39 @@ const feedbackMessageDefinition = defineVividComponent(
|
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
class RenderInLightDomBehaviour {
|
|
65
|
-
constructor(
|
|
65
|
+
constructor(directive) {
|
|
66
66
|
this.source = null;
|
|
67
|
-
this.templateBindingObserver =
|
|
68
|
-
templateBinding,
|
|
67
|
+
this.templateBindingObserver = directive.templateBinding.createObserver(
|
|
69
68
|
this,
|
|
70
|
-
|
|
69
|
+
directive
|
|
71
70
|
);
|
|
72
71
|
}
|
|
73
|
-
bind(
|
|
74
|
-
this.source = source;
|
|
75
|
-
this.context = context;
|
|
72
|
+
bind(controller) {
|
|
73
|
+
this.source = controller.source;
|
|
74
|
+
this.context = controller.context;
|
|
75
|
+
this.controller = controller;
|
|
76
76
|
if (!this.insertionPoint) {
|
|
77
77
|
this.insertionPoint = document.createComment("");
|
|
78
|
-
source.appendChild(this.insertionPoint);
|
|
78
|
+
this.source.appendChild(this.insertionPoint);
|
|
79
79
|
}
|
|
80
|
-
this.
|
|
81
|
-
|
|
82
|
-
unbind() {
|
|
83
|
-
this.source = null;
|
|
84
|
-
this.view.unbind();
|
|
85
|
-
this.templateBindingObserver.disconnect();
|
|
80
|
+
this.templateBindingObserver.bind(controller);
|
|
81
|
+
this.handleChange(this.source, this.templateBindingObserver);
|
|
86
82
|
}
|
|
83
|
+
// unbind(): void {
|
|
84
|
+
// this.source = null;
|
|
85
|
+
// if (this.view) {
|
|
86
|
+
// this.view.unbind();
|
|
87
|
+
// }
|
|
88
|
+
// // The observer will be automatically cleaned up when the behavior is destroyed
|
|
89
|
+
// }
|
|
87
90
|
/**
|
|
88
91
|
* Handles change of the template itself.
|
|
89
92
|
*/
|
|
90
|
-
handleChange() {
|
|
91
|
-
this.
|
|
92
|
-
this.templateBindingObserver.
|
|
93
|
-
|
|
93
|
+
handleChange(source, args) {
|
|
94
|
+
if (args === this.templateBindingObserver) {
|
|
95
|
+
const template = this.templateBindingObserver.bind(this.controller);
|
|
96
|
+
this.instantiateTemplate(template);
|
|
97
|
+
}
|
|
94
98
|
}
|
|
95
99
|
instantiateTemplate(template) {
|
|
96
100
|
if (this.view) {
|
|
@@ -101,22 +105,25 @@ class RenderInLightDomBehaviour {
|
|
|
101
105
|
this.view.insertBefore(this.insertionPoint);
|
|
102
106
|
}
|
|
103
107
|
}
|
|
104
|
-
class RenderInLightDomDirective
|
|
108
|
+
class RenderInLightDomDirective {
|
|
105
109
|
constructor(templateBinding) {
|
|
106
|
-
|
|
110
|
+
/**
|
|
111
|
+
* The structural id of the DOM node to which the created behavior will apply.
|
|
112
|
+
*/
|
|
113
|
+
this.targetNodeId = "";
|
|
107
114
|
this.templateBinding = templateBinding;
|
|
108
|
-
this.
|
|
109
|
-
|
|
115
|
+
this.dataBinding = templateBinding;
|
|
116
|
+
}
|
|
117
|
+
createHTML(add) {
|
|
118
|
+
return Markup.comment(add(this));
|
|
110
119
|
}
|
|
111
120
|
createBehavior() {
|
|
112
|
-
return new RenderInLightDomBehaviour(
|
|
113
|
-
this.templateBinding,
|
|
114
|
-
this.isTemplateBindingVolatile
|
|
115
|
-
);
|
|
121
|
+
return new RenderInLightDomBehaviour(this);
|
|
116
122
|
}
|
|
117
123
|
}
|
|
124
|
+
HTMLDirective.define(RenderInLightDomDirective);
|
|
118
125
|
function renderInLightDOM(templateOrTemplateBinding) {
|
|
119
|
-
const templateBinding =
|
|
126
|
+
const templateBinding = normalizeBinding(templateOrTemplateBinding);
|
|
120
127
|
return new RenderInLightDomDirective(templateBinding);
|
|
121
128
|
}
|
|
122
129
|
|
|
@@ -10,7 +10,7 @@ const withErrorText = require('./with-error-text.cjs');
|
|
|
10
10
|
const formElement = require('./form-element.cjs');
|
|
11
11
|
const localized = require('./localized.cjs');
|
|
12
12
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
13
|
-
const popup_definition = require('./
|
|
13
|
+
const popup_definition = require('./definition5.cjs');
|
|
14
14
|
const textField_definition = require('../text-field/definition.cjs');
|
|
15
15
|
const button_definition = require('./definition.cjs');
|
|
16
16
|
|
|
@@ -146,10 +146,10 @@ class PickerField extends withContextualHelp.WithContextualHelp(
|
|
|
146
146
|
() => this.locale,
|
|
147
147
|
this.#localeChangeHandler
|
|
148
148
|
);
|
|
149
|
-
this.#localeChangeObserver.observe(this, fastElement.
|
|
149
|
+
this.#localeChangeObserver.observe(this, fastElement.ExecutionContext.default);
|
|
150
150
|
}
|
|
151
151
|
#stopObservingLocaleChanges() {
|
|
152
|
-
this.#localeChangeObserver.
|
|
152
|
+
this.#localeChangeObserver.dispose();
|
|
153
153
|
}
|
|
154
154
|
#dismissOnClickOutside;
|
|
155
155
|
#openPopupIfPossible() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Observable,
|
|
1
|
+
import { Observable, ExecutionContext, attr, observable, ref, slotted, html } from '@microsoft/fast-element';
|
|
2
2
|
import { h as handleEscapeKeyAndStopPropogation } from './index.js';
|
|
3
3
|
import { a as WithFeedback } from './mixins.js';
|
|
4
4
|
import { F as FormAssociated } from './form-associated.js';
|
|
@@ -8,7 +8,7 @@ import { W as WithErrorText } from './with-error-text.js';
|
|
|
8
8
|
import { F as FormElement } from './form-element.js';
|
|
9
9
|
import { L as Localized } from './localized.js';
|
|
10
10
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
11
|
-
import { P as Popup } from './
|
|
11
|
+
import { P as Popup } from './definition5.js';
|
|
12
12
|
import { VwcTextFieldElement as TextField } from '../text-field/definition.js';
|
|
13
13
|
import { B as Button } from './definition.js';
|
|
14
14
|
|
|
@@ -144,10 +144,10 @@ class PickerField extends WithContextualHelp(
|
|
|
144
144
|
() => this.locale,
|
|
145
145
|
this.#localeChangeHandler
|
|
146
146
|
);
|
|
147
|
-
this.#localeChangeObserver.observe(this,
|
|
147
|
+
this.#localeChangeObserver.observe(this, ExecutionContext.default);
|
|
148
148
|
}
|
|
149
149
|
#stopObservingLocaleChanges() {
|
|
150
|
-
this.#localeChangeObserver.
|
|
150
|
+
this.#localeChangeObserver.dispose();
|
|
151
151
|
}
|
|
152
152
|
#dismissOnClickOutside;
|
|
153
153
|
#openPopupIfPossible() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const fastWebUtilities = require('@microsoft/fast-web-utilities');
|
|
4
4
|
const fastElement = require('@microsoft/fast-element');
|
|
5
|
-
const popup_definition = require('./
|
|
5
|
+
const popup_definition = require('./definition5.cjs');
|
|
6
6
|
const delegatesAria = require('./delegates-aria.cjs');
|
|
7
7
|
|
|
8
8
|
const getDecimalPlaces = (num) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { limit, classNames, Orientation } from '@microsoft/fast-web-utilities';
|
|
2
2
|
import { ref, when, html } from '@microsoft/fast-element';
|
|
3
|
-
import { P as Popup, a as PlacementStrategy } from './
|
|
3
|
+
import { P as Popup, a as PlacementStrategy } from './definition5.js';
|
|
4
4
|
import { d as delegateAria } from './delegates-aria.js';
|
|
5
5
|
|
|
6
6
|
const getDecimalPlaces = (num) => {
|
|
@@ -562,10 +562,10 @@ const TimeSelectionPicker = (Base) => {
|
|
|
562
562
|
() => this._use12hClock,
|
|
563
563
|
this.#clockChangeHandler
|
|
564
564
|
);
|
|
565
|
-
this.#clockChangeObserver.observe(this, fastElement.
|
|
565
|
+
this.#clockChangeObserver.observe(this, fastElement.ExecutionContext.default);
|
|
566
566
|
}
|
|
567
567
|
#stopObservingClockChanges() {
|
|
568
|
-
this.#clockChangeObserver.
|
|
568
|
+
this.#clockChangeObserver.dispose();
|
|
569
569
|
}
|
|
570
570
|
/**
|
|
571
571
|
* @internal
|
|
@@ -588,7 +588,7 @@ const TimeSelectionPicker = (Base) => {
|
|
|
588
588
|
_onPickerButtonClick() {
|
|
589
589
|
super._onPickerButtonClick();
|
|
590
590
|
if (this._popupOpen) {
|
|
591
|
-
fastElement.
|
|
591
|
+
fastElement.Updates.process();
|
|
592
592
|
this._inlineTimePickerEl.scrollSelectedOptionsToTop();
|
|
593
593
|
}
|
|
594
594
|
}
|
|
@@ -748,7 +748,7 @@ class TimePicker extends TimeSelectionPicker(
|
|
|
748
748
|
_onPickerButtonClick() {
|
|
749
749
|
super._onPickerButtonClick();
|
|
750
750
|
if (this._popupOpen) {
|
|
751
|
-
fastElement.
|
|
751
|
+
fastElement.Updates.process();
|
|
752
752
|
this._focusableElsWithinDialog()[0]?.focus();
|
|
753
753
|
}
|
|
754
754
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V as VividElement, d as defineVividComponent } from './vivid-element.js';
|
|
2
|
-
import { when, html, repeat, observable, attr, nullableNumberConverter, Observable,
|
|
2
|
+
import { when, html, repeat, observable, attr, nullableNumberConverter, Observable, ExecutionContext, Updates, volatile, ref } from '@microsoft/fast-element';
|
|
3
3
|
import { i as ignoreEventInFocusTraps, a as PickerField } from './picker-field.template.js';
|
|
4
4
|
import { S as SingleValuePicker } from './single-value-picker.js';
|
|
5
5
|
import { classNames } from '@microsoft/fast-web-utilities';
|
|
@@ -560,10 +560,10 @@ const TimeSelectionPicker = (Base) => {
|
|
|
560
560
|
() => this._use12hClock,
|
|
561
561
|
this.#clockChangeHandler
|
|
562
562
|
);
|
|
563
|
-
this.#clockChangeObserver.observe(this,
|
|
563
|
+
this.#clockChangeObserver.observe(this, ExecutionContext.default);
|
|
564
564
|
}
|
|
565
565
|
#stopObservingClockChanges() {
|
|
566
|
-
this.#clockChangeObserver.
|
|
566
|
+
this.#clockChangeObserver.dispose();
|
|
567
567
|
}
|
|
568
568
|
/**
|
|
569
569
|
* @internal
|
|
@@ -586,7 +586,7 @@ const TimeSelectionPicker = (Base) => {
|
|
|
586
586
|
_onPickerButtonClick() {
|
|
587
587
|
super._onPickerButtonClick();
|
|
588
588
|
if (this._popupOpen) {
|
|
589
|
-
|
|
589
|
+
Updates.process();
|
|
590
590
|
this._inlineTimePickerEl.scrollSelectedOptionsToTop();
|
|
591
591
|
}
|
|
592
592
|
}
|
|
@@ -746,7 +746,7 @@ class TimePicker extends TimeSelectionPicker(
|
|
|
746
746
|
_onPickerButtonClick() {
|
|
747
747
|
super._onPickerButtonClick();
|
|
748
748
|
if (this._popupOpen) {
|
|
749
|
-
|
|
749
|
+
Updates.process();
|
|
750
750
|
this._focusableElsWithinDialog()[0]?.focus();
|
|
751
751
|
}
|
|
752
752
|
}
|