@vonage/vivid 3.26.0 → 3.28.2
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/README.md +4 -1
- package/accordion/index.js +0 -2
- package/accordion-item/index.js +0 -2
- package/alert/index.js +0 -2
- package/avatar/index.js +0 -2
- package/badge/index.js +0 -2
- package/banner/index.js +0 -2
- package/breadcrumb-item/index.js +0 -2
- package/button/index.js +0 -2
- package/calendar/index.js +0 -1
- package/calendar-event/index.js +0 -2
- package/card/index.js +0 -2
- package/checkbox/index.js +0 -2
- package/combobox/index.js +0 -3
- package/custom-elements.json +440 -51
- package/data-grid/index.js +1 -5
- package/dialog/index.js +0 -2
- package/empty-state/index.js +0 -2
- package/fab/index.js +0 -2
- package/file-picker/index.js +24 -0
- package/header/index.js +1 -1
- package/icon/index.js +0 -2
- package/index.d.ts +3 -3
- package/index.js +31 -35
- package/layout/index.js +1 -1
- package/lib/accordion/accordion.d.ts +5 -5
- package/lib/accordion/accordion.template.d.ts +3 -3
- package/lib/accordion/definition.d.ts +2 -2
- package/lib/accordion/index.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +12 -12
- package/lib/accordion-item/accordion-item.template.d.ts +4 -4
- package/lib/accordion-item/definition.d.ts +1 -1
- package/lib/accordion-item/index.d.ts +1 -1
- package/lib/action-group/action-group.d.ts +11 -11
- package/lib/action-group/action-group.template.d.ts +4 -4
- package/lib/action-group/definition.d.ts +2 -2
- package/lib/action-group/index.d.ts +1 -1
- package/lib/alert/alert.d.ts +22 -22
- package/lib/alert/alert.template.d.ts +4 -4
- package/lib/alert/definition.d.ts +2 -2
- package/lib/alert/index.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +14 -14
- package/lib/avatar/avatar.template.d.ts +4 -4
- package/lib/avatar/definition.d.ts +2 -2
- package/lib/avatar/index.d.ts +1 -1
- package/lib/badge/badge.d.ts +14 -14
- package/lib/badge/badge.template.d.ts +4 -4
- package/lib/badge/definition.d.ts +4 -4
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +20 -20
- package/lib/banner/banner.template.d.ts +4 -4
- package/lib/banner/definition.d.ts +2 -2
- package/lib/banner/index.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +3 -3
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -4
- package/lib/breadcrumb/definition.d.ts +1 -1
- package/lib/breadcrumb/index.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -5
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -4
- package/lib/breadcrumb-item/definition.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -1
- package/lib/button/button.d.ts +18 -18
- package/lib/button/button.template.d.ts +4 -4
- package/lib/button/definition.d.ts +2 -2
- package/lib/button/index.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +13 -13
- package/lib/calendar/calendar.template.d.ts +4 -4
- package/lib/calendar/definition.d.ts +1 -1
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -2
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -6
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -9
- package/lib/calendar/index.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +13 -13
- package/lib/calendar-event/calendar-event.template.d.ts +4 -4
- package/lib/calendar-event/definition.d.ts +2 -2
- package/lib/calendar-event/index.d.ts +1 -1
- package/lib/card/card.d.ts +10 -10
- package/lib/card/card.template.d.ts +4 -4
- package/lib/card/definition.d.ts +1 -1
- package/lib/card/index.d.ts +1 -1
- package/lib/checkbox/checkbox.d.ts +10 -11
- package/lib/checkbox/checkbox.template.d.ts +4 -4
- package/lib/checkbox/definition.d.ts +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/combobox/combobox.d.ts +12 -13
- package/lib/combobox/combobox.template.d.ts +4 -4
- package/lib/combobox/definition.d.ts +3 -4
- package/lib/combobox/index.d.ts +1 -1
- package/lib/components.d.ts +52 -52
- package/lib/data-grid/data-grid-cell.d.ts +22 -22
- package/lib/data-grid/data-grid-cell.template.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +4 -4
- package/lib/data-grid/data-grid-row.template.d.ts +3 -3
- package/lib/data-grid/data-grid.d.ts +20 -20
- package/lib/data-grid/data-grid.options.d.ts +38 -38
- package/lib/data-grid/data-grid.template.d.ts +3 -3
- package/lib/data-grid/definition.d.ts +6 -6
- package/lib/data-grid/index.d.ts +1 -1
- package/lib/dialog/definition.d.ts +2 -2
- package/lib/dialog/dialog.d.ts +26 -26
- package/lib/dialog/dialog.template.d.ts +4 -4
- package/lib/dialog/index.d.ts +1 -1
- package/lib/divider/definition.d.ts +1 -1
- package/lib/divider/divider.d.ts +3 -3
- package/lib/divider/divider.template.d.ts +4 -4
- package/lib/divider/index.d.ts +1 -1
- package/lib/elevation/definition.d.ts +1 -1
- package/lib/elevation/elevation.d.ts +5 -5
- package/lib/elevation/elevation.template.d.ts +4 -4
- package/lib/elevation/index.d.ts +1 -1
- package/lib/empty-state/definition.d.ts +3 -3
- package/lib/empty-state/empty-state.d.ts +5 -5
- package/lib/empty-state/empty-state.template.d.ts +4 -4
- package/lib/empty-state/index.d.ts +1 -1
- package/lib/enums.d.ts +60 -60
- package/lib/fab/definition.d.ts +4 -4
- package/lib/fab/fab.d.ts +12 -12
- package/lib/fab/fab.template.d.ts +4 -4
- package/lib/fab/index.d.ts +1 -1
- package/lib/file-picker/definition.d.ts +3 -0
- package/lib/file-picker/file-picker.d.ts +22 -0
- package/lib/file-picker/file-picker.template.d.ts +4 -0
- package/lib/file-picker/index.d.ts +1 -0
- package/lib/focus/definition.d.ts +3 -3
- package/lib/focus/focus.d.ts +3 -3
- package/lib/focus/focus.template.d.ts +4 -4
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/definition.d.ts +3 -3
- package/lib/header/header.d.ts +5 -5
- package/lib/header/header.template.d.ts +4 -4
- package/lib/header/index.d.ts +1 -1
- package/lib/icon/definition.d.ts +4 -4
- package/lib/icon/icon.d.ts +12 -12
- package/lib/icon/icon.placeholder.d.ts +1 -1
- package/lib/icon/icon.template.d.ts +4 -4
- package/lib/icon/index.d.ts +1 -1
- package/lib/layout/definition.d.ts +4 -4
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +17 -17
- package/lib/layout/layout.template.d.ts +4 -4
- package/lib/listbox/definition.d.ts +4 -4
- package/lib/listbox/index.d.ts +1 -1
- package/lib/listbox/listbox.d.ts +6 -6
- package/lib/listbox/listbox.template.d.ts +4 -4
- package/lib/menu/definition.d.ts +12 -12
- package/lib/menu/index.d.ts +1 -1
- package/lib/menu/menu.d.ts +16 -14
- package/lib/menu/menu.template.d.ts +3 -3
- package/lib/menu-item/definition.d.ts +3 -3
- package/lib/menu-item/index.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +14 -14
- package/lib/menu-item/menu-item.template.d.ts +4 -4
- package/lib/nav/definition.d.ts +3 -3
- package/lib/nav/index.d.ts +1 -1
- package/lib/nav/nav.d.ts +3 -3
- package/lib/nav/nav.template.d.ts +4 -4
- package/lib/nav-disclosure/definition.d.ts +3 -3
- package/lib/nav-disclosure/index.d.ts +1 -1
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -10
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -4
- package/lib/nav-item/definition.d.ts +3 -3
- package/lib/nav-item/index.d.ts +1 -1
- package/lib/nav-item/nav-item.d.ts +7 -7
- package/lib/nav-item/nav-item.template.d.ts +4 -4
- package/lib/note/definition.d.ts +4 -4
- package/lib/note/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -10
- package/lib/note/note.template.d.ts +4 -4
- package/lib/number-field/definition.d.ts +5 -5
- package/lib/number-field/index.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +13 -13
- package/lib/number-field/number-field.template.d.ts +4 -4
- package/lib/option/definition.d.ts +3 -3
- package/lib/option/index.d.ts +1 -1
- package/lib/option/option.d.ts +12 -12
- package/lib/option/option.template.d.ts +4 -4
- package/lib/pagination/definition.d.ts +3 -3
- package/lib/pagination/index.d.ts +1 -1
- package/lib/pagination/pagination.d.ts +18 -18
- package/lib/pagination/pagination.template.d.ts +4 -4
- package/lib/popup/definition.d.ts +5 -5
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +21 -21
- package/lib/popup/popup.template.d.ts +4 -4
- package/lib/progress/definition.d.ts +4 -4
- package/lib/progress/index.d.ts +1 -1
- package/lib/progress/progress.d.ts +9 -9
- package/lib/progress/progress.template.d.ts +5 -5
- package/lib/progress-ring/definition.d.ts +4 -4
- package/lib/progress-ring/index.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +7 -7
- package/lib/progress-ring/progress-ring.template.d.ts +4 -4
- package/lib/radio/definition.d.ts +3 -3
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/radio.d.ts +7 -7
- package/lib/radio/radio.template.d.ts +4 -4
- package/lib/radio-group/definition.d.ts +11 -11
- package/lib/radio-group/index.d.ts +1 -1
- package/lib/radio-group/radio-group.d.ts +4 -4
- package/lib/radio-group/radio-group.template.d.ts +4 -4
- package/lib/select/definition.d.ts +4 -4
- package/lib/select/index.d.ts +1 -1
- package/lib/select/select.d.ts +17 -18
- package/lib/select/select.template.d.ts +4 -4
- package/lib/side-drawer/definition.d.ts +3 -3
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +9 -9
- package/lib/side-drawer/side-drawer.template.d.ts +4 -4
- package/lib/slider/definition.d.ts +3 -3
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/slider.d.ts +4 -4
- package/lib/slider/slider.template.d.ts +4 -4
- package/lib/switch/definition.d.ts +4 -4
- package/lib/switch/index.d.ts +1 -1
- package/lib/switch/switch.d.ts +7 -7
- package/lib/switch/switch.template.d.ts +4 -4
- package/lib/tab/definition.d.ts +4 -4
- package/lib/tab/index.d.ts +1 -1
- package/lib/tab/tab.d.ts +14 -14
- package/lib/tab/tab.template.d.ts +3 -3
- package/lib/tab-panel/definition.d.ts +3 -3
- package/lib/tab-panel/index.d.ts +1 -1
- package/lib/tab-panel/tab-panel.d.ts +3 -3
- package/lib/tab-panel/tab-panel.template.d.ts +2 -2
- package/lib/tabs/definition.d.ts +3 -3
- package/lib/tabs/index.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +15 -15
- package/lib/tabs/tabs.template.d.ts +2 -2
- package/lib/tag/definition.d.ts +4 -4
- package/lib/tag/index.d.ts +1 -1
- package/lib/tag/tag.d.ts +22 -22
- package/lib/tag/tag.template.d.ts +4 -4
- package/lib/tag-group/definition.d.ts +3 -3
- package/lib/tag-group/index.d.ts +1 -1
- package/lib/tag-group/tag-group.d.ts +3 -3
- package/lib/tag-group/tag-group.template.d.ts +4 -4
- package/lib/text-anchor/definition.d.ts +3 -3
- package/lib/text-anchor/index.d.ts +1 -1
- package/lib/text-anchor/text-anchor.d.ts +7 -7
- package/lib/text-anchor/text-anchor.template.d.ts +4 -4
- package/lib/text-area/definition.d.ts +4 -4
- package/lib/text-area/index.d.ts +1 -1
- package/lib/text-area/text-area.d.ts +8 -9
- package/lib/text-area/text-area.template.d.ts +4 -4
- package/lib/text-field/definition.d.ts +4 -4
- package/lib/text-field/index.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +13 -14
- package/lib/text-field/text-field.template.d.ts +4 -4
- package/lib/toggletip/definition.d.ts +3 -3
- package/lib/toggletip/index.d.ts +1 -1
- package/lib/toggletip/toggletip.d.ts +15 -15
- package/lib/toggletip/toggletip.template.d.ts +4 -4
- package/lib/tooltip/definition.d.ts +3 -3
- package/lib/tooltip/index.d.ts +1 -1
- package/lib/tooltip/tooltip.d.ts +14 -14
- package/lib/tooltip/tooltip.template.d.ts +4 -4
- package/lib/tree-item/definition.d.ts +3 -3
- package/lib/tree-item/index.d.ts +1 -1
- package/lib/tree-item/tree-item.d.ts +7 -7
- package/lib/tree-item/tree-item.template.d.ts +4 -4
- package/lib/tree-view/definition.d.ts +3 -3
- package/lib/tree-view/index.d.ts +1 -1
- package/lib/tree-view/tree-view.d.ts +3 -3
- package/lib/tree-view/tree-view.template.d.ts +2 -2
- package/listbox/index.js +17 -21
- package/menu/index.js +2 -5
- package/menu-item/index.js +1 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -3
- package/nav-item/index.js +1 -3
- package/note/index.js +1 -3
- package/number-field/index.js +1 -4
- package/option/index.js +0 -2
- package/package.json +10 -8
- package/pagination/index.js +2 -6
- package/popup/index.js +0 -3
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +3 -3
- package/select/index.js +1 -4
- package/shared/affix.js +2 -5
- package/shared/anchor.js +2 -1
- package/shared/apply-mixins.js +1 -1
- package/shared/definition.js +7 -9
- package/shared/definition10.js +13 -17
- package/shared/definition11.js +6 -9
- package/shared/definition12.js +16 -18
- package/shared/definition13.js +6 -8
- package/shared/definition14.js +7 -12
- package/shared/definition15.js +43 -52
- package/shared/definition16.js +8 -71
- package/shared/definition17.js +36 -45
- package/shared/definition18.js +19 -24
- package/shared/definition19.js +45 -49
- package/shared/definition2.js +24 -28
- package/shared/definition20.js +390 -281
- package/shared/definition21.js +12 -16
- package/shared/definition22.js +82 -168
- package/shared/definition23.js +35 -41
- package/shared/definition24.js +6 -8
- package/shared/definition25.js +10 -14
- package/shared/definition26.js +40 -42
- package/shared/definition27.js +2285 -48
- package/shared/definition28.js +46 -38
- package/shared/definition29.js +38 -370
- package/shared/definition3.js +5 -9
- package/shared/definition30.js +348 -302
- package/shared/definition31.js +365 -14
- package/shared/definition32.js +12 -71
- package/shared/definition33.js +63 -26
- package/shared/definition34.js +24 -40
- package/shared/definition35.js +32 -436
- package/shared/definition36.js +428 -217
- package/shared/definition37.js +175 -77
- package/shared/definition38.js +50 -34
- package/shared/definition39.js +36 -430
- package/shared/definition4.js +3 -5
- package/shared/definition40.js +358 -589
- package/shared/definition41.js +644 -75
- package/shared/definition42.js +70 -587
- package/shared/definition43.js +503 -84
- package/shared/definition44.js +124 -52
- package/shared/definition45.js +57 -19
- package/shared/definition46.js +17 -487
- package/shared/definition47.js +477 -102
- package/shared/definition48.js +109 -19
- package/shared/definition49.js +17 -276
- package/shared/definition5.js +7 -8
- package/shared/definition50.js +253 -101
- package/shared/definition51.js +114 -629
- package/shared/definition52.js +92 -85
- package/shared/definition53.js +112 -70
- package/shared/definition54.js +65 -294
- package/shared/definition55.js +303 -0
- package/shared/definition6.js +17 -23
- package/shared/definition7.js +44 -47
- package/shared/definition8.js +3 -5
- package/shared/definition9.js +13 -17
- package/shared/design-system/index.d.ts +3 -3
- package/shared/focus2.js +1 -3
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +16 -20
- package/shared/icon.js +2 -1171
- package/shared/index.js +41 -1549
- package/shared/listbox.js +1 -1
- package/shared/patterns/affix.d.ts +9 -9
- package/shared/patterns/focus.d.ts +3 -3
- package/shared/patterns/form-elements/form-elements.d.ts +57 -57
- package/shared/patterns/form-elements/index.d.ts +1 -1
- package/shared/patterns/index.d.ts +3 -3
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.template.js +38 -40
- package/shared/text-field.js +1 -1
- package/shared/text-field2.js +1 -1
- package/shared/when.js +19 -5
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -4
- 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 +17 -17
- package/styles/tokens/theme-light.css +17 -17
- package/switch/index.js +1 -3
- package/tab/index.js +1 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -5
- package/tag/index.js +1 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +0 -2
- package/text-area/index.js +1 -3
- package/text-field/index.js +1 -3
- package/toggletip/index.js +1 -5
- package/tooltip/index.js +1 -4
- package/tree-item/index.js +2 -4
- package/tree-view/index.js +1 -1
- package/vivid.api.json +210 -848
- package/shared/es.object.assign.js +0 -68
- package/shared/es.regexp.to-string.js +0 -61
- package/shared/es.string.includes.js +0 -83
- package/shared/string-trim.js +0 -40
- package/shared/to-string.js +0 -51
package/shared/definition42.js
CHANGED
|
@@ -1,604 +1,87 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import {
|
|
3
|
-
import { t as toString$1 } from './to-string.js';
|
|
4
|
-
import { w as whitespaces$1, s as stringTrim } from './string-trim.js';
|
|
5
|
-
import './es.regexp.to-string.js';
|
|
6
|
-
import { D as Direction, g as getDirection } from './direction.js';
|
|
7
|
-
import { l as limit$1 } from './numbers.js';
|
|
8
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
9
|
-
import { O as Orientation } from './aria.js';
|
|
10
|
-
import { a as keyHome, k as keyEnd, b as keyArrowDown, i as keyArrowLeft, c as keyArrowUp, h as keyArrowRight } from './key-codes.js';
|
|
11
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
12
|
-
import { r as ref } from './ref.js';
|
|
13
|
-
import { O as Orientation$1 } from './aria2.js';
|
|
1
|
+
import { F as FoundationElement, d as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { w as when } from './when.js';
|
|
14
3
|
import { c as classNames } from './class-names.js';
|
|
15
4
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) {
|
|
20
|
-
let pct = limit$1(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition));
|
|
21
|
-
if (direction === Direction.rtl) {
|
|
22
|
-
pct = 1 - pct;
|
|
23
|
-
}
|
|
24
|
-
return pct;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class _Slider extends FoundationElement {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Slider:class)} component.
|
|
31
|
-
*
|
|
32
|
-
* @internal
|
|
33
|
-
*/
|
|
34
|
-
class FormAssociatedSlider extends FormAssociated(_Slider) {
|
|
35
|
-
constructor() {
|
|
36
|
-
super(...arguments);
|
|
37
|
-
this.proxy = document.createElement("input");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The selection modes of a {@link @microsoft/fast-foundation#(Slider:class)}.
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
const SliderMode = {
|
|
46
|
-
singleValue: "single-value",
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* A Slider Custom HTML Element.
|
|
50
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#slider | ARIA slider }.
|
|
51
|
-
*
|
|
52
|
-
* @slot track - The track of the slider
|
|
53
|
-
* @slot track-start - The track-start visual indicator
|
|
54
|
-
* @slot thumb - The slider thumb
|
|
55
|
-
* @slot - The default slot for labels
|
|
56
|
-
* @csspart positioning-region - The region used to position the elements of the slider
|
|
57
|
-
* @csspart track-container - The region containing the track elements
|
|
58
|
-
* @csspart track-start - The element wrapping the track start slot
|
|
59
|
-
* @csspart thumb-container - The thumb container element which is programatically positioned
|
|
60
|
-
* @fires change - Fires a custom 'change' event when the slider value changes
|
|
61
|
-
*
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
class Slider$1 extends FormAssociatedSlider {
|
|
65
|
-
constructor() {
|
|
66
|
-
super(...arguments);
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
this.direction = Direction.ltr;
|
|
71
|
-
/**
|
|
72
|
-
* @internal
|
|
73
|
-
*/
|
|
74
|
-
this.isDragging = false;
|
|
75
|
-
/**
|
|
76
|
-
* @internal
|
|
77
|
-
*/
|
|
78
|
-
this.trackWidth = 0;
|
|
79
|
-
/**
|
|
80
|
-
* @internal
|
|
81
|
-
*/
|
|
82
|
-
this.trackMinWidth = 0;
|
|
83
|
-
/**
|
|
84
|
-
* @internal
|
|
85
|
-
*/
|
|
86
|
-
this.trackHeight = 0;
|
|
87
|
-
/**
|
|
88
|
-
* @internal
|
|
89
|
-
*/
|
|
90
|
-
this.trackLeft = 0;
|
|
91
|
-
/**
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
this.trackMinHeight = 0;
|
|
95
|
-
/**
|
|
96
|
-
* Custom function that generates a string for the component's "aria-valuetext" attribute based on the current value.
|
|
97
|
-
*
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
100
|
-
this.valueTextFormatter = () => null;
|
|
101
|
-
/**
|
|
102
|
-
* The minimum allowed value.
|
|
103
|
-
*
|
|
104
|
-
* @defaultValue - 0
|
|
105
|
-
* @public
|
|
106
|
-
* @remarks
|
|
107
|
-
* HTML Attribute: min
|
|
108
|
-
*/
|
|
109
|
-
this.min = 0; // Map to proxy element.
|
|
110
|
-
/**
|
|
111
|
-
* The maximum allowed value.
|
|
112
|
-
*
|
|
113
|
-
* @defaultValue - 10
|
|
114
|
-
* @public
|
|
115
|
-
* @remarks
|
|
116
|
-
* HTML Attribute: max
|
|
117
|
-
*/
|
|
118
|
-
this.max = 10; // Map to proxy element.
|
|
119
|
-
/**
|
|
120
|
-
* Value to increment or decrement via arrow keys, mouse click or drag.
|
|
121
|
-
*
|
|
122
|
-
* @public
|
|
123
|
-
* @remarks
|
|
124
|
-
* HTML Attribute: step
|
|
125
|
-
*/
|
|
126
|
-
this.step = 1; // Map to proxy element.
|
|
127
|
-
/**
|
|
128
|
-
* The orientation of the slider.
|
|
129
|
-
*
|
|
130
|
-
* @public
|
|
131
|
-
* @remarks
|
|
132
|
-
* HTML Attribute: orientation
|
|
133
|
-
*/
|
|
134
|
-
this.orientation = Orientation.horizontal;
|
|
135
|
-
/**
|
|
136
|
-
* The selection mode.
|
|
137
|
-
*
|
|
138
|
-
* @public
|
|
139
|
-
* @remarks
|
|
140
|
-
* HTML Attribute: mode
|
|
141
|
-
*/
|
|
142
|
-
this.mode = SliderMode.singleValue;
|
|
143
|
-
this.keypressHandler = (e) => {
|
|
144
|
-
if (this.readOnly) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (e.key === keyHome) {
|
|
148
|
-
e.preventDefault();
|
|
149
|
-
this.value = `${this.min}`;
|
|
150
|
-
}
|
|
151
|
-
else if (e.key === keyEnd) {
|
|
152
|
-
e.preventDefault();
|
|
153
|
-
this.value = `${this.max}`;
|
|
154
|
-
}
|
|
155
|
-
else if (!e.shiftKey) {
|
|
156
|
-
switch (e.key) {
|
|
157
|
-
case keyArrowRight:
|
|
158
|
-
case keyArrowUp:
|
|
159
|
-
e.preventDefault();
|
|
160
|
-
this.increment();
|
|
161
|
-
break;
|
|
162
|
-
case keyArrowLeft:
|
|
163
|
-
case keyArrowDown:
|
|
164
|
-
e.preventDefault();
|
|
165
|
-
this.decrement();
|
|
166
|
-
break;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
this.setupTrackConstraints = () => {
|
|
171
|
-
const clientRect = this.track.getBoundingClientRect();
|
|
172
|
-
this.trackWidth = this.track.clientWidth;
|
|
173
|
-
this.trackMinWidth = this.track.clientLeft;
|
|
174
|
-
this.trackHeight = clientRect.bottom;
|
|
175
|
-
this.trackMinHeight = clientRect.top;
|
|
176
|
-
this.trackLeft = this.getBoundingClientRect().left;
|
|
177
|
-
if (this.trackWidth === 0) {
|
|
178
|
-
this.trackWidth = 1;
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
this.setupListeners = (remove = false) => {
|
|
182
|
-
const eventAction = `${remove ? "remove" : "add"}EventListener`;
|
|
183
|
-
this[eventAction]("keydown", this.keypressHandler);
|
|
184
|
-
this[eventAction]("mousedown", this.handleMouseDown);
|
|
185
|
-
this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, {
|
|
186
|
-
passive: true,
|
|
187
|
-
});
|
|
188
|
-
this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, {
|
|
189
|
-
passive: true,
|
|
190
|
-
});
|
|
191
|
-
// removes handlers attached by mousedown handlers
|
|
192
|
-
if (remove) {
|
|
193
|
-
this.handleMouseDown(null);
|
|
194
|
-
this.handleThumbMouseDown(null);
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* @internal
|
|
199
|
-
*/
|
|
200
|
-
this.initialValue = "";
|
|
201
|
-
/**
|
|
202
|
-
* Handle mouse moves during a thumb drag operation
|
|
203
|
-
* If the event handler is null it removes the events
|
|
204
|
-
*/
|
|
205
|
-
this.handleThumbMouseDown = (event) => {
|
|
206
|
-
if (event) {
|
|
207
|
-
if (this.readOnly || this.disabled || event.defaultPrevented) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
event.target.focus();
|
|
211
|
-
}
|
|
212
|
-
const eventAction = `${event !== null ? "add" : "remove"}EventListener`;
|
|
213
|
-
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
214
|
-
window[eventAction]("mousemove", this.handleMouseMove, { passive: true });
|
|
215
|
-
window[eventAction]("touchmove", this.handleMouseMove, { passive: true });
|
|
216
|
-
window[eventAction]("touchend", this.handleWindowMouseUp);
|
|
217
|
-
this.isDragging = event !== null;
|
|
218
|
-
};
|
|
219
|
-
/**
|
|
220
|
-
* Handle mouse moves during a thumb drag operation
|
|
221
|
-
*/
|
|
222
|
-
this.handleMouseMove = (e) => {
|
|
223
|
-
if (this.readOnly || this.disabled || e.defaultPrevented) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
// update the value based on current position
|
|
227
|
-
const sourceEvent = window.TouchEvent && e instanceof TouchEvent
|
|
228
|
-
? e.touches[0]
|
|
229
|
-
: e;
|
|
230
|
-
const eventValue = this.orientation === Orientation.horizontal
|
|
231
|
-
? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft
|
|
232
|
-
: sourceEvent.pageY - document.documentElement.scrollTop;
|
|
233
|
-
this.value = `${this.calculateNewValue(eventValue)}`;
|
|
234
|
-
};
|
|
235
|
-
this.calculateNewValue = (rawValue) => {
|
|
236
|
-
// update the value based on current position
|
|
237
|
-
const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal
|
|
238
|
-
? this.trackMinWidth
|
|
239
|
-
: this.trackMinHeight, this.orientation === Orientation.horizontal
|
|
240
|
-
? this.trackWidth
|
|
241
|
-
: this.trackHeight, this.direction);
|
|
242
|
-
const newValue = (this.max - this.min) * newPosition + this.min;
|
|
243
|
-
return this.convertToConstrainedValue(newValue);
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Handle a window mouse up during a drag operation
|
|
247
|
-
*/
|
|
248
|
-
this.handleWindowMouseUp = (event) => {
|
|
249
|
-
this.stopDragging();
|
|
250
|
-
};
|
|
251
|
-
this.stopDragging = () => {
|
|
252
|
-
this.isDragging = false;
|
|
253
|
-
this.handleMouseDown(null);
|
|
254
|
-
this.handleThumbMouseDown(null);
|
|
255
|
-
};
|
|
256
|
-
/**
|
|
257
|
-
*
|
|
258
|
-
* @param e - MouseEvent or null. If there is no event handler it will remove the events
|
|
259
|
-
*/
|
|
260
|
-
this.handleMouseDown = (e) => {
|
|
261
|
-
const eventAction = `${e !== null ? "add" : "remove"}EventListener`;
|
|
262
|
-
if (e === null || (!this.disabled && !this.readOnly)) {
|
|
263
|
-
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
264
|
-
window.document[eventAction]("mouseleave", this.handleWindowMouseUp);
|
|
265
|
-
window[eventAction]("mousemove", this.handleMouseMove);
|
|
266
|
-
if (e) {
|
|
267
|
-
e.preventDefault();
|
|
268
|
-
this.setupTrackConstraints();
|
|
269
|
-
e.target.focus();
|
|
270
|
-
const controlValue = this.orientation === Orientation.horizontal
|
|
271
|
-
? e.pageX - document.documentElement.scrollLeft - this.trackLeft
|
|
272
|
-
: e.pageY - document.documentElement.scrollTop;
|
|
273
|
-
this.value = `${this.calculateNewValue(controlValue)}`;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
this.convertToConstrainedValue = (value) => {
|
|
278
|
-
if (isNaN(value)) {
|
|
279
|
-
value = this.min;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* The following logic intends to overcome the issue with math in JavaScript with regards to floating point numbers.
|
|
283
|
-
* This is needed as the `step` may be an integer but could also be a float. To accomplish this the step is assumed to be a float
|
|
284
|
-
* and is converted to an integer by determining the number of decimal places it represent, multiplying it until it is an
|
|
285
|
-
* integer and then dividing it to get back to the correct number.
|
|
286
|
-
*/
|
|
287
|
-
let constrainedValue = value - this.min;
|
|
288
|
-
const roundedConstrainedValue = Math.round(constrainedValue / this.step);
|
|
289
|
-
const remainderValue = constrainedValue -
|
|
290
|
-
(roundedConstrainedValue * (this.stepMultiplier * this.step)) /
|
|
291
|
-
this.stepMultiplier;
|
|
292
|
-
constrainedValue =
|
|
293
|
-
remainderValue >= Number(this.step) / 2
|
|
294
|
-
? constrainedValue - remainderValue + Number(this.step)
|
|
295
|
-
: constrainedValue - remainderValue;
|
|
296
|
-
return constrainedValue + this.min;
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
readOnlyChanged() {
|
|
300
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
301
|
-
this.proxy.readOnly = this.readOnly;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* The value property, typed as a number.
|
|
306
|
-
*
|
|
307
|
-
* @public
|
|
308
|
-
*/
|
|
309
|
-
get valueAsNumber() {
|
|
310
|
-
return parseFloat(super.value);
|
|
311
|
-
}
|
|
312
|
-
set valueAsNumber(next) {
|
|
313
|
-
this.value = next.toString();
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* @internal
|
|
317
|
-
*/
|
|
318
|
-
valueChanged(previous, next) {
|
|
319
|
-
super.valueChanged(previous, next);
|
|
320
|
-
if (this.$fastController.isConnected) {
|
|
321
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
322
|
-
}
|
|
323
|
-
this.$emit("change");
|
|
324
|
-
}
|
|
325
|
-
minChanged() {
|
|
326
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
327
|
-
this.proxy.min = `${this.min}`;
|
|
328
|
-
}
|
|
329
|
-
this.validate();
|
|
330
|
-
}
|
|
331
|
-
maxChanged() {
|
|
332
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
333
|
-
this.proxy.max = `${this.max}`;
|
|
334
|
-
}
|
|
335
|
-
this.validate();
|
|
336
|
-
}
|
|
337
|
-
stepChanged() {
|
|
338
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
339
|
-
this.proxy.step = `${this.step}`;
|
|
340
|
-
}
|
|
341
|
-
this.updateStepMultiplier();
|
|
342
|
-
this.validate();
|
|
343
|
-
}
|
|
344
|
-
orientationChanged() {
|
|
345
|
-
if (this.$fastController.isConnected) {
|
|
346
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* @internal
|
|
351
|
-
*/
|
|
352
|
-
connectedCallback() {
|
|
353
|
-
super.connectedCallback();
|
|
354
|
-
this.proxy.setAttribute("type", "range");
|
|
355
|
-
this.direction = getDirection(this);
|
|
356
|
-
this.updateStepMultiplier();
|
|
357
|
-
this.setupTrackConstraints();
|
|
358
|
-
this.setupListeners();
|
|
359
|
-
this.setupDefaultValue();
|
|
360
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* @internal
|
|
364
|
-
*/
|
|
365
|
-
disconnectedCallback() {
|
|
366
|
-
this.setupListeners(true);
|
|
367
|
-
}
|
|
368
|
-
/**
|
|
369
|
-
* Increment the value by the step
|
|
370
|
-
*
|
|
371
|
-
* @public
|
|
372
|
-
*/
|
|
373
|
-
increment() {
|
|
374
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical
|
|
375
|
-
? Number(this.value) + Number(this.step)
|
|
376
|
-
: Number(this.value) - Number(this.step);
|
|
377
|
-
const incrementedVal = this.convertToConstrainedValue(newVal);
|
|
378
|
-
const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`;
|
|
379
|
-
this.value = incrementedValString;
|
|
380
|
-
}
|
|
381
|
-
/**
|
|
382
|
-
* Decrement the value by the step
|
|
383
|
-
*
|
|
384
|
-
* @public
|
|
385
|
-
*/
|
|
386
|
-
decrement() {
|
|
387
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical
|
|
388
|
-
? Number(this.value) - Number(this.step)
|
|
389
|
-
: Number(this.value) + Number(this.step);
|
|
390
|
-
const decrementedVal = this.convertToConstrainedValue(newVal);
|
|
391
|
-
const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`;
|
|
392
|
-
this.value = decrementedValString;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Places the thumb based on the current value
|
|
396
|
-
*
|
|
397
|
-
* @public
|
|
398
|
-
* @param direction - writing mode
|
|
399
|
-
*/
|
|
400
|
-
setThumbPositionForOrientation(direction) {
|
|
401
|
-
const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction);
|
|
402
|
-
const percentage = (1 - newPct) * 100;
|
|
403
|
-
if (this.orientation === Orientation.horizontal) {
|
|
404
|
-
this.position = this.isDragging
|
|
405
|
-
? `right: ${percentage}%; transition: none;`
|
|
406
|
-
: `right: ${percentage}%; transition: all 0.2s ease;`;
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
this.position = this.isDragging
|
|
410
|
-
? `bottom: ${percentage}%; transition: none;`
|
|
411
|
-
: `bottom: ${percentage}%; transition: all 0.2s ease;`;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Update the step multiplier used to ensure rounding errors from steps that
|
|
416
|
-
* are not whole numbers
|
|
417
|
-
*/
|
|
418
|
-
updateStepMultiplier() {
|
|
419
|
-
const stepString = this.step + "";
|
|
420
|
-
const decimalPlacesOfStep = !!(this.step % 1)
|
|
421
|
-
? stepString.length - stepString.indexOf(".") - 1
|
|
422
|
-
: 0;
|
|
423
|
-
this.stepMultiplier = Math.pow(10, decimalPlacesOfStep);
|
|
424
|
-
}
|
|
425
|
-
get midpoint() {
|
|
426
|
-
return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`;
|
|
427
|
-
}
|
|
428
|
-
setupDefaultValue() {
|
|
429
|
-
if (typeof this.value === "string") {
|
|
430
|
-
if (this.value.length === 0) {
|
|
431
|
-
this.initialValue = this.midpoint;
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
const value = parseFloat(this.value);
|
|
435
|
-
if (!Number.isNaN(value) && (value < this.min || value > this.max)) {
|
|
436
|
-
this.value = this.midpoint;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
__decorate([
|
|
443
|
-
attr({ attribute: "readonly", mode: "boolean" })
|
|
444
|
-
], Slider$1.prototype, "readOnly", void 0);
|
|
445
|
-
__decorate([
|
|
446
|
-
observable
|
|
447
|
-
], Slider$1.prototype, "direction", void 0);
|
|
448
|
-
__decorate([
|
|
449
|
-
observable
|
|
450
|
-
], Slider$1.prototype, "isDragging", void 0);
|
|
451
|
-
__decorate([
|
|
452
|
-
observable
|
|
453
|
-
], Slider$1.prototype, "position", void 0);
|
|
454
|
-
__decorate([
|
|
455
|
-
observable
|
|
456
|
-
], Slider$1.prototype, "trackWidth", void 0);
|
|
457
|
-
__decorate([
|
|
458
|
-
observable
|
|
459
|
-
], Slider$1.prototype, "trackMinWidth", void 0);
|
|
460
|
-
__decorate([
|
|
461
|
-
observable
|
|
462
|
-
], Slider$1.prototype, "trackHeight", void 0);
|
|
463
|
-
__decorate([
|
|
464
|
-
observable
|
|
465
|
-
], Slider$1.prototype, "trackLeft", void 0);
|
|
466
|
-
__decorate([
|
|
467
|
-
observable
|
|
468
|
-
], Slider$1.prototype, "trackMinHeight", void 0);
|
|
469
|
-
__decorate([
|
|
470
|
-
observable
|
|
471
|
-
], Slider$1.prototype, "valueTextFormatter", void 0);
|
|
472
|
-
__decorate([
|
|
473
|
-
attr({ converter: nullableNumberConverter })
|
|
474
|
-
], Slider$1.prototype, "min", void 0);
|
|
475
|
-
__decorate([
|
|
476
|
-
attr({ converter: nullableNumberConverter })
|
|
477
|
-
], Slider$1.prototype, "max", void 0);
|
|
478
|
-
__decorate([
|
|
479
|
-
attr({ converter: nullableNumberConverter })
|
|
480
|
-
], Slider$1.prototype, "step", void 0);
|
|
481
|
-
__decorate([
|
|
482
|
-
attr
|
|
483
|
-
], Slider$1.prototype, "orientation", void 0);
|
|
484
|
-
__decorate([
|
|
485
|
-
attr
|
|
486
|
-
], Slider$1.prototype, "mode", void 0);
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
490
|
-
* is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
|
|
491
|
-
* the maximum will be returned. Otherwise, the value is returned un-changed.
|
|
492
|
-
*/
|
|
493
|
-
/**
|
|
494
|
-
* Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
|
|
495
|
-
* If value is greater than max, max will be returned.
|
|
496
|
-
*/
|
|
497
|
-
function limit(min, max, value) {
|
|
498
|
-
return Math.min(Math.max(value, min), max);
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
var css_248z = ":host {\n display: inline-block;\n width: 100%;\n}\n\n:host([orientation=vertical]) {\n height: 100%;\n min-height: calc(var(--_thumb-interaction-indicator-size) * 5);\n}\n\n.control {\n --_thumb-size: 12px;\n --_thumb-interaction-indicator-size: 36px;\n height: var(--_thumb-interaction-indicator-size);\n cursor: pointer;\n outline: none;\n user-select: none;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control .positioning-region {\n position: relative;\n}\n.control .track {\n position: absolute;\n background: var(--_track-background-color);\n border-radius: 4px;\n}\n.control .track .track-start {\n position: absolute;\n left: 0;\n height: 100%;\n background: var(--_track-start-background-color);\n border-radius: 4px;\n}\n.control .thumb-container {\n position: absolute;\n width: var(--_thumb-interaction-indicator-size);\n height: var(--_thumb-interaction-indicator-size);\n cursor: inherit;\n touch-action: none;\n}\n.control .thumb-container::before {\n position: absolute;\n display: block;\n width: var(--_thumb-interaction-indicator-size);\n height: var(--_thumb-interaction-indicator-size);\n background-color: var(--_track-start-background-color);\n border-radius: 50%;\n content: \"\";\n opacity: var(--_thumb-interaction-indicator-alpha, 0);\n transition: opacity 0.2s ease-out 0s;\n}\n.control .thumb-container::after {\n position: absolute;\n display: block;\n width: var(--_thumb-size);\n height: var(--_thumb-size);\n background-color: var(--_track-start-background-color);\n border-radius: 50%;\n content: \"\";\n inset: calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2);\n}\n.control[aria-orientation=horizontal] {\n width: calc(100% - var(--_thumb-size));\n min-width: var(--_thumb-size);\n margin-left: calc(var(--_thumb-size) / 2);\n}\n.control[aria-orientation=horizontal] .track {\n top: calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);\n right: 0;\n left: 0;\n height: 2px;\n}\n.control[aria-orientation=horizontal] .track .mark {\n width: 100%;\n height: 4px;\n}\n.control[aria-orientation=horizontal] .thumb-container {\n transform: translateX(calc(var(--_thumb-interaction-indicator-size) / 2));\n}\n.control[aria-orientation=vertical] {\n height: calc(100% - var(--_thumb-interaction-indicator-size));\n min-height: var(--_thumb-interaction-indicator-size);\n margin-top: calc(var(--_thumb-interaction-indicator-size) / 2);\n}\n.control[aria-orientation=vertical] .positioning-region {\n height: 100%;\n}\n.control[aria-orientation=vertical] .track {\n left: calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);\n width: 2px;\n height: 100%;\n}\n.control[aria-orientation=vertical] .track .mark {\n width: 4px;\n height: 100%;\n}\n.control[aria-orientation=vertical] .track-start {\n top: 0;\n width: 100%;\n height: auto;\n}\n.control[aria-orientation=vertical] .thumb-container {\n transform: translateY(calc(var(--_thumb-interaction-indicator-size) / 2));\n}\n.control.disabled {\n --_track-background-color: var(--vvd-color-neutral-100);\n --_track-start-background-color: var(--vvd-color-neutral-500);\n cursor: not-allowed;\n pointer-events: none;\n}\n.control:not(.disabled) {\n --_track-background-color: var(--vvd-color-neutral-300);\n --_track-start-background-color: var(--vvd-color-canvas-text);\n}\n.control:not(.disabled) .thumb-container:hover {\n --_thumb-interaction-indicator-alpha: 0.12;\n}\n.control:not(.disabled) .thumb-container:active {\n --_thumb-interaction-indicator-alpha: 0.25;\n}\n\n.focus-indicator {\n --focus-inset: -3px;\n --focus-stroke-gap-color: transparent;\n border-radius: 50%;\n}\n.control:not(:focus-visible) .focus-indicator {\n display: none;\n}";
|
|
502
|
-
|
|
503
|
-
var global = global$1;
|
|
504
|
-
var fails = fails$1;
|
|
505
|
-
var uncurryThis = functionUncurryThis;
|
|
506
|
-
var toString = toString$1;
|
|
507
|
-
var trim = stringTrim.trim;
|
|
508
|
-
var whitespaces = whitespaces$1;
|
|
509
|
-
|
|
510
|
-
var charAt = uncurryThis(''.charAt);
|
|
511
|
-
var $parseFloat$1 = global.parseFloat;
|
|
512
|
-
var Symbol = global.Symbol;
|
|
513
|
-
var ITERATOR = Symbol && Symbol.iterator;
|
|
514
|
-
var FORCED = 1 / $parseFloat$1(whitespaces + '-0') !== -Infinity
|
|
515
|
-
// MS Edge 18- broken with boxed symbols
|
|
516
|
-
|| (ITERATOR && !fails(function () { $parseFloat$1(Object(ITERATOR)); }));
|
|
517
|
-
|
|
518
|
-
// `parseFloat` method
|
|
519
|
-
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
520
|
-
var numberParseFloat = FORCED ? function parseFloat(string) {
|
|
521
|
-
var trimmedString = trim(toString(string));
|
|
522
|
-
var result = $parseFloat$1(trimmedString);
|
|
523
|
-
return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
|
|
524
|
-
} : $parseFloat$1;
|
|
525
|
-
|
|
526
|
-
var $ = _export;
|
|
527
|
-
var $parseFloat = numberParseFloat;
|
|
528
|
-
|
|
529
|
-
// `parseFloat` method
|
|
530
|
-
// https://tc39.es/ecma262/#sec-parsefloat-string
|
|
531
|
-
$({ global: true, forced: parseFloat != $parseFloat }, {
|
|
532
|
-
parseFloat: $parseFloat
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
class Slider extends Slider$1 {
|
|
5
|
+
var _SideDrawer_instances, _SideDrawer_close, _SideDrawer_open;
|
|
6
|
+
class SideDrawer extends FoundationElement {
|
|
536
7
|
constructor() {
|
|
537
8
|
super(...arguments);
|
|
538
|
-
this
|
|
9
|
+
_SideDrawer_instances.add(this);
|
|
10
|
+
this.alternate = false;
|
|
11
|
+
this.modal = false;
|
|
12
|
+
this.open = false;
|
|
13
|
+
this.trailing = false;
|
|
539
14
|
}
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
super.valueChanged(previous, value);
|
|
15
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
16
|
+
super.attributeChangedCallback(name, oldValue, newValue);
|
|
17
|
+
switch (name) {
|
|
18
|
+
case 'open':
|
|
19
|
+
{
|
|
20
|
+
this.open ? __classPrivateFieldGet(this, _SideDrawer_instances, "m", _SideDrawer_open).call(this) : __classPrivateFieldGet(this, _SideDrawer_instances, "m", _SideDrawer_close).call(this);
|
|
21
|
+
}
|
|
549
22
|
}
|
|
550
23
|
}
|
|
551
24
|
}
|
|
25
|
+
_SideDrawer_instances = new WeakSet(), _SideDrawer_close = function _SideDrawer_close() {
|
|
26
|
+
this.$emit('close', undefined, {
|
|
27
|
+
bubbles: false
|
|
28
|
+
});
|
|
29
|
+
}, _SideDrawer_open = function _SideDrawer_open() {
|
|
30
|
+
this.$emit('open', undefined, {
|
|
31
|
+
bubbles: false
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
__decorate([attr({
|
|
35
|
+
mode: 'boolean'
|
|
36
|
+
}), __metadata("design:type", Object)], SideDrawer.prototype, "alternate", void 0);
|
|
37
|
+
__decorate([attr({
|
|
38
|
+
mode: 'boolean'
|
|
39
|
+
}), __metadata("design:type", Object)], SideDrawer.prototype, "modal", void 0);
|
|
552
40
|
__decorate([attr({
|
|
553
41
|
mode: 'boolean'
|
|
554
|
-
}), __metadata("design:type", Object)],
|
|
42
|
+
}), __metadata("design:type", Object)], SideDrawer.prototype, "open", void 0);
|
|
43
|
+
__decorate([attr({
|
|
44
|
+
mode: 'boolean'
|
|
45
|
+
}), __metadata("design:type", Object)], SideDrawer.prototype, "trailing", void 0);
|
|
46
|
+
|
|
47
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 07 Aug 2023 18:00:27 GMT\n */\n.control {\n position: fixed;\n z-index: 1;\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n inline-size: 280px;\n inset-block: 0;\n overflow-y: auto;\n}\n.control[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n.control.trailing {\n inset-inline-end: 0;\n}\n.control:not(.open).trailing {\n transform: translateX(100%);\n}\n.control:not(.open):not(.trailing) {\n transform: translateX(-100%);\n}\n.control.open:not(.modal).trailing + .side-drawer-app-content {\n margin-inline-end: var(--side-drawer-app-content-offset, 280px);\n}\n.control.open:not(.modal):not(.trailing) + .side-drawer-app-content {\n margin-inline-start: var(--side-drawer-app-content-offset, 280px);\n}\n@media (prefers-reduced-motion: no-preference) {\n .control {\n transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n }\n}\n\n.scrim {\n background-color: var(--vvd-color-canvas-text, currentColor);\n opacity: 0.5;\n position: fixed;\n inset: 0;\n}\n.scrim:not(.open) {\n display: none;\n}";
|
|
555
48
|
|
|
556
|
-
let _ = t => t,
|
|
557
|
-
_t,
|
|
558
|
-
_t2;
|
|
559
49
|
const getClasses = ({
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
"
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
<div
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
${0}
|
|
588
|
-
</div>
|
|
589
|
-
<div ${0} class="thumb-container" style="${0}">
|
|
590
|
-
${0}
|
|
591
|
-
</div>
|
|
592
|
-
</div>
|
|
593
|
-
</div>`), x => x.disabled ? null : 0, x => x.valueTextFormatter(x.value), x => x.value, x => x.min, x => x.max, x => x.disabled ? true : void 0, x => x.orientation, getClasses, x => x.orientation, ref('track'), x => x.position, x => x.markers ? getMarkersTemplate(x.orientation === Orientation$1.horizontal, Math.floor((x.max - x.min) / x.step)) : void 0, ref('thumb'), x => x.position, () => focusTemplate);
|
|
50
|
+
modal,
|
|
51
|
+
open,
|
|
52
|
+
trailing
|
|
53
|
+
}) => classNames('control', ['modal', modal], ['open', open], ['trailing', trailing]);
|
|
54
|
+
const getScrimClasses = ({
|
|
55
|
+
open
|
|
56
|
+
}) => classNames('scrim', ['open', open]);
|
|
57
|
+
const sideDrawerTemplate = () => html`
|
|
58
|
+
<aside class="${getClasses}" part="base ${x => x.alternate ? 'vvd-theme-alternate' : ''}"
|
|
59
|
+
@keydown="${(x, c) => handleKeydown(x, c.event)}">
|
|
60
|
+
<slot></slot>
|
|
61
|
+
</aside>
|
|
62
|
+
|
|
63
|
+
<div class="side-drawer-app-content" ?inert="${x => x.open && x.modal}">
|
|
64
|
+
<slot name="app-content"></slot>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
${when(x => x.modal, html`<div class="${getScrimClasses}" @click="${x => x.open = false}"></div>`)}
|
|
68
|
+
`;
|
|
69
|
+
const handleKeydown = (x, {
|
|
70
|
+
key
|
|
71
|
+
}) => {
|
|
72
|
+
if (key === 'Escape') {
|
|
73
|
+
x.open = false;
|
|
74
|
+
} else {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
594
77
|
};
|
|
595
78
|
|
|
596
|
-
const
|
|
597
|
-
baseName: '
|
|
598
|
-
template:
|
|
79
|
+
const sideDrawerDefinition = SideDrawer.compose({
|
|
80
|
+
baseName: 'side-drawer',
|
|
81
|
+
template: sideDrawerTemplate,
|
|
599
82
|
styles: css_248z
|
|
600
83
|
});
|
|
601
|
-
const
|
|
602
|
-
const
|
|
84
|
+
const sideDrawerRegistries = [sideDrawerDefinition()];
|
|
85
|
+
const registerSideDrawer = registerFactory(sideDrawerRegistries);
|
|
603
86
|
|
|
604
|
-
export {
|
|
87
|
+
export { sideDrawerRegistries as a, registerSideDrawer as r, sideDrawerDefinition as s };
|