@material/web 1.0.0-pre.2 → 1.0.0-pre.4
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/LICENSE +1 -1
- package/README.md +41 -41
- package/autocomplete/autocomplete-item.js.map +1 -1
- package/autocomplete/autocomplete-list.js.map +1 -1
- package/autocomplete/autocomplete-surface.js.map +1 -1
- package/autocomplete/filled-autocomplete.d.ts +0 -2
- package/autocomplete/filled-autocomplete.js +0 -7
- package/autocomplete/filled-autocomplete.js.map +1 -1
- package/autocomplete/lib/_filled-autocomplete.scss +22 -28
- package/autocomplete/lib/_outlined-autocomplete.scss +23 -29
- package/autocomplete/lib/_shared.scss +6 -10
- package/autocomplete/lib/autocomplete.d.ts +2 -2
- package/autocomplete/lib/autocomplete.js +4 -5
- package/autocomplete/lib/autocomplete.js.map +1 -1
- package/autocomplete/lib/autocompletelist/autocomplete-list-styles.scss +2 -0
- package/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.scss +2 -0
- package/autocomplete/lib/filled-styles.css.js +1 -1
- package/autocomplete/lib/filled-styles.css.js.map +1 -1
- package/autocomplete/lib/filled-styles.scss +2 -0
- package/autocomplete/lib/outlined-styles.css.js +1 -1
- package/autocomplete/lib/outlined-styles.css.js.map +1 -1
- package/autocomplete/lib/outlined-styles.scss +2 -0
- package/autocomplete/lib/shared-styles.scss +2 -0
- package/autocomplete/outlined-autocomplete.d.ts +0 -2
- package/autocomplete/outlined-autocomplete.js +0 -7
- package/autocomplete/outlined-autocomplete.js.map +1 -1
- package/badge/badge.js.map +1 -1
- package/badge/lib/_badge.scss +10 -13
- package/badge/lib/badge-styles.css.js +1 -1
- package/badge/lib/badge-styles.css.js.map +1 -1
- package/badge/lib/badge-styles.scss +2 -0
- package/badge/lib/badge.js.map +1 -1
- package/button/elevated-button.js.map +1 -1
- package/button/elevated-link-button.js.map +1 -1
- package/button/filled-button.js.map +1 -1
- package/button/filled-link-button.js.map +1 -1
- package/button/lib/_elevated-button.scss +10 -15
- package/button/lib/_elevation.scss +4 -1
- package/button/lib/_filled-button.scss +12 -14
- package/button/lib/_icon.scss +1 -0
- package/button/lib/_outlined-button.scss +10 -15
- package/button/lib/_shared.scss +14 -19
- package/button/lib/_text-button.scss +12 -14
- package/button/lib/_tonal-button.scss +10 -15
- package/button/lib/button.js.map +1 -1
- package/button/lib/elevated-styles.css.js +1 -1
- package/button/lib/elevated-styles.css.js.map +1 -1
- package/button/lib/elevated-styles.scss +2 -0
- package/button/lib/filled-styles.css.js +1 -1
- package/button/lib/filled-styles.css.js.map +1 -1
- package/button/lib/filled-styles.scss +2 -0
- package/button/lib/link-button.js.map +1 -1
- package/button/lib/outlined-styles.css.js +1 -1
- package/button/lib/outlined-styles.css.js.map +1 -1
- package/button/lib/outlined-styles.scss +2 -0
- package/button/lib/shared-elevation-styles.scss +2 -0
- package/button/lib/shared-styles.css.js +1 -1
- package/button/lib/shared-styles.css.js.map +1 -1
- package/button/lib/shared-styles.scss +2 -0
- package/button/lib/text-styles.css.js +1 -1
- package/button/lib/text-styles.css.js.map +1 -1
- package/button/lib/text-styles.scss +2 -0
- package/button/lib/tonal-styles.css.js +1 -1
- package/button/lib/tonal-styles.css.js.map +1 -1
- package/button/lib/tonal-styles.scss +2 -0
- package/button/outlined-button.js.map +1 -1
- package/button/outlined-link-button.js.map +1 -1
- package/button/text-button.js.map +1 -1
- package/button/text-link-button.js.map +1 -1
- package/button/tonal-button.js.map +1 -1
- package/button/tonal-link-button.js.map +1 -1
- package/checkbox/checkbox.js.map +1 -1
- package/checkbox/lib/_checkbox.scss +26 -31
- package/checkbox/lib/checkbox-styles.css.js +1 -1
- package/checkbox/lib/checkbox-styles.css.js.map +1 -1
- package/checkbox/lib/checkbox-styles.scss +2 -0
- package/checkbox/lib/checkbox.js +6 -6
- package/checkbox/lib/checkbox.js.map +1 -1
- package/checkbox/lib/forced-colors-styles.scss +2 -0
- package/chips/action/delete-action.js.map +1 -1
- package/chips/action/lib/action.js +4 -4
- package/chips/action/lib/action.js.map +1 -1
- package/chips/action/lib/link-action.js +1 -1
- package/chips/action/lib/link-action.js.map +1 -1
- package/chips/action/lib/primary-action.js.map +1 -1
- package/chips/action/lib/selectable-action.js.map +1 -1
- package/chips/action/link-action.js.map +1 -1
- package/chips/action/presentational-action.js.map +1 -1
- package/chips/action/primary-action.js.map +1 -1
- package/chips/action/selectable-action.js.map +1 -1
- package/chips/chip/lib/_assist-chip-theme.scss +4 -0
- package/chips/chip/lib/_chip-theme.scss +29 -40
- package/chips/chip/lib/_chip.scss +2 -0
- package/chips/chip/lib/_filter-chip-theme.scss +4 -0
- package/chips/chip/lib/_input-chip-theme.scss +4 -0
- package/chips/chip/lib/_suggestion-chip-theme.scss +4 -0
- package/chips/chip/lib/chip.js.map +1 -1
- package/chips/chip/lib/foundation.js +4 -4
- package/chips/chip/lib/foundation.js.map +1 -1
- package/chips/chip/lib/link-chip.js.map +1 -1
- package/chips/chip/lib/selectable-chip.js.map +1 -1
- package/chips/chip/lib/types.d.ts +2 -2
- package/chips/chipset/lib/_chip-set-theme.scss +2 -0
- package/chips/chipset/lib/_chip-set.scss +2 -0
- package/chips/chipset/lib/foundation.js +3 -3
- package/chips/chipset/lib/foundation.js.map +1 -1
- package/chips/chipset/lib/types.d.ts +3 -3
- package/controller/events.js +4 -0
- package/controller/events.js.map +1 -1
- package/controller/form-controller.d.ts +1 -1
- package/controller/form-controller.js +21 -29
- package/controller/form-controller.js.map +1 -1
- package/dialog/dialog.js.map +1 -1
- package/dialog/harness.d.ts +2 -2
- package/dialog/harness.js +11 -8
- package/dialog/harness.js.map +1 -1
- package/dialog/lib/_dialog.scss +7 -11
- package/dialog/lib/_tokens.scss +9 -6
- package/dialog/lib/dialog-styles.css.js +1 -1
- package/dialog/lib/dialog-styles.css.js.map +1 -1
- package/dialog/lib/dialog-styles.scss +2 -0
- package/dialog/lib/dialog.js +9 -7
- package/dialog/lib/dialog.js.map +1 -1
- package/divider/divider.js.map +1 -1
- package/divider/lib/_divider.scss +2 -0
- package/divider/lib/divider-styles.scss +2 -0
- package/divider/lib/divider.js.map +1 -1
- package/elevation/elevation.js.map +1 -1
- package/elevation/lib/_elevation.scss +4 -0
- package/elevation/lib/_md-comp-elevation.scss +4 -0
- package/elevation/lib/elevation-styles.scss +2 -0
- package/elevation/lib/elevation.js.map +1 -1
- package/fab/fab-extended.js.map +1 -1
- package/fab/fab.js.map +1 -1
- package/fab/lib/_fab-extended.scss +18 -11
- package/fab/lib/_fab.scss +7 -2
- package/fab/lib/_shared.scss +16 -8
- package/fab/lib/fab-extended-styles.css.js +1 -1
- package/fab/lib/fab-extended-styles.css.js.map +1 -1
- package/fab/lib/fab-extended-styles.scss +2 -0
- package/fab/lib/fab-shared-styles.css.js +1 -1
- package/fab/lib/fab-shared-styles.css.js.map +1 -1
- package/fab/lib/fab-shared-styles.scss +2 -0
- package/fab/lib/fab-shared.d.ts +9 -15
- package/fab/lib/fab-shared.js +21 -33
- package/fab/lib/fab-shared.js.map +1 -1
- package/fab/lib/fab-styles.css.js +1 -1
- package/fab/lib/fab-styles.css.js.map +1 -1
- package/fab/lib/fab-styles.scss +2 -0
- package/field/filled-field.d.ts +1 -1
- package/field/filled-field.js +1 -1
- package/field/filled-field.js.map +1 -1
- package/field/harness.js +1 -1
- package/field/harness.js.map +1 -1
- package/field/lib/_content.scss +120 -57
- package/field/lib/_filled-field.scss +73 -130
- package/field/lib/_label.scss +27 -65
- package/field/lib/_md-comp-filled-field.scss +127 -56
- package/field/lib/_md-comp-outlined-field.scss +104 -52
- package/field/lib/_outlined-field.scss +108 -120
- package/field/lib/_shared.scss +27 -45
- package/field/lib/_supporting-text.scss +25 -52
- package/field/lib/field.d.ts +15 -31
- package/field/lib/field.js +130 -139
- package/field/lib/field.js.map +1 -1
- package/field/lib/filled-field.d.ts +5 -16
- package/field/lib/filled-field.js +8 -70
- package/field/lib/filled-field.js.map +1 -1
- package/field/lib/filled-styles.css.js +1 -1
- package/field/lib/filled-styles.css.js.map +1 -1
- package/field/lib/outlined-field.d.ts +4 -10
- package/field/lib/outlined-field.js +13 -33
- package/field/lib/outlined-field.js.map +1 -1
- package/field/lib/outlined-styles.css.js +1 -1
- package/field/lib/outlined-styles.css.js.map +1 -1
- package/field/lib/shared-styles.css.js +1 -1
- package/field/lib/shared-styles.css.js.map +1 -1
- package/field/outlined-field.d.ts +1 -1
- package/field/outlined-field.js +1 -1
- package/field/outlined-field.js.map +1 -1
- package/focus/focus-ring.js.map +1 -1
- package/focus/lib/_focus-ring.scss +7 -13
- package/focus/lib/_md-comp-focus-ring.scss +4 -0
- package/focus/lib/focus-ring-styles.css.js +1 -1
- package/focus/lib/focus-ring-styles.css.js.map +1 -1
- package/focus/lib/focus-ring-styles.scss +2 -0
- package/focus/lib/focus-ring.js.map +1 -1
- package/icon/icon.js.map +1 -1
- package/icon/lib/_icon.scss +3 -1
- package/icon/lib/_md-comp-icon.scss +1 -2
- package/icon/lib/icon-styles.css.js +1 -1
- package/icon/lib/icon-styles.css.js.map +1 -1
- package/icon/lib/icon-styles.scss +2 -0
- package/iconbutton/filled-icon-button-toggle.js.map +1 -1
- package/iconbutton/filled-icon-button.js.map +1 -1
- package/iconbutton/filled-link-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button-toggle.js.map +1 -1
- package/iconbutton/filled-tonal-icon-button.js.map +1 -1
- package/iconbutton/filled-tonal-link-icon-button.js.map +1 -1
- package/iconbutton/lib/_filled-icon-button.scss +19 -19
- package/iconbutton/lib/_filled-tonal-icon-button.scss +19 -19
- package/iconbutton/lib/_outlined-icon-button.scss +20 -16
- package/iconbutton/lib/_shared.scss +8 -8
- package/iconbutton/lib/_standard-icon-button.scss +21 -18
- package/iconbutton/lib/filled-styles.css.js +1 -1
- package/iconbutton/lib/filled-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-styles.scss +2 -0
- package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
- package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
- package/iconbutton/lib/filled-tonal-styles.scss +2 -0
- package/iconbutton/lib/icon-button-toggle.js.map +1 -1
- package/iconbutton/lib/icon-button.js.map +1 -1
- package/iconbutton/lib/link-icon-button.js.map +1 -1
- package/iconbutton/lib/outlined-styles.css.js +1 -1
- package/iconbutton/lib/outlined-styles.css.js.map +1 -1
- package/iconbutton/lib/outlined-styles.scss +2 -0
- package/iconbutton/lib/shared-styles.scss +2 -0
- package/iconbutton/lib/standard-styles.css.js +1 -1
- package/iconbutton/lib/standard-styles.css.js.map +1 -1
- package/iconbutton/lib/standard-styles.scss +2 -0
- package/iconbutton/outlined-icon-button-toggle.js.map +1 -1
- package/iconbutton/outlined-icon-button.js.map +1 -1
- package/iconbutton/outlined-link-icon-button.js.map +1 -1
- package/iconbutton/standard-icon-button-toggle.js.map +1 -1
- package/iconbutton/standard-icon-button.js.map +1 -1
- package/iconbutton/standard-link-icon-button.js.map +1 -1
- package/list/lib/_list.scss +25 -11
- package/list/lib/list-styles.scss +2 -0
- package/list/lib/list.js +3 -1
- package/list/lib/list.js.map +1 -1
- package/list/lib/listitem/_list-item.scss +320 -128
- 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-styles.scss +2 -0
- package/list/lib/listitem/list-item.d.ts +8 -7
- package/list/lib/listitem/list-item.js +25 -27
- package/list/lib/listitem/list-item.js.map +1 -1
- package/list/lib/listitemlink/list-item-link.js.map +1 -1
- package/list/list-item-link.d.ts +18 -0
- package/list/list-item-link.js +19 -2
- package/list/list-item-link.js.map +1 -1
- package/list/list-item.d.ts +19 -0
- package/list/list-item.js +20 -2
- package/list/list-item.js.map +1 -1
- package/list/list.js.map +1 -1
- package/menu/lib/_menu.scss +32 -8
- package/menu/lib/menu-styles.css.js +1 -1
- package/menu/lib/menu-styles.css.js.map +1 -1
- package/menu/lib/menu-styles.scss +2 -0
- package/menu/lib/menu.d.ts +1 -1
- package/menu/lib/menu.js +8 -7
- package/menu/lib/menu.js.map +1 -1
- package/menu/lib/menuitem/_menu-item.scss +44 -76
- 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-styles.scss +2 -0
- package/menu/lib/menuitem/menu-item.js.map +1 -1
- package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
- package/menu/lib/shared.d.ts +3 -3
- package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -1
- package/menu/lib/submenuitem/sub-menu-item.js +0 -1
- package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
- package/menu/lib/surfacePositionController.d.ts +1 -1
- package/menu/lib/typeaheadController.d.ts +1 -1
- package/menu/menu-item-link.js +1 -2
- package/menu/menu-item-link.js.map +1 -1
- package/menu/menu-item.js +2 -3
- package/menu/menu-item.js.map +1 -1
- package/menu/menu.js.map +1 -1
- package/menu/sub-menu-item.js +1 -2
- package/menu/sub-menu-item.js.map +1 -1
- package/menusurface/lib/_md-comp-menu-surface.scss +5 -1
- package/menusurface/lib/_menu-surface.scss +4 -0
- package/menusurface/lib/foundation.js +31 -31
- package/menusurface/lib/foundation.js.map +1 -1
- package/menusurface/lib/menu-surface-styles.scss +2 -0
- package/menusurface/lib/menu-surface.d.ts +2 -2
- package/menusurface/lib/menu-surface.js.map +1 -1
- package/menusurface/menu-surface.js.map +1 -1
- package/navigationbar/lib/_navigation-bar.scss +2 -0
- package/navigationbar/lib/constants.d.ts +1 -1
- package/navigationbar/lib/navigation-bar-styles.scss +2 -0
- package/navigationbar/lib/navigation-bar.js.map +1 -1
- package/navigationbar/navigation-bar.js.map +1 -1
- package/navigationdrawer/lib/_navigation-drawer-modal.scss +11 -2
- package/navigationdrawer/lib/_navigation-drawer.scss +10 -5
- package/navigationdrawer/lib/_shared.scss +4 -8
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-modal-styles.scss +2 -0
- package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
- package/navigationdrawer/lib/navigation-drawer-styles.scss +2 -0
- package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
- package/navigationdrawer/lib/shared-styles.scss +2 -0
- package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
- package/navigationdrawer/navigation-drawer.js.map +1 -1
- package/navigationtab/lib/_navigation-tab.scss +26 -22
- package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
- package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
- package/navigationtab/lib/navigation-tab-styles.scss +2 -0
- package/navigationtab/lib/navigation-tab.js +4 -4
- package/navigationtab/lib/navigation-tab.js.map +1 -1
- package/navigationtab/navigation-tab.js.map +1 -1
- package/package.json +2 -2
- package/radio/lib/_radio.scss +16 -14
- package/radio/lib/forced-colors-styles.scss +2 -0
- package/radio/lib/radio-styles.css.js +1 -1
- package/radio/lib/radio-styles.css.js.map +1 -1
- package/radio/lib/radio-styles.scss +2 -0
- package/radio/lib/radio.js +21 -21
- package/radio/lib/radio.js.map +1 -1
- package/radio/radio.js.map +1 -1
- package/ripple/directive.d.ts +1 -33
- package/ripple/directive.js +7 -194
- package/ripple/directive.js.map +1 -1
- package/ripple/lib/_md-comp-ripple.scss +20 -19
- package/ripple/lib/_ripple.scss +20 -20
- package/ripple/lib/ripple-styles.css.js +1 -1
- package/ripple/lib/ripple-styles.css.js.map +1 -1
- package/ripple/lib/ripple-styles.scss +2 -0
- package/ripple/lib/ripple.d.ts +50 -48
- package/ripple/lib/ripple.js +214 -76
- package/ripple/lib/ripple.js.map +1 -1
- package/ripple/ripple.d.ts +9 -1
- package/ripple/ripple.js +9 -1
- package/ripple/ripple.js.map +1 -1
- package/sass/_assert.scss +2 -0
- package/sass/_color-scheme.scss +4 -0
- package/sass/_color.scss +4 -0
- package/sass/_elevation.scss +4 -0
- package/sass/_feature-flags.scss +2 -0
- package/sass/_map-ext.scss +2 -0
- package/sass/_resolvers.scss +4 -4
- package/sass/_shape.scss +75 -27
- package/sass/_string-ext.scss +44 -0
- package/sass/_theme.scss +4 -0
- package/sass/_typography.scss +18 -93
- package/sass/_var.scss +4 -0
- package/segmentedbutton/lib/_outlined-segmented-button.scss +4 -0
- package/segmentedbutton/lib/_shared.scss +18 -22
- package/segmentedbutton/lib/outlined-styles.css.js +1 -1
- package/segmentedbutton/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbutton/lib/outlined-styles.scss +2 -0
- package/segmentedbutton/lib/segmented-button.js +4 -4
- package/segmentedbutton/lib/segmented-button.js.map +1 -1
- package/segmentedbutton/lib/shared-styles.css.js +1 -1
- package/segmentedbutton/lib/shared-styles.css.js.map +1 -1
- package/segmentedbutton/lib/shared-styles.scss +2 -0
- package/segmentedbutton/outlined-segmented-button.js.map +1 -1
- package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +9 -5
- package/segmentedbuttonset/lib/_shared.scss +0 -13
- package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
- package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
- package/segmentedbuttonset/lib/outlined-styles.scss +2 -0
- package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
- package/segmentedbuttonset/lib/shared-styles.scss +2 -0
- package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
- package/{list/lib/listitem/list-item-private-styles.scss → slider/_slider.scss} +1 -3
- package/slider/harness.d.ts +20 -0
- package/slider/harness.js +63 -0
- package/slider/harness.js.map +1 -0
- package/slider/lib/_slider.scss +503 -0
- package/slider/lib/_tokens.scss +66 -0
- package/slider/lib/forced-colors-styles.css.js +9 -0
- package/slider/lib/forced-colors-styles.css.js.map +1 -0
- package/slider/lib/forced-colors-styles.scss +53 -0
- package/slider/lib/slider-styles.css.js +9 -0
- package/slider/lib/slider-styles.css.js.map +1 -0
- package/{menu/lib/menuitem/menu-item-private-styles.scss → slider/lib/slider-styles.scss} +2 -2
- package/slider/lib/slider.d.ts +158 -0
- package/slider/lib/slider.js +575 -0
- package/slider/lib/slider.js.map +1 -0
- package/slider/slider.d.ts +28 -0
- package/slider/slider.js +32 -0
- package/slider/slider.js.map +1 -0
- package/switch/lib/README.md +55 -0
- package/switch/lib/_handle.scss +17 -18
- package/switch/lib/_icon.scss +4 -0
- package/switch/lib/_switch.scss +11 -18
- package/switch/lib/_track.scss +2 -0
- package/switch/lib/switch-styles.css.js +1 -1
- package/switch/lib/switch-styles.css.js.map +1 -1
- package/switch/lib/switch-styles.scss +2 -0
- package/switch/lib/switch.js +9 -9
- package/switch/lib/switch.js.map +1 -1
- package/switch/switch.js.map +1 -1
- package/textfield/filled-text-field.d.ts +1 -1
- package/textfield/filled-text-field.js +1 -2
- package/textfield/filled-text-field.js.map +1 -1
- package/textfield/harness.js +1 -1
- package/textfield/harness.js.map +1 -1
- package/textfield/lib/_filled-text-field.scss +116 -110
- package/textfield/lib/_icon.scss +14 -73
- package/textfield/lib/_input.scss +15 -36
- package/textfield/lib/_outlined-text-field.scss +107 -103
- package/textfield/lib/_shared.scss +10 -29
- package/textfield/lib/filled-forced-colors-styles.scss +2 -0
- package/textfield/lib/filled-styles.css.js +1 -1
- package/textfield/lib/filled-styles.css.js.map +1 -1
- package/textfield/lib/filled-styles.scss +2 -0
- package/textfield/lib/filled-text-field.d.ts +6 -5
- package/textfield/lib/filled-text-field.js +8 -7
- package/textfield/lib/filled-text-field.js.map +1 -1
- package/textfield/lib/outlined-forced-colors-styles.scss +2 -0
- package/textfield/lib/outlined-styles.css.js +1 -1
- package/textfield/lib/outlined-styles.css.js.map +1 -1
- package/textfield/lib/outlined-styles.scss +2 -0
- package/textfield/lib/outlined-text-field.d.ts +6 -5
- package/textfield/lib/outlined-text-field.js +8 -7
- package/textfield/lib/outlined-text-field.js.map +1 -1
- package/textfield/lib/shared-styles.css.js +1 -1
- package/textfield/lib/shared-styles.css.js.map +1 -1
- package/textfield/lib/shared-styles.scss +2 -0
- package/textfield/lib/text-field.d.ts +40 -88
- package/textfield/lib/text-field.js +194 -270
- package/textfield/lib/text-field.js.map +1 -1
- package/textfield/outlined-text-field.d.ts +1 -1
- package/textfield/outlined-text-field.js +1 -2
- package/textfield/outlined-text-field.js.map +1 -1
- package/tokens/_index.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-assist-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-badge.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-banner.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-bottom-app-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-carousel-item.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-checkbox.scss +4 -15
- package/tokens/{v0_152 → v0_160}/_md-comp-circular-progress-indicator.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-data-table.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-date-input-modal.scss +10 -10
- package/tokens/{v0_152 → v0_160}/_md-comp-date-picker-docked.scss +23 -23
- package/tokens/{v0_152 → v0_160}/_md-comp-date-picker-modal.scss +34 -34
- package/tokens/{v0_152 → v0_160}/_md-comp-dialog.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-divider.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-elevated-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-elevated-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-branded.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-primary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-secondary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-surface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-extended-fab-tertiary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-branded-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-branded.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-primary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-secondary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-surface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-fab-tertiary.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-autocomplete.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-select.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-text-field.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-tonal-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filled-tonal-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-filter-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-full-screen-dialog.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-input-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-linear-progress-indicator.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-list.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-menu.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-drawer.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-navigation-rail.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-autocomplete.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-card.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-icon-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-segmented-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-select.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-outlined-text-field.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-plain-tooltip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-primary-navigation-tab.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-radio-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-rich-tooltip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-scrim.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-search-bar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-search-view.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-secondary-navigation-tab.scss +1 -3
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-bottom.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-floating.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-sheet-side.scss +10 -10
- package/tokens/{v0_152 → v0_160}/_md-comp-slider.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-snackbar.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-standard-menu-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-suggestion-chip.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-switch.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-text-button.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-time-input.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-time-picker.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-large.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-medium.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-small-centered.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-comp-top-app-bar-small.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-ref-palette.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-ref-typeface.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-color.scss +217 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-elevation.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-motion.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-shape.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-state.scss +1 -1
- package/tokens/{v0_152 → v0_160}/_md-sys-typescale.scss +1 -1
- package/tokens/v0_161/_index.scss +107 -0
- package/tokens/v0_161/_md-comp-assist-chip.scss +109 -0
- package/tokens/v0_161/_md-comp-badge.scss +58 -0
- package/tokens/v0_161/_md-comp-banner.scss +75 -0
- package/tokens/v0_161/_md-comp-bottom-app-bar.scss +35 -0
- package/tokens/v0_161/_md-comp-carousel-item.scss +65 -0
- package/tokens/v0_161/_md-comp-checkbox.scss +126 -0
- package/tokens/v0_161/_md-comp-circular-progress-indicator.scss +39 -0
- package/tokens/v0_161/_md-comp-data-table.scss +96 -0
- package/tokens/v0_161/_md-comp-date-input-modal.scss +89 -0
- package/tokens/v0_161/_md-comp-date-picker-docked.scss +246 -0
- package/tokens/v0_161/_md-comp-date-picker-modal.scss +305 -0
- package/tokens/v0_161/_md-comp-dialog.scss +123 -0
- package/tokens/v0_161/_md-comp-divider.scss +25 -0
- package/tokens/v0_161/_md-comp-elevated-button.scss +91 -0
- package/tokens/v0_161/_md-comp-elevated-card.scss +59 -0
- package/tokens/v0_161/_md-comp-extended-fab-branded.scss +86 -0
- package/tokens/v0_161/_md-comp-extended-fab-primary.scss +94 -0
- package/tokens/v0_161/_md-comp-extended-fab-secondary.scss +95 -0
- package/tokens/v0_161/_md-comp-extended-fab-surface.scss +90 -0
- package/tokens/v0_161/_md-comp-extended-fab-tertiary.scss +95 -0
- package/tokens/v0_161/_md-comp-fab-branded-large.scss +60 -0
- package/tokens/v0_161/_md-comp-fab-branded.scss +60 -0
- package/tokens/v0_161/_md-comp-fab-primary-large.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-primary-small.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-primary.scss +65 -0
- package/tokens/v0_161/_md-comp-fab-secondary-large.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-secondary-small.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-secondary.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-surface-large.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-surface-small.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-surface.scss +64 -0
- package/tokens/v0_161/_md-comp-fab-tertiary-large.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-tertiary-small.scss +66 -0
- package/tokens/v0_161/_md-comp-fab-tertiary.scss +66 -0
- package/tokens/v0_161/_md-comp-filled-autocomplete.scss +267 -0
- package/tokens/v0_161/_md-comp-filled-button.scss +89 -0
- package/tokens/v0_161/_md-comp-filled-card.scss +58 -0
- package/tokens/v0_161/_md-comp-filled-icon-button.scss +79 -0
- package/tokens/v0_161/_md-comp-filled-menu-button.scss +98 -0
- package/tokens/v0_161/_md-comp-filled-select.scss +272 -0
- package/tokens/v0_161/_md-comp-filled-text-field.scss +189 -0
- package/tokens/v0_161/_md-comp-filled-tonal-button.scss +99 -0
- package/tokens/v0_161/_md-comp-filled-tonal-icon-button.scss +86 -0
- package/tokens/v0_161/_md-comp-filter-chip.scss +209 -0
- package/tokens/v0_161/_md-comp-full-screen-dialog.scss +111 -0
- package/tokens/v0_161/_md-comp-icon-button.scss +70 -0
- package/tokens/v0_161/_md-comp-input-chip.scss +184 -0
- package/tokens/v0_161/_md-comp-linear-progress-indicator.scss +41 -0
- package/tokens/v0_161/_md-comp-list.scss +248 -0
- package/tokens/v0_161/_md-comp-menu.scss +37 -0
- package/tokens/v0_161/_md-comp-navigation-bar.scss +114 -0
- package/tokens/v0_161/_md-comp-navigation-drawer.scss +162 -0
- package/tokens/v0_161/_md-comp-navigation-rail.scss +131 -0
- package/tokens/v0_161/_md-comp-outlined-autocomplete.scss +257 -0
- package/tokens/v0_161/_md-comp-outlined-button.scss +84 -0
- package/tokens/v0_161/_md-comp-outlined-card.scss +65 -0
- package/tokens/v0_161/_md-comp-outlined-icon-button.scss +79 -0
- package/tokens/v0_161/_md-comp-outlined-menu-button.scss +94 -0
- package/tokens/v0_161/_md-comp-outlined-segmented-button.scss +112 -0
- package/tokens/v0_161/_md-comp-outlined-select.scss +262 -0
- package/tokens/v0_161/_md-comp-outlined-text-field.scss +171 -0
- package/tokens/v0_161/_md-comp-plain-tooltip.scss +55 -0
- package/tokens/v0_161/_md-comp-primary-navigation-tab.scss +121 -0
- package/tokens/v0_161/_md-comp-radio-button.scss +68 -0
- package/tokens/v0_161/_md-comp-rich-tooltip.scss +121 -0
- package/tokens/v0_161/_md-comp-scrim.scss +25 -0
- package/tokens/v0_161/_md-comp-search-bar.scss +99 -0
- package/tokens/v0_161/_md-comp-search-view.scss +93 -0
- package/tokens/v0_161/_md-comp-secondary-navigation-tab.scss +84 -0
- package/tokens/v0_161/_md-comp-sheet-bottom.scss +45 -0
- package/tokens/v0_161/_md-comp-sheet-floating.scss +34 -0
- package/tokens/v0_161/_md-comp-sheet-side.scss +91 -0
- package/tokens/v0_161/_md-comp-slider.scss +114 -0
- package/tokens/v0_161/_md-comp-snackbar.scss +127 -0
- package/tokens/v0_161/_md-comp-standard-menu-button.scss +98 -0
- package/tokens/v0_161/_md-comp-suggestion-chip.scss +125 -0
- package/tokens/v0_161/_md-comp-switch.scss +136 -0
- package/tokens/v0_161/_md-comp-text-button.scss +77 -0
- package/tokens/v0_161/_md-comp-time-input.scss +218 -0
- package/tokens/v0_161/_md-comp-time-picker.scss +264 -0
- package/tokens/v0_161/_md-comp-top-app-bar-large.scss +63 -0
- package/tokens/v0_161/_md-comp-top-app-bar-medium.scss +63 -0
- package/tokens/v0_161/_md-comp-top-app-bar-small-centered.scss +66 -0
- package/tokens/v0_161/_md-comp-top-app-bar-small.scss +64 -0
- package/tokens/v0_161/_md-ref-palette.scss +107 -0
- package/tokens/v0_161/_md-ref-typeface.scss +21 -0
- package/tokens/v0_161/_md-sys-color.scss +904 -0
- package/tokens/v0_161/_md-sys-elevation.scss +21 -0
- package/tokens/v0_161/_md-sys-motion.scss +53 -0
- package/tokens/v0_161/_md-sys-shape.scss +30 -0
- package/tokens/v0_161/_md-sys-state.scss +19 -0
- package/tokens/v0_161/_md-sys-typescale.scss +284 -0
- package/tokens/v0_161/index.test.css.js +9 -0
- package/tokens/v0_161/index.test.css.js.map +1 -0
- package/tokens/v0_161/index.test.scss +584 -0
- package/tokens/v0_161/lib.test.css.js +9 -0
- package/tokens/v0_161/lib.test.css.js.map +1 -0
- package/tokens/v0_161/lib.test.scss +663 -0
- package/controller/foundation.d.ts +0 -24
- package/controller/foundation.js +0 -18
- package/controller/foundation.js.map +0 -1
- package/controller/observer-foundation.d.ts +0 -25
- package/controller/observer-foundation.js +0 -37
- package/controller/observer-foundation.js.map +0 -1
- package/controller/observer.d.ts +0 -52
- package/controller/observer.js +0 -149
- package/controller/observer.js.map +0 -1
- package/decorators/bound.d.ts +0 -40
- package/decorators/bound.js +0 -49
- package/decorators/bound.js.map +0 -1
- package/list/lib/avatar/_list-item-avatar.scss +0 -38
- package/list/lib/avatar/list-item-avatar-styles.css.js +0 -9
- package/list/lib/avatar/list-item-avatar-styles.css.js.map +0 -1
- package/list/lib/avatar/list-item-avatar-styles.scss +0 -8
- package/list/lib/avatar/list-item-avatar.d.ts +0 -21
- package/list/lib/avatar/list-item-avatar.js +0 -48
- package/list/lib/avatar/list-item-avatar.js.map +0 -1
- package/list/lib/icon/_list-item-icon.scss +0 -67
- package/list/lib/icon/list-item-icon-styles.css.js +0 -9
- package/list/lib/icon/list-item-icon-styles.css.js.map +0 -1
- package/list/lib/icon/list-item-icon-styles.scss +0 -8
- package/list/lib/icon/list-item-icon.d.ts +0 -9
- package/list/lib/icon/list-item-icon.js +0 -15
- package/list/lib/icon/list-item-icon.js.map +0 -1
- package/list/lib/image/_list-item-image.scss +0 -59
- package/list/lib/image/list-item-image-styles.css.js +0 -9
- package/list/lib/image/list-item-image-styles.css.js.map +0 -1
- package/list/lib/image/list-item-image-styles.scss +0 -8
- package/list/lib/image/list-item-image.d.ts +0 -21
- package/list/lib/image/list-item-image.js +0 -48
- package/list/lib/image/list-item-image.js.map +0 -1
- package/list/lib/listitem/list-item-private-styles.css.js +0 -9
- package/list/lib/listitem/list-item-private-styles.css.js.map +0 -1
- package/list/lib/video/_list-item-video.scss +0 -67
- package/list/lib/video/list-item-video-styles.css.d.ts +0 -1
- package/list/lib/video/list-item-video-styles.css.js +0 -9
- package/list/lib/video/list-item-video-styles.css.js.map +0 -1
- package/list/lib/video/list-item-video-styles.scss +0 -8
- package/list/lib/video/list-item-video.d.ts +0 -53
- package/list/lib/video/list-item-video.js +0 -115
- package/list/lib/video/list-item-video.js.map +0 -1
- package/list/list-item-avatar.d.ts +0 -20
- package/list/list-item-avatar.js +0 -23
- package/list/list-item-avatar.js.map +0 -1
- package/list/list-item-icon.d.ts +0 -20
- package/list/list-item-icon.js +0 -23
- package/list/list-item-icon.js.map +0 -1
- package/list/list-item-image.d.ts +0 -20
- package/list/list-item-image.js +0 -23
- package/list/list-item-image.js.map +0 -1
- package/list/list-item-video.d.ts +0 -20
- package/list/list-item-video.js +0 -23
- package/list/list-item-video.js.map +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.d.ts +0 -1
- package/menu/lib/menuitem/menu-item-private-styles.css.js +0 -9
- package/menu/lib/menuitem/menu-item-private-styles.css.js.map +0 -1
- /package/{list/lib/avatar/list-item-avatar-styles.css.d.ts → slider/lib/forced-colors-styles.css.d.ts} +0 -0
- /package/{list/lib/icon/list-item-icon-styles.css.d.ts → slider/lib/slider-styles.css.d.ts} +0 -0
- /package/tokens/{v0_152 → v0_160}/_index.scss +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.d.ts +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.js +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.css.js.map +0 -0
- /package/tokens/{v0_152 → v0_160}/index.test.scss +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.d.ts +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.js +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.css.js.map +0 -0
- /package/tokens/{v0_152 → v0_160}/lib.test.scss +0 -0
- /package/{list/lib/image/list-item-image-styles.css.d.ts → tokens/v0_161/index.test.css.d.ts} +0 -0
- /package/{list/lib/listitem/list-item-private-styles.css.d.ts → tokens/v0_161/lib.test.css.d.ts} +0 -0
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { __decorate, __metadata } from "tslib";
|
|
7
|
-
import { html, LitElement } from 'lit';
|
|
7
|
+
import { html, LitElement, nothing } from 'lit';
|
|
8
8
|
import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
|
|
9
9
|
import { classMap } from 'lit/directives/class-map.js';
|
|
10
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
11
10
|
import { live } from 'lit/directives/live.js';
|
|
12
11
|
import { styleMap } from 'lit/directives/style-map.js';
|
|
13
12
|
import { html as staticHtml } from 'lit/static-html.js';
|
|
@@ -15,8 +14,94 @@ import { redispatchEvent } from '../../controller/events.js';
|
|
|
15
14
|
import { FormController, getFormValue } from '../../controller/form-controller.js';
|
|
16
15
|
import { stringConverter } from '../../controller/string-converter.js';
|
|
17
16
|
import { ariaProperty } from '../../decorators/aria-property.js';
|
|
18
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* A text field component.
|
|
19
|
+
*/
|
|
19
20
|
export class TextField extends LitElement {
|
|
21
|
+
// FormElement
|
|
22
|
+
get form() {
|
|
23
|
+
return this.closest('form');
|
|
24
|
+
}
|
|
25
|
+
[getFormValue]() {
|
|
26
|
+
return this.value;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets or sets the direction in which selection occurred.
|
|
30
|
+
*/
|
|
31
|
+
get selectionDirection() {
|
|
32
|
+
return this.getInput().selectionDirection;
|
|
33
|
+
}
|
|
34
|
+
set selectionDirection(value) {
|
|
35
|
+
this.getInput().selectionDirection = value;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Gets or sets the end position or offset of a text selection.
|
|
39
|
+
*/
|
|
40
|
+
get selectionEnd() {
|
|
41
|
+
return this.getInput().selectionEnd;
|
|
42
|
+
}
|
|
43
|
+
set selectionEnd(value) {
|
|
44
|
+
this.getInput().selectionEnd = value;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Gets or sets the starting position or offset of a text selection.
|
|
48
|
+
*/
|
|
49
|
+
get selectionStart() {
|
|
50
|
+
return this.getInput().selectionStart;
|
|
51
|
+
}
|
|
52
|
+
set selectionStart(value) {
|
|
53
|
+
this.getInput().selectionStart = value;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Returns the native validation error message that would be displayed upon
|
|
57
|
+
* calling `reportValidity()`.
|
|
58
|
+
*
|
|
59
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage
|
|
60
|
+
*/
|
|
61
|
+
get validationMessage() {
|
|
62
|
+
return this.getInput().validationMessage;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Returns a ValidityState object that represents the validity states of the
|
|
66
|
+
* text field.
|
|
67
|
+
*
|
|
68
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validity
|
|
69
|
+
*/
|
|
70
|
+
get validity() {
|
|
71
|
+
return this.getInput().validity;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The text field's value as a number.
|
|
75
|
+
*/
|
|
76
|
+
get valueAsNumber() {
|
|
77
|
+
return this.getInput().valueAsNumber;
|
|
78
|
+
}
|
|
79
|
+
set valueAsNumber(value) {
|
|
80
|
+
this.getInput().valueAsNumber = value;
|
|
81
|
+
this.value = this.getInput().value;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The text field's value as a Date.
|
|
85
|
+
*/
|
|
86
|
+
get valueAsDate() {
|
|
87
|
+
return this.getInput().valueAsDate;
|
|
88
|
+
}
|
|
89
|
+
set valueAsDate(value) {
|
|
90
|
+
this.getInput().valueAsDate = value;
|
|
91
|
+
this.value = this.getInput().value;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns whether an element will successfully validate based on forms
|
|
95
|
+
* validation rules and constraints.
|
|
96
|
+
*
|
|
97
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/willValidate
|
|
98
|
+
*/
|
|
99
|
+
get willValidate() {
|
|
100
|
+
return this.getInput().willValidate;
|
|
101
|
+
}
|
|
102
|
+
get hasError() {
|
|
103
|
+
return this.error || this.nativeError;
|
|
104
|
+
}
|
|
20
105
|
constructor() {
|
|
21
106
|
super();
|
|
22
107
|
this.disabled = false;
|
|
@@ -77,13 +162,10 @@ export class TextField extends LitElement {
|
|
|
77
162
|
*/
|
|
78
163
|
this.textDirection = '';
|
|
79
164
|
// ARIA
|
|
80
|
-
// TODO(b/210730484): replace with @soyParam annotation
|
|
81
165
|
this.ariaAutoComplete = null;
|
|
82
166
|
this.ariaControls = null;
|
|
83
167
|
this.ariaActiveDescendant = null;
|
|
84
168
|
this.ariaExpanded = null;
|
|
85
|
-
// tslint:disable:decorator-placement
|
|
86
|
-
// @ts-ignore(b/264292293): Use `override` with TS 4.9+
|
|
87
169
|
this.role = null;
|
|
88
170
|
this.name = '';
|
|
89
171
|
// <input> properties
|
|
@@ -135,7 +217,6 @@ export class TextField extends LitElement {
|
|
|
135
217
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step
|
|
136
218
|
*/
|
|
137
219
|
this.step = '';
|
|
138
|
-
// TODO(b/237284412): replace with exported types
|
|
139
220
|
this.type = 'text';
|
|
140
221
|
/**
|
|
141
222
|
* Returns true when the text field has been interacted with. Native
|
|
@@ -171,98 +252,11 @@ export class TextField extends LitElement {
|
|
|
171
252
|
* `reportValidity()`.
|
|
172
253
|
*/
|
|
173
254
|
this.nativeErrorText = '';
|
|
174
|
-
/** @soyUniqueAttribute */
|
|
175
|
-
this.counterId = 'counter';
|
|
176
|
-
/** @soyUniqueAttribute */
|
|
177
|
-
this.supportingTextId = 'support';
|
|
178
255
|
this.addController(new FormController(this));
|
|
179
|
-
|
|
180
|
-
this.addEventListener('click', this.handleClick);
|
|
256
|
+
this.addEventListener('click', this.focus);
|
|
181
257
|
this.addEventListener('focusin', this.handleFocusin);
|
|
182
258
|
this.addEventListener('focusout', this.handleFocusout);
|
|
183
259
|
}
|
|
184
|
-
// tslint:enable:decorator-placement
|
|
185
|
-
// FormElement
|
|
186
|
-
get form() {
|
|
187
|
-
return this.closest('form');
|
|
188
|
-
}
|
|
189
|
-
[getFormValue]() {
|
|
190
|
-
return this.value;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Gets or sets the direction in which selection occurred.
|
|
194
|
-
*/
|
|
195
|
-
get selectionDirection() {
|
|
196
|
-
return this.getInput().selectionDirection;
|
|
197
|
-
}
|
|
198
|
-
set selectionDirection(value) {
|
|
199
|
-
this.getInput().selectionDirection = value;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Gets or sets the end position or offset of a text selection.
|
|
203
|
-
*/
|
|
204
|
-
get selectionEnd() {
|
|
205
|
-
return this.getInput().selectionEnd;
|
|
206
|
-
}
|
|
207
|
-
set selectionEnd(value) {
|
|
208
|
-
this.getInput().selectionEnd = value;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Gets or sets the starting position or offset of a text selection.
|
|
212
|
-
*/
|
|
213
|
-
get selectionStart() {
|
|
214
|
-
return this.getInput().selectionStart;
|
|
215
|
-
}
|
|
216
|
-
set selectionStart(value) {
|
|
217
|
-
this.getInput().selectionStart = value;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Returns the native validation error message that would be displayed upon
|
|
221
|
-
* calling `reportValidity()`.
|
|
222
|
-
*
|
|
223
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validationMessage
|
|
224
|
-
*/
|
|
225
|
-
get validationMessage() {
|
|
226
|
-
return this.getInput().validationMessage;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Returns a ValidityState object that represents the validity states of the
|
|
230
|
-
* text field.
|
|
231
|
-
*
|
|
232
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/validity
|
|
233
|
-
*/
|
|
234
|
-
get validity() {
|
|
235
|
-
return this.getInput().validity;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* The text field's value as a number.
|
|
239
|
-
*/
|
|
240
|
-
get valueAsNumber() {
|
|
241
|
-
return this.getInput().valueAsNumber;
|
|
242
|
-
}
|
|
243
|
-
set valueAsNumber(value) {
|
|
244
|
-
this.getInput().valueAsNumber = value;
|
|
245
|
-
this.value = this.getInput().value;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* The text field's value as a Date.
|
|
249
|
-
*/
|
|
250
|
-
get valueAsDate() {
|
|
251
|
-
return this.getInput().valueAsDate;
|
|
252
|
-
}
|
|
253
|
-
set valueAsDate(value) {
|
|
254
|
-
this.getInput().valueAsDate = value;
|
|
255
|
-
this.value = this.getInput().value;
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Returns whether an element will successfully validate based on forms
|
|
259
|
-
* validation rules and constraints.
|
|
260
|
-
*
|
|
261
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/willValidate
|
|
262
|
-
*/
|
|
263
|
-
get willValidate() {
|
|
264
|
-
return this.getInput().willValidate;
|
|
265
|
-
}
|
|
266
260
|
/**
|
|
267
261
|
* Checks the text field's native validation and returns whether or not the
|
|
268
262
|
* element is valid.
|
|
@@ -286,15 +280,7 @@ export class TextField extends LitElement {
|
|
|
286
280
|
// button, to the input when focus is requested.
|
|
287
281
|
return;
|
|
288
282
|
}
|
|
289
|
-
|
|
290
|
-
// delegating focus
|
|
291
|
-
this.getInput().focus();
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Unfocuses the text field.
|
|
295
|
-
*/
|
|
296
|
-
blur() {
|
|
297
|
-
this.getInput().blur();
|
|
283
|
+
super.focus();
|
|
298
284
|
}
|
|
299
285
|
/**
|
|
300
286
|
* Checks the text field's native validation and returns whether or not the
|
|
@@ -404,40 +390,65 @@ export class TextField extends LitElement {
|
|
|
404
390
|
this.nativeError = false;
|
|
405
391
|
this.nativeErrorText = '';
|
|
406
392
|
}
|
|
407
|
-
|
|
393
|
+
update(changedProperties) {
|
|
394
|
+
// Consider a value change anything that is not the initial empty string
|
|
395
|
+
// value.
|
|
396
|
+
const valueHasChanged = changedProperties.has('value') &&
|
|
397
|
+
changedProperties.get('value') !== undefined;
|
|
398
|
+
if (valueHasChanged && !this.ignoreNextValueChange) {
|
|
399
|
+
this.valueHasChanged = true;
|
|
400
|
+
}
|
|
401
|
+
if (this.ignoreNextValueChange) {
|
|
402
|
+
this.ignoreNextValueChange = false;
|
|
403
|
+
}
|
|
404
|
+
super.update(changedProperties);
|
|
405
|
+
}
|
|
408
406
|
render() {
|
|
407
|
+
const classes = {
|
|
408
|
+
'disabled': this.disabled,
|
|
409
|
+
'error': !this.disabled && this.hasError,
|
|
410
|
+
};
|
|
409
411
|
return html `
|
|
410
|
-
<span class="
|
|
412
|
+
<span class="text-field ${classMap(classes)}">
|
|
411
413
|
${this.renderField()}
|
|
412
414
|
</span>
|
|
413
415
|
`;
|
|
414
416
|
}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
417
|
+
updated(changedProperties) {
|
|
418
|
+
// Keep changedProperties arg so that subclasses may call it
|
|
419
|
+
// If a property such as `type` changes and causes the internal <input>
|
|
420
|
+
// value to change without dispatching an event, re-sync it.
|
|
421
|
+
const value = this.getInput().value;
|
|
422
|
+
if (this.value !== value) {
|
|
423
|
+
// Don't consider these updates (such as setting `defaultValue`) as
|
|
424
|
+
// the developer directly changing the `value`.
|
|
425
|
+
this.ignoreNextValueChange = true;
|
|
426
|
+
// Note this is typically inefficient in updated() since it schedules
|
|
427
|
+
// another update. However, it is needed for the <input> to fully render
|
|
428
|
+
// before checking its value.
|
|
429
|
+
this.value = value;
|
|
430
|
+
}
|
|
431
|
+
if (this.refreshErrorAlert) {
|
|
432
|
+
// The past render cycle removed the role="alert" from the error message.
|
|
433
|
+
// Re-add it after an animation frame to re-announce the error.
|
|
434
|
+
requestAnimationFrame(() => {
|
|
435
|
+
this.refreshErrorAlert = false;
|
|
436
|
+
});
|
|
437
|
+
}
|
|
425
438
|
}
|
|
426
|
-
/** @soyTemplate */
|
|
427
439
|
renderField() {
|
|
428
440
|
const prefix = this.renderPrefix();
|
|
429
441
|
const suffix = this.renderSuffix();
|
|
430
442
|
const input = this.renderInput();
|
|
431
|
-
const inputValue = this.getInputValue();
|
|
432
443
|
return staticHtml `<${this.fieldTag}
|
|
433
|
-
class="
|
|
444
|
+
class="field"
|
|
434
445
|
?disabled=${this.disabled}
|
|
435
|
-
?error=${this.
|
|
446
|
+
?error=${this.hasError}
|
|
436
447
|
?focused=${this.focused}
|
|
437
448
|
?hasEnd=${this.hasTrailingIcon}
|
|
438
449
|
?hasStart=${this.hasLeadingIcon}
|
|
439
450
|
.label=${this.label}
|
|
440
|
-
?populated=${!!
|
|
451
|
+
?populated=${!!this.getInputValue()}
|
|
441
452
|
?required=${this.required}
|
|
442
453
|
>
|
|
443
454
|
${this.renderLeadingIcon()}
|
|
@@ -447,74 +458,44 @@ export class TextField extends LitElement {
|
|
|
447
458
|
${this.renderCounter()}
|
|
448
459
|
</${this.fieldTag}>`;
|
|
449
460
|
}
|
|
450
|
-
/**
|
|
451
|
-
* @soyTemplate
|
|
452
|
-
* @slotName start
|
|
453
|
-
*/
|
|
454
461
|
renderLeadingIcon() {
|
|
455
462
|
return html `
|
|
456
|
-
<span class="
|
|
457
|
-
slot="start">
|
|
463
|
+
<span class="icon leading" slot="start">
|
|
458
464
|
<slot name="leadingicon" @slotchange=${this.handleIconChange}></slot>
|
|
459
465
|
</span>
|
|
460
466
|
`;
|
|
461
467
|
}
|
|
462
|
-
/**
|
|
463
|
-
* @soyTemplate
|
|
464
|
-
* @slotName end
|
|
465
|
-
*/
|
|
466
468
|
renderTrailingIcon() {
|
|
467
469
|
return html `
|
|
468
|
-
<span class="
|
|
469
|
-
slot="end">
|
|
470
|
+
<span class="icon trailing" slot="end">
|
|
470
471
|
<slot name="trailingicon" @slotchange=${this.handleIconChange}></slot>
|
|
471
472
|
</span>
|
|
472
473
|
`;
|
|
473
474
|
}
|
|
474
|
-
/** @soyTemplate */
|
|
475
475
|
renderInput() {
|
|
476
|
-
// TODO(b/237283903): remove when custom isTruthy directive is supported
|
|
477
|
-
const placeholderValue = this.placeholder || undefined;
|
|
478
|
-
const ariaActiveDescendantValue = this.ariaActiveDescendant || undefined;
|
|
479
|
-
const ariaAutoCompleteValue = this.ariaAutoComplete || undefined;
|
|
480
|
-
const ariaControlsValue = this.ariaControls || undefined;
|
|
481
|
-
const ariaDescribedByValue = this.getAriaDescribedBy() || undefined;
|
|
482
|
-
const ariaExpandedValue = this.ariaExpanded || undefined;
|
|
483
|
-
const ariaLabelValue = this.ariaLabel || this.label || undefined;
|
|
484
|
-
const ariaLabelledByValue = this.ariaLabelledBy || undefined;
|
|
485
|
-
const maxValue = this.max || undefined;
|
|
486
|
-
const maxLengthValue = this.maxLength > -1 ? this.maxLength : undefined;
|
|
487
|
-
const minValue = this.min || undefined;
|
|
488
|
-
const minLengthValue = this.minLength > -1 ? this.minLength : undefined;
|
|
489
|
-
const patternValue = this.pattern || undefined;
|
|
490
|
-
const roleValue = this.role || undefined;
|
|
491
|
-
const stepValue = this.step || undefined;
|
|
492
|
-
/** @styleMap */
|
|
493
476
|
const style = { direction: this.textDirection };
|
|
494
477
|
// TODO(b/243805848): remove `as unknown as number` once lit analyzer is
|
|
495
478
|
// fixed
|
|
496
479
|
return html `<input
|
|
497
|
-
class="md3-text-field__input"
|
|
498
480
|
style=${styleMap(style)}
|
|
499
|
-
aria-activedescendant=${
|
|
500
|
-
aria-autocomplete=${
|
|
501
|
-
aria-controls=${
|
|
502
|
-
aria-describedby=${
|
|
503
|
-
aria-expanded=${
|
|
504
|
-
aria-invalid=${this.
|
|
505
|
-
aria-label=${
|
|
506
|
-
aria-labelledby=${ifDefined(ariaLabelledByValue)}
|
|
481
|
+
aria-activedescendant=${this.ariaActiveDescendant || nothing}
|
|
482
|
+
aria-autocomplete=${this.ariaAutoComplete || nothing}
|
|
483
|
+
aria-controls=${this.ariaControls || nothing}
|
|
484
|
+
aria-describedby=${this.getAriaDescribedBy() || nothing}
|
|
485
|
+
aria-expanded=${this.ariaExpanded || nothing}
|
|
486
|
+
aria-invalid=${this.hasError}
|
|
487
|
+
aria-label=${this.ariaLabel || this.label || nothing}
|
|
507
488
|
?disabled=${this.disabled}
|
|
508
|
-
max=${
|
|
509
|
-
maxlength=${
|
|
510
|
-
min=${
|
|
511
|
-
minlength=${
|
|
512
|
-
pattern=${
|
|
513
|
-
placeholder=${
|
|
514
|
-
role=${
|
|
489
|
+
max=${(this.max || nothing)}
|
|
490
|
+
maxlength=${this.maxLength > -1 ? this.maxLength : nothing}
|
|
491
|
+
min=${(this.min || nothing)}
|
|
492
|
+
minlength=${this.minLength > -1 ? this.minLength : nothing}
|
|
493
|
+
pattern=${this.pattern || nothing}
|
|
494
|
+
placeholder=${this.placeholder || nothing}
|
|
495
|
+
role=${this.role || nothing}
|
|
515
496
|
?readonly=${this.readOnly}
|
|
516
497
|
?required=${this.required}
|
|
517
|
-
step=${
|
|
498
|
+
step=${(this.step || nothing)}
|
|
518
499
|
type=${this.type}
|
|
519
500
|
.value=${live(this.getInputValue())}
|
|
520
501
|
@change=${this.redispatchEvent}
|
|
@@ -522,131 +503,80 @@ export class TextField extends LitElement {
|
|
|
522
503
|
@select=${this.redispatchEvent}
|
|
523
504
|
>`;
|
|
524
505
|
}
|
|
525
|
-
/** @soyTemplate */
|
|
526
506
|
getInputValue() {
|
|
527
507
|
const alwaysShowValue = this.dirty || this.valueHasChanged;
|
|
528
|
-
|
|
508
|
+
if (alwaysShowValue) {
|
|
509
|
+
return this.value;
|
|
510
|
+
}
|
|
511
|
+
return this.defaultValue || this.value;
|
|
529
512
|
}
|
|
530
|
-
/** @soyTemplate */
|
|
531
513
|
getAriaDescribedBy() {
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
'';
|
|
514
|
+
const ids = [];
|
|
515
|
+
if (this.getSupportingText()) {
|
|
516
|
+
ids.push('support');
|
|
517
|
+
}
|
|
518
|
+
if (this.getCounterText()) {
|
|
519
|
+
ids.push('counter');
|
|
520
|
+
}
|
|
521
|
+
return ids.join(' ');
|
|
538
522
|
}
|
|
539
|
-
/** @soyTemplate */
|
|
540
523
|
renderPrefix() {
|
|
541
|
-
return this.prefixText
|
|
542
|
-
html `<span class="md3-text-field__prefix">${this.prefixText}</span>` :
|
|
543
|
-
html ``;
|
|
544
|
-
// TODO(b/217441842): Create shared function once argument bug is fixed
|
|
545
|
-
// return this.renderAffix(/* isSuffix */ false);
|
|
524
|
+
return this.renderAffix(this.prefixText, /* isSuffix */ false);
|
|
546
525
|
}
|
|
547
|
-
/** @soyTemplate */
|
|
548
526
|
renderSuffix() {
|
|
549
|
-
return this.suffixText
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
527
|
+
return this.renderAffix(this.suffixText, /* isSuffix */ true);
|
|
528
|
+
}
|
|
529
|
+
renderAffix(text, isSuffix) {
|
|
530
|
+
if (!text) {
|
|
531
|
+
return nothing;
|
|
532
|
+
}
|
|
533
|
+
const classes = {
|
|
534
|
+
'suffix': isSuffix,
|
|
535
|
+
'prefix': !isSuffix,
|
|
536
|
+
};
|
|
537
|
+
return html `<span class="${classMap(classes)}">${text}</span>`;
|
|
554
538
|
}
|
|
555
|
-
/**
|
|
556
|
-
* @soyTemplate
|
|
557
|
-
* @slotName supporting-text
|
|
558
|
-
*/
|
|
559
539
|
renderSupportingText() {
|
|
560
|
-
const shouldAlert = this.shouldErrorAnnounce();
|
|
561
540
|
const text = this.getSupportingText();
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
return
|
|
541
|
+
if (!text) {
|
|
542
|
+
return nothing;
|
|
543
|
+
}
|
|
544
|
+
return html `<span id="support"
|
|
545
|
+
slot="supporting-text"
|
|
546
|
+
role=${this.shouldErrorAnnounce() ? 'alert' : nothing}>${text}</span>`;
|
|
566
547
|
}
|
|
567
|
-
/** @soyTemplate */
|
|
568
548
|
getSupportingText() {
|
|
569
549
|
const errorText = this.getErrorText();
|
|
570
|
-
return this.
|
|
550
|
+
return this.hasError && errorText ? errorText : this.supportingText;
|
|
571
551
|
}
|
|
572
|
-
/** @soyTemplate */
|
|
573
552
|
getErrorText() {
|
|
574
553
|
return this.error ? this.errorText : this.nativeErrorText;
|
|
575
554
|
}
|
|
576
|
-
/** @soyTemplate */
|
|
577
555
|
shouldErrorAnnounce() {
|
|
578
556
|
// Announce if there is an error and error text visible.
|
|
579
557
|
// If refreshErrorAlert is true, do not announce. This will remove the
|
|
580
558
|
// role="alert" attribute. Another render cycle will happen after an
|
|
581
559
|
// animation frame to re-add the role.
|
|
582
|
-
return this.
|
|
560
|
+
return this.hasError && !!this.getErrorText() && !this.refreshErrorAlert;
|
|
583
561
|
}
|
|
584
|
-
/**
|
|
585
|
-
* @soyTemplate
|
|
586
|
-
* @slotName supporting-text-end
|
|
587
|
-
*/
|
|
588
562
|
renderCounter() {
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
563
|
+
const text = this.getCounterText();
|
|
564
|
+
if (!text) {
|
|
565
|
+
return nothing;
|
|
566
|
+
}
|
|
592
567
|
// TODO(b/244473435): add aria-label and announcements
|
|
593
|
-
return
|
|
568
|
+
return html `<span id="counter"
|
|
569
|
+
class="counter"
|
|
570
|
+
slot="supporting-text-end">${text}</span>`;
|
|
594
571
|
}
|
|
595
|
-
// TODO(b/244197198): replace with !!this.getCounterText()
|
|
596
|
-
/** @soyTemplate */
|
|
597
|
-
hasCounter() {
|
|
598
|
-
return this.maxLength > -1;
|
|
599
|
-
}
|
|
600
|
-
/** @soyTemplate */
|
|
601
572
|
getCounterText() {
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
return this.hasCounter() ? html `${length} / ${this.maxLength}` : html ``;
|
|
605
|
-
}
|
|
606
|
-
update(changedProperties) {
|
|
607
|
-
// Consider a value change anything that is not the initial empty string
|
|
608
|
-
// value.
|
|
609
|
-
const valueHasChanged = changedProperties.has('value') &&
|
|
610
|
-
changedProperties.get('value') !== undefined;
|
|
611
|
-
if (valueHasChanged && !this.ignoreNextValueChange) {
|
|
612
|
-
this.valueHasChanged = true;
|
|
613
|
-
}
|
|
614
|
-
if (this.ignoreNextValueChange) {
|
|
615
|
-
this.ignoreNextValueChange = false;
|
|
616
|
-
}
|
|
617
|
-
super.update(changedProperties);
|
|
618
|
-
}
|
|
619
|
-
updated(changedProperties) {
|
|
620
|
-
// If a property such as `type` changes and causes the internal <input>
|
|
621
|
-
// value to change without dispatching an event, re-sync it.
|
|
622
|
-
const value = this.getInput().value;
|
|
623
|
-
if (this.value !== value) {
|
|
624
|
-
// Don't consider these updates (such as setting `defaultValue`) as
|
|
625
|
-
// the developer directly changing the `value`.
|
|
626
|
-
this.ignoreNextValueChange = true;
|
|
627
|
-
// Note this is typically inefficient in updated() since it schedules
|
|
628
|
-
// another update. However, it is needed for the <input> to fully render
|
|
629
|
-
// before checking its value.
|
|
630
|
-
this.value = value;
|
|
631
|
-
}
|
|
632
|
-
if (this.refreshErrorAlert) {
|
|
633
|
-
// The past render cycle removed the role="alert" from the error message.
|
|
634
|
-
// Re-add it after an animation frame to re-announce the error.
|
|
635
|
-
requestAnimationFrame(() => {
|
|
636
|
-
this.refreshErrorAlert = false;
|
|
637
|
-
});
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
/** @bubbleWizEvent */
|
|
641
|
-
handleClick() {
|
|
642
|
-
this.focus();
|
|
573
|
+
return this.maxLength > -1 ? `${this.value.length} / ${this.maxLength}` :
|
|
574
|
+
'';
|
|
643
575
|
}
|
|
644
|
-
|
|
645
|
-
handleFocusin(event) {
|
|
576
|
+
handleFocusin() {
|
|
646
577
|
this.focused = true;
|
|
647
578
|
}
|
|
648
|
-
|
|
649
|
-
handleFocusout(event) {
|
|
579
|
+
handleFocusout() {
|
|
650
580
|
if (this.matches(':focus-within')) {
|
|
651
581
|
// Changing focus to another child within the text field, like a button
|
|
652
582
|
return;
|
|
@@ -692,7 +622,7 @@ export class TextField extends LitElement {
|
|
|
692
622
|
this.hasTrailingIcon = this.trailingIcons.length > 0;
|
|
693
623
|
}
|
|
694
624
|
}
|
|
695
|
-
TextField.shadowRootOptions = {
|
|
625
|
+
TextField.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };
|
|
696
626
|
__decorate([
|
|
697
627
|
property({ type: Boolean, reflect: true }),
|
|
698
628
|
__metadata("design:type", Object)
|
|
@@ -775,12 +705,6 @@ __decorate([
|
|
|
775
705
|
,
|
|
776
706
|
__metadata("design:type", String)
|
|
777
707
|
], TextField.prototype, "ariaLabel", void 0);
|
|
778
|
-
__decorate([
|
|
779
|
-
property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true }),
|
|
780
|
-
ariaProperty // tslint:disable-line:no-new-decorators
|
|
781
|
-
,
|
|
782
|
-
__metadata("design:type", String)
|
|
783
|
-
], TextField.prototype, "ariaLabelledBy", void 0);
|
|
784
708
|
__decorate([
|
|
785
709
|
property({ type: String, attribute: 'data-role', noAccessor: true }),
|
|
786
710
|
ariaProperty // tslint:disable-line:no-new-decorators
|
|
@@ -852,7 +776,7 @@ __decorate([
|
|
|
852
776
|
__metadata("design:type", Object)
|
|
853
777
|
], TextField.prototype, "nativeErrorText", void 0);
|
|
854
778
|
__decorate([
|
|
855
|
-
query('
|
|
779
|
+
query('input'),
|
|
856
780
|
__metadata("design:type", HTMLInputElement)
|
|
857
781
|
], TextField.prototype, "input", void 0);
|
|
858
782
|
__decorate([
|