@shortfuse/materialdesignweb 0.5.0 → 0.7.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 +155 -77
- package/bin/generate-css.js +12 -0
- package/components/Badge.css +30 -0
- package/components/Badge.js +15 -0
- package/components/Body.css +14 -0
- package/components/Body.js +7 -0
- package/components/BottomAppBar.css +23 -0
- package/components/BottomAppBar.js +25 -0
- package/components/Box.css +31 -0
- package/components/Box.js +24 -0
- package/components/Button.css +146 -0
- package/components/Button.js +95 -0
- package/components/Button.md +61 -0
- package/components/Card.css +109 -0
- package/components/Card.js +82 -0
- package/components/Checkbox.css +77 -0
- package/components/Checkbox.js +59 -0
- package/components/CheckboxIcon.css +89 -0
- package/components/CheckboxIcon.js +41 -0
- package/components/Chip.css +35 -0
- package/components/Chip.js +22 -0
- package/components/Dialog.css +235 -0
- package/components/Dialog.js +327 -0
- package/components/DialogActions.js +13 -0
- package/components/Divider.css +41 -0
- package/components/Divider.js +13 -0
- package/components/ExtendedFab.css +24 -0
- package/components/ExtendedFab.js +11 -0
- package/components/Fab.css +23 -0
- package/components/Fab.js +26 -0
- package/components/FilterChip.css +80 -0
- package/components/FilterChip.js +51 -0
- package/components/Headline.css +14 -0
- package/components/Headline.js +33 -0
- package/components/Icon.css +76 -0
- package/components/Icon.js +174 -0
- package/components/IconButton.css +151 -0
- package/components/IconButton.js +65 -0
- package/components/Input.js +16 -0
- package/components/Label.css +14 -0
- package/components/Label.js +7 -0
- package/components/Layout.css +19 -0
- package/components/Layout.js +12 -0
- package/components/List.css +12 -0
- package/components/List.js +17 -0
- package/components/ListItem.css +224 -0
- package/components/ListItem.js +112 -0
- package/components/ListOption.css +34 -0
- package/components/ListOption.js +122 -0
- package/components/ListSelect.css +9 -0
- package/components/ListSelect.js +206 -0
- package/components/Menu.css +171 -0
- package/components/Menu.js +470 -0
- package/components/MenuItem.css +53 -0
- package/components/MenuItem.js +215 -0
- package/components/Nav.css +17 -0
- package/components/Nav.js +23 -0
- package/components/NavBar.css +34 -0
- package/components/NavBar.js +88 -0
- package/components/NavBarItem.css +41 -0
- package/components/NavBarItem.js +7 -0
- package/components/NavDrawer.css +31 -0
- package/components/NavDrawer.js +13 -0
- package/components/NavDrawerItem.css +42 -0
- package/components/NavDrawerItem.js +12 -0
- package/components/NavItem.css +181 -0
- package/components/NavItem.js +83 -0
- package/components/NavRail.css +47 -0
- package/components/NavRail.js +17 -0
- package/components/NavRailItem.css +25 -0
- package/components/NavRailItem.js +7 -0
- package/components/Option.js +91 -0
- package/components/Outline.css +138 -0
- package/components/Pane.css +261 -0
- package/components/Pane.js +21 -0
- package/components/Progress.css +74 -0
- package/components/Progress.js +67 -0
- package/components/ProgressCircle.css +226 -0
- package/components/ProgressLine.css +155 -0
- package/components/Radio.css +83 -0
- package/components/Radio.js +42 -0
- package/components/RadioIcon.css +73 -0
- package/components/RadioIcon.js +37 -0
- package/components/Ripple.css +74 -0
- package/components/Ripple.js +114 -0
- package/components/SegmentedButton.css +94 -0
- package/components/SegmentedButton.js +49 -0
- package/components/SegmentedButtonGroup.css +12 -0
- package/components/SegmentedButtonGroup.js +44 -0
- package/components/Select.css +52 -0
- package/components/Select.js +71 -0
- package/components/Shape.css +132 -0
- package/components/Shape.js +25 -0
- package/components/Slider.css +306 -0
- package/components/Slider.js +206 -0
- package/components/Snackbar.css +80 -0
- package/components/Snackbar.js +75 -0
- package/components/Surface.css +10 -0
- package/components/Surface.js +23 -0
- package/components/Switch.css +63 -0
- package/components/Switch.js +127 -0
- package/components/SwitchIcon.css +177 -0
- package/components/SwitchIcon.js +89 -0
- package/components/SwitchIconAnimations.css +89 -0
- package/components/Tab.css +85 -0
- package/components/Tab.js +103 -0
- package/components/TabContent.js +151 -0
- package/components/TabList.css +129 -0
- package/components/TabList.js +309 -0
- package/components/TabPanel.js +37 -0
- package/components/TextArea.css +93 -0
- package/components/TextArea.js +229 -0
- package/components/Title.css +14 -0
- package/components/Title.js +15 -0
- package/components/Tooltip.css +40 -0
- package/components/Tooltip.js +22 -0
- package/components/TopAppBar.css +209 -0
- package/components/TopAppBar.js +201 -0
- package/core/Composition.js +988 -0
- package/core/CustomElement.js +844 -0
- package/core/ICustomElement.d.ts +288 -0
- package/core/ICustomElement.js +1 -0
- package/core/css.js +51 -0
- package/core/customTypes.js +125 -0
- package/core/dom.js +56 -154
- package/core/identify.js +40 -0
- package/core/observe.js +410 -0
- package/core/template.js +121 -0
- package/core/typings.d.ts +135 -0
- package/core/typings.js +1 -0
- package/mixins/AriaReflectorMixin.js +42 -0
- package/mixins/AriaToolbarMixin.js +13 -0
- package/mixins/ControlMixin.css +57 -0
- package/mixins/ControlMixin.js +212 -0
- package/mixins/DensityMixin.css +40 -0
- package/mixins/DensityMixin.js +11 -0
- package/mixins/FlexableMixin.css +79 -0
- package/mixins/FlexableMixin.js +32 -0
- package/mixins/FormAssociatedMixin.js +170 -0
- package/mixins/InputMixin.js +335 -0
- package/mixins/KeyboardNavMixin.js +244 -0
- package/mixins/RTLObserverMixin.js +35 -0
- package/mixins/ResizeObserverMixin.js +38 -0
- package/mixins/RippleMixin.css +12 -0
- package/mixins/RippleMixin.js +115 -0
- package/mixins/ScrollListenerMixin.js +100 -0
- package/mixins/ShapeMixin.css +135 -0
- package/mixins/ShapeMixin.js +31 -0
- package/mixins/StateMixin.css +82 -0
- package/mixins/StateMixin.js +114 -0
- package/mixins/SurfaceMixin.css +150 -0
- package/mixins/SurfaceMixin.js +32 -0
- package/mixins/TextFieldMixin.css +657 -0
- package/mixins/TextFieldMixin.js +121 -0
- package/mixins/ThemableMixin.css +204 -0
- package/mixins/ThemableMixin.js +16 -0
- package/mixins/TooltipTriggerMixin.css +27 -0
- package/mixins/TooltipTriggerMixin.js +366 -0
- package/mixins/TouchTargetMixin.css +26 -0
- package/mixins/TouchTargetMixin.js +9 -0
- package/package.json +54 -49
- package/theming/index.js +594 -0
- package/theming/loader.js +24 -0
- package/utils/cli.js +11 -0
- package/utils/color_keywords.js +151 -0
- package/utils/hct/Cam16.js +298 -0
- package/utils/hct/CorePalette.js +84 -0
- package/utils/hct/Hct.js +172 -0
- package/utils/hct/Scheme.js +587 -0
- package/utils/hct/TonalPalette.js +68 -0
- package/utils/hct/ViewingConditions.js +136 -0
- package/utils/hct/blend.js +93 -0
- package/utils/hct/colorUtils.js +302 -0
- package/utils/hct/hctSolver.js +559 -0
- package/utils/hct/helper.js +182 -0
- package/utils/hct/mathUtils.js +153 -0
- package/utils/jsonMergePatch.js +100 -0
- package/utils/jsx-runtime.js +101 -0
- package/utils/popup.js +117 -0
- package/utils/svg.js +129 -0
- package/.browserslistrc +0 -4
- package/.eslintrc.json +0 -204
- package/.stylelintrc.json +0 -645
- package/.vscode/launch.json +0 -31
- package/.vscode/settings.json +0 -3
- package/.vscode/tasks.json +0 -32
- package/CHANGELOG.md +0 -36
- package/CODE_OF_CONDUCT.md +0 -46
- package/adapters/datatable/column.js +0 -176
- package/adapters/datatable/index.js +0 -960
- package/adapters/dom/index.js +0 -586
- package/adapters/list/index.js +0 -69
- package/adapters/search/index.js +0 -495
- package/components/appbar/_spec.scss +0 -165
- package/components/appbar/_theme.scss +0 -0
- package/components/appbar/index.scss +0 -2
- package/components/banner/_spec.scss +0 -83
- package/components/banner/_theme.scss +0 -0
- package/components/banner/index.scss +0 -2
- package/components/bottomnav/README.md +0 -85
- package/components/bottomnav/_spec.scss +0 -149
- package/components/bottomnav/_theme.scss +0 -0
- package/components/bottomnav/index.js +0 -117
- package/components/bottomnav/index.scss +0 -2
- package/components/bottomnav/item.js +0 -88
- package/components/button/README.md +0 -61
- package/components/button/_spec.scss +0 -162
- package/components/button/_theme.scss +0 -42
- package/components/button/index.eta +0 -32
- package/components/button/index.js +0 -43
- package/components/button/index.pug +0 -18
- package/components/button/index.scss +0 -2
- package/components/card/_spec.scss +0 -241
- package/components/card/_theme.scss +0 -0
- package/components/card/index.scss +0 -2
- package/components/chip/_spec.scss +0 -111
- package/components/chip/_theme.scss +0 -105
- package/components/chip/index.js +0 -23
- package/components/chip/index.scss +0 -2
- package/components/chip/item.js +0 -20
- package/components/datatable/_spec.scss +0 -225
- package/components/datatable/_theme.scss +0 -128
- package/components/datatable/cell.js +0 -44
- package/components/datatable/columnheader.js +0 -46
- package/components/datatable/index.js +0 -374
- package/components/datatable/index.scss +0 -2
- package/components/datatable/row.js +0 -48
- package/components/datatable/rowheader.js +0 -18
- package/components/dialog/_spec.scss +0 -203
- package/components/dialog/_theme.scss +0 -7
- package/components/dialog/index.js +0 -601
- package/components/dialog/index.scss +0 -2
- package/components/divider/_spec.scss +0 -11
- package/components/divider/_theme.scss +0 -0
- package/components/divider/index.scss +0 -2
- package/components/elevation/_spec.scss +0 -9
- package/components/elevation/_theme.scss +0 -0
- package/components/elevation/index.scss +0 -2
- package/components/fab/_spec.scss +0 -210
- package/components/fab/_theme.scss +0 -0
- package/components/fab/index.js +0 -99
- package/components/fab/index.scss +0 -2
- package/components/grid/_spec.scss +0 -169
- package/components/grid/_theme.scss +0 -0
- package/components/grid/index.scss +0 -2
- package/components/layout/_mixins.scss +0 -11
- package/components/layout/_spec.scss +0 -916
- package/components/layout/_theme.scss +0 -19
- package/components/layout/index.js +0 -454
- package/components/layout/index.scss +0 -2
- package/components/list/_spec.scss +0 -363
- package/components/list/_theme.scss +0 -102
- package/components/list/content.js +0 -106
- package/components/list/index.js +0 -256
- package/components/list/index.scss +0 -2
- package/components/list/item.js +0 -167
- package/components/list/secondary.js +0 -45
- package/components/menu/_spec.scss +0 -329
- package/components/menu/_theme.scss +0 -0
- package/components/menu/index.js +0 -705
- package/components/menu/index.scss +0 -2
- package/components/menu/item.js +0 -231
- package/components/progress/_spec.scss +0 -156
- package/components/progress/_theme.scss +0 -0
- package/components/progress/index.js +0 -36
- package/components/progress/index.scss +0 -2
- package/components/selection/_spec.scss +0 -376
- package/components/selection/_theme.scss +0 -134
- package/components/selection/index.eta +0 -60
- package/components/selection/index.js +0 -70
- package/components/selection/index.pug +0 -30
- package/components/selection/index.scss +0 -2
- package/components/selection/input.js +0 -54
- package/components/selection/radiogroup.js +0 -40
- package/components/slider/_spec.scss +0 -59
- package/components/slider/_theme.scss +0 -0
- package/components/slider/index.scss +0 -2
- package/components/snackbar/_spec.scss +0 -150
- package/components/snackbar/_theme.scss +0 -0
- package/components/snackbar/index.js +0 -338
- package/components/snackbar/index.scss +0 -2
- package/components/tab/_spec.scss +0 -220
- package/components/tab/_theme.scss +0 -0
- package/components/tab/content.js +0 -210
- package/components/tab/index.js +0 -257
- package/components/tab/index.scss +0 -2
- package/components/tab/item.js +0 -88
- package/components/tab/list.js +0 -196
- package/components/tab/panel.js +0 -54
- package/components/textfield/README.md +0 -179
- package/components/textfield/_spec.scss +0 -763
- package/components/textfield/_theme.scss +0 -264
- package/components/textfield/index.eta +0 -74
- package/components/textfield/index.js +0 -160
- package/components/textfield/index.pug +0 -30
- package/components/textfield/index.scss +0 -2
- package/components/tooltip/_spec.scss +0 -185
- package/components/tooltip/_theme.scss +0 -0
- package/components/tooltip/index.scss +0 -2
- package/components/type/_spec.scss +0 -227
- package/components/type/_theme.scss +0 -0
- package/components/type/index.scss +0 -2
- package/core/_breakpoint.scss +0 -189
- package/core/_elevation.scss +0 -78
- package/core/_length.scss +0 -8
- package/core/_motion.scss +0 -31
- package/core/_platform.scss +0 -12
- package/core/_type.scss +0 -128
- package/core/aria/attributes.js +0 -141
- package/core/aria/button.js +0 -49
- package/core/aria/keyboard.js +0 -92
- package/core/aria/rovingtabindex.js +0 -175
- package/core/aria/tab.js +0 -59
- package/core/document/index.js +0 -39
- package/core/overlay/_spec.scss +0 -28
- package/core/overlay/_theme.scss +0 -147
- package/core/overlay/index.js +0 -95
- package/core/overlay/index.scss +0 -2
- package/core/ripple/_spec.scss +0 -196
- package/core/ripple/_theme.scss +0 -20
- package/core/ripple/index.js +0 -286
- package/core/ripple/index.scss +0 -2
- package/core/theme/_aliases.scss +0 -15
- package/core/theme/_config.scss +0 -8
- package/core/theme/_functions.scss +0 -22
- package/core/theme/_palettes.scss +0 -405
- package/core/theme/_spec.scss +0 -0
- package/core/theme/_theme.scss +0 -268
- package/core/theme/index.js +0 -50
- package/core/theme/index.scss +0 -4
- package/core/throttler.js +0 -42
- package/core/transition/index.js +0 -465
- package/docs/_flex.scss +0 -28
- package/docs/_menuoptions.js +0 -183
- package/docs/_partials/_androidnavbar.eta +0 -5
- package/docs/_partials/_androidstatusbar.eta +0 -13
- package/docs/_partials/_appbar.eta +0 -27
- package/docs/_partials/_buttontest.eta +0 -31
- package/docs/_partials/_header.eta +0 -146
- package/docs/_partials/_navlistitem.eta +0 -16
- package/docs/_partials/_target.eta +0 -1
- package/docs/_sample-utils.js +0 -88
- package/docs/_storage.js +0 -33
- package/docs/docs.scss +0 -331
- package/docs/framework.scss +0 -26
- package/docs/index.eta +0 -12
- package/docs/index.js +0 -7
- package/docs/pages/appbar.eta +0 -108
- package/docs/pages/appbar.js +0 -0
- package/docs/pages/bottomnav.eta +0 -188
- package/docs/pages/bottomnav.js +0 -118
- package/docs/pages/button.eta +0 -124
- package/docs/pages/button.js +0 -224
- package/docs/pages/card.eta +0 -90
- package/docs/pages/card.js +0 -175
- package/docs/pages/chip.eta +0 -122
- package/docs/pages/chip.js +0 -80
- package/docs/pages/color.eta +0 -143
- package/docs/pages/color.js +0 -261
- package/docs/pages/datatable.eta +0 -323
- package/docs/pages/datatable.js +0 -160
- package/docs/pages/dialog.eta +0 -184
- package/docs/pages/dialog.js +0 -174
- package/docs/pages/dom.eta +0 -26
- package/docs/pages/dom.js +0 -140
- package/docs/pages/elevation.eta +0 -35
- package/docs/pages/elevation.js +0 -0
- package/docs/pages/fab.eta +0 -99
- package/docs/pages/fab.js +0 -43
- package/docs/pages/grid.eta +0 -135
- package/docs/pages/grid.js +0 -128
- package/docs/pages/layout.eta +0 -8
- package/docs/pages/layout.js +0 -0
- package/docs/pages/list.eta +0 -465
- package/docs/pages/list.js +0 -8
- package/docs/pages/menu.eta +0 -274
- package/docs/pages/menu.js +0 -213
- package/docs/pages/overlay.eta +0 -69
- package/docs/pages/overlay.js +0 -3
- package/docs/pages/progress.eta +0 -23
- package/docs/pages/progress.js +0 -12
- package/docs/pages/ripple.eta +0 -27
- package/docs/pages/ripple.js +0 -3
- package/docs/pages/search.eta +0 -242
- package/docs/pages/search.js +0 -226
- package/docs/pages/selection.eta +0 -107
- package/docs/pages/selection.js +0 -12
- package/docs/pages/slider.eta +0 -23
- package/docs/pages/slider.js +0 -0
- package/docs/pages/snackbar.eta +0 -83
- package/docs/pages/snackbar.js +0 -157
- package/docs/pages/tab.eta +0 -407
- package/docs/pages/tab.js +0 -152
- package/docs/pages/textfield.eta +0 -487
- package/docs/pages/textfield.js +0 -257
- package/docs/pages/tooltip.eta +0 -92
- package/docs/pages/tooltip.js +0 -0
- package/docs/pages/transition.eta +0 -117
- package/docs/pages/transition.js +0 -52
- package/docs/pages/type.eta +0 -31
- package/docs/pages/type.js +0 -0
- package/docs/postrender.js +0 -41
- package/docs/prerender.js +0 -16
- package/docs/pwa/_dialogs.eta +0 -143
- package/docs/pwa/_menus.eta +0 -16
- package/docs/pwa/pwa-prerender.js +0 -3
- package/docs/pwa/pwa.eta +0 -478
- package/docs/pwa/pwa.js +0 -298
- package/docs/pwa/pwa.scss +0 -31
- package/docs/themes/theme-colored.scss +0 -15
- package/docs/themes/theme-default.scss +0 -3
- package/index.scss +0 -27
- package/jsconfig.json +0 -16
- package/scripts/deploy-docs.sh +0 -9
- package/templates/index.eta +0 -2
- package/templates/index.pug +0 -3
- package/tsconfig.json +0 -16
- package/webpack.config.js +0 -304
package/adapters/search/index.js
DELETED
|
@@ -1,495 +0,0 @@
|
|
|
1
|
-
// https://www.w3.org/TR/wai-aria-practices/#combobox
|
|
2
|
-
|
|
3
|
-
import * as ListContent from '../../components/list/content.js';
|
|
4
|
-
import * as List from '../../components/list/index.js';
|
|
5
|
-
import * as TextField from '../../components/textfield/index.js';
|
|
6
|
-
import { getTextNode } from '../../core/dom.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @param {string} input
|
|
10
|
-
* @param {string} content
|
|
11
|
-
* @return {boolean}
|
|
12
|
-
*/
|
|
13
|
-
function containsTextFilter(input, content) {
|
|
14
|
-
return content.trim().toLocaleLowerCase()
|
|
15
|
-
.includes(input.trim().toLocaleLowerCase());
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* @param {string} input
|
|
20
|
-
* @param {string} content
|
|
21
|
-
* @return {boolean}
|
|
22
|
-
*/
|
|
23
|
-
function startsWithTextFilter(input, content) {
|
|
24
|
-
return content.trim().toLocaleLowerCase()
|
|
25
|
-
.indexOf(input.trim().toLocaleLowerCase()) === 0;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param {Element} item
|
|
30
|
-
* @return {string}
|
|
31
|
-
*/
|
|
32
|
-
function defaultItemTextParser(item) {
|
|
33
|
-
if (item.hasAttribute('data-mdw-search-text')) {
|
|
34
|
-
return item.getAttribute('data-mdw-search-text');
|
|
35
|
-
}
|
|
36
|
-
let textElement;
|
|
37
|
-
[
|
|
38
|
-
'mdw-list__text-line',
|
|
39
|
-
'mdw-list__text',
|
|
40
|
-
'mdw-list__content',
|
|
41
|
-
].some((className) => {
|
|
42
|
-
textElement = item.getElementsByClassName(className)[0];
|
|
43
|
-
return textElement != null;
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const textNode = textElement ? getTextNode(textElement) : getTextNode(item);
|
|
47
|
-
if (textNode) {
|
|
48
|
-
return textNode.textContent || '';
|
|
49
|
-
}
|
|
50
|
-
return '';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @param {Element} list
|
|
55
|
-
* @param {boolean} [backwards=false]
|
|
56
|
-
* @return {Element} sibling
|
|
57
|
-
*/
|
|
58
|
-
function selectSibling(list, backwards) {
|
|
59
|
-
const current = list.querySelector('[role="option"][aria-selected="true"]');
|
|
60
|
-
const items = list.querySelectorAll('[role="option"]:not([aria-hidden="true"]):not([disabled])');
|
|
61
|
-
let sibling;
|
|
62
|
-
if (current && current.getAttribute('aria-hidden') !== 'true') {
|
|
63
|
-
for (let i = 0; i < items.length; i++) {
|
|
64
|
-
const item = items.item(i);
|
|
65
|
-
if (item === current) {
|
|
66
|
-
sibling = backwards ? items[i - 1] : items[i + 1];
|
|
67
|
-
break;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
} else if (backwards) {
|
|
71
|
-
sibling = items[items.length - 1];
|
|
72
|
-
} else {
|
|
73
|
-
sibling = items[0];
|
|
74
|
-
}
|
|
75
|
-
if (sibling && sibling !== current) {
|
|
76
|
-
if (current) {
|
|
77
|
-
current.setAttribute('aria-selected', 'false');
|
|
78
|
-
}
|
|
79
|
-
sibling.setAttribute('aria-selected', 'true');
|
|
80
|
-
return sibling;
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* @param {Element} el
|
|
87
|
-
* @return {number}
|
|
88
|
-
*/
|
|
89
|
-
function getElementVisibility(el) {
|
|
90
|
-
let rect = el.getBoundingClientRect();
|
|
91
|
-
const { top, height } = rect;
|
|
92
|
-
let next = el.parentElement;
|
|
93
|
-
do {
|
|
94
|
-
rect = next.getBoundingClientRect();
|
|
95
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
96
|
-
if ((top + height) > rect.bottom) {
|
|
97
|
-
// bottom clipped
|
|
98
|
-
return 1;
|
|
99
|
-
}
|
|
100
|
-
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
101
|
-
if (top < rect.top) {
|
|
102
|
-
// top clipped
|
|
103
|
-
return -1;
|
|
104
|
-
}
|
|
105
|
-
next = next.parentElement;
|
|
106
|
-
} while (next !== document.body);
|
|
107
|
-
if (top < 0) {
|
|
108
|
-
return -1;
|
|
109
|
-
}
|
|
110
|
-
if ((top + height) > document.documentElement.clientHeight) {
|
|
111
|
-
return 1;
|
|
112
|
-
}
|
|
113
|
-
return 0;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @param {Element} listItem
|
|
118
|
-
* @return {void}
|
|
119
|
-
*/
|
|
120
|
-
function scrollItemIntoView(listItem) {
|
|
121
|
-
const visibility = getElementVisibility(listItem);
|
|
122
|
-
if (visibility < 0) {
|
|
123
|
-
listItem.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
124
|
-
} else if (visibility > 0) {
|
|
125
|
-
listItem.scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' });
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* @callback SearchAdapterTextFilter
|
|
131
|
-
* @param {string} input
|
|
132
|
-
* @param {string} content
|
|
133
|
-
* @return {boolean} passes
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* @template T
|
|
138
|
-
* @typedef SearchAdapterOptions
|
|
139
|
-
* @prop {Element} textfield
|
|
140
|
-
* @prop {Element} list
|
|
141
|
-
* @prop {('contains'|'startsWith'|SearchAdapterTextFilter)} [textFilter='contains']
|
|
142
|
-
* @prop {function(Element):string} [itemTextParser]
|
|
143
|
-
* @prop {boolean} [dropdown=false]
|
|
144
|
-
* @prop {boolean} [filterItems=true]
|
|
145
|
-
* @prop {('replace'|'append'|'none')} [suggestionMethod='replace']
|
|
146
|
-
* @prop {function(string):(Promise<T[]>)|T[]} [performSearch]
|
|
147
|
-
* @prop {function(T[]):(Promise<void>|void)} [updateList]
|
|
148
|
-
* @prop {boolean} [searchOnFocus=true]
|
|
149
|
-
* @prop {number} [debounce=null] Debounce time in milliseconds
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
/** @template T */
|
|
153
|
-
export default class SearchAdapter {
|
|
154
|
-
/** @param {SearchAdapterOptions<T>} options */
|
|
155
|
-
constructor(options) {
|
|
156
|
-
this.textfield = options.textfield;
|
|
157
|
-
this.list = options.list;
|
|
158
|
-
this.list.setAttribute('role', 'listbox');
|
|
159
|
-
List.attach(this.list);
|
|
160
|
-
if (typeof options.textFilter === 'function') {
|
|
161
|
-
this.filter = options.textFilter;
|
|
162
|
-
} else if (options.textFilter === 'startsWith') {
|
|
163
|
-
this.filter = startsWithTextFilter;
|
|
164
|
-
} else {
|
|
165
|
-
this.filter = containsTextFilter;
|
|
166
|
-
}
|
|
167
|
-
this.itemTextParser = defaultItemTextParser || options.itemTextParser;
|
|
168
|
-
const input = /** @type {HTMLInputElement} */ (this.textfield.getElementsByClassName('mdw-textfield__input')[0]);
|
|
169
|
-
this.input = input;
|
|
170
|
-
this.list.addEventListener(ListContent.ACTIVATE_EVENT, (event) => {
|
|
171
|
-
const item = /** @type {HTMLElement} */(event.target);
|
|
172
|
-
this.onItemSelected(item);
|
|
173
|
-
const inputValue = this.input.value || '';
|
|
174
|
-
this.suggestedInput = inputValue;
|
|
175
|
-
this.input.setSelectionRange(inputValue.length, inputValue.length);
|
|
176
|
-
this.input.focus();
|
|
177
|
-
this.hideDropDown();
|
|
178
|
-
});
|
|
179
|
-
this.input.addEventListener('keydown', (event) => {
|
|
180
|
-
this.onTextFieldKeydownEvent(event);
|
|
181
|
-
});
|
|
182
|
-
this.input.addEventListener('input', (event) => {
|
|
183
|
-
if (this.handleInputEvent) {
|
|
184
|
-
this.handleInputEvent(event);
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
this.input.addEventListener('blur', (event) => {
|
|
188
|
-
if (this.handleBlurEvent) {
|
|
189
|
-
this.handleBlurEvent(event);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
this.input.addEventListener('focus', (event) => {
|
|
193
|
-
if (this.searchOnFocus) {
|
|
194
|
-
this.handleInputEvent(event);
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
this.dropdown = options.dropdown;
|
|
199
|
-
if (options.filterItems !== false) {
|
|
200
|
-
this.filterItems = true;
|
|
201
|
-
}
|
|
202
|
-
if (options.searchOnFocus !== false) {
|
|
203
|
-
this.searchOnFocus = true;
|
|
204
|
-
}
|
|
205
|
-
this.debounce = options.debounce;
|
|
206
|
-
this.suggestionMethod = options.suggestionMethod || 'replace';
|
|
207
|
-
this.currentSearchTerm = this.input.value || '';
|
|
208
|
-
/** @type {?string} */
|
|
209
|
-
this.suggestedInput = null;
|
|
210
|
-
/** @type {?string} */
|
|
211
|
-
this.previousValue = null;
|
|
212
|
-
this.performSearch = options.performSearch || this.performSearch.bind(this);
|
|
213
|
-
this.updateList = options.updateList || this.updateList.bind(this);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* @param {string} value
|
|
218
|
-
* @return {Promise<T[]>|T[]}
|
|
219
|
-
*/
|
|
220
|
-
// eslint-disable-next-line class-methods-use-this
|
|
221
|
-
performSearch(value) {
|
|
222
|
-
return [];
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* @param {T[]} results
|
|
227
|
-
* @return {Promise<void>|void}
|
|
228
|
-
*/
|
|
229
|
-
// eslint-disable-next-line class-methods-use-this
|
|
230
|
-
updateList(results) {
|
|
231
|
-
return undefined;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* Default input handler
|
|
236
|
-
* @param {Event} [event]
|
|
237
|
-
* @return {void}
|
|
238
|
-
*/
|
|
239
|
-
handleInputEvent(event) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
240
|
-
if (document.activeElement !== this.input) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
const inputValue = this.input.value || '';
|
|
244
|
-
if (inputValue === this.suggestedInput) {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
this.showDropDown();
|
|
248
|
-
if (inputValue === this.previousValue) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
this.previousValue = inputValue;
|
|
252
|
-
this.currentSearchTerm = inputValue;
|
|
253
|
-
|
|
254
|
-
void (async () => {
|
|
255
|
-
try {
|
|
256
|
-
await this.performDebounce(inputValue);
|
|
257
|
-
await this.checkExpired(inputValue);
|
|
258
|
-
const searchResults = await this.performSearch(inputValue);
|
|
259
|
-
await this.checkExpired(inputValue);
|
|
260
|
-
await this.updateList(searchResults);
|
|
261
|
-
await this.filterListItems();
|
|
262
|
-
} catch (error) {
|
|
263
|
-
if (error.message === 'debounced') {
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
if (error.message === 'expired') {
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
throw error;
|
|
270
|
-
}
|
|
271
|
-
})();
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @param {string} inputValue
|
|
276
|
-
* @return {Promise<void>}
|
|
277
|
-
*/
|
|
278
|
-
checkExpired(inputValue) {
|
|
279
|
-
if (inputValue === this.currentSearchTerm) {
|
|
280
|
-
return Promise.resolve();
|
|
281
|
-
}
|
|
282
|
-
return Promise.reject(new Error('expired'));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* @param {string} searchTerm
|
|
287
|
-
* @return {Promise<void>}
|
|
288
|
-
*/
|
|
289
|
-
performDebounce(searchTerm) {
|
|
290
|
-
if (!this.debounce) {
|
|
291
|
-
return Promise.resolve();
|
|
292
|
-
}
|
|
293
|
-
return new Promise((resolve, reject) => {
|
|
294
|
-
setTimeout(() => {
|
|
295
|
-
if (searchTerm !== this.currentSearchTerm) {
|
|
296
|
-
reject(new Error('debounced'));
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
resolve();
|
|
300
|
-
}, this.debounce);
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
/** @return {boolean} handled */
|
|
305
|
-
showDropDown() {
|
|
306
|
-
if (!this.dropdown) {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
const dropDownElement = this.textfield.querySelector('.mdw-textfield__dropdown');
|
|
310
|
-
let changed = false;
|
|
311
|
-
if (dropDownElement.hasAttribute('mdw-hide')) {
|
|
312
|
-
dropDownElement.removeAttribute('mdw-hide');
|
|
313
|
-
changed = true;
|
|
314
|
-
}
|
|
315
|
-
if (!dropDownElement.hasAttribute('mdw-show')) {
|
|
316
|
-
dropDownElement.setAttribute('mdw-show', '');
|
|
317
|
-
changed = true;
|
|
318
|
-
}
|
|
319
|
-
return changed;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/** @return {boolean} handled */
|
|
323
|
-
isDropDownShown() {
|
|
324
|
-
if (!this.dropdown) {
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
const dropDownElement = this.textfield.querySelector('.mdw-textfield__dropdown');
|
|
328
|
-
if (dropDownElement.hasAttribute('mdw-hide')) {
|
|
329
|
-
return false;
|
|
330
|
-
}
|
|
331
|
-
if (this.input === document.activeElement) {
|
|
332
|
-
return true;
|
|
333
|
-
}
|
|
334
|
-
if (dropDownElement.hasAttribute('mdw-show')) {
|
|
335
|
-
return true;
|
|
336
|
-
}
|
|
337
|
-
return false;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
/** @return {boolean} handled */
|
|
341
|
-
hideDropDown() {
|
|
342
|
-
if (!this.dropdown) {
|
|
343
|
-
return true;
|
|
344
|
-
}
|
|
345
|
-
const dropDownElement = this.textfield.querySelector('.mdw-textfield__dropdown');
|
|
346
|
-
if (!dropDownElement.hasAttribute('mdw-hide')) {
|
|
347
|
-
dropDownElement.setAttribute('mdw-hide', '');
|
|
348
|
-
return true;
|
|
349
|
-
}
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* @param {Event|FocusEvent} event
|
|
355
|
-
* @return {void}
|
|
356
|
-
*/
|
|
357
|
-
handleBlurEvent(event) { // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
358
|
-
if (this.dropdown) {
|
|
359
|
-
const dropDownElement = this.textfield.querySelector('.mdw-textfield__dropdown');
|
|
360
|
-
if (dropDownElement.hasAttribute('mdw-show')) {
|
|
361
|
-
dropDownElement.removeAttribute('mdw-show');
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* @param {Element} item
|
|
368
|
-
* @return {void}
|
|
369
|
-
*/
|
|
370
|
-
onItemSelected(item) {
|
|
371
|
-
if (this.suggestionMethod === 'none') {
|
|
372
|
-
return;
|
|
373
|
-
}
|
|
374
|
-
let suggestion = this.itemTextParser(item);
|
|
375
|
-
if (suggestion) {
|
|
376
|
-
suggestion = suggestion.trim();
|
|
377
|
-
}
|
|
378
|
-
if (!suggestion) {
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
this.suggestedInput = suggestion;
|
|
382
|
-
if (this.suggestionMethod === 'replace') {
|
|
383
|
-
TextField.setValue(this.textfield, suggestion);
|
|
384
|
-
} else if (this.suggestionMethod === 'append') {
|
|
385
|
-
const selectionStart = (this.previousValue || '').length;
|
|
386
|
-
const selectionEnd = suggestion.length;
|
|
387
|
-
TextField.setValue(this.textfield, suggestion);
|
|
388
|
-
this.input.setSelectionRange(selectionStart, selectionEnd);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* @param {SearchAdapterTextFilter} [fnFilter]
|
|
394
|
-
* @return {void}
|
|
395
|
-
*/
|
|
396
|
-
filterListItems(fnFilter) {
|
|
397
|
-
if (!this.filterItems) {
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
const input = this.input.value;
|
|
401
|
-
const current = this.list.querySelector('[role="option"][aria-selected="true"]');
|
|
402
|
-
const items = this.list.querySelectorAll('[role="option"]');
|
|
403
|
-
let hasItem = false;
|
|
404
|
-
for (const item of items) {
|
|
405
|
-
const content = this.itemTextParser(item);
|
|
406
|
-
const fn = fnFilter || this.filter;
|
|
407
|
-
if (fn(input, content)) {
|
|
408
|
-
hasItem = true;
|
|
409
|
-
item.setAttribute('aria-hidden', 'false');
|
|
410
|
-
} else {
|
|
411
|
-
item.setAttribute('aria-hidden', 'true');
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
if (current && current.getAttribute('aria-hidden') === 'true') {
|
|
415
|
-
const newSelection = selectSibling(this.list);
|
|
416
|
-
if (newSelection) {
|
|
417
|
-
this.onItemSelected(newSelection);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
if (!hasItem) {
|
|
421
|
-
this.hideDropDown();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* @param {KeyboardEvent} event
|
|
427
|
-
* @return {void}
|
|
428
|
-
*/
|
|
429
|
-
onTextFieldKeydownEvent(event) {
|
|
430
|
-
if (event.defaultPrevented) {
|
|
431
|
-
return;
|
|
432
|
-
}
|
|
433
|
-
if (event.ctrlKey || event.altKey) {
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
switch (event.key) {
|
|
437
|
-
case 'ArrowUp':
|
|
438
|
-
case 'Up': {
|
|
439
|
-
if (this.isDropDownShown()) {
|
|
440
|
-
const sibling = selectSibling(this.list, true);
|
|
441
|
-
if (sibling) {
|
|
442
|
-
scrollItemIntoView(sibling);
|
|
443
|
-
this.onItemSelected(sibling);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
event.stopPropagation();
|
|
447
|
-
event.preventDefault();
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
450
|
-
case 'ArrowDown':
|
|
451
|
-
case 'Down': {
|
|
452
|
-
if (this.isDropDownShown()) {
|
|
453
|
-
const sibling = selectSibling(this.list, false);
|
|
454
|
-
if (sibling) {
|
|
455
|
-
scrollItemIntoView(sibling);
|
|
456
|
-
this.onItemSelected(sibling);
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
event.stopPropagation();
|
|
460
|
-
event.preventDefault();
|
|
461
|
-
break;
|
|
462
|
-
}
|
|
463
|
-
case 'Esc':
|
|
464
|
-
case 'Escape': {
|
|
465
|
-
if (this.hideDropDown()) {
|
|
466
|
-
this.suggestedInput = this.previousValue;
|
|
467
|
-
TextField.setValue(this.textfield, this.previousValue);
|
|
468
|
-
event.stopPropagation();
|
|
469
|
-
event.preventDefault();
|
|
470
|
-
}
|
|
471
|
-
break;
|
|
472
|
-
}
|
|
473
|
-
case 'Enter': {
|
|
474
|
-
/** @type {HTMLElement} */
|
|
475
|
-
const current = this.list.querySelector('[role="option"][aria-selected="true"]');
|
|
476
|
-
if (current && this.hideDropDown()) {
|
|
477
|
-
current.click();
|
|
478
|
-
event.stopPropagation();
|
|
479
|
-
event.preventDefault();
|
|
480
|
-
}
|
|
481
|
-
break;
|
|
482
|
-
}
|
|
483
|
-
case 'Tab': {
|
|
484
|
-
/** @type {HTMLElement} */
|
|
485
|
-
const current = this.list.querySelector('[role="option"][aria-selected="true"]');
|
|
486
|
-
if (current && this.hideDropDown()) {
|
|
487
|
-
current.click();
|
|
488
|
-
event.stopPropagation();
|
|
489
|
-
}
|
|
490
|
-
break;
|
|
491
|
-
}
|
|
492
|
-
default:
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
// https://material.io/guidelines/layout/structure.html#structure-app-bar
|
|
2
|
-
// https://material.io/archive/guidelines/components/toolbars.html
|
|
3
|
-
|
|
4
|
-
@use '../../core/_breakpoint.scss' as breakpoint;
|
|
5
|
-
@use '../../core/_length.scss' as *;
|
|
6
|
-
@use '../../core/_type.scss' as type;
|
|
7
|
-
|
|
8
|
-
:root {
|
|
9
|
-
--mdw-appbar__min-block-size: 64px;
|
|
10
|
-
--mdw-appbar__min-block-size__dense: 48px;
|
|
11
|
-
--mdw-appbar__min-block-size__prominent: 128px;
|
|
12
|
-
--mdw-appbar__min-block-size__prominent__dense: 96px;
|
|
13
|
-
--mdw-appbar__min-block-size__mobile: 56px;
|
|
14
|
-
--mdw-appbar__min-block-size__mobile__landscape: 48px;
|
|
15
|
-
--mdw-appbar__content-margin-inline: 24px;
|
|
16
|
-
--mdw-appbar__start-margin-inline-start: 8px;
|
|
17
|
-
@include breakpoint.has16DPMargin() {
|
|
18
|
-
--mdw-appbar__content-margin-inline: 16px;
|
|
19
|
-
--mdw-appbar__start-margin-inline-start: 0;
|
|
20
|
-
}
|
|
21
|
-
@include breakpoint.maxTabletDevice {
|
|
22
|
-
// No high density on mobile
|
|
23
|
-
--mdw-appbar__min-block-size: var(--mdw-appbar__min-block-size__mobile);
|
|
24
|
-
--mdw-appbar__min-block-size__dense: var(--mdw-appbar__min-block-size__mobile);
|
|
25
|
-
--mdw-appbar__min-block-size__prominent__dense: var(--mdw-appbar__min-block-size__prominent);
|
|
26
|
-
}
|
|
27
|
-
@include breakpoint.isMobileDeviceLandscape {
|
|
28
|
-
--mdw-appbar__min-block-size: var(--mdw-appbar__min-block-size__mobile__landscape);
|
|
29
|
-
--mdw-appbar__min-block-size__dense: var(--mdw-appbar__min-block-size__mobile__landscape);
|
|
30
|
-
}
|
|
31
|
-
--mdw-appbar__icon-min-block-size: 40px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.mdw-appbar {
|
|
35
|
-
display: grid;
|
|
36
|
-
|
|
37
|
-
grid-template-columns: auto 1fr auto;
|
|
38
|
-
grid-template-rows: auto auto;
|
|
39
|
-
|
|
40
|
-
min-block-size: var(--mdw-appbar__min-block-size);
|
|
41
|
-
|
|
42
|
-
transition-duration: inherit;
|
|
43
|
-
transition-property: min-block-size;
|
|
44
|
-
transition-timing-function: inherit;
|
|
45
|
-
|
|
46
|
-
z-index: 1;
|
|
47
|
-
|
|
48
|
-
&[mdw-centered] {
|
|
49
|
-
grid-template-columns: minmax(auto, 1fr) minmax(0, auto) minmax(auto, 1fr);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
&[mdw-dense] {
|
|
53
|
-
--mdw-appbar__min-block-size: var(--mdw-appbar__min-block-size__dense);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.mdw-appbar__action {
|
|
58
|
-
display: grid;
|
|
59
|
-
grid-template-columns: auto 1fr auto;
|
|
60
|
-
|
|
61
|
-
min-block-size: var(--mdw-appbar__min-block-size);
|
|
62
|
-
|
|
63
|
-
transition-duration: inherit;
|
|
64
|
-
transition-property: min-block-size;
|
|
65
|
-
transition-timing-function: inherit;
|
|
66
|
-
|
|
67
|
-
z-index: 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.mdw-appbar__content {
|
|
71
|
-
display: flex;
|
|
72
|
-
flex-direction: column;
|
|
73
|
-
|
|
74
|
-
grid-column: 1 / span 3;
|
|
75
|
-
grid-row: 2;
|
|
76
|
-
|
|
77
|
-
margin-inline: var(--mdw-appbar__content-margin-inline);
|
|
78
|
-
padding-inline-start: 56px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.mdw-appbar__title {
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
|
|
85
|
-
align-self: center;
|
|
86
|
-
|
|
87
|
-
grid-column: 2;
|
|
88
|
-
grid-row: 1 / span 2;
|
|
89
|
-
|
|
90
|
-
overflow: hidden;
|
|
91
|
-
|
|
92
|
-
min-block-size: auto;
|
|
93
|
-
|
|
94
|
-
block-size: auto;
|
|
95
|
-
margin: 0 16px;
|
|
96
|
-
|
|
97
|
-
transition-duration: inherit;
|
|
98
|
-
transition-property: font, letter-spacing, margin-block-size;
|
|
99
|
-
transition-timing-function: inherit;
|
|
100
|
-
|
|
101
|
-
text-overflow: ellipsis;
|
|
102
|
-
white-space: nowrap;
|
|
103
|
-
|
|
104
|
-
@include type.addRules('h6');
|
|
105
|
-
|
|
106
|
-
// TODO: Use CSS Variables instead of nesting
|
|
107
|
-
.mdw-appbar[mdw-prominent] & {
|
|
108
|
-
min-block-size: var(--mdw-appbar__min-block-size__prominent);
|
|
109
|
-
|
|
110
|
-
white-space: normal;
|
|
111
|
-
@include type.addRules('h5');
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.mdw-appbar[mdw-prominent][mdw-dense] & {
|
|
115
|
-
min-block-size: var(--mdw-appbar__min-block-size__prominent__dense);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
&[mdw-custom] {
|
|
119
|
-
margin-block-start: 0;
|
|
120
|
-
|
|
121
|
-
&::after {
|
|
122
|
-
display: none;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.mdw-appbar__start {
|
|
128
|
-
grid-column: 1;
|
|
129
|
-
|
|
130
|
-
margin-inline-start: var(--mdw-appbar__start-margin-inline-start);
|
|
131
|
-
|
|
132
|
-
padding-inline: 8px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.mdw-appbar__end {
|
|
136
|
-
grid-column: 3;
|
|
137
|
-
justify-content: flex-end;
|
|
138
|
-
|
|
139
|
-
margin-inline-end: -12px;
|
|
140
|
-
padding-inline-end: var(--mdw-appbar__content-margin-inline);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.mdw-appbar__start,
|
|
144
|
-
.mdw-appbar__end {
|
|
145
|
-
display: flex;
|
|
146
|
-
align-items: center;
|
|
147
|
-
flex-direction: row;
|
|
148
|
-
grid-row: 1/1;
|
|
149
|
-
|
|
150
|
-
min-block-size: inherit;
|
|
151
|
-
|
|
152
|
-
transition-property: margin-block-start;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.mdw-appbar__start .mdw-button {
|
|
156
|
-
margin: 0;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.mdw-appbar__end .mdw-button {
|
|
160
|
-
margin: 0 4px;
|
|
161
|
-
|
|
162
|
-
&[mdw-more-button] {
|
|
163
|
-
margin-inline-end: -2px;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
File without changes
|