material 3.7.3 → 3.8.1
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/NOTICE +223 -0
- package/README.md +6 -4
- package/dist/components/badge/badge.d.ts +4 -0
- package/dist/components/badge/constants.d.ts +4 -0
- package/dist/components/badge/index.d.ts +1 -0
- package/dist/components/badge/types.d.ts +102 -0
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
- package/dist/components/bottom-app-bar/constants.d.ts +3 -0
- package/dist/components/bottom-app-bar/types.d.ts +42 -0
- package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
- package/dist/components/bottom-sheet/constants.d.ts +9 -0
- package/dist/components/bottom-sheet/types.d.ts +52 -0
- package/dist/components/button/button.d.ts +4 -0
- package/dist/components/button/constants.d.ts +20 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button/types.d.ts +190 -0
- package/dist/components/button-group/button-group.d.ts +4 -0
- package/dist/components/button-group/constants.d.ts +54 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/types.d.ts +125 -0
- package/dist/components/card/card.d.ts +4 -0
- package/dist/components/card/constants.d.ts +11 -0
- package/dist/components/card/content.d.ts +16 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/types.d.ts +123 -0
- package/dist/components/carousel/carousel.d.ts +1 -0
- package/dist/components/carousel/constants.d.ts +10 -0
- package/dist/components/carousel/types.d.ts +16 -0
- package/dist/components/checkbox/checkbox.d.ts +5 -0
- package/dist/components/checkbox/constants.d.ts +13 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/checkbox/types.d.ts +94 -0
- package/dist/components/chips/chips.d.ts +4 -0
- package/dist/components/chips/constants.d.ts +1 -0
- package/dist/components/chips/factories.d.ts +4 -0
- package/dist/components/chips/types.d.ts +140 -0
- package/dist/components/datepicker/constants.d.ts +38 -0
- package/dist/components/datepicker/datepicker.d.ts +2 -0
- package/dist/components/datepicker/types.d.ts +139 -0
- package/dist/components/dialog/constants.d.ts +45 -0
- package/dist/components/dialog/dialog.d.ts +5 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/types.d.ts +196 -0
- package/dist/components/divider/config.d.ts +30 -0
- package/dist/components/divider/constants.d.ts +15 -0
- package/dist/components/divider/divider.d.ts +4 -0
- package/dist/components/divider/types.d.ts +27 -0
- package/dist/components/drawer/constants.d.ts +39 -0
- package/dist/components/drawer/drawer.d.ts +4 -0
- package/dist/components/drawer/index.d.ts +1 -0
- package/dist/components/drawer/types.d.ts +109 -0
- package/dist/components/extended-fab/constants.d.ts +32 -0
- package/dist/components/extended-fab/extended-fab.d.ts +4 -0
- package/dist/components/extended-fab/types.d.ts +126 -0
- package/dist/components/fab/constants.d.ts +26 -0
- package/dist/components/fab/fab.d.ts +4 -0
- package/dist/components/fab/types.d.ts +103 -0
- package/dist/components/fab-menu/constants.d.ts +9 -0
- package/dist/components/fab-menu/fab-menu.d.ts +4 -0
- package/dist/components/fab-menu/types.d.ts +41 -0
- package/dist/components/icon-button/constants.d.ts +34 -0
- package/dist/components/icon-button/icon-button.d.ts +4 -0
- package/dist/components/icon-button/types.d.ts +157 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/list/constants.d.ts +30 -0
- package/dist/components/list/index.d.ts +1 -0
- package/dist/components/list/list.d.ts +4 -0
- package/dist/components/list/types.d.ts +110 -0
- package/dist/components/loading-indicator/constants.d.ts +16 -0
- package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
- package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
- package/dist/components/loading-indicator/types.d.ts +21 -0
- package/dist/components/menu/constants.d.ts +51 -0
- package/dist/components/menu/features/controller.js +1 -1
- package/dist/components/menu/features/keyboard.js +8 -3
- package/dist/components/menu/features/opener.js +2 -16
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/inner.d.ts +2 -0
- package/dist/components/menu/menu.d.ts +4 -0
- package/dist/components/menu/on-demand.d.ts +9 -0
- package/dist/components/menu/types.d.ts +185 -1
- package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
- package/dist/components/navigation-bar/types.d.ts +12 -0
- package/dist/components/navigation-rail/constants.d.ts +2 -0
- package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
- package/dist/components/navigation-rail/types.d.ts +18 -0
- package/dist/components/progress/constants.d.ts +37 -0
- package/dist/components/progress/progress.d.ts +4 -0
- package/dist/components/progress/types.d.ts +136 -0
- package/dist/components/radios/constants.d.ts +14 -0
- package/dist/components/radios/radios.d.ts +4 -0
- package/dist/components/radios/types.d.ts +89 -0
- package/dist/components/search/constants.d.ts +34 -0
- package/dist/components/search/search.d.ts +4 -0
- package/dist/components/search/types.d.ts +109 -0
- package/dist/components/select/constants.d.ts +46 -0
- package/dist/components/select/features.js +9 -1
- package/dist/components/select/index.d.ts +2 -0
- package/dist/components/select/select.d.ts +4 -0
- package/dist/components/select/types.d.ts +95 -0
- package/dist/components/side-sheet/constants.d.ts +9 -0
- package/dist/components/side-sheet/side-sheet.d.ts +4 -0
- package/dist/components/side-sheet/types.d.ts +51 -0
- package/dist/components/slider/constants.d.ts +62 -0
- package/dist/components/slider/slider.d.ts +4 -0
- package/dist/components/slider/types.d.ts +78 -0
- package/dist/components/snackbar/constants.d.ts +37 -0
- package/dist/components/snackbar/snackbar.d.ts +5 -0
- package/dist/components/snackbar/types.d.ts +67 -0
- package/dist/components/split-button/api.js +13 -3
- package/dist/components/split-button/constants.d.ts +13 -0
- package/dist/components/split-button/split-button.d.ts +4 -0
- package/dist/components/split-button/types.d.ts +50 -0
- package/dist/components/switch/constants.d.ts +34 -0
- package/dist/components/switch/switch.d.ts +4 -0
- package/dist/components/switch/types.d.ts +55 -0
- package/dist/components/tabs/constants.d.ts +49 -0
- package/dist/components/tabs/indicator.d.ts +22 -0
- package/dist/components/tabs/responsive.d.ts +17 -0
- package/dist/components/tabs/tab.d.ts +5 -0
- package/dist/components/tabs/tabs.d.ts +4 -0
- package/dist/components/tabs/types.d.ts +170 -0
- package/dist/components/tabs/utils.d.ts +24 -0
- package/dist/components/text-field/constants.d.ts +61 -0
- package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
- package/dist/components/text-field/text-field.d.ts +4 -0
- package/dist/components/text-field/types.d.ts +84 -0
- package/dist/components/timepicker/constants.d.ts +61 -0
- package/dist/components/timepicker/types.d.ts +145 -0
- package/dist/components/toolbar/constants.d.ts +8 -0
- package/dist/components/toolbar/toolbar.d.ts +4 -0
- package/dist/components/toolbar/types.d.ts +75 -0
- package/dist/components/tooltip/constants.d.ts +43 -0
- package/dist/components/tooltip/tooltip.d.ts +4 -0
- package/dist/components/tooltip/types.d.ts +78 -0
- package/dist/components/top-app-bar/constants.d.ts +29 -0
- package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
- package/dist/components/top-app-bar/types.d.ts +55 -0
- package/dist/core/canvas/animation.d.ts +6 -0
- package/dist/core/canvas/drawing.d.ts +47 -0
- package/dist/core/canvas/index.d.ts +1 -0
- package/dist/core/canvas/resize.d.ts +7 -0
- package/dist/core/canvas/utils.d.ts +39 -0
- package/dist/core/compose/base.d.ts +9 -0
- package/dist/core/compose/cleanup.d.ts +2 -0
- package/dist/core/compose/component.d.ts +13 -0
- package/dist/core/compose/features/badge.d.ts +10 -0
- package/dist/core/compose/features/checkable.d.ts +13 -0
- package/dist/core/compose/features/debounce.d.ts +19 -0
- package/dist/core/compose/features/disabled.d.ts +11 -0
- package/dist/core/compose/features/events.d.ts +19 -0
- package/dist/core/compose/features/icon.d.ts +20 -0
- package/dist/core/compose/features/input.d.ts +31 -0
- package/dist/core/compose/features/lifecycle.d.ts +16 -0
- package/dist/core/compose/features/position.d.ts +13 -0
- package/dist/core/compose/features/ripple.d.ts +17 -0
- package/dist/core/compose/features/size.d.ts +5 -0
- package/dist/core/compose/features/style.d.ts +5 -0
- package/dist/core/compose/features/text.d.ts +20 -0
- package/dist/core/compose/features/textinput.d.ts +39 -0
- package/dist/core/compose/features/textlabel.d.ts +18 -0
- package/dist/core/compose/features/throttle.d.ts +18 -0
- package/dist/core/compose/features/track.d.ts +12 -0
- package/dist/core/compose/features/variant.d.ts +5 -0
- package/dist/core/compose/features/withEvents.d.ts +12 -0
- package/dist/core/compose/pipe.d.ts +12 -0
- package/dist/core/compose/utils/type-guards.d.ts +5 -0
- package/dist/core/config/component.d.ts +17 -0
- package/dist/core/config/global.d.ts +15 -0
- package/dist/core/config.d.ts +34 -0
- package/dist/core/dom/attributes.d.ts +25 -0
- package/dist/core/dom/classes.d.ts +24 -0
- package/dist/core/dom/create.d.ts +47 -0
- package/dist/core/dom/events.d.ts +26 -0
- package/dist/core/dom/focus.d.ts +11 -0
- package/dist/core/dom/html.d.ts +6 -0
- package/dist/core/dom/layer.d.ts +36 -0
- package/dist/core/dom/roving.d.ts +7 -0
- package/dist/core/navigation/destinations.d.ts +10 -0
- package/dist/core/shapes/cubic.d.ts +8 -0
- package/dist/core/shapes/material.d.ts +45 -0
- package/dist/core/shapes/polygon.d.ts +11 -0
- package/dist/core/state/emitter.d.ts +19 -0
- package/dist/core/state/events.d.ts +17 -0
- package/dist/core/state/store.d.ts +40 -0
- package/dist/core/theme/shape.d.ts +3 -0
- package/dist/core/theme/tokens.d.ts +6 -0
- package/dist/core/utils/background.d.ts +7 -0
- package/dist/core/utils/color.d.ts +5 -0
- package/dist/core/utils/index.d.ts +9 -0
- package/dist/core/utils/mobile.d.ts +10 -0
- package/dist/core/utils/object.d.ts +9 -0
- package/dist/core/utils/performance.d.ts +20 -0
- package/dist/core/utils/theme.d.ts +8 -0
- package/dist/core/utils/url.d.ts +3 -0
- package/dist/elements/adapter.d.ts +24 -0
- package/dist/elements/badge.d.ts +4 -0
- package/dist/elements/bottom-app-bar.d.ts +4 -0
- package/dist/elements/bottom-sheet.d.ts +6 -0
- package/dist/elements/button-group.d.ts +8 -0
- package/dist/elements/button.d.ts +5 -0
- package/dist/elements/card.d.ts +4 -0
- package/dist/elements/carousel.d.ts +5 -0
- package/dist/elements/checkbox.d.ts +4 -0
- package/dist/elements/chips.d.ts +9 -0
- package/dist/elements/css/menu.css +1 -1
- package/dist/elements/css/menu.js +1 -1
- package/dist/elements/datepicker.d.ts +6 -0
- package/dist/elements/define.d.ts +48 -0
- package/dist/elements/dialog.d.ts +5 -0
- package/dist/elements/divider.d.ts +4 -0
- package/dist/elements/drawer.d.ts +6 -0
- package/dist/elements/extended-fab.d.ts +6 -0
- package/dist/elements/fab-menu.d.ts +10 -0
- package/dist/elements/fab.d.ts +6 -0
- package/dist/elements/icon-button.d.ts +6 -0
- package/dist/elements/index.d.ts +4 -0
- package/dist/elements/list.d.ts +8 -0
- package/dist/elements/loading-indicator.d.ts +4 -0
- package/dist/elements/menu.d.ts +12 -0
- package/dist/elements/navigation-bar.d.ts +6 -0
- package/dist/elements/navigation-rail.d.ts +10 -0
- package/dist/elements/preupgrade/badge.css +1 -1
- package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
- package/dist/elements/preupgrade/bottom-sheet.css +1 -1
- package/dist/elements/preupgrade/button-group.css +1 -1
- package/dist/elements/preupgrade/button.css +1 -1
- package/dist/elements/preupgrade/card.css +1 -1
- package/dist/elements/preupgrade/carousel.css +1 -1
- package/dist/elements/preupgrade/checkbox.css +1 -1
- package/dist/elements/preupgrade/chips.css +1 -1
- package/dist/elements/preupgrade/datepicker.css +1 -1
- package/dist/elements/preupgrade/dialog.css +1 -1
- package/dist/elements/preupgrade/divider.css +1 -1
- package/dist/elements/preupgrade/drawer.css +1 -1
- package/dist/elements/preupgrade/extended-fab.css +1 -1
- package/dist/elements/preupgrade/fab-menu.css +1 -1
- package/dist/elements/preupgrade/fab.css +1 -1
- package/dist/elements/preupgrade/icon-button.css +1 -1
- package/dist/elements/preupgrade/list.css +1 -1
- package/dist/elements/preupgrade/loading-indicator.css +1 -1
- package/dist/elements/preupgrade/menu.css +1 -1
- package/dist/elements/preupgrade/navigation-bar.css +1 -1
- package/dist/elements/preupgrade/navigation-rail.css +1 -1
- package/dist/elements/preupgrade/progress.css +1 -1
- package/dist/elements/preupgrade/radios.css +1 -1
- package/dist/elements/preupgrade/search.css +1 -1
- package/dist/elements/preupgrade/select.css +1 -1
- package/dist/elements/preupgrade/side-sheet.css +1 -1
- package/dist/elements/preupgrade/slider.css +1 -1
- package/dist/elements/preupgrade/snackbar.css +1 -1
- package/dist/elements/preupgrade/split-button.css +1 -1
- package/dist/elements/preupgrade/switch.css +1 -1
- package/dist/elements/preupgrade/tabs.css +1 -1
- package/dist/elements/preupgrade/text-field.css +1 -1
- package/dist/elements/preupgrade/timepicker.css +1 -1
- package/dist/elements/preupgrade/toolbar.css +1 -1
- package/dist/elements/preupgrade/tooltip.css +1 -1
- package/dist/elements/preupgrade/top-app-bar.css +1 -1
- package/dist/elements/preupgrade.css +1 -1
- package/dist/elements/progress.d.ts +4 -0
- package/dist/elements/radios.d.ts +5 -0
- package/dist/elements/search.d.ts +15 -0
- package/dist/elements/select.d.ts +6 -0
- package/dist/elements/side-sheet.d.ts +5 -0
- package/dist/elements/slider.d.ts +7 -0
- package/dist/elements/snackbar.d.ts +4 -0
- package/dist/elements/split-button.d.ts +8 -0
- package/dist/elements/styles.d.ts +11 -0
- package/dist/elements/switch.d.ts +5 -0
- package/dist/elements/tabs.d.ts +6 -0
- package/dist/elements/text-field.d.ts +9 -0
- package/dist/elements/timepicker.d.ts +9 -0
- package/dist/elements/toolbar.d.ts +4 -0
- package/dist/elements/tooltip.d.ts +4 -0
- package/dist/elements/top-app-bar.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/react/create.d.ts +15 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/jsx.d.ts +3 -0
- package/dist/solid/create.d.ts +16 -0
- package/dist/solid/index.d.ts +1 -0
- package/dist/solid/jsx.d.ts +4 -0
- package/dist/ssr/index.d.ts +3 -0
- package/dist/ssr/solid.d.ts +1 -0
- package/dist/ssr/svelte.d.ts +1 -0
- package/dist/ssr/vue.d.ts +1 -0
- package/dist/styles/badge.css +1 -1
- package/dist/styles/base-lite.css +2 -2
- package/dist/styles/base.css +2 -2
- package/dist/styles/bottom-app-bar.css +1 -1
- package/dist/styles/bottom-sheet.css +1 -1
- package/dist/styles/button-group.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/card.css +1 -1
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/checkbox.css +1 -1
- package/dist/styles/chips.css +1 -1
- package/dist/styles/contrast.css +2 -2
- package/dist/styles/datepicker.css +1 -1
- package/dist/styles/dialog.css +1 -1
- package/dist/styles/divider.css +1 -1
- package/dist/styles/drawer.css +1 -1
- package/dist/styles/extended-fab.css +1 -1
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/fab.css +1 -1
- package/dist/styles/icon-button.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/loading-indicator.css +1 -1
- package/dist/styles/menu.css +2 -2
- package/dist/styles/navigation-bar.css +1 -1
- package/dist/styles/navigation-rail.css +1 -1
- package/dist/styles/progress.css +1 -1
- package/dist/styles/radios.css +1 -1
- package/dist/styles/search.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/side-sheet.css +1 -1
- package/dist/styles/slider.css +1 -1
- package/dist/styles/snackbar.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +1 -1
- package/dist/styles/tabs.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/timepicker.css +1 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/tooltip.css +1 -1
- package/dist/styles/top-app-bar.css +1 -1
- package/dist/styles/typography.css +1 -1
- package/dist/styles/utilities.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/svelte/runtime.d.ts +21 -0
- package/dist/theme/image.d.ts +4 -0
- package/dist/theme/image.js +5 -0
- package/dist/theme/index.d.ts +43 -0
- package/dist/theme/index.js +32 -0
- package/dist/theme/roles.js +68 -0
- package/dist/theme/variants.d.ts +15 -0
- package/dist/theme/variants.js +17 -0
- package/dist/theme/vendor/contrast/contrast.js +72 -0
- package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +64 -0
- package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
- package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +63 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +100 -0
- package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +125 -0
- package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
- package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
- package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
- package/dist/theme/vendor/hct/cam16.js +249 -0
- package/dist/theme/vendor/hct/hct.d.ts +32 -0
- package/dist/theme/vendor/hct/hct.js +86 -0
- package/dist/theme/vendor/hct/hct_solver.js +390 -0
- package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
- package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
- package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
- package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
- package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
- package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
- package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
- package/dist/theme/vendor/scheme/scheme_content.js +30 -0
- package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
- package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
- package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
- package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
- package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
- package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
- package/dist/theme/vendor/score/score.js +100 -0
- package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
- package/dist/theme/vendor/utils/color_utils.js +173 -0
- package/dist/theme/vendor/utils/image_utils.js +72 -0
- package/dist/theme/vendor/utils/math_utils.js +75 -0
- package/dist/theme/vendor/utils/string_utils.js +61 -0
- package/dist/themes/autumn-contrast.css +2 -2
- package/dist/themes/autumn.css +2 -2
- package/dist/themes/baseline-contrast.css +2 -2
- package/dist/themes/baseline.css +2 -2
- package/dist/themes/brownbeige-contrast.css +2 -2
- package/dist/themes/brownbeige.css +2 -2
- package/dist/themes/content-contrast.css +2 -2
- package/dist/themes/content.css +2 -2
- package/dist/themes/desert-contrast.css +2 -2
- package/dist/themes/desert.css +2 -2
- package/dist/themes/expressive-contrast.css +2 -2
- package/dist/themes/expressive.css +2 -2
- package/dist/themes/fidelity-contrast.css +2 -2
- package/dist/themes/fidelity.css +2 -2
- package/dist/themes/forest-contrast.css +2 -2
- package/dist/themes/forest.css +2 -2
- package/dist/themes/fruit-salad-contrast.css +2 -2
- package/dist/themes/fruit-salad.css +2 -2
- package/dist/themes/highcontrast-contrast.css +2 -2
- package/dist/themes/highcontrast.css +2 -2
- package/dist/themes/monochrome-contrast.css +2 -2
- package/dist/themes/monochrome.css +2 -2
- package/dist/themes/neutral-contrast.css +2 -2
- package/dist/themes/neutral.css +2 -2
- package/dist/themes/ocean-contrast.css +2 -2
- package/dist/themes/ocean.css +2 -2
- package/dist/themes/rainbow-contrast.css +2 -2
- package/dist/themes/rainbow.css +2 -2
- package/dist/themes/sageivory-contrast.css +2 -2
- package/dist/themes/sageivory.css +2 -2
- package/dist/themes/spring-contrast.css +2 -2
- package/dist/themes/spring.css +2 -2
- package/dist/themes/summer-contrast.css +2 -2
- package/dist/themes/summer.css +2 -2
- package/dist/themes/sunset-contrast.css +2 -2
- package/dist/themes/sunset.css +2 -2
- package/dist/themes/tealcaramel-contrast.css +2 -2
- package/dist/themes/tealcaramel.css +2 -2
- package/dist/themes/vibrant-contrast.css +2 -2
- package/dist/themes/vibrant.css +2 -2
- package/dist/vue/create.d.ts +18 -0
- package/dist/vue/index.d.ts +1 -0
- package/package.json +14 -1
- package/src/styles/components/_menu.scss +14 -1
- package/src/styles/themes/_autumn.scss +20 -2
- package/src/styles/themes/_base-theme.scss +34 -24
- package/src/styles/themes/_baseline.scss +18 -0
- package/src/styles/themes/_brownbeige.scss +30 -2
- package/src/styles/themes/_content.scss +30 -2
- package/src/styles/themes/_desert.scss +30 -2
- package/src/styles/themes/_expressive.scss +30 -2
- package/src/styles/themes/_fidelity.scss +30 -2
- package/src/styles/themes/_forest.scss +20 -2
- package/src/styles/themes/_fruit-salad.scss +30 -2
- package/src/styles/themes/_highcontrast.scss +21 -2
- package/src/styles/themes/_monochrome.scss +30 -2
- package/src/styles/themes/_neutral.scss +30 -2
- package/src/styles/themes/_ocean.scss +20 -2
- package/src/styles/themes/_rainbow.scss +30 -2
- package/src/styles/themes/_sageivory.scss +30 -2
- package/src/styles/themes/_spring.scss +20 -2
- package/src/styles/themes/_summer.scss +30 -2
- package/src/styles/themes/_sunset.scss +20 -2
- package/src/styles/themes/_tealcaramel.scss +30 -2
- package/src/styles/themes/_vibrant.scss +30 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseComponent, ElementComponent } from "../../../core/compose/component.js";
|
|
2
|
+
/** Extended element component with input field */
|
|
2
3
|
interface InputElementComponent extends ElementComponent {
|
|
3
4
|
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
4
5
|
emit?: (event: string, data?: unknown) => void;
|
|
@@ -6,24 +7,48 @@ interface InputElementComponent extends ElementComponent {
|
|
|
6
7
|
destroy: () => void;
|
|
7
8
|
};
|
|
8
9
|
}
|
|
10
|
+
/** What an interactive trailing icon's `trailing` event carries */
|
|
9
11
|
export interface TextFieldTrailingPayload {
|
|
12
|
+
/** The field's value when the icon was activated */
|
|
10
13
|
value: string;
|
|
14
|
+
/** The click (Enter and Space reach a button as one) */
|
|
11
15
|
event: MouseEvent;
|
|
12
16
|
}
|
|
17
|
+
/** Configuration for trailing icon feature */
|
|
13
18
|
export interface TrailingIconConfig {
|
|
19
|
+
/** Trailing icon HTML content */
|
|
14
20
|
trailingIcon?: string;
|
|
21
|
+
/** Makes the trailing icon a button with this accessible name: clear, show password, open a menu. */
|
|
15
22
|
trailingIconLabel?: string;
|
|
23
|
+
/** `trailing` listener. */
|
|
16
24
|
onTrailingClick?: (event: TextFieldTrailingPayload) => void;
|
|
25
|
+
/** Whether the field starts disabled; the trailing button is disabled with it */
|
|
17
26
|
disabled?: boolean;
|
|
27
|
+
/** CSS class prefix */
|
|
18
28
|
prefix?: string;
|
|
29
|
+
/** Component name */
|
|
19
30
|
componentName?: string;
|
|
20
31
|
}
|
|
32
|
+
/** Component with trailing icon capabilities */
|
|
33
|
+
/** What this feature installs. */
|
|
21
34
|
export interface TrailingIconFeature {
|
|
35
|
+
/** Trailing icon element */
|
|
22
36
|
trailingIcon: HTMLElement | null;
|
|
37
|
+
/**
|
|
38
|
+
* Sets trailing icon content
|
|
39
|
+
* @param html
|
|
40
|
+
* @param label
|
|
41
|
+
*/
|
|
23
42
|
setTrailingIcon: (html: string, label?: string) => TrailingIconComponent;
|
|
43
|
+
/** Removes trailing icon */
|
|
24
44
|
removeTrailingIcon: () => TrailingIconComponent;
|
|
25
45
|
}
|
|
46
|
+
/** Component with trailingicon capabilities */
|
|
26
47
|
export interface TrailingIconComponent extends BaseComponent, TrailingIconFeature {
|
|
27
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Adds trailing icon to a text field component
|
|
51
|
+
* @param config
|
|
52
|
+
*/
|
|
28
53
|
export declare const withTrailingIcon: <T extends TrailingIconConfig & object>(config: T) => <C extends InputElementComponent>(component: C) => C & TrailingIconFeature;
|
|
29
54
|
export {};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { TextFieldConfig, TextFieldComponent } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new TextField component Text fields allow users to enter text into a UI.
|
|
4
|
+
* @param config
|
|
5
|
+
*/
|
|
2
6
|
declare const createTextField: (config?: TextFieldConfig) => TextFieldComponent;
|
|
3
7
|
export default createTextField;
|
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import type { EventCallback } from "../../core/state/emitter.js";
|
|
2
2
|
import type { TextFieldTrailingPayload } from "./features/trailing-icon.js";
|
|
3
3
|
export type { TextFieldTrailingPayload };
|
|
4
|
+
/** Available TextField variants */
|
|
4
5
|
export type TextFieldVariant = "filled" | "outlined";
|
|
6
|
+
/** TextField variant constants */
|
|
5
7
|
export declare const TEXT_FIELD_VARIANTS: {
|
|
6
8
|
readonly FILLED: "filled";
|
|
7
9
|
readonly OUTLINED: "outlined";
|
|
8
10
|
};
|
|
11
|
+
/** Available TextField states */
|
|
9
12
|
export type TextFieldStates = "active" | "inactive" | "disabled";
|
|
13
|
+
/** Available TextField density levels */
|
|
10
14
|
export type TextFieldDensity = "default" | "compact";
|
|
15
|
+
/** TextField density constants */
|
|
11
16
|
export declare const TEXT_FIELD_DENSITY: {
|
|
12
17
|
readonly DEFAULT: "default";
|
|
13
18
|
readonly COMPACT: "compact";
|
|
14
19
|
};
|
|
20
|
+
/** Available TextField types */
|
|
15
21
|
export type TextFieldTypes = "text" | "password" | "email" | "number" | "tel" | "url" | "search" | "multiline";
|
|
22
|
+
/** TextField type constants */
|
|
16
23
|
export declare const TEXT_FIELD_TYPES: {
|
|
17
24
|
readonly TEXT: "text";
|
|
18
25
|
readonly PASSWORD: "password";
|
|
@@ -23,91 +30,165 @@ export declare const TEXT_FIELD_TYPES: {
|
|
|
23
30
|
readonly SEARCH: "search";
|
|
24
31
|
readonly MULTILINE: "multiline";
|
|
25
32
|
};
|
|
33
|
+
/** Configuration interface for the TextField component */
|
|
26
34
|
export interface TextFieldConfig {
|
|
35
|
+
/** Input type (text, password, email, etc.) */
|
|
27
36
|
type?: TextFieldTypes | string;
|
|
37
|
+
/** Visual variant (filled, outlined) */
|
|
28
38
|
variant?: TextFieldVariant | string;
|
|
39
|
+
/** Density level (default, compact) */
|
|
29
40
|
density?: TextFieldDensity | string;
|
|
41
|
+
/** Input name attribute */
|
|
30
42
|
name?: string;
|
|
43
|
+
/** Label text */
|
|
31
44
|
label?: string;
|
|
45
|
+
/** Accessible name for the input; the visible label is the fallback. */
|
|
32
46
|
ariaLabel?: string;
|
|
47
|
+
/** Initial value */
|
|
33
48
|
value?: string;
|
|
49
|
+
/** Placeholder text */
|
|
34
50
|
placeholder?: string;
|
|
51
|
+
/** Whether input is required; the label gets an asterisk */
|
|
35
52
|
required?: boolean;
|
|
53
|
+
/** No asterisk on a required field: M3 lets a form whose fields are mostly */
|
|
36
54
|
noAsterisk?: boolean;
|
|
55
|
+
/** Whether text field is disabled */
|
|
37
56
|
disabled?: boolean;
|
|
57
|
+
/** Whether text field is readonly */
|
|
38
58
|
readonly?: boolean;
|
|
59
|
+
/** Maximum input length */
|
|
39
60
|
maxLength?: number;
|
|
61
|
+
/** Input pattern for validation */
|
|
40
62
|
pattern?: string;
|
|
63
|
+
/** Autocomplete attribute */
|
|
41
64
|
autocomplete?: string;
|
|
65
|
+
/** Leading icon HTML content. */
|
|
42
66
|
leadingIcon?: string;
|
|
67
|
+
/** Trailing icon HTML content. */
|
|
43
68
|
trailingIcon?: string;
|
|
69
|
+
/** Makes the trailing icon a button with this accessible name (clear, show password, …), emitting `trailing` when activated. */
|
|
44
70
|
trailingIconLabel?: string;
|
|
71
|
+
/** `trailing` listener registered at creation. */
|
|
45
72
|
onTrailingClick?: TextFieldEvents["trailing"];
|
|
73
|
+
/** Supporting text content */
|
|
46
74
|
supportingText?: string;
|
|
75
|
+
/** Whether supporting text indicates an error */
|
|
47
76
|
error?: boolean;
|
|
77
|
+
/** Prefix text to display before the input */
|
|
48
78
|
prefixText?: string;
|
|
79
|
+
/** Suffix text to display after the input */
|
|
49
80
|
suffixText?: string;
|
|
81
|
+
/** Additional CSS classes */
|
|
50
82
|
class?: string;
|
|
83
|
+
/** Prefix for class names */
|
|
51
84
|
prefix?: string;
|
|
85
|
+
/** Component name */
|
|
52
86
|
componentName?: string;
|
|
53
87
|
}
|
|
88
|
+
/** Payload emitted by native input/change and autofill detection. */
|
|
54
89
|
export interface TextFieldValuePayload {
|
|
55
90
|
value: string;
|
|
56
91
|
isEmpty: boolean;
|
|
57
92
|
isAutofilled: boolean;
|
|
58
93
|
}
|
|
94
|
+
/** Focus and blur report whether the input is empty, without a native event. */
|
|
59
95
|
export interface TextFieldFocusPayload {
|
|
60
96
|
isEmpty: boolean;
|
|
61
97
|
}
|
|
98
|
+
/** Events emitted by the text input feature. */
|
|
62
99
|
export interface TextFieldEvents {
|
|
100
|
+
/** The trailing icon button was activated (`trailingIconLabel`) */
|
|
63
101
|
trailing: (payload: TextFieldTrailingPayload) => void;
|
|
64
102
|
input: (payload: TextFieldValuePayload) => void;
|
|
65
103
|
change: (payload: TextFieldValuePayload) => void;
|
|
66
104
|
focus: (payload: TextFieldFocusPayload) => void;
|
|
67
105
|
blur: (payload: TextFieldFocusPayload) => void;
|
|
68
106
|
}
|
|
107
|
+
/** TextField component interface */
|
|
69
108
|
export interface TextFieldComponent {
|
|
109
|
+
/** The root element of the text field */
|
|
70
110
|
element: HTMLElement;
|
|
111
|
+
/** The container: label, input, outline, icons and affixes, above the supporting text row. */
|
|
71
112
|
field: HTMLElement;
|
|
113
|
+
/** The input element */
|
|
72
114
|
input: HTMLInputElement | HTMLTextAreaElement;
|
|
115
|
+
/** Gets the text field's value */
|
|
73
116
|
getValue: () => string;
|
|
117
|
+
/** Sets the text field's value */
|
|
74
118
|
setValue: (value: string) => TextFieldComponent;
|
|
119
|
+
/** Sets an attribute on the input element */
|
|
75
120
|
setAttribute: (name: string, value: string) => TextFieldComponent;
|
|
121
|
+
/** Gets an attribute from the input element */
|
|
76
122
|
getAttribute: (name: string) => string | null;
|
|
123
|
+
/** Removes an attribute from the input element */
|
|
77
124
|
removeAttribute: (name: string) => TextFieldComponent;
|
|
125
|
+
/** Sets the text field's variant (filled or outlined) */
|
|
78
126
|
setVariant: (variant: TextFieldVariant) => TextFieldComponent;
|
|
127
|
+
/** Gets the text field's current variant */
|
|
79
128
|
getVariant: () => TextFieldVariant;
|
|
129
|
+
/** Sets the text field's label text */
|
|
80
130
|
setLabel: (text: string) => TextFieldComponent;
|
|
131
|
+
/** Gets the text field's label text */
|
|
81
132
|
getLabel: () => string;
|
|
133
|
+
/** Leading icon element (if present) */
|
|
82
134
|
leadingIcon: HTMLElement | null;
|
|
135
|
+
/** Sets the leading icon HTML content */
|
|
83
136
|
setLeadingIcon: (html: string) => TextFieldComponent;
|
|
137
|
+
/** Removes the leading icon */
|
|
84
138
|
removeLeadingIcon: () => TextFieldComponent;
|
|
139
|
+
/** Trailing icon element (if present) */
|
|
85
140
|
trailingIcon: HTMLElement | null;
|
|
141
|
+
/** Sets the trailing icon HTML content */
|
|
142
|
+
/** Sets the trailing icon. */
|
|
86
143
|
setTrailingIcon: (html: string, label?: string) => TextFieldComponent;
|
|
144
|
+
/** Removes the trailing icon */
|
|
87
145
|
removeTrailingIcon: () => TextFieldComponent;
|
|
146
|
+
/** Makes the field required or optional, the label's asterisk with it */
|
|
88
147
|
setRequired: (required: boolean) => TextFieldComponent;
|
|
148
|
+
/** Whether the field is required */
|
|
89
149
|
isRequired: () => boolean;
|
|
150
|
+
/** Supporting text element (if present) */
|
|
90
151
|
supportingTextElement: HTMLElement | null;
|
|
152
|
+
/** Sets the supporting text content */
|
|
91
153
|
setSupportingText: (text: string, isError?: boolean) => TextFieldComponent;
|
|
154
|
+
/** Removes the supporting text */
|
|
92
155
|
removeSupportingText: () => TextFieldComponent;
|
|
156
|
+
/** Prefix text element (if present) */
|
|
93
157
|
prefixTextElement: HTMLElement | null;
|
|
158
|
+
/** Sets the prefix text content */
|
|
94
159
|
setPrefixText: (text: string) => TextFieldComponent;
|
|
160
|
+
/** Removes the prefix text */
|
|
95
161
|
removePrefixText: () => TextFieldComponent;
|
|
162
|
+
/** Suffix text element (if present) */
|
|
96
163
|
suffixTextElement: HTMLElement | null;
|
|
164
|
+
/** Sets the suffix text content */
|
|
97
165
|
setSuffixText: (text: string) => TextFieldComponent;
|
|
166
|
+
/** Removes the suffix text */
|
|
98
167
|
removeSuffixText: () => TextFieldComponent;
|
|
168
|
+
/** Manually update element positions (useful after DOM changes) */
|
|
99
169
|
updatePositions: () => TextFieldComponent;
|
|
170
|
+
/** Sets the error state of the text field */
|
|
100
171
|
setError: (error: boolean, message?: string) => TextFieldComponent;
|
|
172
|
+
/** Gets the current error state */
|
|
101
173
|
isError: () => boolean;
|
|
174
|
+
/** Sets the density of the text field */
|
|
102
175
|
setDensity: (density: TextFieldDensity | string) => TextFieldComponent;
|
|
176
|
+
/** Gets the current density setting */
|
|
103
177
|
getDensity: () => string;
|
|
178
|
+
/** Subscribes to input state events; keyboard events use input.addEventListener. */
|
|
104
179
|
on: <K extends keyof TextFieldEvents>(event: K, handler: TextFieldEvents[K]) => TextFieldComponent;
|
|
180
|
+
/** Removes event listener */
|
|
105
181
|
off: <K extends keyof TextFieldEvents>(event: K, handler: TextFieldEvents[K]) => TextFieldComponent;
|
|
182
|
+
/** Enables the text field */
|
|
106
183
|
enable: () => TextFieldComponent;
|
|
184
|
+
/** Disables the text field */
|
|
107
185
|
disable: () => TextFieldComponent;
|
|
186
|
+
/** Whether the text field is disabled */
|
|
108
187
|
isDisabled: () => boolean;
|
|
188
|
+
/** Destroys the text field component and cleans up resources */
|
|
109
189
|
destroy: () => void;
|
|
110
190
|
}
|
|
191
|
+
/** API options interface */
|
|
111
192
|
export interface ApiOptions {
|
|
112
193
|
disabled: {
|
|
113
194
|
enable: () => void;
|
|
@@ -118,8 +199,10 @@ export interface ApiOptions {
|
|
|
118
199
|
destroy: () => void;
|
|
119
200
|
};
|
|
120
201
|
}
|
|
202
|
+
/** Base component interface */
|
|
121
203
|
export interface BaseComponent {
|
|
122
204
|
element: HTMLElement;
|
|
205
|
+
/** The prefixed class name, from createBase */
|
|
123
206
|
getClass: (name: string) => string;
|
|
124
207
|
input?: HTMLInputElement | HTMLTextAreaElement;
|
|
125
208
|
config?: {
|
|
@@ -165,6 +248,7 @@ export interface BaseComponent {
|
|
|
165
248
|
setError?: (error: boolean, message?: string) => void;
|
|
166
249
|
isError?: () => boolean;
|
|
167
250
|
}
|
|
251
|
+
/** Registers TextFieldConfig with the global defaults map, so `setComponentDefaults("text-field", ...)` is typed without core importing anything from this component. */
|
|
168
252
|
declare module "../../core/config/global" {
|
|
169
253
|
interface ComponentConfigMap {
|
|
170
254
|
"text-field"?: Partial<TextFieldConfig>;
|
|
@@ -1,70 +1,131 @@
|
|
|
1
|
+
/** Time picker display types */
|
|
1
2
|
export declare const TIMEPICKER_TYPES: {
|
|
3
|
+
/** Clock dial-based time picker */
|
|
2
4
|
readonly DIAL: "dial";
|
|
5
|
+
/** Text input-based time picker */
|
|
3
6
|
readonly INPUT: "input";
|
|
4
7
|
};
|
|
8
|
+
/** Time picker orientations */
|
|
5
9
|
export declare const TIMEPICKER_ORIENTATIONS: {
|
|
10
|
+
/** Vertical layout (default on mobile) */
|
|
6
11
|
readonly VERTICAL: "vertical";
|
|
12
|
+
/** Horizontal layout */
|
|
7
13
|
readonly HORIZONTAL: "horizontal";
|
|
8
14
|
};
|
|
15
|
+
/** Time formats */
|
|
9
16
|
export declare const TIMEPICKER_FORMATS: {
|
|
17
|
+
/** 12-hour format with AM/PM */
|
|
10
18
|
readonly AMPM: "12h";
|
|
19
|
+
/** 24-hour format */
|
|
11
20
|
readonly MILITARY: "24h";
|
|
12
21
|
};
|
|
22
|
+
/** Time periods for 12-hour format */
|
|
13
23
|
export declare const TIMEPICKER_PERIODS: {
|
|
24
|
+
/** Morning */
|
|
14
25
|
readonly AM: "AM";
|
|
26
|
+
/** Afternoon/Evening */
|
|
15
27
|
readonly PM: "PM";
|
|
16
28
|
};
|
|
29
|
+
/** Time picker event types */
|
|
17
30
|
export declare const TIMEPICKER_EVENTS: {
|
|
31
|
+
/** Fired when the committed time changes: on OK, or setValue */
|
|
18
32
|
readonly CHANGE: "change";
|
|
33
|
+
/** Fired as the dial, fields or AM/PM change the draft, while open */
|
|
19
34
|
readonly INPUT: "input";
|
|
35
|
+
/** Fired when time picker opens */
|
|
20
36
|
readonly OPEN: "open";
|
|
37
|
+
/** Fired when time picker closes */
|
|
21
38
|
readonly CLOSE: "close";
|
|
39
|
+
/** Fired when time is confirmed */
|
|
22
40
|
readonly CONFIRM: "confirm";
|
|
41
|
+
/** Fired when time picker is canceled */
|
|
23
42
|
readonly CANCEL: "cancel";
|
|
24
43
|
};
|
|
44
|
+
/** Time constants used for generating clock numbers and validation */
|
|
25
45
|
export declare const TIMEPICKER_VALUES: {
|
|
46
|
+
/** Hours for 12-hour format (1-12) */
|
|
26
47
|
readonly HOURS_12: number[];
|
|
48
|
+
/** Hours for 24-hour format (0-23) */
|
|
27
49
|
readonly HOURS_24: number[];
|
|
50
|
+
/** Minutes (0-59) */
|
|
28
51
|
readonly MINUTES: number[];
|
|
52
|
+
/** Seconds (0-59) */
|
|
29
53
|
readonly SECONDS: number[];
|
|
30
54
|
};
|
|
55
|
+
/** Element class selectors for time picker components */
|
|
31
56
|
export declare const TIMEPICKER_SELECTORS: {
|
|
57
|
+
/** Main container selector */
|
|
32
58
|
readonly CONTAINER: ".mtrl-time-picker";
|
|
59
|
+
/** Dialog container selector */
|
|
33
60
|
readonly DIALOG: ".mtrl-time-picker__dialog";
|
|
61
|
+
/** Title element selector */
|
|
34
62
|
readonly TITLE: ".mtrl-time-picker__title";
|
|
63
|
+
/** Content container selector */
|
|
35
64
|
readonly CONTENT: ".mtrl-time-picker__content";
|
|
65
|
+
/** Clock dial container selector */
|
|
36
66
|
readonly DIAL: ".mtrl-time-picker__dial";
|
|
67
|
+
/** Clock dial face selector */
|
|
37
68
|
readonly DIAL_FACE: ".mtrl-time-picker__dial-face";
|
|
69
|
+
/** Clock centre dot selector */
|
|
38
70
|
readonly DIAL_CENTER: ".mtrl-time-picker__dial-centre";
|
|
71
|
+
/** Clock numbers container selector */
|
|
39
72
|
readonly DIAL_NUMBERS: ".mtrl-time-picker__dial-numbers";
|
|
73
|
+
/** Individual number element selector */
|
|
40
74
|
readonly DIAL_NUMBER: ".mtrl-time-picker__dial-number";
|
|
75
|
+
/** Input container selector */
|
|
41
76
|
readonly INPUT_CONTAINER: ".mtrl-time-picker__input-container";
|
|
77
|
+
/** Hours input selector */
|
|
42
78
|
readonly HOURS_INPUT: ".mtrl-time-picker__hours";
|
|
79
|
+
/** Minutes input selector */
|
|
43
80
|
readonly MINUTES_INPUT: ".mtrl-time-picker__minutes";
|
|
81
|
+
/** Seconds input selector */
|
|
44
82
|
readonly SECONDS_INPUT: ".mtrl-time-picker__seconds";
|
|
83
|
+
/** Time separator selector */
|
|
45
84
|
readonly SEPARATOR: ".mtrl-time-picker__separator";
|
|
85
|
+
/** AM/PM selector container */
|
|
46
86
|
readonly PERIOD_CONTAINER: ".mtrl-time-picker__period";
|
|
87
|
+
/** AM button selector */
|
|
47
88
|
readonly PERIOD_AM: ".mtrl-time-picker__period-am";
|
|
89
|
+
/** PM button selector */
|
|
48
90
|
readonly PERIOD_PM: ".mtrl-time-picker__period-pm";
|
|
91
|
+
/** Actions container selector */
|
|
49
92
|
readonly ACTIONS: ".mtrl-time-picker__actions";
|
|
93
|
+
/** Toggle type button selector */
|
|
50
94
|
readonly TOGGLE_TYPE_BUTTON: ".mtrl-time-picker__toggle-type";
|
|
95
|
+
/** Cancel button selector */
|
|
51
96
|
readonly CANCEL_BUTTON: ".mtrl-time-picker__cancel";
|
|
97
|
+
/** Confirm button selector */
|
|
52
98
|
readonly CONFIRM_BUTTON: ".mtrl-time-picker__confirm";
|
|
53
99
|
};
|
|
100
|
+
/** Default icons for the time picker */
|
|
54
101
|
export declare const TIMEPICKER_ICONS: {
|
|
102
|
+
/** Default clock icon */
|
|
55
103
|
readonly CLOCK: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <polyline points=\"12 6 12 12 16 14\"></polyline>\n </svg>";
|
|
104
|
+
/** Default keyboard icon */
|
|
56
105
|
readonly KEYBOARD: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" ry=\"2\"></rect>\n <line x1=\"6\" y1=\"8\" x2=\"6\" y2=\"8\"></line>\n <line x1=\"10\" y1=\"8\" x2=\"10\" y2=\"8\"></line>\n <line x1=\"14\" y1=\"8\" x2=\"14\" y2=\"8\"></line>\n <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"8\"></line>\n <line x1=\"6\" y1=\"12\" x2=\"6\" y2=\"12\"></line>\n <line x1=\"10\" y1=\"12\" x2=\"10\" y2=\"12\"></line>\n <line x1=\"14\" y1=\"12\" x2=\"14\" y2=\"12\"></line>\n <line x1=\"18\" y1=\"12\" x2=\"18\" y2=\"12\"></line>\n <line x1=\"6\" y1=\"16\" x2=\"18\" y2=\"16\"></line>\n </svg>";
|
|
57
106
|
};
|
|
107
|
+
/** Default configuration values for the time picker */
|
|
58
108
|
export declare const TIMEPICKER_DEFAULTS: {
|
|
109
|
+
/** Default picker type */
|
|
59
110
|
readonly TYPE: "dial";
|
|
111
|
+
/** Default time format */
|
|
60
112
|
readonly FORMAT: "12h";
|
|
113
|
+
/** Default orientation */
|
|
61
114
|
readonly ORIENTATION: "vertical";
|
|
115
|
+
/** Whether to show seconds selector */
|
|
62
116
|
readonly SHOW_SECONDS: false;
|
|
117
|
+
/** Step interval for minute selection */
|
|
63
118
|
readonly MINUTE_STEP: 1;
|
|
119
|
+
/** Step interval for second selection */
|
|
64
120
|
readonly SECOND_STEP: 1;
|
|
121
|
+
/** Default cancel button text */
|
|
65
122
|
readonly CANCEL_TEXT: "Cancel";
|
|
123
|
+
/** Default confirm button text */
|
|
66
124
|
readonly CONFIRM_TEXT: "OK";
|
|
125
|
+
/** Whether picker is initially open: the default of the `open` option */
|
|
67
126
|
readonly OPEN: false;
|
|
127
|
+
/** Default clock icon */
|
|
68
128
|
readonly CLOCK_ICON: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"10\"></circle>\n <polyline points=\"12 6 12 12 16 14\"></polyline>\n </svg>";
|
|
129
|
+
/** Default keyboard icon */
|
|
69
130
|
readonly KEYBOARD_ICON: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" ry=\"2\"></rect>\n <line x1=\"6\" y1=\"8\" x2=\"6\" y2=\"8\"></line>\n <line x1=\"10\" y1=\"8\" x2=\"10\" y2=\"8\"></line>\n <line x1=\"14\" y1=\"8\" x2=\"14\" y2=\"8\"></line>\n <line x1=\"18\" y1=\"8\" x2=\"18\" y2=\"8\"></line>\n <line x1=\"6\" y1=\"12\" x2=\"6\" y2=\"12\"></line>\n <line x1=\"10\" y1=\"12\" x2=\"10\" y2=\"12\"></line>\n <line x1=\"14\" y1=\"12\" x2=\"14\" y2=\"12\"></line>\n <line x1=\"18\" y1=\"12\" x2=\"18\" y2=\"12\"></line>\n <line x1=\"6\" y1=\"16\" x2=\"18\" y2=\"16\"></line>\n </svg>";
|
|
70
131
|
};
|
|
@@ -1,109 +1,254 @@
|
|
|
1
1
|
import type { ForwardedEventPayload } from "../../core/dom/index.js";
|
|
2
2
|
import type { NormalizedEvent } from "../../core/utils/mobile.js";
|
|
3
|
+
/** Normalized touch-end event emitted by the interactive root on touch devices. */
|
|
3
4
|
export type TimePickerTapPayload = NormalizedEvent;
|
|
5
|
+
/** Horizontal swipe emitted by the interactive root on touch devices. */
|
|
4
6
|
export interface TimePickerSwipePayload {
|
|
5
7
|
direction: "left" | "right";
|
|
6
8
|
deltaX: number;
|
|
7
9
|
deltaY: number;
|
|
8
10
|
}
|
|
11
|
+
/** The committed 24-hour value carried by `change` and `confirm`. */
|
|
9
12
|
export interface TimePickerValueEvent {
|
|
13
|
+
/** HH:MM, or HH:MM:SS with showSeconds */
|
|
10
14
|
value: string;
|
|
11
15
|
}
|
|
16
|
+
/** A draft edit while the committed value remains available as `value`. */
|
|
12
17
|
export interface TimePickerInputEvent extends TimePickerValueEvent {
|
|
18
|
+
/** The uncommitted 24-hour value shown in the open picker. */
|
|
13
19
|
draftValue: string;
|
|
14
20
|
}
|
|
21
|
+
/** Events emitted by the picker API and its interactive root. */
|
|
15
22
|
export interface TimePickerEvents {
|
|
23
|
+
/** The committed 24-hour value (HH:MM, or HH:MM:SS with showSeconds), also submitted by the form: once when OK commits a different time. */
|
|
16
24
|
change: (event: TimePickerValueEvent) => void;
|
|
25
|
+
/** The committed value and draft as the dial, fields or AM/PM change. */
|
|
17
26
|
input: (event: TimePickerInputEvent) => void;
|
|
27
|
+
/** The confirmed 24-hour value, matching getValue() and the submitted form value. */
|
|
18
28
|
confirm: (event: TimePickerValueEvent) => void;
|
|
19
29
|
open: () => void;
|
|
20
30
|
close: () => void;
|
|
21
31
|
cancel: () => void;
|
|
32
|
+
/** Root events; the dialog is inside the root, so its clicks and keys reach these too. */
|
|
22
33
|
click: (payload: ForwardedEventPayload<MouseEvent, HTMLElement>) => void;
|
|
23
34
|
keydown: (payload: ForwardedEventPayload<KeyboardEvent, HTMLElement>) => void;
|
|
24
35
|
tap: (payload: TimePickerTapPayload) => void;
|
|
25
36
|
swipe: (payload: TimePickerSwipePayload) => void;
|
|
26
37
|
}
|
|
38
|
+
/** Time picker display type */
|
|
27
39
|
export declare enum TIME_PICKER_TYPE {
|
|
40
|
+
/** Clock dial-based time picker */
|
|
28
41
|
DIAL = "dial",
|
|
42
|
+
/** Text input-based time picker */
|
|
29
43
|
INPUT = "input"
|
|
30
44
|
}
|
|
45
|
+
/** Time picker orientation */
|
|
31
46
|
export declare enum TIME_PICKER_ORIENTATION {
|
|
47
|
+
/** Vertical layout (default on mobile) */
|
|
32
48
|
VERTICAL = "vertical",
|
|
49
|
+
/** Horizontal layout */
|
|
33
50
|
HORIZONTAL = "horizontal"
|
|
34
51
|
}
|
|
52
|
+
/** Time format (12-hour or 24-hour) */
|
|
35
53
|
export declare enum TIME_FORMAT {
|
|
54
|
+
/** 12-hour format with AM/PM */
|
|
36
55
|
AMPM = "12h",
|
|
56
|
+
/** 24-hour format */
|
|
37
57
|
MILITARY = "24h"
|
|
38
58
|
}
|
|
59
|
+
/** A time format as the enum or its string value, `'12h'` or `'24h'` */
|
|
39
60
|
export type TimeFormat = TIME_FORMAT | `${TIME_FORMAT}`;
|
|
61
|
+
/** A time picker type as the enum or its string value, `'dial'` or `'input'` */
|
|
40
62
|
export type TimePickerType = TIME_PICKER_TYPE | `${TIME_PICKER_TYPE}`;
|
|
63
|
+
/** An orientation as the enum or its string value, `'vertical'` or `'horizontal'` */
|
|
41
64
|
export type TimePickerOrientation = TIME_PICKER_ORIENTATION | `${TIME_PICKER_ORIENTATION}`;
|
|
65
|
+
/** Period of day for 12-hour format */
|
|
42
66
|
export declare enum TIME_PERIOD {
|
|
67
|
+
/** Morning */
|
|
43
68
|
AM = "AM",
|
|
69
|
+
/** Afternoon/Evening */
|
|
44
70
|
PM = "PM"
|
|
45
71
|
}
|
|
72
|
+
/** Configuration interface for the TimePicker component */
|
|
46
73
|
export interface TimePickerConfig {
|
|
74
|
+
/** Initial time value in 24-hour format (HH:MM) */
|
|
47
75
|
value?: string;
|
|
76
|
+
/** Form field name. */
|
|
48
77
|
name?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Type of time picker to display
|
|
80
|
+
* @default TIME_PICKER_TYPE.DIAL
|
|
81
|
+
*/
|
|
49
82
|
type?: TimePickerType;
|
|
83
|
+
/**
|
|
84
|
+
* Time format to use (12h or 24h)
|
|
85
|
+
* @default TIME_FORMAT.AMPM
|
|
86
|
+
*/
|
|
50
87
|
format?: TimeFormat;
|
|
88
|
+
/**
|
|
89
|
+
* Layout orientation for the time picker
|
|
90
|
+
* @default TIME_PICKER_ORIENTATION.VERTICAL
|
|
91
|
+
*/
|
|
51
92
|
orientation?: TimePickerOrientation;
|
|
93
|
+
/** Title text for the time picker */
|
|
52
94
|
title?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Whether to show seconds selector
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
53
99
|
showSeconds?: boolean;
|
|
100
|
+
/** Additional CSS classes to add to the time picker */
|
|
54
101
|
class?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Component prefix for class names
|
|
104
|
+
* @default 'mtrl'
|
|
105
|
+
*/
|
|
55
106
|
prefix?: string;
|
|
107
|
+
/** Component name used in class generation */
|
|
56
108
|
componentName?: string;
|
|
109
|
+
/** Earliest selectable time, 24-hour `HH:MM` or `HH:MM:SS`. */
|
|
57
110
|
minTime?: string;
|
|
111
|
+
/** Latest selectable time, 24-hour `HH:MM` or `HH:MM:SS`; as `minTime`, at the other end. */
|
|
58
112
|
maxTime?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Minute step: dial minutes off it are disabled, a pointer between them picks the nearest, and a typed minute rounds to it when committed.
|
|
115
|
+
* @default 1
|
|
116
|
+
*/
|
|
59
117
|
minuteStep?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Second step, as `minuteStep`, when seconds are shown.
|
|
120
|
+
* @default 1
|
|
121
|
+
*/
|
|
60
122
|
secondStep?: number;
|
|
123
|
+
/**
|
|
124
|
+
* Custom text for cancel button
|
|
125
|
+
* @default 'Cancel'
|
|
126
|
+
*/
|
|
61
127
|
cancelText?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Custom text for confirm button
|
|
130
|
+
* @default 'OK'
|
|
131
|
+
*/
|
|
62
132
|
confirmText?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Whether the time picker is open when the factory returns: `isOpen()` is true and `open` has been emitted (to `onOpen`).
|
|
135
|
+
* @default false
|
|
136
|
+
*/
|
|
63
137
|
open?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the picker is disabled: it does not open
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
64
142
|
disabled?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Where the dialog is appended.
|
|
145
|
+
* @default the component's element
|
|
146
|
+
*/
|
|
65
147
|
container?: string | HTMLElement;
|
|
148
|
+
/** Custom icon for the clock button */
|
|
66
149
|
clockIcon?: string;
|
|
150
|
+
/** Custom icon for the keyboard button */
|
|
67
151
|
keyboardIcon?: string;
|
|
152
|
+
/** `change` listener registered at creation. */
|
|
68
153
|
onChange?: TimePickerEvents["change"];
|
|
154
|
+
/** `input` listener registered at creation, as the draft changes while the picker is open. */
|
|
69
155
|
onInput?: TimePickerEvents["input"];
|
|
156
|
+
/** `open` listener registered at creation. */
|
|
70
157
|
onOpen?: TimePickerEvents["open"];
|
|
158
|
+
/** `close` listener registered at creation. */
|
|
71
159
|
onClose?: TimePickerEvents["close"];
|
|
160
|
+
/** `confirm` listener registered at creation. */
|
|
72
161
|
onConfirm?: TimePickerEvents["confirm"];
|
|
162
|
+
/** `cancel` listener registered at creation. */
|
|
73
163
|
onCancel?: TimePickerEvents["cancel"];
|
|
74
164
|
}
|
|
165
|
+
/** Configuration as it leaves `createBaseConfig`. */
|
|
75
166
|
export type ResolvedTimePickerConfig = TimePickerConfig & Required<Pick<TimePickerConfig, "type" | "format" | "orientation" | "showSeconds" | "minuteStep" | "secondStep" | "cancelText" | "confirmText" | "open" | "clockIcon" | "keyboardIcon" | "prefix">> & {
|
|
167
|
+
/** The dialog title's id, unique per picker. */
|
|
76
168
|
titleId?: string;
|
|
77
169
|
};
|
|
170
|
+
/** Time value object */
|
|
78
171
|
export interface TimeValue {
|
|
172
|
+
/** Hours (0-23) */
|
|
79
173
|
hours: number;
|
|
174
|
+
/** Minutes (0-59) */
|
|
80
175
|
minutes: number;
|
|
176
|
+
/** Seconds (0-59), optional */
|
|
81
177
|
seconds?: number;
|
|
178
|
+
/** AM/PM for 12-hour format */
|
|
82
179
|
period?: TIME_PERIOD;
|
|
83
180
|
}
|
|
181
|
+
/** TimePicker component interface */
|
|
84
182
|
export interface TimePickerComponent {
|
|
183
|
+
/** The time picker's container DOM element */
|
|
85
184
|
element: HTMLElement;
|
|
185
|
+
/** Modal container element */
|
|
86
186
|
modalElement: HTMLElement;
|
|
187
|
+
/** Dialog container element */
|
|
87
188
|
dialogElement: HTMLElement;
|
|
189
|
+
/** Whether the time picker is currently open */
|
|
88
190
|
isOpen: () => boolean;
|
|
191
|
+
/** Opens the time picker. */
|
|
89
192
|
open: () => TimePickerComponent;
|
|
193
|
+
/** Closes the time picker */
|
|
90
194
|
close: () => TimePickerComponent;
|
|
195
|
+
/** Toggles the time picker open/closed state */
|
|
91
196
|
toggle: () => TimePickerComponent;
|
|
197
|
+
/** Gets the current time value */
|
|
92
198
|
getValue: () => string;
|
|
199
|
+
/** Gets the current time as a TimeValue object */
|
|
93
200
|
getTimeObject: () => TimeValue;
|
|
201
|
+
/**
|
|
202
|
+
* Sets the time value.
|
|
203
|
+
* @param time
|
|
204
|
+
*/
|
|
94
205
|
setValue: (time: string) => TimePickerComponent;
|
|
206
|
+
/**
|
|
207
|
+
* Sets the time picker type (dial or input)
|
|
208
|
+
* @param type
|
|
209
|
+
*/
|
|
95
210
|
setType: (type: TimePickerType) => TimePickerComponent;
|
|
211
|
+
/** Gets the current time picker type */
|
|
96
212
|
getType: () => TIME_PICKER_TYPE;
|
|
213
|
+
/**
|
|
214
|
+
* Sets the time format (12h or 24h)
|
|
215
|
+
* @param format
|
|
216
|
+
*/
|
|
97
217
|
setFormat: (format: TimeFormat) => TimePickerComponent;
|
|
218
|
+
/** Gets the current time format */
|
|
98
219
|
getFormat: () => TIME_FORMAT;
|
|
220
|
+
/**
|
|
221
|
+
* Sets the time picker orientation
|
|
222
|
+
* @param orientation
|
|
223
|
+
*/
|
|
99
224
|
setOrientation: (orientation: TimePickerOrientation) => TimePickerComponent;
|
|
225
|
+
/** Gets the current time picker orientation */
|
|
100
226
|
getOrientation: () => TIME_PICKER_ORIENTATION;
|
|
227
|
+
/**
|
|
228
|
+
* Sets the time picker title
|
|
229
|
+
* @param title
|
|
230
|
+
*/
|
|
101
231
|
setTitle: (title: string) => TimePickerComponent;
|
|
232
|
+
/** Gets the current time picker title */
|
|
102
233
|
getTitle: () => string;
|
|
234
|
+
/** Enables the picker */
|
|
103
235
|
enable: () => TimePickerComponent;
|
|
236
|
+
/** Disables the picker: it does not open, and an open one is cancelled */
|
|
104
237
|
disable: () => TimePickerComponent;
|
|
238
|
+
/** Whether the picker is disabled */
|
|
105
239
|
isDisabled: () => boolean;
|
|
240
|
+
/** Destroys the time picker component and cleans up resources */
|
|
106
241
|
destroy: () => void;
|
|
242
|
+
/**
|
|
243
|
+
* Adds an event listener to the time picker
|
|
244
|
+
* @param event
|
|
245
|
+
* @param handler
|
|
246
|
+
*/
|
|
107
247
|
on: <K extends keyof TimePickerEvents>(event: K, handler: TimePickerEvents[K]) => TimePickerComponent;
|
|
248
|
+
/**
|
|
249
|
+
* Removes an event listener from the time picker
|
|
250
|
+
* @param event
|
|
251
|
+
* @param handler
|
|
252
|
+
*/
|
|
108
253
|
off: <K extends keyof TimePickerEvents>(event: K, handler: TimePickerEvents[K]) => TimePickerComponent;
|
|
109
254
|
}
|