@shortfuse/materialdesignweb 0.8.0 → 0.9.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/README.md +50 -198
- package/bin/mdw-css.js +1 -1
- package/components/Badge.js +15 -5
- package/components/Body.js +7 -0
- package/components/BottomAppBar.js +7 -10
- package/components/BottomSheet.js +472 -0
- package/components/Box.js +11 -49
- package/components/Button.js +81 -82
- package/components/Card.js +74 -62
- package/components/Checkbox.js +15 -25
- package/components/CheckboxIcon.js +19 -31
- package/components/Chip.js +18 -13
- package/components/Dialog.js +70 -100
- package/components/DialogActions.js +4 -0
- package/components/Display.js +64 -0
- package/components/Divider.js +5 -0
- package/components/Fab.js +94 -17
- package/components/FabContainer.js +57 -0
- package/components/FilterChip.js +43 -32
- package/components/Grid.js +187 -0
- package/components/Headline.js +9 -28
- package/components/Icon.js +80 -71
- package/components/IconButton.js +77 -120
- package/components/Input.js +745 -86
- package/components/InputChip.js +193 -0
- package/components/Label.js +7 -0
- package/components/List.js +11 -5
- package/components/ListItem.js +92 -23
- package/components/ListOption.js +143 -65
- package/components/Listbox.js +57 -17
- package/components/Menu.js +39 -27
- package/components/MenuItem.js +49 -36
- package/components/NavBar.js +66 -21
- package/components/NavBarItem.js +5 -0
- package/components/NavDrawer.js +33 -16
- package/components/NavDrawerItem.js +7 -4
- package/components/NavItem.js +61 -34
- package/components/NavRail.js +32 -21
- package/components/NavRailItem.js +10 -2
- package/components/Page.js +119 -0
- package/components/Pane.js +24 -0
- package/components/Popup.js +23 -8
- package/components/Progress.js +25 -5
- package/components/Radio.js +8 -7
- package/components/RadioIcon.js +24 -15
- package/components/Ripple.js +25 -7
- package/components/Root.js +225 -0
- package/components/Scrim.js +95 -0
- package/components/Search.js +30 -25
- package/components/SegmentedButton.js +53 -40
- package/components/SegmentedButtonGroup.js +15 -12
- package/components/Select.js +19 -10
- package/components/Shape.js +10 -66
- package/components/SideSheet.js +337 -0
- package/components/Slider.js +93 -36
- package/components/Snackbar.js +52 -20
- package/components/SnackbarContainer.js +51 -0
- package/components/Surface.js +20 -10
- package/components/Switch.js +21 -18
- package/components/SwitchIcon.js +62 -33
- package/components/Tab.js +78 -38
- package/components/TabContent.js +33 -12
- package/components/TabList.js +95 -34
- package/components/TabPanel.js +10 -1
- package/components/Table.js +151 -0
- package/components/TextArea.js +48 -16
- package/components/Title.js +8 -9
- package/components/Tooltip.js +51 -22
- package/components/TopAppBar.js +71 -78
- package/constants/shapes.js +36 -0
- package/constants/typography.js +127 -0
- package/core/Composition.js +391 -201
- package/core/CompositionAdapter.js +35 -18
- package/core/CustomElement.js +634 -254
- package/core/css.js +117 -12
- package/core/customTypes.js +161 -49
- package/core/dom.js +18 -11
- package/core/jsonMergePatch.js +27 -11
- package/core/observe.js +308 -256
- package/core/optimizations.js +9 -9
- package/core/template.js +14 -57
- package/dist/CustomElement.min.js +2 -0
- package/dist/CustomElement.min.js.map +7 -0
- package/dist/core/CustomElement.min.js +2 -0
- package/dist/core/CustomElement.min.js.map +7 -0
- package/dist/index.min.js +85 -115
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +1 -1
- package/dom/HTMLOptionsCollectionProxy.js +108 -0
- package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
- package/loaders/theme.js +12 -0
- package/mixins/AriaReflectorMixin.js +64 -15
- package/mixins/AriaToolbarMixin.js +6 -0
- package/mixins/ControlMixin.js +79 -33
- package/mixins/DelegatesFocusMixin.js +62 -0
- package/mixins/DensityMixin.js +7 -3
- package/mixins/ElevationMixin.js +61 -0
- package/mixins/FlexableMixin.js +87 -39
- package/mixins/FormAssociatedMixin.js +76 -10
- package/mixins/HyperlinkMixin.js +76 -0
- package/mixins/InputMixin.js +227 -32
- package/mixins/KeyboardNavMixin.js +11 -7
- package/mixins/NavigationListenerMixin.js +33 -0
- package/mixins/PopupMixin.js +216 -219
- package/mixins/RTLObserverMixin.js +2 -0
- package/mixins/ResizeObserverMixin.js +18 -4
- package/mixins/RippleMixin.js +11 -7
- package/mixins/ScrollListenerMixin.js +14 -2
- package/mixins/SemiStickyMixin.js +51 -98
- package/mixins/ShapeMaskedMixin.js +125 -0
- package/mixins/ShapeMixin.js +30 -203
- package/mixins/StateMixin.js +74 -34
- package/mixins/TextFieldMixin.js +128 -145
- package/mixins/ThemableMixin.js +57 -56
- package/mixins/TooltipTriggerMixin.js +305 -359
- package/mixins/TouchTargetMixin.js +5 -2
- package/mixins/TypographyMixin.js +128 -0
- package/package.json +125 -81
- package/services/rtl.js +10 -0
- package/services/svgAlias.js +17 -0
- package/{theming/index.js → services/theme.js} +25 -176
- package/types/bin/mdw-css.d.ts +3 -0
- package/types/bin/mdw-css.d.ts.map +1 -0
- package/types/components/Badge.d.ts +39 -0
- package/types/components/Badge.d.ts.map +1 -0
- package/types/components/Body.d.ts +29 -0
- package/types/components/Body.d.ts.map +1 -0
- package/types/components/BottomAppBar.d.ts +72 -0
- package/types/components/BottomAppBar.d.ts.map +1 -0
- package/types/components/BottomSheet.d.ts +135 -0
- package/types/components/BottomSheet.d.ts.map +1 -0
- package/types/components/Box.d.ts +16 -0
- package/types/components/Box.d.ts.map +1 -0
- package/types/components/Button.d.ts +245 -0
- package/types/components/Button.d.ts.map +1 -0
- package/types/components/Card.d.ts +147 -0
- package/types/components/Card.d.ts.map +1 -0
- package/types/components/Checkbox.d.ts +207 -0
- package/types/components/Checkbox.d.ts.map +1 -0
- package/types/components/CheckboxIcon.d.ts +44 -0
- package/types/components/CheckboxIcon.d.ts.map +1 -0
- package/types/components/Chip.d.ts +248 -0
- package/types/components/Chip.d.ts.map +1 -0
- package/types/components/Dialog.d.ts +103 -0
- package/types/components/Dialog.d.ts.map +1 -0
- package/types/components/DialogActions.d.ts +4 -0
- package/types/components/DialogActions.d.ts.map +1 -0
- package/types/components/Display.d.ts +46 -0
- package/types/components/Display.d.ts.map +1 -0
- package/types/components/Divider.d.ts +10 -0
- package/types/components/Divider.d.ts.map +1 -0
- package/types/components/Fab.d.ts +273 -0
- package/types/components/Fab.d.ts.map +1 -0
- package/types/components/FabContainer.d.ts +10 -0
- package/types/components/FabContainer.d.ts.map +1 -0
- package/types/components/FilterChip.d.ts +256 -0
- package/types/components/FilterChip.d.ts.map +1 -0
- package/types/components/Grid.d.ts +38 -0
- package/types/components/Grid.d.ts.map +1 -0
- package/types/components/Headline.d.ts +46 -0
- package/types/components/Headline.d.ts.map +1 -0
- package/types/components/Icon.d.ts +55 -0
- package/types/components/Icon.d.ts.map +1 -0
- package/types/components/IconButton.d.ts +284 -0
- package/types/components/IconButton.d.ts.map +1 -0
- package/types/components/Input.d.ts +2528 -0
- package/types/components/Input.d.ts.map +1 -0
- package/types/components/InputChip.d.ts +85 -0
- package/types/components/InputChip.d.ts.map +1 -0
- package/types/components/Label.d.ts +29 -0
- package/types/components/Label.d.ts.map +1 -0
- package/types/components/List.d.ts +35 -0
- package/types/components/List.d.ts.map +1 -0
- package/types/components/ListItem.d.ts +124 -0
- package/types/components/ListItem.d.ts.map +1 -0
- package/types/components/ListOption.d.ts +158 -0
- package/types/components/ListOption.d.ts.map +1 -0
- package/types/components/Listbox.d.ts +763 -0
- package/types/components/Listbox.d.ts.map +1 -0
- package/types/components/Menu.d.ts +130 -0
- package/types/components/Menu.d.ts.map +1 -0
- package/types/components/MenuItem.d.ts +232 -0
- package/types/components/MenuItem.d.ts.map +1 -0
- package/types/components/NavBar.d.ts +20 -0
- package/types/components/NavBar.d.ts.map +1 -0
- package/types/components/NavBarItem.d.ts +97 -0
- package/types/components/NavBarItem.d.ts.map +1 -0
- package/types/components/NavDrawer.d.ts +107 -0
- package/types/components/NavDrawer.d.ts.map +1 -0
- package/types/components/NavDrawerItem.d.ts +97 -0
- package/types/components/NavDrawerItem.d.ts.map +1 -0
- package/types/components/NavItem.d.ts +99 -0
- package/types/components/NavItem.d.ts.map +1 -0
- package/types/components/NavRail.d.ts +108 -0
- package/types/components/NavRail.d.ts.map +1 -0
- package/types/components/NavRailItem.d.ts +97 -0
- package/types/components/NavRailItem.d.ts.map +1 -0
- package/types/components/Page.d.ts +25 -0
- package/types/components/Page.d.ts.map +1 -0
- package/types/components/Pane.d.ts +44 -0
- package/types/components/Pane.d.ts.map +1 -0
- package/types/components/Popup.d.ts +78 -0
- package/types/components/Popup.d.ts.map +1 -0
- package/types/components/Progress.d.ts +21 -0
- package/types/components/Progress.d.ts.map +1 -0
- package/types/components/Radio.d.ts +201 -0
- package/types/components/Radio.d.ts.map +1 -0
- package/types/components/RadioIcon.d.ts +46 -0
- package/types/components/RadioIcon.d.ts.map +1 -0
- package/types/components/Ripple.d.ts +35 -0
- package/types/components/Ripple.d.ts.map +1 -0
- package/types/components/Root.d.ts +68 -0
- package/types/components/Root.d.ts.map +1 -0
- package/types/components/Scrim.d.ts +6 -0
- package/types/components/Scrim.d.ts.map +1 -0
- package/types/components/Search.d.ts +516 -0
- package/types/components/Search.d.ts.map +1 -0
- package/types/components/SegmentedButton.d.ts +252 -0
- package/types/components/SegmentedButton.d.ts.map +1 -0
- package/types/components/SegmentedButtonGroup.d.ts +43 -0
- package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
- package/types/components/Select.d.ts +158 -0
- package/types/components/Select.d.ts.map +1 -0
- package/types/components/Shape.d.ts +10 -0
- package/types/components/Shape.d.ts.map +1 -0
- package/types/components/SideSheet.d.ts +111 -0
- package/types/components/SideSheet.d.ts.map +1 -0
- package/types/components/Slider.d.ts +203 -0
- package/types/components/Slider.d.ts.map +1 -0
- package/types/components/Snackbar.d.ts +73 -0
- package/types/components/Snackbar.d.ts.map +1 -0
- package/types/components/SnackbarContainer.d.ts +6 -0
- package/types/components/SnackbarContainer.d.ts.map +1 -0
- package/types/components/Surface.d.ts +45 -0
- package/types/components/Surface.d.ts.map +1 -0
- package/types/components/Switch.d.ts +187 -0
- package/types/components/Switch.d.ts.map +1 -0
- package/types/components/SwitchIcon.d.ts +61 -0
- package/types/components/SwitchIcon.d.ts.map +1 -0
- package/types/components/Tab.d.ts +139 -0
- package/types/components/Tab.d.ts.map +1 -0
- package/types/components/TabContent.d.ts +124 -0
- package/types/components/TabContent.d.ts.map +1 -0
- package/types/components/TabList.d.ts +1111 -0
- package/types/components/TabList.d.ts.map +1 -0
- package/types/components/TabPanel.d.ts +28 -0
- package/types/components/TabPanel.d.ts.map +1 -0
- package/types/components/Table.d.ts +25 -0
- package/types/components/Table.d.ts.map +1 -0
- package/types/components/TextArea.d.ts +201 -0
- package/types/components/TextArea.d.ts.map +1 -0
- package/types/components/Title.d.ts +46 -0
- package/types/components/Title.d.ts.map +1 -0
- package/types/components/Tooltip.d.ts +49 -0
- package/types/components/Tooltip.d.ts.map +1 -0
- package/types/components/TopAppBar.d.ts +129 -0
- package/types/components/TopAppBar.d.ts.map +1 -0
- package/types/constants/colorKeywords.d.ts +2 -0
- package/types/constants/colorKeywords.d.ts.map +1 -0
- package/types/constants/shapes.d.ts +38 -0
- package/types/constants/shapes.d.ts.map +1 -0
- package/types/constants/typography.d.ts +212 -0
- package/types/constants/typography.d.ts.map +1 -0
- package/types/core/Composition.d.ts +260 -0
- package/types/core/Composition.d.ts.map +1 -0
- package/types/core/CompositionAdapter.d.ts +114 -0
- package/types/core/CompositionAdapter.d.ts.map +1 -0
- package/types/core/CustomElement.d.ts +304 -0
- package/types/core/CustomElement.d.ts.map +1 -0
- package/types/core/css.d.ts +44 -0
- package/types/core/css.d.ts.map +1 -0
- package/types/core/customTypes.d.ts +22 -0
- package/types/core/customTypes.d.ts.map +1 -0
- package/types/core/dom.d.ts +32 -0
- package/types/core/dom.d.ts.map +1 -0
- package/types/core/jsonMergePatch.d.ts +31 -0
- package/types/core/jsonMergePatch.d.ts.map +1 -0
- package/types/core/observe.d.ts +114 -0
- package/types/core/observe.d.ts.map +1 -0
- package/types/core/optimizations.d.ts +7 -0
- package/types/core/optimizations.d.ts.map +1 -0
- package/types/core/template.d.ts +47 -0
- package/types/core/template.d.ts.map +1 -0
- package/types/core/uid.d.ts +6 -0
- package/types/core/uid.d.ts.map +1 -0
- package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
- package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
- package/types/index.d.ts +88 -0
- package/types/index.d.ts.map +1 -0
- package/types/loaders/palette.d.ts +2 -0
- package/types/loaders/palette.d.ts.map +1 -0
- package/types/loaders/theme.d.ts +2 -0
- package/types/loaders/theme.d.ts.map +1 -0
- package/types/mixins/AriaReflectorMixin.d.ts +31 -0
- package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
- package/types/mixins/AriaToolbarMixin.d.ts +34 -0
- package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
- package/types/mixins/ControlMixin.d.ts +124 -0
- package/types/mixins/ControlMixin.d.ts.map +1 -0
- package/types/mixins/DelegatesFocusMixin.d.ts +13 -0
- package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
- package/types/mixins/DensityMixin.d.ts +8 -0
- package/types/mixins/DensityMixin.d.ts.map +1 -0
- package/types/mixins/ElevationMixin.d.ts +32 -0
- package/types/mixins/ElevationMixin.d.ts.map +1 -0
- package/types/mixins/FlexableMixin.d.ts +14 -0
- package/types/mixins/FlexableMixin.d.ts.map +1 -0
- package/types/mixins/FormAssociatedMixin.d.ts +123 -0
- package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
- package/types/mixins/HyperlinkMixin.d.ts +25 -0
- package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
- package/types/mixins/InputMixin.d.ts +173 -0
- package/types/mixins/InputMixin.d.ts.map +1 -0
- package/types/mixins/KeyboardNavMixin.d.ts +46 -0
- package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
- package/types/mixins/NavigationListenerMixin.d.ts +8 -0
- package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
- package/types/mixins/PopupMixin.d.ts +98 -0
- package/types/mixins/PopupMixin.d.ts.map +1 -0
- package/types/mixins/RTLObserverMixin.d.ts +8 -0
- package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
- package/types/mixins/ResizeObserverMixin.d.ts +13 -0
- package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
- package/types/mixins/RippleMixin.d.ts +94 -0
- package/types/mixins/RippleMixin.d.ts.map +1 -0
- package/types/mixins/ScrollListenerMixin.d.ts +46 -0
- package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
- package/types/mixins/SemiStickyMixin.d.ts +50 -0
- package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMaskedMixin.d.ts +12 -0
- package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMixin.d.ts +39 -0
- package/types/mixins/ShapeMixin.d.ts.map +1 -0
- package/types/mixins/StateMixin.d.ts +29 -0
- package/types/mixins/StateMixin.d.ts.map +1 -0
- package/types/mixins/TextFieldMixin.d.ts +153 -0
- package/types/mixins/TextFieldMixin.d.ts.map +1 -0
- package/types/mixins/ThemableMixin.d.ts +10 -0
- package/types/mixins/ThemableMixin.d.ts.map +1 -0
- package/types/mixins/TooltipTriggerMixin.d.ts +114 -0
- package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
- package/types/mixins/TouchTargetMixin.d.ts +6 -0
- package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
- package/types/mixins/TypographyMixin.d.ts +20 -0
- package/types/mixins/TypographyMixin.d.ts.map +1 -0
- package/types/services/rtl.d.ts +3 -0
- package/types/services/rtl.d.ts.map +1 -0
- package/types/services/svgAlias.d.ts +13 -0
- package/types/services/svgAlias.d.ts.map +1 -0
- package/types/services/theme.d.ts +45 -0
- package/types/services/theme.d.ts.map +1 -0
- package/types/utils/cli.d.ts +3 -0
- package/types/utils/cli.d.ts.map +1 -0
- package/types/utils/function.d.ts +3 -0
- package/types/utils/function.d.ts.map +1 -0
- package/types/utils/jsx-runtime.d.ts +20 -0
- package/types/utils/jsx-runtime.d.ts.map +1 -0
- package/types/utils/material-color/blend.d.ts +34 -0
- package/types/utils/material-color/blend.d.ts.map +1 -0
- package/types/utils/material-color/hct/Cam16.d.ts +142 -0
- package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
- package/types/utils/material-color/hct/Hct.d.ts +93 -0
- package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
- package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
- package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
- package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
- package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
- package/types/utils/material-color/helper.d.ts +8 -0
- package/types/utils/material-color/helper.d.ts.map +1 -0
- package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
- package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
- package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
- package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
- package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
- package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
- package/types/utils/material-color/utils/color.d.ts +172 -0
- package/types/utils/material-color/utils/color.d.ts.map +1 -0
- package/types/utils/material-color/utils/math.d.ts +94 -0
- package/types/utils/material-color/utils/math.d.ts.map +1 -0
- package/types/utils/pixelmatch.d.ts +22 -0
- package/types/utils/pixelmatch.d.ts.map +1 -0
- package/types/utils/popup.d.ts +106 -0
- package/types/utils/popup.d.ts.map +1 -0
- package/types/utils/searchParams.d.ts +3 -0
- package/types/utils/searchParams.d.ts.map +1 -0
- package/types/utils/svg.d.ts +7 -0
- package/types/utils/svg.d.ts.map +1 -0
- package/utils/jsx-runtime.js +9 -4
- package/utils/material-color/scheme/Scheme.js +1 -1
- package/utils/pixelmatch.js +363 -0
- package/utils/popup.js +86 -10
- package/utils/searchParams.js +22 -0
- package/components/Button.md +0 -61
- package/components/ExtendedFab.js +0 -32
- package/components/Layout.js +0 -504
- package/components/Nav.js +0 -38
- package/core/DomAdapter.js +0 -586
- package/core/ICustomElement.d.ts +0 -291
- package/core/ICustomElement.js +0 -1
- package/core/test.js +0 -126
- package/core/typings.d.ts +0 -142
- package/core/typings.js +0 -1
- package/mixins/SurfaceMixin.js +0 -127
- package/theming/loader.js +0 -22
- /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
|
@@ -4,11 +4,13 @@ const registeredElements = new Set();
|
|
|
4
4
|
let rtlObserver;
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Observes document `dir` changes and updates `pageIsRTL` on hosts.
|
|
7
8
|
* @param {typeof import('../core/CustomElement.js').default} Base
|
|
8
9
|
*/
|
|
9
10
|
export default function RTLObserverMixin(Base) {
|
|
10
11
|
return Base
|
|
11
12
|
.observe({
|
|
13
|
+
/** Whether the page/document direction is RTL; kept in sync */
|
|
12
14
|
pageIsRTL: {
|
|
13
15
|
type: 'boolean',
|
|
14
16
|
value: document.documentElement.dir === 'rtl',
|
|
@@ -6,12 +6,17 @@ const resizeObserver = new ResizeObserver((entries) => {
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Attaches a shared ResizeObserver to the element and provides lifecycle helpers.
|
|
9
10
|
* @param {typeof import('../core/CustomElement.js').default} Base
|
|
10
11
|
*/
|
|
11
12
|
export default function ResizeObserverMixin(Base) {
|
|
12
13
|
return Base
|
|
13
|
-
.
|
|
14
|
-
|
|
14
|
+
.observe({
|
|
15
|
+
/** Enable or disable automatic ResizeObserver attachment (defaults true) */
|
|
16
|
+
_resizeObserverEnabled: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
value: true,
|
|
19
|
+
},
|
|
15
20
|
})
|
|
16
21
|
.methods({
|
|
17
22
|
/** @param {ResizeObserverEntry} entry */
|
|
@@ -19,7 +24,9 @@ export default function ResizeObserverMixin(Base) {
|
|
|
19
24
|
// Virtual function
|
|
20
25
|
},
|
|
21
26
|
observeResize() {
|
|
22
|
-
resizeObserver.observe(this
|
|
27
|
+
resizeObserver.observe(this, {
|
|
28
|
+
box: 'border-box',
|
|
29
|
+
});
|
|
23
30
|
},
|
|
24
31
|
unobserveResize() {
|
|
25
32
|
resizeObserver.unobserve(this);
|
|
@@ -27,11 +34,18 @@ export default function ResizeObserverMixin(Base) {
|
|
|
27
34
|
})
|
|
28
35
|
.on({
|
|
29
36
|
connected() {
|
|
30
|
-
if (!this.
|
|
37
|
+
if (!this._resizeObserverEnabled) return;
|
|
31
38
|
this.observeResize();
|
|
32
39
|
},
|
|
33
40
|
disconnected() {
|
|
34
41
|
this.unobserveResize();
|
|
35
42
|
},
|
|
43
|
+
_resizeObserverEnabledChanged(previous, enabled) {
|
|
44
|
+
if (enabled) {
|
|
45
|
+
this.observeResize();
|
|
46
|
+
} else {
|
|
47
|
+
this.unobserveResize();
|
|
48
|
+
}
|
|
49
|
+
},
|
|
36
50
|
});
|
|
37
51
|
}
|
package/mixins/RippleMixin.js
CHANGED
|
@@ -3,14 +3,16 @@ import Ripple from '../components/Ripple.js';
|
|
|
3
3
|
/** @typedef {import('../components/Ripple.js').default} Ripple */
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Provides visual ripple effects (pointer/press ripples) and helpers to add/remove them.
|
|
6
7
|
* @param {ReturnType<import('./StateMixin.js').default>} Base
|
|
7
8
|
*/
|
|
8
9
|
export default function RippleMixin(Base) {
|
|
9
10
|
return Base
|
|
10
11
|
.set({
|
|
12
|
+
/** WeakRef to the last appended Ripple instance (used to release/hold) */
|
|
11
13
|
/** @type {WeakRef<InstanceType<Ripple>>} */
|
|
12
14
|
_lastRippleWeakRef: null,
|
|
13
|
-
/** Flag set if ripple was added this event loop
|
|
15
|
+
/** Flag set if ripple was added this event loop to avoid duplicate ripples */
|
|
14
16
|
_rippleAdded: false,
|
|
15
17
|
})
|
|
16
18
|
.define({
|
|
@@ -67,8 +69,8 @@ export default function RippleMixin(Base) {
|
|
|
67
69
|
if (lastRipple) {
|
|
68
70
|
lastRipple.holdRipple = false;
|
|
69
71
|
}
|
|
70
|
-
|
|
71
|
-
this.addRipple(x, y);
|
|
72
|
+
// Ripple from pointerdown
|
|
73
|
+
this.addRipple(x, y, true);
|
|
72
74
|
},
|
|
73
75
|
'~click'(e) {
|
|
74
76
|
if (this._rippleAdded) {
|
|
@@ -77,17 +79,17 @@ export default function RippleMixin(Base) {
|
|
|
77
79
|
}
|
|
78
80
|
if (e.pointerType || e.detail) return;
|
|
79
81
|
if (this.disabledState) return;
|
|
80
|
-
if (this.
|
|
82
|
+
if (this.pressedState || this._keyReleased) return;
|
|
81
83
|
const lastRipple = this._lastRipple;
|
|
82
84
|
if (lastRipple) {
|
|
83
85
|
lastRipple.holdRipple = false;
|
|
84
86
|
}
|
|
85
|
-
|
|
87
|
+
// Ripple from programmatic click
|
|
86
88
|
this.addRipple();
|
|
87
89
|
},
|
|
88
90
|
})
|
|
89
91
|
.on({
|
|
90
|
-
|
|
92
|
+
pressedStateChanged(oldValue, pressed) {
|
|
91
93
|
const ripple = this._lastRipple;
|
|
92
94
|
if (!pressed) {
|
|
93
95
|
if (ripple) {
|
|
@@ -100,7 +102,7 @@ export default function RippleMixin(Base) {
|
|
|
100
102
|
// Sometimes pointer events may be out of order
|
|
101
103
|
return;
|
|
102
104
|
}
|
|
103
|
-
|
|
105
|
+
// Ripple from pressed state
|
|
104
106
|
this.addRipple(null, null, true);
|
|
105
107
|
return;
|
|
106
108
|
}
|
|
@@ -120,6 +122,8 @@ export default function RippleMixin(Base) {
|
|
|
120
122
|
overflow: hidden;
|
|
121
123
|
|
|
122
124
|
pointer-events: none;
|
|
125
|
+
|
|
126
|
+
border-radius: inherit;
|
|
123
127
|
}
|
|
124
128
|
`;
|
|
125
129
|
}
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
const IDLE_TIMEOUT_MS = 500;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
+
* Tracks scroll/resize positions and exposes scroll-related lifecycle helpers.
|
|
4
5
|
* @param {typeof import('../core/CustomElement.js').default} Base
|
|
5
6
|
*/
|
|
6
7
|
export default function ScrollListenerMixin(Base) {
|
|
7
8
|
return Base
|
|
8
9
|
.observe({
|
|
10
|
+
/** Current horizontal scroll position (px) */
|
|
9
11
|
_scrollListenerPositionX: { type: 'float', empty: 0, reflect: false },
|
|
12
|
+
/** Current vertical scroll position (px) */
|
|
10
13
|
_scrollListenerPositionY: { type: 'float', empty: 0, reflect: false },
|
|
14
|
+
/** Timestamp of the last idle period (ms) */
|
|
11
15
|
_scrollListenerLastIdle: { type: 'float', empty: 0 },
|
|
16
|
+
/** Timestamp of the last scroll event (ms) */
|
|
12
17
|
_scrollListenerLastScroll: { type: 'float', empty: 0 },
|
|
18
|
+
/** Timestamp of the last resize event (ms) */
|
|
13
19
|
_scrollListenerLastResize: { type: 'float', empty: 0 },
|
|
14
20
|
})
|
|
15
21
|
.set({
|
|
16
|
-
/**
|
|
22
|
+
/** WeakRef to the current scroller (HTMLElement or window) */
|
|
23
|
+
/** @type {WeakRef<HTMLElement|Window>} */
|
|
17
24
|
_scroller: null,
|
|
25
|
+
/** Listener bound to scroller 'scroll' events */
|
|
18
26
|
/** @type {EventListener} */
|
|
19
27
|
_scrollerScrollListener: null,
|
|
28
|
+
/** Listener bound to scroller 'resize' events */
|
|
20
29
|
/** @type {EventListener} */
|
|
21
30
|
_scrollerResizeListener: null,
|
|
31
|
+
/** Internal debounce timer id used for idle detection */
|
|
22
32
|
_scrollDebounce: null,
|
|
23
33
|
})
|
|
24
34
|
.methods({
|
|
@@ -51,7 +61,7 @@ export default function ScrollListenerMixin(Base) {
|
|
|
51
61
|
* @return {boolean}
|
|
52
62
|
*/
|
|
53
63
|
startScrollListener(scroller) {
|
|
54
|
-
scroller ??=
|
|
64
|
+
scroller ??= window;
|
|
55
65
|
if (!scroller) return false;
|
|
56
66
|
|
|
57
67
|
if (scroller === document.body) {
|
|
@@ -59,6 +69,7 @@ export default function ScrollListenerMixin(Base) {
|
|
|
59
69
|
scroller = window;
|
|
60
70
|
}
|
|
61
71
|
|
|
72
|
+
// @ts-expect-error Only HTMLElement or Window can scroll
|
|
62
73
|
this._scroller = new WeakRef(scroller);
|
|
63
74
|
this._scrollerScrollListener = this._scrollListenerOnScrollerScroll.bind(this);
|
|
64
75
|
this._scrollerResizeListener = this._scrollListenerOnScrollerResize.bind(this);
|
|
@@ -82,6 +93,7 @@ export default function ScrollListenerMixin(Base) {
|
|
|
82
93
|
if (scroller === window) {
|
|
83
94
|
return document.documentElement.scrollHeight;
|
|
84
95
|
}
|
|
96
|
+
// @ts-ignore Already checked for window
|
|
85
97
|
return scroller.scrollHeight;
|
|
86
98
|
},
|
|
87
99
|
_scrollListenerScrollerClientHeight() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ELEMENT_ANIMATION_TYPE } from '../core/customTypes.js';
|
|
2
2
|
|
|
3
3
|
import ScrollListenerMixin from './ScrollListenerMixin.js';
|
|
4
4
|
|
|
@@ -10,42 +10,42 @@ export default function SemiStickyMixin(Base) {
|
|
|
10
10
|
return Base
|
|
11
11
|
.mixin(ScrollListenerMixin)
|
|
12
12
|
.observe({
|
|
13
|
+
/** Measured full height of the element used for hiding calculations (px) */
|
|
13
14
|
_semiStickyHeight: { type: 'float', empty: 0 },
|
|
15
|
+
/** Measured top offset used as reveal threshold (px) */
|
|
14
16
|
_semiStickyOffsetY: { type: 'float', empty: 0 },
|
|
15
|
-
|
|
16
|
-
_semiStickyOffsetX: { type: 'float', empty: 0 },
|
|
17
|
+
/** Current translateY applied to the element (px) */
|
|
17
18
|
_semiStickyTranslateY: { type: 'float', empty: 0 },
|
|
18
|
-
|
|
19
|
+
/** Animation duration when transitioning translateY (ms) */
|
|
19
20
|
_semiStickyDuration: { type: 'float', empty: 0 },
|
|
21
|
+
/** Animation easing function for transitions */
|
|
20
22
|
_semiStickyEasing: { empty: 'ease-in' },
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
23
|
+
/** Whether measurements have been performed */
|
|
24
|
+
_semiStickyMeasured: 'boolean',
|
|
25
|
+
/** When true, element remains always visible */
|
|
25
26
|
stickyAlways: 'boolean',
|
|
27
|
+
/** Stick to offsetParent instead of window */
|
|
28
|
+
stickyParent: 'boolean',
|
|
26
29
|
})
|
|
27
30
|
.methods({
|
|
28
|
-
/** @return {HTMLElement} */
|
|
29
|
-
_getSemiStickyElement() { return this; },
|
|
30
31
|
_refreshSemiStickyMetrics() {
|
|
31
|
-
const
|
|
32
|
-
this._semiStickyHeight =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this._semiStickyOffsetY = semiStickyElement.offsetTop;
|
|
37
|
-
this._semiStickyOffsetX = semiStickyElement.offsetLeft;
|
|
38
|
-
semiStickyElement.style.position = 'sticky';
|
|
32
|
+
const styles = window.getComputedStyle(this);
|
|
33
|
+
this._semiStickyHeight = this.offsetHeight
|
|
34
|
+
+ Number.parseFloat(styles.marginTop) + Number.parseFloat(styles.marginBottom);
|
|
35
|
+
this._semiStickyOffsetY = Number.parseFloat(styles.marginTop);
|
|
36
|
+
this._semiStickyMeasured = true;
|
|
39
37
|
},
|
|
40
38
|
})
|
|
41
39
|
.observe({
|
|
42
40
|
_semiStickyStyleStyle: {
|
|
43
|
-
...
|
|
44
|
-
get({
|
|
41
|
+
...ELEMENT_ANIMATION_TYPE,
|
|
42
|
+
get({
|
|
43
|
+
_semiStickyMeasured, _semiStickyTranslateY, _semiStickyDuration, _semiStickyEasing,
|
|
44
|
+
}) {
|
|
45
|
+
if (!_semiStickyMeasured) return null;
|
|
45
46
|
return {
|
|
46
|
-
target: this._getSemiStickyElement(),
|
|
47
47
|
styles: {
|
|
48
|
-
transform: `
|
|
48
|
+
transform: `translateY(${_semiStickyTranslateY}px)`,
|
|
49
49
|
},
|
|
50
50
|
timing: {
|
|
51
51
|
duration: _semiStickyDuration,
|
|
@@ -56,93 +56,46 @@ export default function SemiStickyMixin(Base) {
|
|
|
56
56
|
},
|
|
57
57
|
})
|
|
58
58
|
.on({
|
|
59
|
-
_scrollListenerLastResizeChanged() {
|
|
60
|
-
if (this._semiStickyAnchor !== 'bottom') return;
|
|
61
|
-
// Chrome Bug: When window resizes bottom sticky needs to be recomputed
|
|
62
|
-
// Force style recalculation
|
|
63
|
-
const semiStickyElement = this._getSemiStickyElement();
|
|
64
|
-
semiStickyElement.style.setProperty('bottom', 'auto');
|
|
65
|
-
// eslint-disable-next-line no-unused-expressions
|
|
66
|
-
semiStickyElement.clientHeight;
|
|
67
|
-
semiStickyElement.style.removeProperty('bottom');
|
|
68
|
-
this.propChangedCallback('_scrollListenerPositionY', this._scrollListenerPositionY, this._scrollListenerPositionY);
|
|
69
|
-
},
|
|
70
59
|
_scrollListenerPositionYChanged(oldValue, newValue) {
|
|
71
60
|
const delta = newValue - oldValue;
|
|
72
|
-
if (this.
|
|
73
|
-
this.
|
|
74
|
-
this._semiStickyTranslateY = (this.stickyAlways || newValue < this._semiStickyOffsetY)
|
|
75
|
-
? 0
|
|
76
|
-
: Math.min(0, Math.max(this._semiStickyTranslateY - delta, -this._semiStickyHeight));
|
|
77
|
-
} else if (this._semiStickyAnchor === 'bottom') {
|
|
78
|
-
this._semiStickyDuration = 0;
|
|
79
|
-
const anchor = this._scrollListenerScrollerClientHeight + newValue;
|
|
80
|
-
const distanceFromAnchor = this._semiStickyOffsetY - anchor;
|
|
81
|
-
this._semiStickyTranslateY = this.stickyAlways
|
|
82
|
-
? 0
|
|
83
|
-
: Math.max(0, Math.min(
|
|
84
|
-
this._semiStickyTranslateY + delta,
|
|
85
|
-
this._semiStickyHeight + Math.min(0, distanceFromAnchor),
|
|
86
|
-
));
|
|
61
|
+
if (!this._semiStickyMeasured) {
|
|
62
|
+
this._refreshSemiStickyMetrics();
|
|
87
63
|
}
|
|
64
|
+
this._semiStickyDuration = 0;
|
|
65
|
+
// 0 if disabled or if has not scroll passed height
|
|
66
|
+
// Valid range = -100% < x < 0
|
|
67
|
+
this._semiStickyTranslateY = (this.stickyAlways || newValue < this._semiStickyOffsetY)
|
|
68
|
+
? 0
|
|
69
|
+
: Math.min(Math.max(-this._semiStickyHeight, this._semiStickyTranslateY - delta), 0);
|
|
88
70
|
},
|
|
89
71
|
_scrollListenerLastIdleChanged() {
|
|
90
72
|
if (this.stickyAlways) return;
|
|
91
73
|
this._refreshSemiStickyMetrics();
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const visibility = delta / this._semiStickyHeight;
|
|
74
|
+
const offsetTop = this.offsetTop;
|
|
75
|
+
const offset = this._scrollListenerPositionY - offsetTop;
|
|
76
|
+
const delta = offset - this._semiStickyTranslateY;
|
|
77
|
+
const visibility = delta / this._semiStickyHeight;
|
|
97
78
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
} else if (this._semiStickyAnchor === 'bottom') {
|
|
116
|
-
const max = this._semiStickyHeight;
|
|
117
|
-
const visibility = (max - this._semiStickyTranslateY) / max;
|
|
118
|
-
if (visibility <= 0) return;
|
|
119
|
-
if (visibility >= 1) return;
|
|
120
|
-
if (visibility >= 0.5) {
|
|
121
|
-
// Reveal all
|
|
122
|
-
this._semiStickyDuration = 250;
|
|
123
|
-
this._semiStickyEasing = 'ease-in';
|
|
124
|
-
this._semiStickyTranslateY = 0;
|
|
125
|
-
// this._semiStickyHeadlineOpacity = 1;
|
|
126
|
-
} else {
|
|
127
|
-
this._semiStickyDuration = 200;
|
|
128
|
-
this._semiStickyEasing = 'ease-out';
|
|
129
|
-
const anchor = this._scrollListenerScrollerClientHeight + this._scrollListenerPositionY;
|
|
130
|
-
const distanceFromAnchor = this._semiStickyOffsetY - anchor;
|
|
131
|
-
// Don't hide past origin
|
|
132
|
-
this._semiStickyTranslateY = this._semiStickyHeight + Math.min(0, distanceFromAnchor);
|
|
133
|
-
}
|
|
79
|
+
if (visibility <= 0) return;
|
|
80
|
+
if (visibility >= 1) return;
|
|
81
|
+
if (visibility <= 0.5 || offsetTop < this._semiStickyHeight) {
|
|
82
|
+
// Reveal all
|
|
83
|
+
this._semiStickyDuration = 250;
|
|
84
|
+
this._semiStickyEasing = 'ease-in';
|
|
85
|
+
this._semiStickyTranslateY = 0;
|
|
86
|
+
// this._semiStickyHeadlineOpacity = 1;
|
|
87
|
+
} else {
|
|
88
|
+
this._semiStickyDuration = 200;
|
|
89
|
+
this._semiStickyEasing = 'ease-out';
|
|
90
|
+
// Don't hide past origin
|
|
91
|
+
this._semiStickyTranslateY = Math.max(
|
|
92
|
+
this._semiStickyOffsetY - this._scrollListenerPositionY,
|
|
93
|
+
-this._semiStickyHeight,
|
|
94
|
+
);
|
|
134
95
|
}
|
|
135
96
|
},
|
|
136
97
|
connected() {
|
|
137
|
-
|
|
138
|
-
// Connect scroll when element gets first size
|
|
139
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
140
|
-
this.startScrollListener(semiStickyElement.offsetParent ?? window);
|
|
141
|
-
resizeObserver.disconnect();
|
|
142
|
-
this._refreshSemiStickyMetrics();
|
|
143
|
-
});
|
|
144
|
-
resizeObserver.observe(semiStickyElement);
|
|
145
|
-
this._refreshSemiStickyMetrics();
|
|
98
|
+
this.startScrollListener(this.stickyParent ? this.offsetParent : window);
|
|
146
99
|
},
|
|
147
100
|
disconnected() {
|
|
148
101
|
this._scrollListenerClear();
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides shape masking utilities and logical shape attributes (shape-top/start/end/bottom).
|
|
3
|
+
* @param {typeof import('../core/CustomElement.js').default} Base
|
|
4
|
+
*/
|
|
5
|
+
export default function ShapeMaskedMixin(Base) {
|
|
6
|
+
return Base
|
|
7
|
+
.observe({
|
|
8
|
+
/** Show top cut/shape on the element */
|
|
9
|
+
shapeTop: 'boolean',
|
|
10
|
+
/** Show bottom cut/shape on the element */
|
|
11
|
+
shapeBottom: 'boolean',
|
|
12
|
+
/** Show start-side cut/shape (logical start) */
|
|
13
|
+
shapeStart: 'boolean',
|
|
14
|
+
/** Show end-side cut/shape (logical end) */
|
|
15
|
+
shapeEnd: 'boolean',
|
|
16
|
+
/** Predefined shape size/style name (none|extra-small|small|medium|large|extra-large|full|inherit) */
|
|
17
|
+
shapeStyle: 'string',
|
|
18
|
+
})
|
|
19
|
+
.css`
|
|
20
|
+
:host {
|
|
21
|
+
--mdw-shape__size: 0px;
|
|
22
|
+
--mdw-shape__ltr: calc(0.5 * var(--mdw-dir, 1) + 0.5); /* 1 if LTR, 0 if RTL */
|
|
23
|
+
--mdw-shape__rtl: calc(-0.5 * var(--mdw-dir, 1) + 0.5); /* 0 if LTR, 1 if RTL */
|
|
24
|
+
--mdw-shape__mask: none;
|
|
25
|
+
|
|
26
|
+
/** By default, fallback to border-radius */
|
|
27
|
+
--mdw-shape__rounded: 1;
|
|
28
|
+
--mdw-shape__inline-start-deg: calc(var(--mdw-dir, 1) * -90deg);
|
|
29
|
+
|
|
30
|
+
--mdw-shape__size__top-start-size: var(--mdw-shape__size);
|
|
31
|
+
--mdw-shape__size__top-end-size: var(--mdw-shape__size);
|
|
32
|
+
--mdw-shape__size__bottom-start-size: var(--mdw-shape__size);
|
|
33
|
+
--mdw-shape__size__bottom-end-size: var(--mdw-shape__size);
|
|
34
|
+
/* (1/2n + 1/2)L + (-1/2n + 1/2)R */
|
|
35
|
+
|
|
36
|
+
--mdw-shape__size__top-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__top-end-size)));
|
|
37
|
+
--mdw-shape__size__top-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__top-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__top-end-size)));
|
|
38
|
+
--mdw-shape__size__bottom-left-size: calc((var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-end-size)));
|
|
39
|
+
--mdw-shape__size__bottom-right-size: calc((var(--mdw-shape__rtl) * var(--mdw-shape__size__bottom-start-size)) + (var(--mdw-shape__ltr) * var(--mdw-shape__size__bottom-end-size)));
|
|
40
|
+
|
|
41
|
+
border-start-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-start-size));
|
|
42
|
+
border-start-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__top-end-size));
|
|
43
|
+
border-end-start-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-start-size));
|
|
44
|
+
border-end-end-radius: calc(var(--mdw-shape__rounded) * var(--mdw-shape__size__bottom-end-size));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([shape-style="none"]) {
|
|
48
|
+
--mdw-shape__size: 0px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([shape-style="extra-small"]) {
|
|
52
|
+
--mdw-shape__size: var(--mdw-shape__extra-small);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([shape-style="small"]) {
|
|
56
|
+
--mdw-shape__size: var(--mdw-shape__small);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([shape-style="medium"]) {
|
|
60
|
+
--mdw-shape__size: var(--mdw-shape__medium);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([shape-style="large"]) {
|
|
64
|
+
--mdw-shape__size: var(--mdw-shape__large);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([shape-style="extra-large"]) {
|
|
68
|
+
--mdw-shape__size: var(--mdw-shape__extra-large);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host([shape-style="full"]) {
|
|
72
|
+
--mdw-shape__size: var(--mdw-shape__full);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([shape-style="inherit"]) {
|
|
76
|
+
--mdw-shape__size: inherit;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([shape-top]) {
|
|
80
|
+
--mdw-shape__size__bottom-start-size: 0px;
|
|
81
|
+
--mdw-shape__size__bottom-end-size: 0px;
|
|
82
|
+
--mdw-shape__mask: linear-gradient(transparent 50%, black 50%);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([shape-bottom]) {
|
|
86
|
+
--mdw-shape__size__top-start-size: 0px;
|
|
87
|
+
--mdw-shape__size__top-end-size: 0px;
|
|
88
|
+
--mdw-shape__mask: linear-gradient(black 50%, transparent 50%);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([shape-start]) {
|
|
92
|
+
--mdw-shape__size__top-end-size: 0px;
|
|
93
|
+
--mdw-shape__size__bottom-end-size: 0px;
|
|
94
|
+
--mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), black 50%, transparent 50%);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([shape-end]) {
|
|
98
|
+
--mdw-shape__size__top-start-size: 0px;
|
|
99
|
+
--mdw-shape__size__bottom-start-size: 0px;
|
|
100
|
+
--mdw-shape__mask: linear-gradient(var(--mdw-shape__inline-start-deg), transparent 50%, black 50%);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@supports(-webkit-mask-box-image: none) {
|
|
104
|
+
:host {
|
|
105
|
+
/* Inherit all the way up to :root */
|
|
106
|
+
--mdw-shape__rounded: inherit;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@supports(-webkit-mask-box-image: none) {
|
|
111
|
+
:host {
|
|
112
|
+
-webkit-mask-box-image: var(--mdw-shape__mask-border-source)
|
|
113
|
+
8 fill /
|
|
114
|
+
var(--mdw-shape__size)
|
|
115
|
+
stretch;
|
|
116
|
+
|
|
117
|
+
-webkit-mask: var(--mdw-shape__mask);
|
|
118
|
+
|
|
119
|
+
transition-duration: 200ms;
|
|
120
|
+
transition-property: -webkit-mask-box-image-width;
|
|
121
|
+
will-change: -webkit-mask-box-image;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
}
|