@shortfuse/materialdesignweb 0.8.0 → 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 +32 -24
- package/bin/mdw-css.js +1 -1
- package/components/Badge.js +12 -5
- package/components/Body.js +3 -0
- package/components/BottomAppBar.js +1 -8
- package/components/BottomSheet.js +424 -0
- package/components/Box.js +11 -49
- package/components/Button.js +61 -82
- package/components/Card.js +56 -61
- package/components/Checkbox.js +7 -25
- package/components/CheckboxIcon.js +10 -28
- package/components/Chip.js +13 -11
- package/components/Dialog.js +49 -98
- package/components/Display.js +55 -0
- package/components/Fab.js +83 -17
- package/components/FabContainer.js +48 -0
- package/components/FilterChip.js +34 -32
- package/components/Grid.js +176 -0
- package/components/Headline.js +5 -28
- package/components/Icon.js +54 -69
- package/components/IconButton.js +71 -120
- package/components/Input.js +669 -83
- package/components/InputChip.js +161 -0
- package/components/Label.js +3 -0
- package/components/List.js +1 -5
- package/components/ListItem.js +39 -23
- package/components/ListOption.js +79 -62
- package/components/Listbox.js +19 -10
- package/components/Menu.js +8 -18
- package/components/MenuItem.js +25 -26
- package/components/NavBar.js +53 -19
- package/components/NavDrawer.js +15 -15
- package/components/NavDrawerItem.js +2 -4
- package/components/NavItem.js +40 -33
- package/components/NavRail.js +23 -21
- package/components/NavRailItem.js +5 -2
- package/components/Page.js +105 -0
- package/components/Pane.js +18 -0
- package/components/Popup.js +17 -8
- package/components/Radio.js +2 -5
- package/components/RadioIcon.js +10 -14
- package/components/Ripple.js +11 -7
- package/components/Root.js +209 -0
- package/components/Scrim.js +87 -0
- package/components/Search.js +12 -20
- package/components/SegmentedButton.js +33 -36
- package/components/SegmentedButtonGroup.js +9 -3
- package/components/Select.js +6 -7
- package/components/Shape.js +5 -65
- package/components/SideSheet.js +308 -0
- package/components/Slider.js +71 -34
- package/components/Snackbar.js +22 -16
- package/components/SnackbarContainer.js +42 -0
- package/components/Surface.js +15 -10
- package/components/Switch.js +3 -16
- package/components/SwitchIcon.js +40 -32
- package/components/Tab.js +57 -38
- package/components/TabContent.js +1 -0
- package/components/TabList.js +60 -32
- package/components/TabPanel.js +1 -1
- package/components/Table.js +116 -0
- package/components/TextArea.js +16 -15
- package/components/Title.js +4 -9
- package/components/Tooltip.js +43 -21
- package/components/TopAppBar.js +56 -78
- package/constants/shapes.js +36 -0
- package/constants/typography.js +127 -0
- package/core/Composition.js +354 -192
- package/core/CompositionAdapter.js +11 -12
- package/core/CustomElement.js +588 -236
- package/core/css.js +117 -12
- package/core/customTypes.js +120 -25
- package/core/dom.js +17 -11
- package/core/jsonMergePatch.js +12 -10
- package/core/observe.js +298 -253
- package/core/optimizations.js +9 -9
- package/core/template.js +14 -57
- 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 +106 -0
- package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
- package/loaders/theme.js +12 -0
- package/mixins/AriaReflectorMixin.js +53 -13
- package/mixins/AriaToolbarMixin.js +3 -0
- package/mixins/ControlMixin.js +76 -33
- package/mixins/DelegatesFocusMixin.js +54 -0
- package/mixins/DensityMixin.js +2 -2
- package/mixins/ElevationMixin.js +62 -0
- package/mixins/FlexableMixin.js +66 -37
- package/mixins/FormAssociatedMixin.js +60 -8
- package/mixins/HyperlinkMixin.js +66 -0
- package/mixins/InputMixin.js +205 -32
- package/mixins/KeyboardNavMixin.js +8 -6
- package/mixins/NavigationListenerMixin.js +33 -0
- package/mixins/PopupMixin.js +176 -208
- package/mixins/ResizeObserverMixin.js +16 -4
- package/mixins/RippleMixin.js +8 -6
- package/mixins/ScrollListenerMixin.js +1 -1
- package/mixins/SemiStickyMixin.js +44 -98
- package/mixins/ShapeMaskedMixin.js +117 -0
- package/mixins/ShapeMixin.js +22 -204
- package/mixins/StateMixin.js +70 -34
- package/mixins/TextFieldMixin.js +107 -143
- package/mixins/ThemableMixin.js +44 -56
- package/mixins/TooltipTriggerMixin.js +291 -359
- package/mixins/TouchTargetMixin.js +1 -1
- package/mixins/TypographyMixin.js +121 -0
- package/package.json +110 -74
- package/services/rtl.js +10 -0
- package/services/svgAlias.js +17 -0
- package/{theming/index.js → services/theme.js} +24 -174
- 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/material-color/scheme/Scheme.js +1 -1
- package/utils/pixelmatch.js +360 -0
- package/utils/popup.js +86 -10
- package/utils/searchParams.js +19 -0
- 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
package/components/Layout.js
DELETED
|
@@ -1,504 +0,0 @@
|
|
|
1
|
-
/* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
|
|
2
|
-
|
|
3
|
-
import CustomElement from '../core/CustomElement.js';
|
|
4
|
-
import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';
|
|
5
|
-
|
|
6
|
-
export default CustomElement
|
|
7
|
-
.extend()
|
|
8
|
-
.observe({
|
|
9
|
-
navBar: 'string',
|
|
10
|
-
navRail: 'string',
|
|
11
|
-
navDrawer: 'string',
|
|
12
|
-
oneFlexible: 'boolean',
|
|
13
|
-
oneFixed: 'boolean',
|
|
14
|
-
twoFlexible: 'boolean',
|
|
15
|
-
twoFixed: 'boolean',
|
|
16
|
-
paneTwoActive: 'boolean',
|
|
17
|
-
paneOneColumns: 'integer',
|
|
18
|
-
paneTwoColumns: 'integer',
|
|
19
|
-
padding: 'integer',
|
|
20
|
-
panes: 'integer',
|
|
21
|
-
_touchDeltaX: 'integer',
|
|
22
|
-
_touchStartX: 'integer',
|
|
23
|
-
_navDrawerTranslateX: {
|
|
24
|
-
empty: '-100%',
|
|
25
|
-
},
|
|
26
|
-
_navDrawerDuration: {
|
|
27
|
-
empty: 0,
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
.observe({
|
|
31
|
-
hasTwo: {
|
|
32
|
-
type: 'boolean',
|
|
33
|
-
reflect: 'write',
|
|
34
|
-
get({ twoFlexible, twoFixed }) {
|
|
35
|
-
return twoFlexible || twoFixed;
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
singlePane: {
|
|
39
|
-
type: 'boolean',
|
|
40
|
-
reflect: 'write',
|
|
41
|
-
get({ oneFlexible, oneFixed, twoFlexible, twoFixed }) {
|
|
42
|
-
return (oneFlexible || oneFixed) && !(twoFlexible || twoFixed);
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
_navDrawerStyle: {
|
|
46
|
-
...ELEMENT_STYLER_TYPE,
|
|
47
|
-
get({ _navDrawerTranslateX, _navDrawerDuration }) {
|
|
48
|
-
return {
|
|
49
|
-
target: 'slot-nav-drawer',
|
|
50
|
-
styles: {
|
|
51
|
-
transform: `translateX(${_navDrawerTranslateX})`,
|
|
52
|
-
},
|
|
53
|
-
timing: {
|
|
54
|
-
duration: _navDrawerDuration,
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
})
|
|
60
|
-
.set({
|
|
61
|
-
/** @type {Map<string, MediaQueryList>} */
|
|
62
|
-
registeredMediaQueries: null,
|
|
63
|
-
refreshedOpenStatesFlag: false,
|
|
64
|
-
_windowResizeListener: null,
|
|
65
|
-
})
|
|
66
|
-
/* Slots should follow tab order */
|
|
67
|
-
.html`
|
|
68
|
-
<slot id=slot-nav-drawer name=nav-drawer state={navDrawer}></slot>
|
|
69
|
-
<div id=scrim state={navDrawer}></div>
|
|
70
|
-
<slot id=slot-nav-rail name=nav-rail state={navRail}></slot>
|
|
71
|
-
<slot id=slot-app-bar name=app-bar></slot>
|
|
72
|
-
<slot id=slot class="pane pane1" columns={paneOneColumns} slotted={oneFlexible}></slot>
|
|
73
|
-
<slot id=slot-fixed name=fixed class="pane pane1" columns={paneOneColumns} slotted={oneFixed} ></slot>
|
|
74
|
-
<slot id=slot-two name=two class="pane pane2" panes={panes} columns={paneTwoColumns} slotted={twoFlexible}></slot>
|
|
75
|
-
<slot id=slot-two-fixed name=two-fixed class="pane pane2" panes={panes} columns={paneTwoColumns} slotted={twoFixed} ></slot>
|
|
76
|
-
<slot id=slot-nav-bar name=nav-bar state={navBar}></slot>
|
|
77
|
-
`
|
|
78
|
-
.methods({
|
|
79
|
-
refreshLayoutValues() {
|
|
80
|
-
/**
|
|
81
|
-
* Prefer content to navigation (eg: Don't shrink content for nav)
|
|
82
|
-
* Prefer 2nd pane always
|
|
83
|
-
* Breakpoints ( x = 16, | = 24 )
|
|
84
|
-
* - Nav Pane1 Pane2 Columns Nav Detail Content Width Use?
|
|
85
|
-
* - Modal 4col x 0 x 0 0 0 0 YES
|
|
86
|
-
* - Rail 4col 80 x 360 x 80 0 360 472 NO
|
|
87
|
-
* - Modal 8col x 600 x 0 0 600 632 YES
|
|
88
|
-
* - Modal 8col | 600 | 0 0 600 648 YES
|
|
89
|
-
* - Rail 8col 80 | 600 | 80 0 600 728 YES
|
|
90
|
-
* - Drawer 4col 360 | 360 | 360 0 360 768 NO
|
|
91
|
-
* - Modal 4col 4col | 360 | 360 | 360 360 720 792 YES
|
|
92
|
-
* - Modal Fixed 4col | 360 | 360 | 360 360 720 792 YES
|
|
93
|
-
* - Rail 4col 4col 80 | 360 | 360 | 80 360 720 872 YES
|
|
94
|
-
* - Rail Fixed 4col 80 | 360 | 360 | 80 360 720 872 YES
|
|
95
|
-
* - Modal 12col | 840 | 0 0 840 888 If Single Pane + No Rail
|
|
96
|
-
* - Rail 12col 80 | 840 | 80 0 840 968 If Single Pane
|
|
97
|
-
* - Drawer 8col 360 | 600 | 360 0 600 1008 NO (Loses Content)
|
|
98
|
-
* - Modal Fixed 8col | 360 | 600 | 0 600 960 1032 If No Rail
|
|
99
|
-
* - Rail Fixed 8col 80 | 360 | 600 | 80 600 960 1112 YES
|
|
100
|
-
* - Drawer 4col 4col 360 | 360 | 360 | 360 360 720 1152 NO (Modal 4/4 has more content)
|
|
101
|
-
* - Drawer Fixed 4col 360 | 360 | 360 | 360 360 720 1152 NO (Modal F/8 has more content)
|
|
102
|
-
* - Drawer 12col 360 | 840 | 360 0 840 1248 If Single Pane
|
|
103
|
-
* - Modal 8col 8col | 600 | 600 | 0 600 1200 1272 *If No Rail
|
|
104
|
-
* - Modal Fixed 12col | 360 | 840 | 0 840 1200 1272 *If No Rail
|
|
105
|
-
* - Rail 8col 8col 80 | 600 | 600 | 80 600 1200 1352 YES
|
|
106
|
-
* - Rail Fixed 12col 80 | 360 | 840 | 80 840 1200 1352 YES
|
|
107
|
-
* - Drawer Fixed 8col 360 | 360 | 600 | 360 600 960 1392 *If No Rail
|
|
108
|
-
* - Drawer 8col 8col 360 | 600 | 600 | 360 600 720 1632 *If No Rail
|
|
109
|
-
* - Drawer Fixed 12col 360 | 360 | 840 | 360 840 1200 1632 YES
|
|
110
|
-
* - Modal 12col 12col | 840 | 840 | 0 840 1680 1752 If No Rail + No Nav Drawer
|
|
111
|
-
* - Rail 12col 12col 80 | 840 | 840 | 80 840 1680 1832 If No Drawer
|
|
112
|
-
* - Drawer 12col 12col 360 | 840 | 840 | 360 840 1680 2112 YES
|
|
113
|
-
*/
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* SORTED + FILTERED
|
|
117
|
-
* - Nav Pane1 Pane2 Columns Nav Detail Content Width
|
|
118
|
-
* - Modal 4col x 0 x 0 0 0 0
|
|
119
|
-
* - Modal 8col x 600 x 0 0 600 632
|
|
120
|
-
* - Modal 8col | 600 | 0 0 600 648
|
|
121
|
-
* - Modal 12col | 840 | 0 0 840 888
|
|
122
|
-
* - Rail 8col 80 | 600 | 80 0 600 728
|
|
123
|
-
* - Rail 12col 80 | 840 | 80 0 840 968
|
|
124
|
-
* - Drawer 12col 360 | 840 | 360 0 840 1248
|
|
125
|
-
* - Modal 4col 4col | 360 | 360 | 0 360 720 792
|
|
126
|
-
* - Modal 8col 8col | 600 | 600 | 0 600 1200 1272
|
|
127
|
-
* - Modal 12col 12col | 840 | 840 | 0 840 1680 1752
|
|
128
|
-
* - Modal Fixed 4col | 360 | 360 | 0 360 720 792
|
|
129
|
-
* - Modal Fixed 8col | 360 | 600 | 0 600 960 1032
|
|
130
|
-
* - Modal Fixed 12col | 360 | 840 | 0 840 1200 1272
|
|
131
|
-
* - Drawer 8col 8col 360 | 600 | 600 | 360 600 720 1632
|
|
132
|
-
* - Drawer Fixed 8col 360 | 360 | 600 | 360 600 960 1392
|
|
133
|
-
* - Rail 4col 4col 80 | 360 | 360 | 80 360 720 872
|
|
134
|
-
* - Rail 8col 8col 80 | 600 | 600 | 80 600 1200 1352
|
|
135
|
-
* - Rail 12col 12col 80 | 840 | 840 | 80 840 1680 1832
|
|
136
|
-
* - Rail Fixed 4col 80 | 360 | 360 | 80 360 720 872
|
|
137
|
-
* - Rail Fixed 8col 80 | 360 | 600 | 80 600 960 1112
|
|
138
|
-
* - Rail Fixed 12col 80 | 360 | 840 | 80 840 1200 1352
|
|
139
|
-
* - Drawer 12col 12col 360 | 840 | 840 | 360 840 1680 2112
|
|
140
|
-
* - Drawer Fixed 12col 360 | 360 | 840 | 360 840 1200 1632
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
const { innerWidth } = window;
|
|
144
|
-
/** @type {[number, 'modal'|'rail'|'drawer', 4|8|12|'fixed', number, number][]} */
|
|
145
|
-
const breakpointTable = [
|
|
146
|
-
[1632, 'drawer', 'fixed', 12, 24],
|
|
147
|
-
[2112, 'drawer', 12, 12, 24],
|
|
148
|
-
[1352, 'rail', 'fixed', 12, 24],
|
|
149
|
-
[1112, 'rail', 'fixed', 8, 24],
|
|
150
|
-
[872, 'rail', 'fixed', 4, 24],
|
|
151
|
-
[1832, 'rail', 12, 12, 24],
|
|
152
|
-
[1352, 'rail', 8, 8, 24],
|
|
153
|
-
[872, 'rail', 4, 4, 24],
|
|
154
|
-
[1392, 'drawer', 'fixed', 8, 24],
|
|
155
|
-
[1632, 'drawer', 8, 8, 24],
|
|
156
|
-
[1272, 'modal', 'fixed', 12, 24],
|
|
157
|
-
[1032, 'modal', 'fixed', 8, 24],
|
|
158
|
-
[792, 'modal', 'fixed', 4, 24],
|
|
159
|
-
[1752, 'modal', 12, 12, 24],
|
|
160
|
-
[1272, 'modal', 8, 8, 24],
|
|
161
|
-
[792, 'modal', 4, 4, 24],
|
|
162
|
-
[1248, 'drawer', 12, 0, 24],
|
|
163
|
-
[960, 'rail', 12, 0, 24],
|
|
164
|
-
[728, 'rail', 8, 0, 24],
|
|
165
|
-
[888, 'modal', 12, 0, 24],
|
|
166
|
-
[648, 'modal', 8, 0, 24],
|
|
167
|
-
[632, 'modal', 8, 0, 16],
|
|
168
|
-
[0, 'modal', 4, 0, 16],
|
|
169
|
-
];
|
|
170
|
-
breakpointTable.some(([minWidth, nav, column1, column2, padding]) => {
|
|
171
|
-
if (innerWidth < minWidth) return false;
|
|
172
|
-
if (column2 && !this.hasTwo) return false;
|
|
173
|
-
if (nav === 'rail') {
|
|
174
|
-
if (!this.navRail) return false;
|
|
175
|
-
this.navRail = 'fixed';
|
|
176
|
-
if (this.navDrawer) this.navDrawer = 'closed';
|
|
177
|
-
if (this.navBar) this.navBar = 'closed';
|
|
178
|
-
} else if (nav === 'drawer') {
|
|
179
|
-
if (!this.navDrawer) return false;
|
|
180
|
-
if (this.navRail) this.navRail = 'closed';
|
|
181
|
-
if (this.navBar) this.navBar = 'closed';
|
|
182
|
-
this.navDrawer = 'fixed';
|
|
183
|
-
} else {
|
|
184
|
-
if (this.navRail) this.navRail = 'closed';
|
|
185
|
-
if (this.navDrawer) this.navDrawer = 'closed';
|
|
186
|
-
if (this.navBar) this.navBar = 'open';
|
|
187
|
-
}
|
|
188
|
-
this.padding = padding;
|
|
189
|
-
if (column2) {
|
|
190
|
-
this.panes = 2;
|
|
191
|
-
if (this.oneFixed) {
|
|
192
|
-
this.paneOneColumns = 4;
|
|
193
|
-
this.paneTwoColumns = column2;
|
|
194
|
-
} else if (this.twoFixed) {
|
|
195
|
-
this.paneOneColumns = column2;
|
|
196
|
-
this.paneTwoColumns = 4;
|
|
197
|
-
}
|
|
198
|
-
} else {
|
|
199
|
-
this.panes = 1;
|
|
200
|
-
this.paneOneColumns = /** @type {number} */ (column1);
|
|
201
|
-
this.paneTwoColumns = this.hasTwo
|
|
202
|
-
? /** @type {number} */ (column1)
|
|
203
|
-
: null;
|
|
204
|
-
}
|
|
205
|
-
return true;
|
|
206
|
-
});
|
|
207
|
-
},
|
|
208
|
-
checkTouchFinished() {
|
|
209
|
-
if (this.navDrawer !== 'open') return;
|
|
210
|
-
const { _touchDeltaX, refs } = this;
|
|
211
|
-
const clientWidth = refs.slotNavDrawer.clientWidth;
|
|
212
|
-
const visibility = (_touchDeltaX + clientWidth) / clientWidth;
|
|
213
|
-
if (visibility < 0.5) {
|
|
214
|
-
this._navDrawerTranslateX = '-100%';
|
|
215
|
-
this._navDrawerDuration = 200 * visibility;
|
|
216
|
-
this.navDrawer = 'closed';
|
|
217
|
-
} else {
|
|
218
|
-
this._navDrawerTranslateX = '0';
|
|
219
|
-
this._navDrawerDuration = 200 * (0.5 * visibility);
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
})
|
|
223
|
-
.events({
|
|
224
|
-
'~touchstart'(event) {
|
|
225
|
-
if (this.navDrawer !== 'open') return;
|
|
226
|
-
if (!event.touches.length) return;
|
|
227
|
-
let [{ clientX, pageX }] = event.touches;
|
|
228
|
-
clientX ??= pageX - window.scrollX; // Safari
|
|
229
|
-
this._touchStartX = clientX;
|
|
230
|
-
},
|
|
231
|
-
'~touchmove'({ touches }) {
|
|
232
|
-
if (this.navDrawer !== 'open') return;
|
|
233
|
-
if (!touches.length) return;
|
|
234
|
-
let [{ clientX, pageX }] = touches;
|
|
235
|
-
clientX ??= pageX - window.scrollX; // Safari
|
|
236
|
-
const delta = Math.min(clientX - this._touchStartX, 0);
|
|
237
|
-
|
|
238
|
-
this._touchDeltaX = delta;
|
|
239
|
-
this._navDrawerTranslateX = `${delta}px`;
|
|
240
|
-
this._navDrawerDuration = 0;
|
|
241
|
-
},
|
|
242
|
-
touchcancel: 'checkTouchFinished',
|
|
243
|
-
'~touchend': 'checkTouchFinished',
|
|
244
|
-
})
|
|
245
|
-
.rootEvents({
|
|
246
|
-
slotchange({ target }) {
|
|
247
|
-
const slotElement = /** @type HTMLSlotElement */ (target);
|
|
248
|
-
const slotted = slotElement.assignedElements().length > 0;
|
|
249
|
-
switch (slotElement.name) {
|
|
250
|
-
case 'nav-rail':
|
|
251
|
-
this.navRail = slotted ? 'closed' : null;
|
|
252
|
-
break;
|
|
253
|
-
case 'nav-bar':
|
|
254
|
-
this.navBar = slotted ? 'closed' : null;
|
|
255
|
-
break;
|
|
256
|
-
case 'nav-drawer':
|
|
257
|
-
this.navDrawer = slotted ? 'closed' : null;
|
|
258
|
-
break;
|
|
259
|
-
case 'fixed':
|
|
260
|
-
this.oneFixed = slotted;
|
|
261
|
-
break;
|
|
262
|
-
case 'two':
|
|
263
|
-
this.twoFlexible = slotted;
|
|
264
|
-
break;
|
|
265
|
-
case 'two-fixed':
|
|
266
|
-
this.twoFixed = slotted;
|
|
267
|
-
break;
|
|
268
|
-
default:
|
|
269
|
-
this.oneFlexible = slotted;
|
|
270
|
-
break;
|
|
271
|
-
}
|
|
272
|
-
this.refreshLayoutValues();
|
|
273
|
-
},
|
|
274
|
-
})
|
|
275
|
-
.childEvents({
|
|
276
|
-
scrim: {
|
|
277
|
-
click() {
|
|
278
|
-
this.navDrawer = 'closed';
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
})
|
|
282
|
-
.on({
|
|
283
|
-
navDrawerChanged(previous, current) {
|
|
284
|
-
this._navDrawerTranslateX = current === 'closed' ? '-100%' : '0';
|
|
285
|
-
this._navDrawerDuration = current === 'fixed' ? 0 : 200;
|
|
286
|
-
},
|
|
287
|
-
connected() {
|
|
288
|
-
this._windowResizeListener = this.refreshLayoutValues.bind(this);
|
|
289
|
-
window.addEventListener('resize', this._windowResizeListener);
|
|
290
|
-
},
|
|
291
|
-
disconnected() {
|
|
292
|
-
window.removeEventListener('resize', this._windowResizeListener);
|
|
293
|
-
},
|
|
294
|
-
})
|
|
295
|
-
.css`
|
|
296
|
-
:host {
|
|
297
|
-
--mdw-grid__columns: 4;
|
|
298
|
-
--mdw-content__max-width: 1040px;
|
|
299
|
-
--mdw-content__padding: 16px;
|
|
300
|
-
--mdw-layout__spacer-width: 24px;
|
|
301
|
-
--mdw-layout__nav-drawer__ratio: 0;
|
|
302
|
-
--mdw-layout__nav-drawer-width: 360px;
|
|
303
|
-
--mdw-layout__nav-rail__ratio: 0;
|
|
304
|
-
--mdw-layout__nav-rail-width: 80px;
|
|
305
|
-
--mdw-layout__pane1-width: minmax(0, 1fr);
|
|
306
|
-
--mdw-layout__pane2-width: 0;
|
|
307
|
-
--mdw-layout__window-padding: 16px;
|
|
308
|
-
|
|
309
|
-
display: grid;
|
|
310
|
-
grid-template-rows: auto 1fr auto;
|
|
311
|
-
grid-template-columns:
|
|
312
|
-
calc(var(--mdw-layout__nav-drawer-width) * var(--mdw-layout__nav-drawer__ratio))
|
|
313
|
-
calc(var(--mdw-layout__nav-rail-width) * var(--mdw-layout__nav-rail__ratio))
|
|
314
|
-
var(--mdw-layout__window-padding)
|
|
315
|
-
var(--mdw-layout__pane1-width)
|
|
316
|
-
var(--mdw-layout__window-padding)
|
|
317
|
-
var(--mdw-layout__pane2-width) 0;
|
|
318
|
-
grid-template-areas:
|
|
319
|
-
"nav-drawer nav-rail app-bar app-bar app-bar pane2 ."
|
|
320
|
-
"nav-drawer nav-rail . pane1 . pane2 ."
|
|
321
|
-
"nav-drawer nav-rail nav-bar nav-bar nav-bar nav-bar .";
|
|
322
|
-
overflow-x: clip;
|
|
323
|
-
|
|
324
|
-
font: var(--mdw-typescale__body-large__font);
|
|
325
|
-
letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
:host(:where([pane-two-active])) {
|
|
329
|
-
grid-template-areas:
|
|
330
|
-
"nav-drawer nav-rail app-bar app-bar app-bar pane1 ."
|
|
331
|
-
"nav-drawer nav-rail . pane2 . pane1 ."
|
|
332
|
-
"nav-drawer nav-rail nav-bar nav-bar nav-bar nav-bar .";
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
:host(:where([panes="2"])) {
|
|
336
|
-
--mdw-content__max-width: auto;
|
|
337
|
-
--mdw-layout__pane2-width: 1fr;
|
|
338
|
-
grid-template-columns:
|
|
339
|
-
calc(var(--mdw-layout__nav-drawer-width) * var(--mdw-layout__nav-drawer__ratio))
|
|
340
|
-
calc(var(--mdw-layout__nav-rail-width) * var(--mdw-layout__nav-rail__ratio))
|
|
341
|
-
var(--mdw-layout__window-padding)
|
|
342
|
-
var(--mdw-layout__pane1-width)
|
|
343
|
-
var(--mdw-layout__spacer-width)
|
|
344
|
-
var(--mdw-layout__pane2-width)
|
|
345
|
-
var(--mdw-layout__window-padding);
|
|
346
|
-
|
|
347
|
-
grid-template-areas:
|
|
348
|
-
"nav-drawer nav-rail app-bar app-bar app-bar pane2 ."
|
|
349
|
-
"nav-drawer nav-rail . pane1 . pane2 ."
|
|
350
|
-
"nav-drawer nav-rail nav-bar nav-bar nav-bar nav-bar .";
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
:host(:where([nav-rail="fixed"])) {
|
|
354
|
-
--mdw-layout__nav-rail__ratio: 1;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
:host(:where([nav-drawer="fixed"])) {
|
|
358
|
-
--mdw-layout__nav-drawer__ratio: 1;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
:host(:where([padding="24"])) {
|
|
362
|
-
--mdw-layout__window-padding: 24px;
|
|
363
|
-
--mdw-content__padding: 24px;
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
:host(:where([panes="2"][one-fixed])) {
|
|
367
|
-
--mdw-layout__pane1-width: 360px;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
:host(:where([panes="2"][two-fixed])) {
|
|
371
|
-
--mdw-layout__pane2-width: 360px;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
#scrim {
|
|
375
|
-
position:fixed;
|
|
376
|
-
inset: 0;
|
|
377
|
-
|
|
378
|
-
pointer-events: none;
|
|
379
|
-
|
|
380
|
-
opacity: 0;
|
|
381
|
-
z-index: 25;
|
|
382
|
-
|
|
383
|
-
background-color: rgb(var(--mdw-color__scrim));
|
|
384
|
-
|
|
385
|
-
transition: opacity 200ms;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
#scrim[state="open"] {
|
|
389
|
-
pointer-events: auto;
|
|
390
|
-
|
|
391
|
-
opacity: 0.38;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
.pane {
|
|
395
|
-
overflow: visible;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.pane[columns="8"] {
|
|
399
|
-
/* stylelint-disable-next-line rule-selector-property-disallowed-list */
|
|
400
|
-
--mdw-grid__columns: 8;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
.pane[columns="12"] {
|
|
404
|
-
/* stylelint-disable-next-line rule-selector-property-disallowed-list */
|
|
405
|
-
--mdw-grid__columns: 12;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
.pane1 {
|
|
409
|
-
grid-area: pane1;
|
|
410
|
-
|
|
411
|
-
box-sizing: content-box;
|
|
412
|
-
inline-size: 100%;
|
|
413
|
-
max-inline-size: var(--mdw-content__max-width, auto);
|
|
414
|
-
margin-inline: auto;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.pane1[slotted] {
|
|
418
|
-
display: block;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
.pane2 {
|
|
422
|
-
--mdw-content__padding: 0;
|
|
423
|
-
grid-area: pane2;
|
|
424
|
-
|
|
425
|
-
visibility: hidden;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
.pane2[active] {
|
|
429
|
-
inset-inline-end: 0;
|
|
430
|
-
|
|
431
|
-
box-sizing: border-box;
|
|
432
|
-
inline-size: 100%;
|
|
433
|
-
padding-inline: var(--mdw-content__padding);
|
|
434
|
-
|
|
435
|
-
visibility: visible;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.pane2[slotted] {
|
|
439
|
-
display: block;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
.pane2[panes="2"] {
|
|
443
|
-
position: sticky;
|
|
444
|
-
inset: 0;
|
|
445
|
-
|
|
446
|
-
overflow-y: auto;
|
|
447
|
-
|
|
448
|
-
block-size: 100vh;
|
|
449
|
-
|
|
450
|
-
visibility: visible;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
#slot-app-bar {
|
|
454
|
-
display: contents; /* Allow sticky */
|
|
455
|
-
|
|
456
|
-
z-index: 2;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
#slot-nav-bar {
|
|
460
|
-
display: contents;
|
|
461
|
-
grid-area: nav-bar;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
#slot-nav-bar[state="closed"] {
|
|
465
|
-
display: none;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
#slot-nav-rail {
|
|
469
|
-
display: none;
|
|
470
|
-
grid-area: nav-rail;
|
|
471
|
-
|
|
472
|
-
z-index: 3;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
#slot-nav-rail[state="fixed"] {
|
|
476
|
-
display: block;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
#slot-nav-drawer {
|
|
480
|
-
position: fixed;
|
|
481
|
-
|
|
482
|
-
display: block;
|
|
483
|
-
grid-area: nav-drawer;
|
|
484
|
-
|
|
485
|
-
/** Initially hidden */
|
|
486
|
-
transform: translateX(-100%);
|
|
487
|
-
visibility: hidden;
|
|
488
|
-
z-index: 26;
|
|
489
|
-
|
|
490
|
-
transition-delay: 0s, 200ms;
|
|
491
|
-
transition-duration: 200ms, 0s;
|
|
492
|
-
transition-property: transform, visibility;
|
|
493
|
-
transition-timing-function: cubic-bezier(0.3, 0, 0.8, 0.15);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
#slot-nav-drawer:is([state="open"],[state="fixed"]) {
|
|
497
|
-
transform: translateX(0);
|
|
498
|
-
visibility: visible;
|
|
499
|
-
|
|
500
|
-
transition-delay: 0s, 0s;
|
|
501
|
-
transition-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
|
|
502
|
-
}
|
|
503
|
-
`
|
|
504
|
-
.autoRegister('mdw-layout');
|
package/components/Nav.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import NavItem from './NavItem.js';
|
|
2
|
-
import Surface from './Surface.js';
|
|
3
|
-
|
|
4
|
-
export default Surface
|
|
5
|
-
.extend()
|
|
6
|
-
.css`
|
|
7
|
-
/* https://m3.material.io/components/navigation-bar/specs */
|
|
8
|
-
/* https://m3.material.io/components/navigation-drawer/specs */
|
|
9
|
-
/* https://m3.material.io/components/navigation-rail/specs */
|
|
10
|
-
|
|
11
|
-
:host {
|
|
12
|
-
--mdw-ink: var(--mdw-color__on-surface);
|
|
13
|
-
--mdw-bg: var(--mdw-color__surface);
|
|
14
|
-
|
|
15
|
-
z-index:2;
|
|
16
|
-
|
|
17
|
-
color: rgb(var(--mdw-ink));
|
|
18
|
-
|
|
19
|
-
font: var(--mdw-typescale__label-medium__font);
|
|
20
|
-
letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
|
|
21
|
-
}
|
|
22
|
-
`
|
|
23
|
-
.set({
|
|
24
|
-
elevated: true,
|
|
25
|
-
color: 'surface',
|
|
26
|
-
})
|
|
27
|
-
.events({
|
|
28
|
-
'~click'(event) {
|
|
29
|
-
// Abort if not child
|
|
30
|
-
if (event.target === this) return;
|
|
31
|
-
if (event.target instanceof NavItem === false) return;
|
|
32
|
-
for (const el of this.querySelectorAll('*')) {
|
|
33
|
-
if (el instanceof NavItem === false) continue;
|
|
34
|
-
el.active = (el === event.target);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
})
|
|
38
|
-
.autoRegister('mdw-nav');
|