@material/web 1.0.0-pre.6 → 1.0.0-pre.7
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 +7 -7
- package/aria/aria.d.ts +43 -0
- package/aria/aria.js +56 -0
- package/aria/aria.js.map +1 -0
- package/aria/delegate.d.ts +37 -0
- package/aria/delegate.js +53 -0
- package/aria/delegate.js.map +1 -0
- package/badge/badge.d.ts +0 -1
- package/badge/badge.js +0 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/badge.d.ts +8 -7
- package/badge/lib/badge.js +5 -6
- package/badge/lib/badge.js.map +1 -1
- package/button/lib/_elevation.scss +13 -3
- package/button/lib/button.d.ts +1 -12
- package/button/lib/button.js +29 -60
- package/button/lib/button.js.map +1 -1
- package/button/lib/shared-elevation-styles.css.js +1 -1
- package/button/lib/shared-elevation-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox.d.ts +0 -1
- package/checkbox/lib/checkbox.js +33 -43
- package/checkbox/lib/checkbox.js.map +1 -1
- package/chips/_filter-chip.scss +6 -0
- package/chips/filter-chip.d.ts +20 -0
- package/chips/filter-chip.js +24 -0
- package/chips/filter-chip.js.map +1 -0
- package/chips/lib/_filter-chip.scss +141 -0
- package/chips/lib/_shared.scss +18 -14
- package/chips/lib/assist-styles.css.js +1 -1
- package/chips/lib/assist-styles.css.js.map +1 -1
- package/chips/lib/chip.d.ts +8 -3
- package/chips/lib/chip.js +29 -30
- package/chips/lib/chip.js.map +1 -1
- package/chips/lib/filter-chip.d.ts +21 -0
- package/chips/lib/filter-chip.js +47 -0
- package/chips/lib/filter-chip.js.map +1 -0
- package/chips/lib/filter-styles.css.js +9 -0
- package/chips/lib/filter-styles.css.js.map +1 -0
- package/{fab/lib/fab-extended-styles.scss → chips/lib/filter-styles.scss} +3 -3
- package/chips/lib/shared-styles.css.js +1 -1
- package/chips/lib/shared-styles.css.js.map +1 -1
- package/chips/lib/suggestion-styles.css.js +1 -1
- package/chips/lib/suggestion-styles.css.js.map +1 -1
- package/circularprogress/harness.d.ts +1 -0
- package/circularprogress/harness.js +4 -0
- package/circularprogress/harness.js.map +1 -1
- package/circularprogress/lib/circular-progress.d.ts +0 -1
- package/circularprogress/lib/circular-progress.js +16 -19
- package/circularprogress/lib/circular-progress.js.map +1 -1
- package/dialog/lib/_dialog.scss +8 -8
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog.js +25 -49
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/lib/divider.js +4 -7
- package/divider/lib/divider.js.map +1 -1
- package/elevation/lib/_elevation.scss +5 -7
- package/elevation/lib/elevation-styles.css.js +1 -1
- package/elevation/lib/elevation-styles.css.js.map +1 -1
- package/fab/_fab.scss +1 -0
- package/fab/branded-fab.d.ts +53 -0
- package/fab/branded-fab.js +56 -0
- package/fab/branded-fab.js.map +1 -0
- package/fab/fab.d.ts +25 -5
- package/fab/fab.js +27 -10
- package/fab/fab.js.map +1 -1
- package/fab/harness.d.ts +1 -2
- package/fab/harness.js +1 -1
- package/fab/harness.js.map +1 -1
- package/fab/lib/_fab-branded.scss +27 -0
- package/fab/lib/_fab.scss +144 -16
- package/fab/lib/_shared.scss +155 -130
- package/fab/lib/fab-branded-styles.css.js +9 -0
- package/fab/lib/fab-branded-styles.css.js.map +1 -0
- package/fab/lib/fab-branded-styles.scss +10 -0
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab.d.ts +14 -10
- package/fab/lib/fab.js +19 -12
- package/fab/lib/fab.js.map +1 -1
- package/fab/lib/forced-colors-styles.css.d.ts +1 -0
- package/fab/lib/forced-colors-styles.css.js +9 -0
- package/fab/lib/forced-colors-styles.css.js.map +1 -0
- package/fab/lib/forced-colors-styles.scss +26 -0
- package/fab/lib/shared-styles.css.d.ts +1 -0
- package/fab/lib/shared-styles.css.js +9 -0
- package/fab/lib/shared-styles.css.js.map +1 -0
- package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
- package/fab/lib/{fab-shared.d.ts → shared.d.ts} +24 -16
- package/fab/lib/shared.js +137 -0
- package/fab/lib/shared.js.map +1 -0
- package/field/lib/field.js +14 -27
- package/field/lib/field.js.map +1 -1
- package/focus/focus-ring.d.ts +0 -1
- package/focus/focus-ring.js +0 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/focus-ring.js +2 -3
- package/focus/lib/focus-ring.js.map +1 -1
- package/focus/strong-focus.js +5 -0
- package/focus/strong-focus.js.map +1 -1
- package/icon/icon.d.ts +0 -1
- package/icon/icon.js +0 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +2 -0
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon.d.ts +5 -4
- package/icon/lib/icon.js +3 -2
- package/icon/lib/icon.js.map +1 -1
- package/iconbutton/lib/icon-button.d.ts +0 -4
- package/iconbutton/lib/icon-button.js +28 -48
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/linearprogress/_linear-progress.scss +6 -0
- package/linearprogress/harness.d.ts +13 -0
- package/linearprogress/harness.js +18 -0
- package/linearprogress/harness.js.map +1 -0
- package/linearprogress/lib/_linear-progress.scss +380 -0
- package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
- package/linearprogress/lib/linear-progress-styles.css.js +9 -0
- package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
- package/linearprogress/lib/linear-progress-styles.scss +8 -0
- package/linearprogress/lib/linear-progress.d.ts +35 -0
- package/linearprogress/lib/linear-progress.js +127 -0
- package/linearprogress/lib/linear-progress.js.map +1 -0
- package/linearprogress/linear-progress.d.ts +23 -0
- package/linearprogress/linear-progress.js +26 -0
- package/linearprogress/linear-progress.js.map +1 -0
- package/list/lib/_list.scss +6 -49
- package/list/lib/list-styles.css.js +1 -1
- package/list/lib/list-styles.css.js.map +1 -1
- package/list/lib/list.d.ts +1 -3
- package/list/lib/list.js +18 -34
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +10 -69
- package/list/lib/listitem/forced-colors-styles.css.js +1 -1
- package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item-styles.css.js +1 -1
- package/list/lib/listitem/list-item-styles.css.js.map +1 -1
- package/list/lib/listitem/list-item.d.ts +2 -4
- package/list/lib/listitem/list-item.js +24 -53
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js +4 -6
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/menu/lib/_menu.scss +6 -28
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu.d.ts +1 -2
- package/menu/lib/menu.js +38 -63
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +13 -32
- package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
- package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
- package/menu/lib/menuitem/menu-item.d.ts +1 -1
- package/menu/lib/menuitem/menu-item.js +4 -6
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
- package/menu/lib/menuitemlink/menu-item-link.js +3 -6
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +6 -2
- package/menu/lib/shared.js.map +1 -1
- package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -2
- package/menu/lib/submenuitem/sub-menu-item.js +7 -15
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +7 -1
- package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
- package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
- package/navigationbar/lib/navigation-bar.d.ts +5 -5
- package/navigationbar/lib/navigation-bar.js +17 -18
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.d.ts +0 -1
- package/navigationbar/navigation-bar.js +0 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal.d.ts +5 -10
- package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer.d.ts +5 -9
- package/navigationdrawer/lib/navigation-drawer.js +17 -38
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
- package/navigationdrawer/navigation-drawer-modal.js +0 -1
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.d.ts +0 -1
- package/navigationdrawer/navigation-drawer.js +0 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/navigation-tab.d.ts +19 -24
- package/navigationtab/lib/navigation-tab.js +48 -68
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/navigation-tab.d.ts +0 -1
- package/navigationtab/navigation-tab.js +0 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +1 -1
- package/radio/lib/radio.d.ts +0 -1
- package/radio/lib/radio.js +30 -37
- package/radio/lib/radio.js.map +1 -1
- package/ripple/lib/ripple.js +7 -13
- package/ripple/lib/ripple.js.map +1 -1
- package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
- package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
- package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
- package/segmentedbutton/lib/segmented-button.d.ts +27 -33
- package/segmentedbutton/lib/segmented-button.js +42 -75
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
- package/segmentedbutton/outlined-segmented-button.js +0 -1
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
- package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
- package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/select/_filled-select.scss +6 -0
- package/select/_outlined-select.scss +6 -0
- package/select/filled-select.d.ts +41 -0
- package/select/filled-select.js +46 -0
- package/select/filled-select.js.map +1 -0
- package/select/harness.d.ts +24 -0
- package/select/harness.js +53 -0
- package/select/harness.js.map +1 -0
- package/select/lib/_filled-select.scss +163 -0
- package/select/lib/_outlined-select.scss +146 -0
- package/select/lib/_shared.scss +48 -0
- package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/filled-forced-colors-styles.css.js +9 -0
- package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
- package/select/lib/filled-forced-colors-styles.scss +29 -0
- package/select/lib/filled-select-styles.css.d.ts +1 -0
- package/select/lib/filled-select-styles.css.js +9 -0
- package/select/lib/filled-select-styles.css.js.map +1 -0
- package/select/lib/filled-select-styles.scss +10 -0
- package/select/lib/filled-select.d.ts +10 -0
- package/select/lib/filled-select.js +16 -0
- package/select/lib/filled-select.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
- package/select/lib/outlined-forced-colors-styles.css.js +9 -0
- package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
- package/select/lib/outlined-forced-colors-styles.scss +29 -0
- package/select/lib/outlined-select-styles.css.d.ts +1 -0
- package/select/lib/outlined-select-styles.css.js +9 -0
- package/select/lib/outlined-select-styles.css.js.map +1 -0
- package/select/lib/outlined-select-styles.scss +10 -0
- package/select/lib/outlined-select.d.ts +10 -0
- package/select/lib/outlined-select.js +16 -0
- package/select/lib/outlined-select.js.map +1 -0
- package/select/lib/select.d.ts +218 -0
- package/select/lib/select.js +587 -0
- package/select/lib/select.js.map +1 -0
- package/select/lib/selectoption/harness.d.ts +11 -0
- package/select/lib/selectoption/harness.js +12 -0
- package/select/lib/selectoption/harness.js.map +1 -0
- package/select/lib/selectoption/select-option.d.ts +30 -0
- package/select/lib/selectoption/select-option.js +71 -0
- package/select/lib/selectoption/select-option.js.map +1 -0
- package/select/lib/shared-styles.css.d.ts +1 -0
- package/select/lib/shared-styles.css.js +9 -0
- package/select/lib/shared-styles.css.js.map +1 -0
- package/select/lib/shared-styles.scss +10 -0
- package/select/lib/shared.d.ts +52 -0
- package/select/lib/shared.js +41 -0
- package/select/lib/shared.js.map +1 -0
- package/select/outlined-select.d.ts +41 -0
- package/select/outlined-select.js +46 -0
- package/select/outlined-select.js.map +1 -0
- package/select/select-option.d.ts +44 -0
- package/select/select-option.js +51 -0
- package/select/select-option.js.map +1 -0
- package/slider/harness.d.ts +1 -0
- package/slider/harness.js +5 -0
- package/slider/harness.js.map +1 -1
- package/slider/lib/_slider.scss +146 -164
- package/slider/lib/forced-colors-styles.css.js +1 -1
- package/slider/lib/forced-colors-styles.css.js.map +1 -1
- package/slider/lib/forced-colors-styles.scss +2 -2
- package/slider/lib/slider-styles.css.js +1 -1
- package/slider/lib/slider-styles.css.js.map +1 -1
- package/slider/lib/slider.d.ts +2 -7
- package/slider/lib/slider.js +64 -118
- package/slider/lib/slider.js.map +1 -1
- package/switch/lib/switch.d.ts +0 -2
- package/switch/lib/switch.js +32 -54
- package/switch/lib/switch.js.map +1 -1
- package/textfield/lib/text-field.d.ts +0 -10
- package/textfield/lib/text-field.js +45 -115
- package/textfield/lib/text-field.js.map +1 -1
- package/tokens/_index.scss +3 -0
- package/tokens/_md-comp-assist-chip.scss +25 -20
- package/tokens/_md-comp-elevation.scss +0 -4
- package/tokens/_md-comp-fab-branded.scss +109 -1
- package/tokens/_md-comp-fab.scss +290 -0
- package/tokens/_md-comp-filled-select.scss +150 -1
- package/tokens/_md-comp-filter-chip.scss +103 -93
- package/tokens/_md-comp-input-chip.scss +77 -85
- package/tokens/_md-comp-linear-progress-indicator.scss +14 -1
- package/tokens/_md-comp-list-item.scss +201 -0
- package/tokens/_md-comp-list.scss +107 -26
- package/tokens/_md-comp-menu-item.scss +76 -0
- package/tokens/_md-comp-menu.scss +52 -2
- package/tokens/_md-comp-outlined-select.scss +150 -1
- package/tokens/_md-comp-slider.scss +13 -1
- package/tokens/_md-comp-suggestion-chip.scss +29 -21
- package/tokens/_values.scss +5 -2
- package/types/aria.d.ts +61 -1
- package/actionelement/action-element.d.ts +0 -79
- package/actionelement/action-element.js +0 -97
- package/actionelement/action-element.js.map +0 -1
- package/button/lib/state.d.ts +0 -10
- package/button/lib/state.js +0 -7
- package/button/lib/state.js.map +0 -1
- package/controller/action-controller.d.ts +0 -147
- package/controller/action-controller.js +0 -286
- package/controller/action-controller.js.map +0 -1
- package/decorators/aria-property.d.ts +0 -32
- package/decorators/aria-property.js +0 -99
- package/decorators/aria-property.js.map +0 -1
- package/fab/_fab-extended.scss +0 -6
- package/fab/fab-extended.d.ts +0 -23
- package/fab/fab-extended.js +0 -29
- package/fab/fab-extended.js.map +0 -1
- package/fab/lib/_fab-extended.scss +0 -73
- package/fab/lib/fab-extended-styles.css.js +0 -9
- package/fab/lib/fab-extended-styles.css.js.map +0 -1
- package/fab/lib/fab-extended.d.ts +0 -19
- package/fab/lib/fab-extended.js +0 -28
- package/fab/lib/fab-extended.js.map +0 -1
- package/fab/lib/fab-shared-styles.css.js +0 -9
- package/fab/lib/fab-shared-styles.css.js.map +0 -1
- package/fab/lib/fab-shared.js +0 -121
- package/fab/lib/fab-shared.js.map +0 -1
- package/slider/lib/_tokens.scss +0 -65
- /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
- /package/fab/lib/{fab-shared-styles.css.d.ts → fab-branded-styles.css.d.ts} +0 -0
|
@@ -24,11 +24,23 @@ $_default: (
|
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
$_unsupported-tokens: (
|
|
27
|
+
'disabled-handle-opacity',
|
|
28
|
+
'label-container-elevation',
|
|
27
29
|
'label-label-text-font',
|
|
28
30
|
'label-label-text-line-height',
|
|
29
31
|
'label-label-text-size',
|
|
30
32
|
'label-label-text-tracking',
|
|
31
|
-
'label-label-text-weight'
|
|
33
|
+
'label-label-text-weight',
|
|
34
|
+
'track-elevation',
|
|
35
|
+
// for efficiency, tick marks are rendered as radial-gradients and
|
|
36
|
+
// have more limited customization
|
|
37
|
+
'with-tick-marks-active-container-opacity',
|
|
38
|
+
'with-tick-marks-container-shape',
|
|
39
|
+
'with-tick-marks-disabled-container-opacity',
|
|
40
|
+
'with-tick-marks-inactive-container-opacity',
|
|
41
|
+
// focus tokens no longer used.
|
|
42
|
+
'focus-state-layer-color',
|
|
43
|
+
'focus-state-layer-opacity'
|
|
32
44
|
);
|
|
33
45
|
|
|
34
46
|
@function values($deps: $_default, $exclude-hardcoded-values: false) {
|
|
@@ -24,6 +24,8 @@ $supported-tokens: (
|
|
|
24
24
|
'disabled-label-text-color',
|
|
25
25
|
'disabled-label-text-opacity',
|
|
26
26
|
'disabled-leading-icon-color',
|
|
27
|
+
'disabled-outline-color',
|
|
28
|
+
'disabled-outline-opacity',
|
|
27
29
|
'elevated-container-color',
|
|
28
30
|
'elevated-container-elevation',
|
|
29
31
|
'elevated-container-shadow-color',
|
|
@@ -33,13 +35,9 @@ $supported-tokens: (
|
|
|
33
35
|
'elevated-focus-container-elevation',
|
|
34
36
|
'elevated-hover-container-elevation',
|
|
35
37
|
'elevated-pressed-container-elevation',
|
|
36
|
-
'flat-disabled-outline-color',
|
|
37
|
-
'flat-disabled-outline-opacity',
|
|
38
|
-
'flat-focus-outline-color',
|
|
39
|
-
'flat-outline-color',
|
|
40
|
-
'flat-outline-width',
|
|
41
38
|
'focus-label-text-color',
|
|
42
39
|
'focus-leading-icon-color',
|
|
40
|
+
'focus-outline-color',
|
|
43
41
|
'focus-state-layer-color',
|
|
44
42
|
'focus-state-layer-opacity',
|
|
45
43
|
'hover-label-text-color',
|
|
@@ -50,6 +48,8 @@ $supported-tokens: (
|
|
|
50
48
|
'label-text-color',
|
|
51
49
|
'label-text-type',
|
|
52
50
|
'leading-icon-color',
|
|
51
|
+
'outline-color',
|
|
52
|
+
'outline-width',
|
|
53
53
|
'pressed-label-text-color',
|
|
54
54
|
'pressed-leading-icon-color',
|
|
55
55
|
'pressed-state-layer-color',
|
|
@@ -59,12 +59,12 @@ $supported-tokens: (
|
|
|
59
59
|
|
|
60
60
|
$unsupported-tokens: (
|
|
61
61
|
// go/keep-sorted start
|
|
62
|
+
'container-elevation',
|
|
62
63
|
'dragged-container-elevation',
|
|
63
64
|
'dragged-label-text-color',
|
|
64
65
|
'dragged-leading-icon-color',
|
|
65
66
|
'dragged-state-layer-color',
|
|
66
67
|
'dragged-state-layer-opacity',
|
|
67
|
-
'flat-container-elevation',
|
|
68
68
|
'label-text-font',
|
|
69
69
|
'label-text-line-height',
|
|
70
70
|
'label-text-size',
|
|
@@ -73,20 +73,6 @@ $unsupported-tokens: (
|
|
|
73
73
|
// go/keep-sorted end
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
$renamed-tokens: (
|
|
77
|
-
// Remove "with-leading-icon-*" prefix (b/273534858)
|
|
78
|
-
'with-leading-icon-disabled-leading-icon-color': 'disabled-leading-icon-color',
|
|
79
|
-
'with-leading-icon-disabled-leading-icon-opacity':
|
|
80
|
-
'disabled-leading-icon-opacity',
|
|
81
|
-
'with-leading-icon-dragged-leading-icon-color': 'dragged-leading-icon-color',
|
|
82
|
-
'with-leading-icon-focus-leading-icon-color': 'focus-leading-icon-color',
|
|
83
|
-
'with-leading-icon-hover-leading-icon-color': 'hover-leading-icon-color',
|
|
84
|
-
'with-leading-icon-leading-icon-color': 'leading-icon-color',
|
|
85
|
-
'with-leading-icon-pressed-leading-icon-color': 'pressed-leading-icon-color',
|
|
86
|
-
// Rename "leading-icon-size" to "icon-size" (b/275577569)
|
|
87
|
-
'with-leading-icon-leading-icon-size': 'icon-size'
|
|
88
|
-
);
|
|
89
|
-
|
|
90
76
|
$_default: (
|
|
91
77
|
'md-sys-color': md-sys-color.values-light(),
|
|
92
78
|
'md-sys-elevation': md-sys-elevation.values(),
|
|
@@ -100,7 +86,29 @@ $_default: (
|
|
|
100
86
|
md-comp-suggestion-chip.values($deps, $exclude-hardcoded-values),
|
|
101
87
|
$supported-tokens: $supported-tokens,
|
|
102
88
|
$unsupported-tokens: $unsupported-tokens,
|
|
103
|
-
$renamed-tokens:
|
|
89
|
+
$renamed-tokens: (
|
|
90
|
+
// Remove "flat-*" prefix (b/275577569)
|
|
91
|
+
'flat-container-elevation': 'container-elevation',
|
|
92
|
+
'flat-disabled-outline-color': 'disabled-outline-color',
|
|
93
|
+
'flat-disabled-outline-opacity': 'disabled-outline-opacity',
|
|
94
|
+
'flat-focus-outline-color': 'focus-outline-color',
|
|
95
|
+
'flat-outline-color': 'outline-color',
|
|
96
|
+
'flat-outline-width': 'outline-width',
|
|
97
|
+
// Remove "with-*" prefixes (b/273534858)
|
|
98
|
+
'with-leading-icon-disabled-leading-icon-color':
|
|
99
|
+
'disabled-leading-icon-color',
|
|
100
|
+
'with-leading-icon-disabled-leading-icon-opacity':
|
|
101
|
+
'disabled-leading-icon-opacity',
|
|
102
|
+
'with-leading-icon-dragged-leading-icon-color':
|
|
103
|
+
'dragged-leading-icon-color',
|
|
104
|
+
'with-leading-icon-focus-leading-icon-color': 'focus-leading-icon-color',
|
|
105
|
+
'with-leading-icon-hover-leading-icon-color': 'hover-leading-icon-color',
|
|
106
|
+
'with-leading-icon-leading-icon-color': 'leading-icon-color',
|
|
107
|
+
'with-leading-icon-pressed-leading-icon-color':
|
|
108
|
+
'pressed-leading-icon-color',
|
|
109
|
+
// Rename "leading-icon-size" to "icon-size" (b/275577569)
|
|
110
|
+
'with-leading-icon-leading-icon-size': 'icon-size'
|
|
111
|
+
)
|
|
104
112
|
);
|
|
105
113
|
|
|
106
114
|
// TODO(b/271876162): remove when tokens compiler emits typescale tokens
|
package/tokens/_values.scss
CHANGED
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
/// @param {Map} $new-tokens [null] - Keyword argument for a Map whose keys
|
|
38
38
|
/// and values are new tokens to be added. They must also appear in the
|
|
39
39
|
/// `$supported-tokens` list.
|
|
40
|
+
/// @param {Bool} $is-subset [null] - Check if provided tokens are only a subset
|
|
41
|
+
/// of the supported tokens. e.g. when generating a theme.
|
|
40
42
|
/// @return {Map} The `tokens.md-comp-*-values()` Map with any unsupported
|
|
41
43
|
/// tokens removed, renamed tokens updated, and new tokens added.
|
|
42
44
|
@function validate($values, $tokens...) {
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
|
|
51
53
|
@each $old-token, $new-token in $renamed-tokens {
|
|
52
54
|
@if not map.has-key($values, $old-token) {
|
|
53
|
-
@error 'values.validate($renamed-tokens: (\'#{$old-
|
|
55
|
+
@error 'values.validate($renamed-tokens: (\'#{$old-token}\': \'#{$new-token}\')) old-token in not the provided values.';
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
$values: map.set($values, $new-token, map.get($values, $old-token));
|
|
@@ -102,7 +104,8 @@
|
|
|
102
104
|
}
|
|
103
105
|
|
|
104
106
|
@each $supported-token in $supported-tokens {
|
|
105
|
-
|
|
107
|
+
$is-subset: map.get($tokens, 'is-subset');
|
|
108
|
+
@if not($is-subset or map.has-key($values, $supported-token)) {
|
|
106
109
|
@error 'The provided values are missing the supported \'#{$supported-token}\' token.';
|
|
107
110
|
}
|
|
108
111
|
}
|
package/types/aria.d.ts
CHANGED
|
@@ -2,12 +2,72 @@
|
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2022 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
6
7
|
* @fileoverview Provides types for `ariaX` properties. These are required when
|
|
7
8
|
* typing `ariaX` properties since lit analyzer requires strict aria string
|
|
8
9
|
* types.
|
|
9
10
|
*/
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* An extension of `ARIAMixin` that enforces strict value types for aria
|
|
14
|
+
* properties.
|
|
15
|
+
*
|
|
16
|
+
* This is needed for correct typing in render functions with lit analyzer.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* render() {
|
|
20
|
+
* const {ariaLabel} = this as ARIAMixinStrict;
|
|
21
|
+
* return html`
|
|
22
|
+
* <button aria-label=${ariaLabel || nothing}>
|
|
23
|
+
* <slot></slot>
|
|
24
|
+
* </button>
|
|
25
|
+
* `;
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
export interface ARIAMixinStrict extends ARIAMixin {
|
|
29
|
+
ariaAtomic: 'true'|'false'|null;
|
|
30
|
+
ariaAutoComplete: 'none'|'inline'|'list'|'both'|null;
|
|
31
|
+
ariaBusy: 'true'|'false'|null;
|
|
32
|
+
ariaChecked: 'true'|'false'|null;
|
|
33
|
+
ariaColCount: `${number}`|null;
|
|
34
|
+
ariaColIndex: `${number}`|null;
|
|
35
|
+
ariaColIndexText: string|null;
|
|
36
|
+
ariaColSpan: `${number}`|null;
|
|
37
|
+
ariaCurrent: 'page'|'step'|'location'|'date'|'time'|'true'|'false'|null;
|
|
38
|
+
ariaDisabled: 'true'|'false'|null;
|
|
39
|
+
ariaExpanded: 'true'|'false'|null;
|
|
40
|
+
ariaHasPopup: 'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'|null;
|
|
41
|
+
ariaHidden: 'true'|'false'|null;
|
|
42
|
+
ariaInvalid: 'true'|'false'|null;
|
|
43
|
+
ariaKeyShortcuts: string|null;
|
|
44
|
+
ariaLabel: string|null;
|
|
45
|
+
ariaLevel: `${number}`|null;
|
|
46
|
+
ariaLive: 'assertive'|'off'|'polite'|null;
|
|
47
|
+
ariaModal: 'true'|'false'|null;
|
|
48
|
+
ariaMultiLine: 'true'|'false'|null;
|
|
49
|
+
ariaMultiSelectable: 'true'|'false'|null;
|
|
50
|
+
ariaOrientation: 'horizontal'|'vertical'|'undefined'|null;
|
|
51
|
+
ariaPlaceholder: string|null;
|
|
52
|
+
ariaPosInSet: `${number}`|null;
|
|
53
|
+
ariaPressed: 'true'|'false'|null;
|
|
54
|
+
ariaReadOnly: 'true'|'false'|null;
|
|
55
|
+
ariaRequired: 'true'|'false'|null;
|
|
56
|
+
ariaRoleDescription: string|null;
|
|
57
|
+
ariaRowCount: `${number}`|null;
|
|
58
|
+
ariaRowIndex: `${number}`|null;
|
|
59
|
+
ariaRowIndexText: string|null;
|
|
60
|
+
ariaRowSpan: `${number}`|null;
|
|
61
|
+
ariaSelected: 'true'|'false'|null;
|
|
62
|
+
ariaSetSize: `${number}`|null;
|
|
63
|
+
ariaSort: 'ascending'|'descending'|'none'|'other'|null;
|
|
64
|
+
ariaValueMax: `${number}`|null;
|
|
65
|
+
ariaValueMin: `${number}`|null;
|
|
66
|
+
ariaValueNow: `${number}`|null;
|
|
67
|
+
ariaValueText: string|null;
|
|
68
|
+
role: ARIARole|null;
|
|
69
|
+
}
|
|
70
|
+
|
|
11
71
|
/**
|
|
12
72
|
* Valid values for `aria-expanded`.
|
|
13
73
|
*/
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { LitElement } from 'lit';
|
|
7
|
-
import { ActionController, ActionControllerHost, BeginPressConfig, EndPressConfig } from '../controller/action-controller.js';
|
|
8
|
-
export { BeginPressConfig, EndPressConfig };
|
|
9
|
-
/**
|
|
10
|
-
* @soyCompatible
|
|
11
|
-
*
|
|
12
|
-
* ActionElement is a base class that provides a handy starting point for using
|
|
13
|
-
* ActionController. Subclasses should add the event handlers on the interactive
|
|
14
|
-
* node in the template, and override `beginPress` and `endPress` to handle
|
|
15
|
-
* pressed state, ripple interaction, and any other "press" interaction.
|
|
16
|
-
*/
|
|
17
|
-
export declare abstract class ActionElement extends LitElement implements ActionControllerHost {
|
|
18
|
-
/**
|
|
19
|
-
* ActionController needs to know if the component is disabled, so subclasses
|
|
20
|
-
* must implement a `disabled` property.
|
|
21
|
-
*/
|
|
22
|
-
abstract disabled: boolean;
|
|
23
|
-
protected actionController: ActionController;
|
|
24
|
-
/**
|
|
25
|
-
* Hook method called when we've confirmed that the gesture is intended to be
|
|
26
|
-
* a press. Subclasses should change the visual state of the control to
|
|
27
|
-
* 'active' at this point, and possibly fire an event. Subclasses should
|
|
28
|
-
* override this method if more needs to be done.
|
|
29
|
-
*
|
|
30
|
-
* @param options `positionEvent` is the Event that is considered the
|
|
31
|
-
* beginning of the press. Null if this was a keyboard interaction.
|
|
32
|
-
*/
|
|
33
|
-
beginPress(options: BeginPressConfig): void;
|
|
34
|
-
/**
|
|
35
|
-
* Hook method called when the control goes from a pressed to unpressed
|
|
36
|
-
* state.
|
|
37
|
-
*
|
|
38
|
-
* @param options If `cancelled` is true, means the user canceled the action.
|
|
39
|
-
* Subclasses which trigger events on endPress() should check the value
|
|
40
|
-
* of this flag, and modify their behavior accordingly.
|
|
41
|
-
*/
|
|
42
|
-
endPress({ cancelled, actionData }: EndPressConfig): void;
|
|
43
|
-
/**
|
|
44
|
-
* Hook method for the ActionController.
|
|
45
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
46
|
-
* template element with `@pointerdown="${this.handlePointerDown}"`
|
|
47
|
-
*/
|
|
48
|
-
handlePointerDown(e: PointerEvent): void;
|
|
49
|
-
/**
|
|
50
|
-
* Hook method for the ActionController.
|
|
51
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
52
|
-
* template element with `@pointerup="${this.handlePointerUp}"`
|
|
53
|
-
*/
|
|
54
|
-
handlePointerUp(e: PointerEvent): void;
|
|
55
|
-
/**
|
|
56
|
-
* Hook method for the ActionController.
|
|
57
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
58
|
-
* template element with `@pointercancel="${this.handlePointerCancel}"`
|
|
59
|
-
*/
|
|
60
|
-
handlePointerCancel(e: PointerEvent): void;
|
|
61
|
-
/**
|
|
62
|
-
* Hook method for the ActionController.
|
|
63
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
64
|
-
* template element with `@pointerleave="${this.handlePointerleave}"`
|
|
65
|
-
*/
|
|
66
|
-
handlePointerLeave(e: PointerEvent): void;
|
|
67
|
-
/**
|
|
68
|
-
* Hook method for the ActionController.
|
|
69
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
70
|
-
* template element with `@click="${this.handleClick}"`
|
|
71
|
-
*/
|
|
72
|
-
handleClick(e: MouseEvent): void;
|
|
73
|
-
/**
|
|
74
|
-
* Hook method for the ActionController.
|
|
75
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
76
|
-
* template element with `@contextmenu="${this.handleContextMenu}"`
|
|
77
|
-
*/
|
|
78
|
-
handleContextMenu(): void;
|
|
79
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { LitElement } from 'lit';
|
|
7
|
-
import { ActionController } from '../controller/action-controller.js';
|
|
8
|
-
/**
|
|
9
|
-
* @soyCompatible
|
|
10
|
-
*
|
|
11
|
-
* ActionElement is a base class that provides a handy starting point for using
|
|
12
|
-
* ActionController. Subclasses should add the event handlers on the interactive
|
|
13
|
-
* node in the template, and override `beginPress` and `endPress` to handle
|
|
14
|
-
* pressed state, ripple interaction, and any other "press" interaction.
|
|
15
|
-
*/
|
|
16
|
-
export class ActionElement extends LitElement {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.actionController = new ActionController(this);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Hook method called when we've confirmed that the gesture is intended to be
|
|
23
|
-
* a press. Subclasses should change the visual state of the control to
|
|
24
|
-
* 'active' at this point, and possibly fire an event. Subclasses should
|
|
25
|
-
* override this method if more needs to be done.
|
|
26
|
-
*
|
|
27
|
-
* @param options `positionEvent` is the Event that is considered the
|
|
28
|
-
* beginning of the press. Null if this was a keyboard interaction.
|
|
29
|
-
*/
|
|
30
|
-
beginPress(options) { }
|
|
31
|
-
/**
|
|
32
|
-
* Hook method called when the control goes from a pressed to unpressed
|
|
33
|
-
* state.
|
|
34
|
-
*
|
|
35
|
-
* @param options If `cancelled` is true, means the user canceled the action.
|
|
36
|
-
* Subclasses which trigger events on endPress() should check the value
|
|
37
|
-
* of this flag, and modify their behavior accordingly.
|
|
38
|
-
*/
|
|
39
|
-
endPress({ cancelled, actionData }) {
|
|
40
|
-
if (!cancelled) {
|
|
41
|
-
this.dispatchEvent(new CustomEvent('action', {
|
|
42
|
-
detail: actionData,
|
|
43
|
-
bubbles: true,
|
|
44
|
-
composed: true,
|
|
45
|
-
}));
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Hook method for the ActionController.
|
|
50
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
51
|
-
* template element with `@pointerdown="${this.handlePointerDown}"`
|
|
52
|
-
*/
|
|
53
|
-
handlePointerDown(e) {
|
|
54
|
-
this.actionController.pointerDown(e);
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Hook method for the ActionController.
|
|
58
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
59
|
-
* template element with `@pointerup="${this.handlePointerUp}"`
|
|
60
|
-
*/
|
|
61
|
-
handlePointerUp(e) {
|
|
62
|
-
this.actionController.pointerUp(e);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Hook method for the ActionController.
|
|
66
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
67
|
-
* template element with `@pointercancel="${this.handlePointerCancel}"`
|
|
68
|
-
*/
|
|
69
|
-
handlePointerCancel(e) {
|
|
70
|
-
this.actionController.pointerCancel(e);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Hook method for the ActionController.
|
|
74
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
75
|
-
* template element with `@pointerleave="${this.handlePointerleave}"`
|
|
76
|
-
*/
|
|
77
|
-
handlePointerLeave(e) {
|
|
78
|
-
this.actionController.pointerLeave(e);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Hook method for the ActionController.
|
|
82
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
83
|
-
* template element with `@click="${this.handleClick}"`
|
|
84
|
-
*/
|
|
85
|
-
handleClick(e) {
|
|
86
|
-
this.actionController.click(e);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Hook method for the ActionController.
|
|
90
|
-
* Subclasses should add this method as an event handler on the interactive
|
|
91
|
-
* template element with `@contextmenu="${this.handleContextMenu}"`
|
|
92
|
-
*/
|
|
93
|
-
handleContextMenu() {
|
|
94
|
-
this.actionController.contextMenu();
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=action-element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-element.js","sourceRoot":"","sources":["action-element.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAC,gBAAgB,EAAyD,MAAM,oCAAoC,CAAC;AAI5H;;;;;;;GAOG;AACH,MAAM,OAAgB,aAAc,SAAQ,UAAU;IAAtD;;QAQY,qBAAgB,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAoF1D,CAAC;IAlFC;;;;;;;;OAQG;IACH,UAAU,CAAC,OAAyB,IAAG,CAAC;IAExC;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAC,SAAS,EAAE,UAAU,EAAiB;QAC9C,IAAI,CAAC,SAAS,EAAE;YACd,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE;gBAC3C,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC,CAAC;SACL;IACH,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,CAAe;QAC/B,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,CAAe;QAC7B,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,mBAAmB,CAAC,CAAe;QACjC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,kBAAkB,CAAC,CAAe;QAChC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,CAAa;QACvB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,iBAAiB;QACf,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC;IACtC,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {LitElement} from 'lit';\n\nimport {ActionController, ActionControllerHost, BeginPressConfig, EndPressConfig} from '../controller/action-controller.js';\n\nexport {BeginPressConfig, EndPressConfig};\n\n/**\n * @soyCompatible\n *\n * ActionElement is a base class that provides a handy starting point for using\n * ActionController. Subclasses should add the event handlers on the interactive\n * node in the template, and override `beginPress` and `endPress` to handle\n * pressed state, ripple interaction, and any other \"press\" interaction.\n */\nexport abstract class ActionElement extends LitElement implements\n ActionControllerHost {\n /**\n * ActionController needs to know if the component is disabled, so subclasses\n * must implement a `disabled` property.\n */\n abstract disabled: boolean;\n\n protected actionController = new ActionController(this);\n\n /**\n * Hook method called when we've confirmed that the gesture is intended to be\n * a press. Subclasses should change the visual state of the control to\n * 'active' at this point, and possibly fire an event. Subclasses should\n * override this method if more needs to be done.\n *\n * @param options `positionEvent` is the Event that is considered the\n * beginning of the press. Null if this was a keyboard interaction.\n */\n beginPress(options: BeginPressConfig) {}\n\n /**\n * Hook method called when the control goes from a pressed to unpressed\n * state.\n *\n * @param options If `cancelled` is true, means the user canceled the action.\n * Subclasses which trigger events on endPress() should check the value\n * of this flag, and modify their behavior accordingly.\n */\n endPress({cancelled, actionData}: EndPressConfig) {\n if (!cancelled) {\n this.dispatchEvent(new CustomEvent('action', {\n detail: actionData,\n bubbles: true,\n composed: true,\n }));\n }\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@pointerdown=\"${this.handlePointerDown}\"`\n */\n handlePointerDown(e: PointerEvent) {\n this.actionController.pointerDown(e);\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@pointerup=\"${this.handlePointerUp}\"`\n */\n handlePointerUp(e: PointerEvent) {\n this.actionController.pointerUp(e);\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@pointercancel=\"${this.handlePointerCancel}\"`\n */\n handlePointerCancel(e: PointerEvent) {\n this.actionController.pointerCancel(e);\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@pointerleave=\"${this.handlePointerleave}\"`\n */\n handlePointerLeave(e: PointerEvent) {\n this.actionController.pointerLeave(e);\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@click=\"${this.handleClick}\"`\n */\n handleClick(e: MouseEvent) {\n this.actionController.click(e);\n }\n\n /**\n * Hook method for the ActionController.\n * Subclasses should add this method as an event handler on the interactive\n * template element with `@contextmenu=\"${this.handleContextMenu}\"`\n */\n handleContextMenu() {\n this.actionController.contextMenu();\n }\n}\n"]}
|
package/button/lib/state.d.ts
DELETED
package/button/lib/state.js
DELETED
package/button/lib/state.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["state.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport interface ButtonState {\n disabled: boolean;\n label: string;\n trailingIcon: boolean;\n}\n"]}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2022 Google LLC
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
7
|
-
/**
|
|
8
|
-
* Delay time from touchstart to when element#beginPress is invoked.
|
|
9
|
-
*/
|
|
10
|
-
export declare const TOUCH_DELAY_MS = 150;
|
|
11
|
-
/**
|
|
12
|
-
* Delay time from beginning to wait for synthetic mouse events till giving up.
|
|
13
|
-
*/
|
|
14
|
-
export declare const WAIT_FOR_MOUSE_CLICK_MS = 500;
|
|
15
|
-
/**
|
|
16
|
-
* Interface for argument to beginPress.
|
|
17
|
-
*/
|
|
18
|
-
export interface BeginPressConfig {
|
|
19
|
-
/**
|
|
20
|
-
* Event that was recorded at the start of the interaction.
|
|
21
|
-
* `null` if the press happened via keyboard.
|
|
22
|
-
*/
|
|
23
|
-
positionEvent: Event | null;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Interface for argument to endPress.
|
|
27
|
-
*/
|
|
28
|
-
export interface EndPressConfig {
|
|
29
|
-
/**
|
|
30
|
-
* `true` if the press was cancelled.
|
|
31
|
-
*/
|
|
32
|
-
cancelled: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Data object to pass along to clients in the `action` event, if relevant.
|
|
35
|
-
*/
|
|
36
|
-
actionData?: {};
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* The necessary interface for using an ActionController
|
|
40
|
-
*/
|
|
41
|
-
export interface ActionControllerHost extends ReactiveControllerHost, HTMLElement {
|
|
42
|
-
disabled: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Determines if pointerdown or click events containing modifier keys should
|
|
45
|
-
* be ignored.
|
|
46
|
-
*/
|
|
47
|
-
ignoreClicksWithModifiers?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Called when a user interaction is determined to be a press.
|
|
50
|
-
*/
|
|
51
|
-
beginPress(config: BeginPressConfig): void;
|
|
52
|
-
/**
|
|
53
|
-
* Called when a press ends or is cancelled.
|
|
54
|
-
*/
|
|
55
|
-
endPress(config: EndPressConfig): void;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* ActionController normalizes user interaction on components and distills it
|
|
59
|
-
* into calling `beginPress` and `endPress` on the component.
|
|
60
|
-
*
|
|
61
|
-
* `beginPress` is a good hook to affect visuals for pressed state, including
|
|
62
|
-
* ripple.
|
|
63
|
-
*
|
|
64
|
-
* `endPress` is a good hook for firing events based on user interaction, and
|
|
65
|
-
* cleaning up the pressed visual state.
|
|
66
|
-
*
|
|
67
|
-
* A component using an ActionController need only implement the ActionElement
|
|
68
|
-
* interface and add the ActionController's event listeners to understand user
|
|
69
|
-
* interaction.
|
|
70
|
-
*/
|
|
71
|
-
export declare class ActionController implements ReactiveController {
|
|
72
|
-
private readonly element;
|
|
73
|
-
constructor(element: ActionControllerHost);
|
|
74
|
-
private get disabled();
|
|
75
|
-
private get ignoreClicksWithModifiers();
|
|
76
|
-
private phase;
|
|
77
|
-
private touchTimer;
|
|
78
|
-
private clickTimer;
|
|
79
|
-
private lastPositionEvent;
|
|
80
|
-
private pressed;
|
|
81
|
-
private checkBoundsAfterContextMenu;
|
|
82
|
-
private setPhase;
|
|
83
|
-
/**
|
|
84
|
-
* Calls beginPress and then endPress. Allows us to programmatically click
|
|
85
|
-
* on the element.
|
|
86
|
-
*/
|
|
87
|
-
private press;
|
|
88
|
-
/**
|
|
89
|
-
* Call `beginPress` on element with triggering event, if applicable.
|
|
90
|
-
*/
|
|
91
|
-
private beginPress;
|
|
92
|
-
/**
|
|
93
|
-
* Call `endPress` on element, and clean up timers.
|
|
94
|
-
*/
|
|
95
|
-
private endPress;
|
|
96
|
-
private cleanup;
|
|
97
|
-
/**
|
|
98
|
-
* Call `endPress` with cancelled state on element, and cleanup timers.
|
|
99
|
-
*/
|
|
100
|
-
private cancelPress;
|
|
101
|
-
private isTouch;
|
|
102
|
-
private touchDelayFinished;
|
|
103
|
-
private waitForClick;
|
|
104
|
-
/**
|
|
105
|
-
* Check if event should trigger actions on the element.
|
|
106
|
-
*/
|
|
107
|
-
private shouldRespondToEvent;
|
|
108
|
-
/**
|
|
109
|
-
* Check if the event is within the bounds of the element.
|
|
110
|
-
*
|
|
111
|
-
* This is only needed for the "stuck" contextmenu longpress on Chrome.
|
|
112
|
-
*/
|
|
113
|
-
private inBounds;
|
|
114
|
-
private eventHasModifiers;
|
|
115
|
-
/**
|
|
116
|
-
* Cancel interactions if the element is removed from the DOM.
|
|
117
|
-
*/
|
|
118
|
-
hostDisconnected(): void;
|
|
119
|
-
/**
|
|
120
|
-
* If the element becomes disabled, cancel interactions.
|
|
121
|
-
*/
|
|
122
|
-
hostUpdated(): void;
|
|
123
|
-
/**
|
|
124
|
-
* Pointer down event handler.
|
|
125
|
-
*/
|
|
126
|
-
pointerDown: (e: PointerEvent) => void;
|
|
127
|
-
/**
|
|
128
|
-
* Pointer up event handler.
|
|
129
|
-
*/
|
|
130
|
-
pointerUp: (e: PointerEvent) => void;
|
|
131
|
-
/**
|
|
132
|
-
* Click event handler.
|
|
133
|
-
*/
|
|
134
|
-
click: (e: MouseEvent) => void;
|
|
135
|
-
/**
|
|
136
|
-
* Pointer leave event handler.
|
|
137
|
-
*/
|
|
138
|
-
pointerLeave: (e: PointerEvent) => void;
|
|
139
|
-
/**
|
|
140
|
-
* Pointer cancel event handler.
|
|
141
|
-
*/
|
|
142
|
-
pointerCancel: (e: PointerEvent) => void;
|
|
143
|
-
/**
|
|
144
|
-
* Contextmenu event handler.
|
|
145
|
-
*/
|
|
146
|
-
contextMenu: () => void;
|
|
147
|
-
}
|