@shortfuse/materialdesignweb 0.7.6 → 0.9.0
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 +87 -90
- package/bin/mdw-css.js +1 -1
- package/components/Badge.js +14 -7
- package/components/Body.js +3 -0
- package/components/BottomAppBar.js +4 -13
- package/components/BottomSheet.js +424 -0
- package/components/Box.js +20 -28
- package/components/Button.js +85 -79
- package/components/Button.md +9 -9
- package/components/Card.js +60 -72
- package/components/Checkbox.js +33 -42
- package/components/CheckboxIcon.js +11 -29
- package/components/Chip.js +13 -11
- package/components/Dialog.js +214 -394
- package/components/DialogActions.js +2 -2
- package/components/Display.js +55 -0
- package/components/Divider.js +3 -3
- package/components/Fab.js +83 -18
- package/components/FabContainer.js +48 -0
- package/components/FilterChip.js +35 -33
- package/components/Grid.js +176 -0
- package/components/Headline.js +5 -28
- package/components/Icon.js +61 -76
- package/components/IconButton.js +72 -126
- package/components/Input.js +859 -1
- package/components/InputChip.js +161 -0
- package/components/Label.js +3 -0
- package/components/List.js +4 -6
- package/components/ListItem.js +46 -30
- package/components/ListOption.js +86 -53
- package/components/Listbox.js +248 -0
- package/components/Menu.js +69 -528
- package/components/MenuItem.js +33 -36
- package/components/NavBar.js +49 -86
- package/components/NavDrawer.js +16 -15
- package/components/NavDrawerItem.js +4 -5
- package/components/NavItem.js +58 -41
- package/components/NavRail.js +30 -20
- package/components/NavRailItem.js +8 -3
- package/components/Page.js +105 -0
- package/components/Pane.js +11 -274
- package/components/Popup.js +29 -0
- package/components/Progress.js +24 -23
- package/components/Radio.js +40 -36
- package/components/RadioIcon.js +12 -16
- package/components/Ripple.js +13 -10
- package/components/Root.js +209 -0
- package/components/Scrim.js +87 -0
- package/components/Search.js +77 -0
- package/components/SegmentedButton.js +33 -45
- package/components/SegmentedButtonGroup.js +25 -13
- package/components/Select.js +10 -11
- package/components/Shape.js +5 -65
- package/components/SideSheet.js +308 -0
- package/components/Slider.js +108 -78
- package/components/Snackbar.js +26 -21
- package/components/SnackbarContainer.js +42 -0
- package/components/Surface.js +17 -12
- package/components/Switch.js +45 -24
- package/components/SwitchIcon.js +49 -39
- package/components/Tab.js +64 -43
- package/components/TabContent.js +5 -3
- package/components/TabList.js +62 -34
- package/components/TabPanel.js +11 -8
- package/components/Table.js +116 -0
- package/components/TextArea.js +54 -50
- package/components/Title.js +4 -9
- package/components/Tooltip.js +44 -22
- package/components/TopAppBar.js +68 -172
- package/constants/shapes.js +36 -0
- package/constants/typography.js +127 -0
- package/core/Composition.js +1164 -645
- package/core/CompositionAdapter.js +314 -0
- package/core/CustomElement.js +701 -286
- package/core/css.js +121 -15
- package/core/customTypes.js +157 -40
- package/core/dom.js +17 -11
- package/{utils → core}/jsonMergePatch.js +42 -18
- package/core/observe.js +343 -244
- package/core/optimizations.js +23 -0
- package/core/template.js +19 -56
- package/core/uid.js +13 -0
- package/dist/index.min.js +85 -184
- package/dist/index.min.js.map +4 -4
- package/dist/meta.json +1 -1
- package/dom/HTMLOptionsCollectionProxy.js +106 -0
- package/loaders/palette.js +13 -0
- package/loaders/theme.js +12 -0
- package/mixins/AriaReflectorMixin.js +53 -14
- package/mixins/AriaToolbarMixin.js +5 -3
- package/mixins/ControlMixin.js +92 -41
- package/mixins/DelegatesFocusMixin.js +54 -0
- package/mixins/DensityMixin.js +2 -3
- package/mixins/ElevationMixin.js +62 -0
- package/mixins/FlexableMixin.js +67 -39
- package/mixins/FormAssociatedMixin.js +71 -16
- package/mixins/HyperlinkMixin.js +66 -0
- package/mixins/InputMixin.js +205 -39
- package/mixins/KeyboardNavMixin.js +22 -7
- package/mixins/NavigationListenerMixin.js +33 -0
- package/mixins/PopupMixin.js +725 -0
- package/mixins/RTLObserverMixin.js +0 -1
- package/mixins/ResizeObserverMixin.js +16 -5
- package/mixins/RippleMixin.js +11 -10
- package/mixins/ScrollListenerMixin.js +42 -33
- package/mixins/SemiStickyMixin.js +97 -0
- package/mixins/ShapeMaskedMixin.js +117 -0
- package/mixins/ShapeMixin.js +17 -194
- package/mixins/StateMixin.js +80 -39
- package/mixins/TextFieldMixin.js +139 -183
- package/mixins/ThemableMixin.js +71 -161
- package/mixins/TooltipTriggerMixin.js +292 -366
- package/mixins/TouchTargetMixin.js +5 -4
- package/mixins/TypographyMixin.js +121 -0
- package/package.json +111 -71
- package/services/rtl.js +10 -0
- package/services/svgAlias.js +17 -0
- package/{theming/index.js → services/theme.js} +25 -175
- 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 +73 -0
- package/types/components/BottomAppBar.d.ts.map +1 -0
- package/types/components/BottomSheet.d.ts +109 -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 +714 -0
- package/types/components/Button.d.ts.map +1 -0
- package/types/components/Card.d.ts +412 -0
- package/types/components/Card.d.ts.map +1 -0
- package/types/components/Checkbox.d.ts +205 -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 +1425 -0
- package/types/components/Chip.d.ts.map +1 -0
- package/types/components/Dialog.d.ts +286 -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 +45 -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 +741 -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 +4283 -0
- package/types/components/FilterChip.d.ts.map +1 -0
- package/types/components/Grid.d.ts +37 -0
- package/types/components/Grid.d.ts.map +1 -0
- package/types/components/Headline.d.ts +47 -0
- package/types/components/Headline.d.ts.map +1 -0
- package/types/components/Icon.d.ts +103 -0
- package/types/components/Icon.d.ts.map +1 -0
- package/types/components/IconButton.d.ts +1486 -0
- package/types/components/IconButton.d.ts.map +1 -0
- package/types/components/Input.d.ts +51288 -0
- package/types/components/Input.d.ts.map +1 -0
- package/types/components/InputChip.d.ts +243 -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 +31 -0
- package/types/components/List.d.ts.map +1 -0
- package/types/components/ListItem.d.ts +349 -0
- package/types/components/ListItem.d.ts.map +1 -0
- package/types/components/ListOption.d.ts +1493 -0
- package/types/components/ListOption.d.ts.map +1 -0
- package/types/components/Listbox.d.ts +12012 -0
- package/types/components/Listbox.d.ts.map +1 -0
- package/types/components/Menu.d.ts +119 -0
- package/types/components/Menu.d.ts.map +1 -0
- package/types/components/MenuItem.d.ts +3109 -0
- package/types/components/MenuItem.d.ts.map +1 -0
- package/types/components/NavBar.d.ts +18 -0
- package/types/components/NavBar.d.ts.map +1 -0
- package/types/components/NavBarItem.d.ts +186 -0
- package/types/components/NavBarItem.d.ts.map +1 -0
- package/types/components/NavDrawer.d.ts +108 -0
- package/types/components/NavDrawer.d.ts.map +1 -0
- package/types/components/NavDrawerItem.d.ts +186 -0
- package/types/components/NavDrawerItem.d.ts.map +1 -0
- package/types/components/NavItem.d.ts +190 -0
- package/types/components/NavItem.d.ts.map +1 -0
- package/types/components/NavRail.d.ts +109 -0
- package/types/components/NavRail.d.ts.map +1 -0
- package/types/components/NavRailItem.d.ts +186 -0
- package/types/components/NavRailItem.d.ts.map +1 -0
- package/types/components/Page.d.ts +24 -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 +76 -0
- package/types/components/Popup.d.ts.map +1 -0
- package/types/components/Progress.d.ts +19 -0
- package/types/components/Progress.d.ts.map +1 -0
- package/types/components/Radio.d.ts +199 -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 +34 -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 +16 -0
- package/types/components/Search.d.ts.map +1 -0
- package/types/components/SegmentedButton.d.ts +718 -0
- package/types/components/SegmentedButton.d.ts.map +1 -0
- package/types/components/SegmentedButtonGroup.d.ts +44 -0
- package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
- package/types/components/Select.d.ts +1361 -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 +106 -0
- package/types/components/SideSheet.d.ts.map +1 -0
- package/types/components/Slider.d.ts +382 -0
- package/types/components/Slider.d.ts.map +1 -0
- package/types/components/Snackbar.d.ts +65 -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 +183 -0
- package/types/components/Switch.d.ts.map +1 -0
- package/types/components/SwitchIcon.d.ts +169 -0
- package/types/components/SwitchIcon.d.ts.map +1 -0
- package/types/components/Tab.d.ts +879 -0
- package/types/components/Tab.d.ts.map +1 -0
- package/types/components/TabContent.d.ts +122 -0
- package/types/components/TabContent.d.ts.map +1 -0
- package/types/components/TabList.d.ts +6266 -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 +2 -0
- package/types/components/Table.d.ts.map +1 -0
- package/types/components/TextArea.d.ts +1394 -0
- package/types/components/TextArea.d.ts.map +1 -0
- package/types/components/Title.d.ts +47 -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 +130 -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 +252 -0
- package/types/core/Composition.d.ts.map +1 -0
- package/types/core/CompositionAdapter.d.ts +92 -0
- package/types/core/CompositionAdapter.d.ts.map +1 -0
- package/types/core/CustomElement.d.ts +302 -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 +26 -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 +113 -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 +23 -0
- package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
- package/types/mixins/AriaToolbarMixin.d.ts +32 -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 +5 -0
- package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
- package/types/mixins/DensityMixin.d.ts +5 -0
- package/types/mixins/DensityMixin.d.ts.map +1 -0
- package/types/mixins/ElevationMixin.d.ts +33 -0
- package/types/mixins/ElevationMixin.d.ts.map +1 -0
- package/types/mixins/FlexableMixin.d.ts +13 -0
- package/types/mixins/FlexableMixin.d.ts.map +1 -0
- package/types/mixins/FormAssociatedMixin.d.ts +122 -0
- package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
- package/types/mixins/HyperlinkMixin.d.ts +22 -0
- package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
- package/types/mixins/InputMixin.d.ts +179 -0
- package/types/mixins/InputMixin.d.ts.map +1 -0
- package/types/mixins/KeyboardNavMixin.d.ts +47 -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 +82 -0
- package/types/mixins/PopupMixin.d.ts.map +1 -0
- package/types/mixins/RTLObserverMixin.d.ts +7 -0
- package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
- package/types/mixins/ResizeObserverMixin.d.ts +12 -0
- package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
- package/types/mixins/RippleMixin.d.ts +92 -0
- package/types/mixins/RippleMixin.d.ts.map +1 -0
- package/types/mixins/ScrollListenerMixin.d.ts +41 -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 +9 -0
- package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
- package/types/mixins/ShapeMixin.d.ts +38 -0
- package/types/mixins/ShapeMixin.d.ts.map +1 -0
- package/types/mixins/StateMixin.d.ts +27 -0
- package/types/mixins/StateMixin.d.ts.map +1 -0
- package/types/mixins/TextFieldMixin.d.ts +1354 -0
- package/types/mixins/TextFieldMixin.d.ts.map +1 -0
- package/types/mixins/ThemableMixin.d.ts +9 -0
- package/types/mixins/ThemableMixin.d.ts.map +1 -0
- package/types/mixins/TooltipTriggerMixin.d.ts +106 -0
- package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
- package/types/mixins/TouchTargetMixin.d.ts +3 -0
- package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
- package/types/mixins/TypographyMixin.d.ts +17 -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/{hct → material-color}/blend.js +8 -10
- package/utils/{hct → material-color/hct}/Cam16.js +196 -69
- package/utils/{hct → material-color/hct}/Hct.js +61 -19
- package/utils/{hct → material-color/hct}/ViewingConditions.js +3 -3
- package/utils/{hct → material-color/hct}/hctSolver.js +9 -16
- package/utils/{hct → material-color}/helper.js +11 -18
- package/utils/{hct → material-color/palettes}/CorePalette.js +79 -19
- package/utils/{hct → material-color/palettes}/TonalPalette.js +12 -4
- package/utils/material-color/scheme/Scheme.js +376 -0
- package/utils/{hct/colorUtils.js → material-color/utils/color.js} +61 -1
- package/utils/pixelmatch.js +360 -0
- package/utils/popup.js +127 -30
- package/utils/searchParams.js +19 -0
- package/components/ExtendedFab.js +0 -36
- package/components/Layout.js +0 -35
- package/components/ListSelect.js +0 -220
- package/components/Nav.js +0 -40
- package/components/Option.js +0 -91
- package/core/ICustomElement.d.ts +0 -291
- package/core/ICustomElement.js +0 -1
- package/core/identify.js +0 -40
- package/core/typings.d.ts +0 -136
- package/core/typings.js +0 -1
- package/mixins/SurfaceMixin.js +0 -181
- package/theming/loader.js +0 -22
- package/utils/hct/Scheme.js +0 -587
- /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
- /package/utils/{hct/mathUtils.js → material-color/utils/math.js} +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
|
|
2
|
+
|
|
3
|
+
import CustomElement from '../core/CustomElement.js';
|
|
4
|
+
import { ELEMENT_STYLE_TYPE } from '../core/customTypes.js';
|
|
5
|
+
import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
|
|
6
|
+
import ResizeObserverMixin from '../mixins/ResizeObserverMixin.js';
|
|
7
|
+
|
|
8
|
+
export default CustomElement
|
|
9
|
+
.extend()
|
|
10
|
+
.mixin(DelegatesFocusMixin)
|
|
11
|
+
.mixin(ResizeObserverMixin)
|
|
12
|
+
.observe({
|
|
13
|
+
paneOne: {
|
|
14
|
+
value: /** @type {'fixed'|'flexible'} */ ('flexible'),
|
|
15
|
+
},
|
|
16
|
+
paneTwo: {
|
|
17
|
+
value: /** @type {'fixed'|'flexible'|null} */ (null),
|
|
18
|
+
},
|
|
19
|
+
paneTwoActive: 'boolean',
|
|
20
|
+
paneTwoBreakpoint: {
|
|
21
|
+
type: 'float',
|
|
22
|
+
empty: 720,
|
|
23
|
+
},
|
|
24
|
+
_lastComputedInlineSize: {
|
|
25
|
+
type: 'float',
|
|
26
|
+
nullable: false,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
.observe({
|
|
30
|
+
_isMultipane({ _lastComputedInlineSize, paneTwo, paneTwoBreakpoint }) {
|
|
31
|
+
return Boolean(paneTwo && _lastComputedInlineSize >= paneTwoBreakpoint);
|
|
32
|
+
},
|
|
33
|
+
})
|
|
34
|
+
.observe({
|
|
35
|
+
_styles: {
|
|
36
|
+
...ELEMENT_STYLE_TYPE,
|
|
37
|
+
get({ _isMultipane, paneOne, paneTwoActive }) {
|
|
38
|
+
if (_isMultipane) {
|
|
39
|
+
return `:host{grid-template-columns:${paneOne === 'fixed' ? '360px' : '1fr'} ${this.paneTwo === 'fixed' ? '360px' : '1fr'}}`;
|
|
40
|
+
}
|
|
41
|
+
if (paneTwoActive) {
|
|
42
|
+
return ':host{grid-template-columns:1fr 0}#slot{display:none}';
|
|
43
|
+
}
|
|
44
|
+
return ':host{grid-template-columns:1fr 0}#two{display:none}';
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
.html`
|
|
49
|
+
<slot id=slot mutli-pane={_isMultipane}></slot>
|
|
50
|
+
<slot id=two name=two mutli-pane={_isMultipane}></slot>
|
|
51
|
+
`
|
|
52
|
+
.css`
|
|
53
|
+
:host {
|
|
54
|
+
--mdw-pane__max-width: 1040px;
|
|
55
|
+
--mdw-pane__margin-inline: 16px;
|
|
56
|
+
--mdw-pane__padding-inline: max(var(--mdw-pane__margin-inline), calc((100% - var(--mdw-pane__max-width)) / 2));
|
|
57
|
+
--mdw-pane__shape__size: 0;
|
|
58
|
+
display: grid;
|
|
59
|
+
column-gap: var(--mdw-page__margin);
|
|
60
|
+
grid-auto-columns: 1fr;
|
|
61
|
+
grid-auto-flow: column;
|
|
62
|
+
|
|
63
|
+
block-size: 100%;
|
|
64
|
+
|
|
65
|
+
padding: 0;
|
|
66
|
+
|
|
67
|
+
font: var(--mdw-typescale__body-large__font);
|
|
68
|
+
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (min-width: 648px) {
|
|
72
|
+
:host {
|
|
73
|
+
--mdw-pane__margin-inline: 24px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (min-width: 728px) {
|
|
78
|
+
:host {
|
|
79
|
+
--mdw-pane__shape__size: var(--mdw-shape__large);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#slot[multi-pane] {
|
|
84
|
+
--mdw-pane__padding-inline: 24px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
#two[mutli-pane] {
|
|
88
|
+
--mdw-pane__padding-inline: 0 24px;
|
|
89
|
+
position: sticky;
|
|
90
|
+
inset-block:0;
|
|
91
|
+
|
|
92
|
+
display: block;
|
|
93
|
+
|
|
94
|
+
overflow-y:auto;
|
|
95
|
+
|
|
96
|
+
block-size: 100vh;
|
|
97
|
+
block-size: 100dvh;
|
|
98
|
+
}
|
|
99
|
+
`
|
|
100
|
+
.overrides({
|
|
101
|
+
onResizeObserved(entry) {
|
|
102
|
+
this._lastComputedInlineSize = entry.borderBoxSize[0]?.inlineSize;
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
.autoRegister('mdw-page');
|
package/components/Pane.js
CHANGED
|
@@ -1,281 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
1
|
+
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import Box from './Box.js';
|
|
4
|
+
|
|
5
|
+
export default Box
|
|
6
6
|
.extend()
|
|
7
|
-
.
|
|
8
|
-
columns: 'integer',
|
|
9
|
-
flexible: 'boolean',
|
|
10
|
-
fixed: 'boolean',
|
|
11
|
-
split: 'boolean',
|
|
12
|
-
navDrawer: 'boolean',
|
|
13
|
-
navRail: 'boolean',
|
|
14
|
-
})
|
|
15
|
-
.html/* html */`
|
|
16
|
-
<slot id=slot></slot>
|
|
17
|
-
`
|
|
7
|
+
.mixin(ShapeMixin)
|
|
18
8
|
.css`
|
|
19
|
-
/* https://m2.material.io/design/layout/responsive-layout-grid.html#columns-gutters-and-margins */
|
|
20
|
-
/*
|
|
21
|
-
* Window breakpoints
|
|
22
|
-
* Compact (0 <= width < 600px):
|
|
23
|
-
* * Single: 100vw - padding
|
|
24
|
-
* * Padding: 16px
|
|
25
|
-
* * Spacer: 0 (none)
|
|
26
|
-
* Medium (600px <= width < 840px)
|
|
27
|
-
* * Single: 100vw - padding - (?navrail)
|
|
28
|
-
* * [Fixed]: 360px
|
|
29
|
-
* * [Flexable]: 100vw - 360px - spacer - padding
|
|
30
|
-
* * [Split] 50vw - ((padding + spacer) / 2)
|
|
31
|
-
* * Padding: 24px
|
|
32
|
-
* * Spacer: 24px
|
|
33
|
-
* Expanded (840px <= width)
|
|
34
|
-
* * Single: 100vw - padding - (?navrail | ?navdrawer)
|
|
35
|
-
* * [Fixed] 360px
|
|
36
|
-
* * [Flexable] 100vw - 360px - spacer - padding - (?navrail | ?navdrawer)
|
|
37
|
-
* * [Split] 50vw - ((padding + spacer + (?navrail | ?navdrawer)) / 2)
|
|
38
|
-
* * Padding: 24px
|
|
39
|
-
* * Spacer: 24px
|
|
40
|
-
*
|
|
41
|
-
* | Screen size | Margin | Body | Layout columns |
|
|
42
|
-
* |---------------------|---------|---------|----------------|
|
|
43
|
-
* | Extra-small (phone) | | | |
|
|
44
|
-
* | 0-631dp | 16dp | Scaling | 4 |
|
|
45
|
-
* | 632 - 647 | Scaling | 600dp | 8 |
|
|
46
|
-
* | Small (tablet) | | | |
|
|
47
|
-
* | 648-887 | 24dp | Scaling | 8 |
|
|
48
|
-
* | 888-1239 | Scaling | 840dp | 12 |
|
|
49
|
-
* | Medium (laptop) | | | |
|
|
50
|
-
* | 1240-1439 | 200dp | Scaling | 12 |
|
|
51
|
-
* | Large (desktop) | | | |
|
|
52
|
-
* | 1440+ | Scaling | 1040 | 12 |
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* Column count is pane-based, not window based requiring newly computed values.
|
|
56
|
-
* Gutters are irrelevant to pane sizing.
|
|
57
|
-
* Nav Rail is ~80px.
|
|
58
|
-
* Nav Drawer is ~360px.
|
|
59
|
-
* Padding and spacers are set by pane's parent.
|
|
60
|
-
* Avoid using CSS Variables because panes are at top of document tree. https://bugs.chromium.org/p/chromium/issues/detail?id=1056209
|
|
61
|
-
* Container queries would reduce code considerably.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
/* Compact */
|
|
65
9
|
:host {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
max-inline-size: 600px;
|
|
73
|
-
|
|
74
|
-
flex: 1;
|
|
75
|
-
|
|
76
|
-
transition-duration: 200ms;
|
|
77
|
-
/* stylelint-disable-next-line liberty/use-logical-spec */
|
|
78
|
-
transition-property: visibility, width, max-inline-size;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* Will set 8col when window is 600px + padding (2x16) */
|
|
82
|
-
/* Will set 12col when window is 840px + padding (2x24) */
|
|
83
|
-
@media screen and (min-width: 632px) { :host { grid-template-columns: repeat(8, 1fr); } }
|
|
84
|
-
@media screen and (min-width: 888px) { :host { grid-template-columns: repeat(12, 1fr); } }
|
|
85
|
-
|
|
86
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) */
|
|
87
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) */
|
|
88
|
-
@media screen and (min-width: 648px) { :host { max-inline-size: 840px } }
|
|
89
|
-
@media screen and (min-width: 1240px) { :host { max-inline-size: 1040px; } }
|
|
90
|
-
|
|
91
|
-
/* NAVRAIL */
|
|
92
|
-
|
|
93
|
-
:host([nav-rail]) {
|
|
94
|
-
grid-template-columns: repeat(4, 1fr);
|
|
95
|
-
|
|
96
|
-
max-inline-size: 600px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/* Will set 8col when window is 600px + padding (2x24) + navrail (80) */
|
|
100
|
-
/* Will set 12col when window is 840px + padding (2x24) + navrail (80) */
|
|
101
|
-
@media screen and (min-width: 728px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }
|
|
102
|
-
@media screen and (min-width: 968px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }
|
|
103
|
-
|
|
104
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + navrail (80) */
|
|
105
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (80) */
|
|
106
|
-
@media screen and (min-width: 728px) { :host([nav-rail]) { max-inline-size: 840px } }
|
|
107
|
-
@media screen and (min-width: 1320px) { :host([nav-rail]) { max-inline-size: 1040px; } }
|
|
108
|
-
|
|
109
|
-
/* NAVDRAWER */
|
|
110
|
-
|
|
111
|
-
:host([nav-drawer]) {
|
|
112
|
-
grid-template-columns: repeat(4, 1fr);
|
|
113
|
-
|
|
114
|
-
max-inline-size: 600px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* Will set 8col when window is 600px + padding (2x24) + navdrawer (360) */
|
|
118
|
-
/* Will set 12col when window is 840px + padding (2x24) + navdrawer (360) */
|
|
119
|
-
@media screen and (min-width: 1008px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }
|
|
120
|
-
@media screen and (min-width: 1248px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }
|
|
121
|
-
|
|
122
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + navrail (360) */
|
|
123
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (360) */
|
|
124
|
-
@media screen and (min-width: 1008px) { :host([nav-rail]) { max-inline-size: 840px } }
|
|
125
|
-
@media screen and (min-width: 1600px) { :host([nav-rail]) { max-inline-size: 1040px; } }
|
|
126
|
-
|
|
127
|
-
/* FLEXIBLE */
|
|
128
|
-
|
|
129
|
-
:host([flexible]) {
|
|
130
|
-
grid-template-columns: repeat(4, 1fr);
|
|
131
|
-
|
|
132
|
-
max-inline-size: 600px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) */
|
|
136
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) */
|
|
137
|
-
@media screen and (min-width: 1032px) { :host([flexible]) { grid-template-columns: repeat(8, 1fr); } }
|
|
138
|
-
@media screen and (min-width: 1272px) { :host([flexible]) { grid-template-columns: repeat(12, 1fr); } }
|
|
139
|
-
|
|
140
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) */
|
|
141
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) */
|
|
142
|
-
@media screen and (min-width: 1032px) { :host([flexible]) { max-inline-size: 840px } }
|
|
143
|
-
@media screen and (min-width: 1624px) { :host([flexible]) { max-inline-size: 1040px; } }
|
|
144
|
-
|
|
145
|
-
/* FLEXIBLE + NAV RAIL */
|
|
146
|
-
|
|
147
|
-
:host([flexible]:where([nav-rail])) {
|
|
148
|
-
grid-template-columns: repeat(4, 1fr);
|
|
149
|
-
|
|
150
|
-
max-inline-size: 600px;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */
|
|
154
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */
|
|
155
|
-
@media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }
|
|
156
|
-
@media screen and (min-width: 1352px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }
|
|
157
|
-
|
|
158
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navrail (80) */
|
|
159
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navrail (80) */
|
|
160
|
-
@media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { max-inline-size: 840px } }
|
|
161
|
-
@media screen and (min-width: 1704px) { :host([flexible]:where([nav-rail])) { max-inline-size: 1040px; } }
|
|
162
|
-
|
|
163
|
-
/* FLEXIBLE + NAV DRAWER */
|
|
164
|
-
|
|
165
|
-
:host([flexible]:where([nav-drawer])) {
|
|
166
|
-
grid-template-columns: repeat(4, 1fr);
|
|
167
|
-
|
|
168
|
-
max-inline-size: 600px;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */
|
|
172
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */
|
|
173
|
-
@media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }
|
|
174
|
-
@media screen and (min-width: 1632px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }
|
|
175
|
-
|
|
176
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navdrawer (360) */
|
|
177
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navdrawer (360) */
|
|
178
|
-
@media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 840px } }
|
|
179
|
-
@media screen and (min-width: 1984px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 1040px; } }
|
|
180
|
-
|
|
181
|
-
/* SPLIT */
|
|
182
|
-
|
|
183
|
-
:host([split]) {
|
|
184
|
-
grid-template-columns: repeat(4, 1fr);
|
|
185
|
-
|
|
186
|
-
max-inline-size: 600px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) */
|
|
190
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) */
|
|
191
|
-
@media screen and (min-width: 1272px) { :host([split]) { grid-template-columns: repeat(8, 1fr); } }
|
|
192
|
-
@media screen and (min-width: 1752px) { :host([split]) { grid-template-columns: repeat(12, 1fr); } }
|
|
193
|
-
|
|
194
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) */
|
|
195
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) */
|
|
196
|
-
@media screen and (min-width: 1272px) { :host([split]) { max-inline-size: 840px } }
|
|
197
|
-
@media screen and (min-width: 2104px) { :host([split]) { max-inline-size: 1040px; } }
|
|
198
|
-
|
|
199
|
-
/* SPLIT + NAVRAIL */
|
|
200
|
-
|
|
201
|
-
:host([split]:where([nav-rail])) {
|
|
202
|
-
grid-template-columns: repeat(4, 1fr);
|
|
203
|
-
|
|
204
|
-
max-inline-size: 600px;
|
|
10
|
+
--mdw-shape__size: var(--mdw-pane__shape__size, 0);
|
|
11
|
+
--mdw-bg: var(--mdw-color__surface);
|
|
12
|
+
--mdw-ink: var(--mdw-color__on-surface);
|
|
13
|
+
background-color: rgb(var(--mdw-bg));
|
|
14
|
+
color: rgb(var(--mdw-ink));
|
|
15
|
+
|
|
205
16
|
}
|
|
206
|
-
|
|
207
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navrail (80) */
|
|
208
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navrail (80) */
|
|
209
|
-
@media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }
|
|
210
|
-
@media screen and (min-width: 1832px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }
|
|
211
|
-
|
|
212
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navrail (80) */
|
|
213
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navrail (80) */
|
|
214
|
-
@media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { max-inline-size: 840px } }
|
|
215
|
-
@media screen and (min-width: 2184px) { :host([split]:where([nav-rail])) { max-inline-size: 1040px; } }
|
|
216
|
-
|
|
217
|
-
/* SPLIT + NAVDRAWER */
|
|
218
|
-
|
|
219
|
-
:host([split]:where([nav-drawer])) {
|
|
220
|
-
grid-template-columns: repeat(4, 1fr);
|
|
221
|
-
|
|
222
|
-
max-inline-size: 600px;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navdrawer (360) */
|
|
226
|
-
/* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navdrawer (360) */
|
|
227
|
-
@media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }
|
|
228
|
-
@media screen and (min-width: 2112px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }
|
|
229
|
-
|
|
230
|
-
/* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navdrawer (360) */
|
|
231
|
-
/* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navdrawer (360) */
|
|
232
|
-
@media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { max-inline-size: 840px } }
|
|
233
|
-
@media screen and (min-width: 2464px) { :host([split]:where([nav-drawer])) { max-inline-size: 1040px; } }
|
|
234
|
-
|
|
235
|
-
:host([full-width]) {
|
|
236
|
-
max-inline-size: none;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/** FIXED **/
|
|
240
|
-
|
|
241
|
-
:host([fixed]) {
|
|
242
|
-
grid-template-columns: repeat(4, 1fr);
|
|
243
|
-
|
|
244
|
-
inline-size:360px;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
@media screen and (max-width: 600px) {
|
|
248
|
-
:host(:nth-of-type(2)) {
|
|
249
|
-
display: none;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
/* Will cap to 360px when window is 360px + padding (2x24px) + spacer (24) + 360px */
|
|
253
|
-
@media screen and (min-width: 792px) {
|
|
254
|
-
:host([fixed]) {
|
|
255
|
-
max-inline-size: 360px
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
#scrim {
|
|
260
|
-
position: absolute;
|
|
261
|
-
inset: 0;
|
|
262
|
-
|
|
263
|
-
grid-area: auto;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
#slot::slotted(*) { grid-column: 1 / none }
|
|
267
|
-
#slot::slotted([colspan="1"]) { grid-column-end: span 1; }
|
|
268
|
-
#slot::slotted([colspan="2"]) { grid-column-end: span 2; }
|
|
269
|
-
#slot::slotted([colspan="3"]) { grid-column-end: span 3; }
|
|
270
|
-
#slot::slotted([colspan="4"]) { grid-column-end: span 4; }
|
|
271
|
-
#slot::slotted([colspan="5"]) { grid-column-end: span 5; }
|
|
272
|
-
#slot::slotted([colspan="6"]) { grid-column-end: span 6; }
|
|
273
|
-
#slot::slotted([colspan="7"]) { grid-column-end: span 7; }
|
|
274
|
-
#slot::slotted([colspan="8"]) { grid-column-end: span 8; }
|
|
275
|
-
#slot::slotted([colspan="9"]) { grid-column-end: span 9; }
|
|
276
|
-
#slot::slotted([colspan="10"]) { grid-column-end: span 10; }
|
|
277
|
-
#slot::slotted([colspan="11"]) { grid-column-end: span 11; }
|
|
278
|
-
#slot::slotted([colspan="12"]) { grid-column-end: span 12; }
|
|
279
|
-
|
|
280
17
|
`
|
|
281
18
|
.autoRegister('mdw-pane');
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import CustomElement from '../core/CustomElement.js';
|
|
2
|
+
import ElevationMixin from '../mixins/ElevationMixin.js';
|
|
3
|
+
import PopupMixin from '../mixins/PopupMixin.js';
|
|
4
|
+
import ShapeMixin from '../mixins/ShapeMixin.js';
|
|
5
|
+
import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
6
|
+
|
|
7
|
+
export default CustomElement
|
|
8
|
+
.extend()
|
|
9
|
+
.mixin(ThemableMixin)
|
|
10
|
+
.mixin(ElevationMixin)
|
|
11
|
+
.mixin(ShapeMixin)
|
|
12
|
+
.mixin(PopupMixin)
|
|
13
|
+
.observe({
|
|
14
|
+
elevation: 'integer',
|
|
15
|
+
})
|
|
16
|
+
.css`
|
|
17
|
+
:host {
|
|
18
|
+
filter: var(--mdw-elevation__drop-shadow__0);
|
|
19
|
+
|
|
20
|
+
transition: filter 200ms;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
:host(:where([elevation="1"])) { filter: var(--mdw-elevation__drop-shadow__1); }
|
|
24
|
+
:host(:where([elevation="2"])) { filter: var(--mdw-elevation__drop-shadow__2); }
|
|
25
|
+
:host(:where([elevation="3"])) { filter: var(--mdw-elevation__drop-shadow__3); }
|
|
26
|
+
:host(:where([elevation="4"])) { filter: var(--mdw-elevation__drop-shadow__4); }
|
|
27
|
+
:host(:where([elevation="5"])) { filter: var(--mdw-elevation__drop-shadow__5); }
|
|
28
|
+
`
|
|
29
|
+
.autoRegister('mdw-popup');
|
package/components/Progress.js
CHANGED
|
@@ -6,8 +6,8 @@ import ThemableMixin from '../mixins/ThemableMixin.js';
|
|
|
6
6
|
// https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element
|
|
7
7
|
|
|
8
8
|
export default CustomElement
|
|
9
|
-
.mixin(ThemableMixin)
|
|
10
9
|
.extend()
|
|
10
|
+
.mixin(ThemableMixin)
|
|
11
11
|
.observe({
|
|
12
12
|
circle: 'boolean',
|
|
13
13
|
value: 'float',
|
|
@@ -37,20 +37,20 @@ export default CustomElement
|
|
|
37
37
|
return /** @type {HTMLProgressElement} */ (this.refs.progress).labels;
|
|
38
38
|
},
|
|
39
39
|
})
|
|
40
|
-
.html
|
|
40
|
+
.html`
|
|
41
41
|
<div id=determinate style="{_determinateStyle}">
|
|
42
42
|
<progress id=progress value={value} max={max} circle={circle}></progress>
|
|
43
|
-
<div
|
|
43
|
+
<div mdw-if={circle} id=circle>
|
|
44
44
|
<div id=semi1 class=semi></div>
|
|
45
45
|
<div id=semi2 class=semi></div>
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
|
-
<div
|
|
49
|
-
<div
|
|
48
|
+
<div mdw-if={!value} id=indeterminate>
|
|
49
|
+
<div mdw-if={!circle} id=indeterminate-line>
|
|
50
50
|
<div id=line1 class=line value={value}></div>
|
|
51
51
|
<div id=line2 class=line value={value}></div>
|
|
52
52
|
</div>
|
|
53
|
-
<div
|
|
53
|
+
<div mdw-if={circle} id=indeterminate-circle>
|
|
54
54
|
<div id=arc2 class=arc></div>
|
|
55
55
|
<div id=arc3 class=arc></div>
|
|
56
56
|
<div id=arc4 class=arc></div>
|
|
@@ -61,7 +61,7 @@ export default CustomElement
|
|
|
61
61
|
/* Base Styles */
|
|
62
62
|
|
|
63
63
|
:host {
|
|
64
|
-
--mdw-bg: var(--mdw-color__surface-
|
|
64
|
+
--mdw-bg: var(--mdw-color__surface-container-highest);
|
|
65
65
|
--mdw-ink: var(--mdw-color__primary);
|
|
66
66
|
--mdw-progress__opacity__duration: 500ms;
|
|
67
67
|
position: relative;
|
|
@@ -296,6 +296,7 @@ export default CustomElement
|
|
|
296
296
|
`
|
|
297
297
|
.css`
|
|
298
298
|
/* Circle Styles */
|
|
299
|
+
/* stylelint-disable liberty/use-logical-spec */
|
|
299
300
|
/** https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/CircularIndeterminateAnimatorDelegate.java */
|
|
300
301
|
|
|
301
302
|
:host {
|
|
@@ -357,11 +358,11 @@ export default CustomElement
|
|
|
357
358
|
}
|
|
358
359
|
|
|
359
360
|
#semi1 {
|
|
360
|
-
|
|
361
|
+
left: 50%;
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
#semi2 {
|
|
364
|
-
|
|
365
|
+
right: 50%;
|
|
365
366
|
}
|
|
366
367
|
|
|
367
368
|
.semi::after {
|
|
@@ -384,7 +385,7 @@ export default CustomElement
|
|
|
384
385
|
|
|
385
386
|
#semi1::after {
|
|
386
387
|
--rotation: min(180deg, calc(var(--value) * 360deg));
|
|
387
|
-
|
|
388
|
+
left: -100%;
|
|
388
389
|
|
|
389
390
|
clip-path: inset(0 50% 0 0);
|
|
390
391
|
|
|
@@ -394,7 +395,7 @@ export default CustomElement
|
|
|
394
395
|
|
|
395
396
|
#semi2::after {
|
|
396
397
|
--rotation: max(0deg, calc(var(--value) * 360deg - 180deg));
|
|
397
|
-
|
|
398
|
+
right: -100%;
|
|
398
399
|
|
|
399
400
|
clip-path: inset(0 0 0 50%);
|
|
400
401
|
|
|
@@ -438,43 +439,43 @@ export default CustomElement
|
|
|
438
439
|
}
|
|
439
440
|
|
|
440
441
|
#arc2 {
|
|
441
|
-
|
|
442
|
-
|
|
442
|
+
bottom: 50%;
|
|
443
|
+
left: 50%;
|
|
443
444
|
|
|
444
445
|
transform-origin: 0 100%;
|
|
445
446
|
}
|
|
446
447
|
|
|
447
448
|
#arc3 {
|
|
448
|
-
|
|
449
|
-
|
|
449
|
+
top: 50%;
|
|
450
|
+
right: 50%;
|
|
450
451
|
|
|
451
452
|
transform-origin: 100% 0;
|
|
452
453
|
}
|
|
453
454
|
|
|
454
455
|
#arc4 {
|
|
455
|
-
|
|
456
|
-
|
|
456
|
+
top: 50%;
|
|
457
|
+
left: 50%;
|
|
457
458
|
|
|
458
459
|
transform-origin: 0 0;
|
|
459
460
|
}
|
|
460
461
|
|
|
461
462
|
#arc2:after {
|
|
462
|
-
|
|
463
|
-
|
|
463
|
+
bottom: -100%;
|
|
464
|
+
left: -100%;
|
|
464
465
|
|
|
465
466
|
clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 100% 50%, 100% 100%, 0% 100%);
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
#arc3:after {
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
top: -100%;
|
|
471
|
+
right: -100%;
|
|
471
472
|
|
|
472
473
|
clip-path: inset(0 50% 50% 0);
|
|
473
474
|
}
|
|
474
475
|
|
|
475
476
|
#arc4:after {
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
top: -100%;
|
|
478
|
+
left: -100%;
|
|
478
479
|
|
|
479
480
|
clip-path: inset(0 50% 0 0);
|
|
480
481
|
}
|