@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/core/theme/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @param {Element} element
|
|
3
|
-
* @param {string} palette
|
|
4
|
-
* @param {''|'light'|'contrast'|'A100'|'A200'|'A400'|'A700'} [tone='']
|
|
5
|
-
* @param {''|'solid'|'high'|'medium'|'inactive'|'divider'} [opacity='']
|
|
6
|
-
* @return {void}
|
|
7
|
-
*/
|
|
8
|
-
export function setInk(element, palette, tone, opacity) {
|
|
9
|
-
if (tone) {
|
|
10
|
-
if (opacity) {
|
|
11
|
-
element.setAttribute('mdw-ink', `${palette} ${tone} ${opacity}`);
|
|
12
|
-
} else {
|
|
13
|
-
element.setAttribute('mdw-ink', `${palette} ${tone}`);
|
|
14
|
-
}
|
|
15
|
-
} else if (opacity) {
|
|
16
|
-
element.setAttribute('mdw-ink', `${palette} ${opacity}`);
|
|
17
|
-
} else {
|
|
18
|
-
element.setAttribute('mdw-ink', palette);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param {Element} element
|
|
24
|
-
* @return {void}
|
|
25
|
-
*/
|
|
26
|
-
export function removeInk(element) {
|
|
27
|
-
element.removeAttribute('mdw-ink');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* @param {Element} element
|
|
32
|
-
* @param {string} palette
|
|
33
|
-
* @param {''|'alt'|'50'|'100'|'200'|'300'|'400'|'500'|'600'|'700'|'800'|'900'} [tone='']
|
|
34
|
-
* @return {void}
|
|
35
|
-
*/
|
|
36
|
-
export function setSurface(element, palette, tone) {
|
|
37
|
-
if (tone) {
|
|
38
|
-
element.setAttribute('mdw-surface', `${palette} ${tone}`);
|
|
39
|
-
} else {
|
|
40
|
-
element.setAttribute('mdw-surface', palette);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @param {Element} element
|
|
46
|
-
* @return {void}
|
|
47
|
-
*/
|
|
48
|
-
export function removeSurface(element) {
|
|
49
|
-
element.removeAttribute('mdw-surface');
|
|
50
|
-
}
|
package/core/theme/index.scss
DELETED
package/core/throttler.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export default class Throttler {
|
|
2
|
-
/** @param {number} throttleTimeMs */
|
|
3
|
-
constructor(throttleTimeMs) {
|
|
4
|
-
this.pending = false;
|
|
5
|
-
this.queued = false;
|
|
6
|
-
this.queue = null;
|
|
7
|
-
this.throttleTimeMs = throttleTimeMs;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
abort() {
|
|
11
|
-
if (this.queue) {
|
|
12
|
-
clearTimeout(this.queue);
|
|
13
|
-
this.queue = null;
|
|
14
|
-
}
|
|
15
|
-
this.pending = false;
|
|
16
|
-
this.queued = false;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @param {Function} fn
|
|
21
|
-
* @return {void}
|
|
22
|
-
*/
|
|
23
|
-
run(fn) {
|
|
24
|
-
if (this.pending) {
|
|
25
|
-
this.queued = true;
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (this.queue) {
|
|
29
|
-
clearTimeout(this.queue);
|
|
30
|
-
this.queue = null;
|
|
31
|
-
}
|
|
32
|
-
this.queued = false;
|
|
33
|
-
this.pending = true;
|
|
34
|
-
this.queue = setTimeout(() => {
|
|
35
|
-
this.pending = false;
|
|
36
|
-
if (this.queued) {
|
|
37
|
-
this.run(fn);
|
|
38
|
-
}
|
|
39
|
-
}, this.throttleTimeMs);
|
|
40
|
-
fn();
|
|
41
|
-
}
|
|
42
|
-
}
|
package/core/transition/index.js
DELETED
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
// https://material.io/design/navigation/navigation-transitions.html
|
|
2
|
-
|
|
3
|
-
const EXPAND_DURATION_MS = 300;
|
|
4
|
-
const COLLAPSE_DURATION_MS = 250;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {Object} ShapeTranformDetails
|
|
8
|
-
* @prop {number} originWidth
|
|
9
|
-
* @prop {number} originHeight
|
|
10
|
-
* @prop {number} translateX
|
|
11
|
-
* @prop {number} translateY
|
|
12
|
-
* @prop {number} scaleX
|
|
13
|
-
* @prop {number} scaleY
|
|
14
|
-
* @prop {function():string} toString
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @param {string} px
|
|
19
|
-
* @return {number}
|
|
20
|
-
*/
|
|
21
|
-
function pxToInteger(px) {
|
|
22
|
-
if (!px) {
|
|
23
|
-
return 0;
|
|
24
|
-
}
|
|
25
|
-
return Number.parseInt(px, 10);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param {string} stringValue
|
|
30
|
-
* @param {number} scaleX
|
|
31
|
-
* @param {number} scaleY
|
|
32
|
-
* @return {string}
|
|
33
|
-
*/
|
|
34
|
-
function convertBoxShadow(stringValue, scaleX, scaleY) {
|
|
35
|
-
/**
|
|
36
|
-
* @param {string} shadow
|
|
37
|
-
* @return {string}
|
|
38
|
-
*/
|
|
39
|
-
function convertShadow(shadow) {
|
|
40
|
-
let inset = '';
|
|
41
|
-
let offsetX = '';
|
|
42
|
-
let offsetY = '';
|
|
43
|
-
let blurRadius = '';
|
|
44
|
-
let spreadRadius = '';
|
|
45
|
-
let color = '';
|
|
46
|
-
for (const value of shadow.trim().split(' ')) {
|
|
47
|
-
if (value.toLowerCase() === 'inset') {
|
|
48
|
-
inset = value;
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
if (value.includes('(') || !value.match(/\d/).length) {
|
|
52
|
-
color = value;
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const numberValue = pxToInteger(value);
|
|
56
|
-
if (!offsetX) {
|
|
57
|
-
offsetX = `${numberValue / scaleX}${value.replace(/[\d.\\]/g, '')}`;
|
|
58
|
-
} else if (!offsetY) {
|
|
59
|
-
offsetY = `${numberValue / scaleY}${value.replace(/[\d.\\]/g, '')}`;
|
|
60
|
-
} else if (!blurRadius) {
|
|
61
|
-
blurRadius = `${numberValue / (scaleX * scaleY)}${value.replace(/[\d.\\-]/g, '')}`;
|
|
62
|
-
} else {
|
|
63
|
-
spreadRadius = `${numberValue / (scaleX * scaleY)}${value.replace(/[\d.\\-]/g, '')}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return [
|
|
67
|
-
inset,
|
|
68
|
-
offsetX,
|
|
69
|
-
offsetY,
|
|
70
|
-
blurRadius,
|
|
71
|
-
spreadRadius,
|
|
72
|
-
color,
|
|
73
|
-
].filter(Boolean).join(' ');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!stringValue) {
|
|
77
|
-
return '';
|
|
78
|
-
}
|
|
79
|
-
return stringValue
|
|
80
|
-
// Strip spaces from anything parenthesized
|
|
81
|
-
.replace(/\([^)]+\)/g, (substring) => substring.replace(/ /g, ''))
|
|
82
|
-
// Split shadows by commas no inside parentheses
|
|
83
|
-
.match(/[^(,]+\([^)]+\)?[^,]*(|$)/g)
|
|
84
|
-
// Convert values
|
|
85
|
-
.map((shadow) => convertShadow(shadow))
|
|
86
|
-
// Rejoin shadows
|
|
87
|
-
.join(', ');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* @param {string} value
|
|
92
|
-
* @param {number} length
|
|
93
|
-
* @return {number}
|
|
94
|
-
*/
|
|
95
|
-
function parsePercentage(value, length) {
|
|
96
|
-
const numValue = pxToInteger(value);
|
|
97
|
-
if (!value.includes('%')) {
|
|
98
|
-
return numValue;
|
|
99
|
-
}
|
|
100
|
-
return ((numValue * length) / 100);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @param {string} stringValue
|
|
105
|
-
* @param {number} width
|
|
106
|
-
* @param {number} height
|
|
107
|
-
* @return {{horizontal:number, vertical:number}}
|
|
108
|
-
*/
|
|
109
|
-
function convertBorderRadius(stringValue, width, height) {
|
|
110
|
-
if (!stringValue) {
|
|
111
|
-
return {
|
|
112
|
-
horizontal: 0,
|
|
113
|
-
vertical: 0,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const split = stringValue.split(' ');
|
|
118
|
-
if (split.length === 1) {
|
|
119
|
-
return {
|
|
120
|
-
horizontal: parsePercentage(stringValue, width),
|
|
121
|
-
vertical: parsePercentage(stringValue, height),
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
horizontal: parsePercentage(split[0], width),
|
|
126
|
-
vertical: parsePercentage(split[1], height),
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* @param {HTMLElement} targetElement
|
|
132
|
-
* @param {HTMLElement} originElement
|
|
133
|
-
* @param {CSSStyleDeclaration} [originStyle]
|
|
134
|
-
* @return {ShapeTranformDetails}
|
|
135
|
-
*/
|
|
136
|
-
export function getShapeTransform(targetElement, originElement, originStyle) {
|
|
137
|
-
const originRect = originElement.getBoundingClientRect();
|
|
138
|
-
const targetRect = targetElement.getBoundingClientRect();
|
|
139
|
-
const originCSSStyle = originStyle || window.getComputedStyle(originElement);
|
|
140
|
-
|
|
141
|
-
let originX = originRect.left;
|
|
142
|
-
let originWidth = originRect.width;
|
|
143
|
-
let originY = originRect.top;
|
|
144
|
-
let originHeight = originRect.height;
|
|
145
|
-
if (originCSSStyle.boxSizing === 'border-box') {
|
|
146
|
-
const paddingTop = pxToInteger(originCSSStyle.paddingTop);
|
|
147
|
-
const paddingRight = pxToInteger(originCSSStyle.paddingRight);
|
|
148
|
-
const paddingBottom = pxToInteger(originCSSStyle.paddingBottom);
|
|
149
|
-
const paddingLeft = pxToInteger(originCSSStyle.paddingLeft);
|
|
150
|
-
originX += paddingLeft;
|
|
151
|
-
originWidth -= (paddingLeft + paddingRight);
|
|
152
|
-
originY += paddingTop;
|
|
153
|
-
originHeight -= (paddingTop + paddingBottom);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return {
|
|
157
|
-
originWidth,
|
|
158
|
-
originHeight,
|
|
159
|
-
translateX: originX - targetRect.left,
|
|
160
|
-
translateY: originY - targetRect.top,
|
|
161
|
-
scaleX: originWidth / targetRect.width,
|
|
162
|
-
scaleY: originHeight / targetRect.height,
|
|
163
|
-
toString() {
|
|
164
|
-
return [
|
|
165
|
-
`translateX(${this.translateX}px)`,
|
|
166
|
-
`translateY(${this.translateY}px)`,
|
|
167
|
-
`scaleX(${this.scaleX})`,
|
|
168
|
-
`scaleY(${this.scaleY})`,
|
|
169
|
-
].join(' ');
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @param {HTMLElement} element
|
|
176
|
-
* @param {string} property
|
|
177
|
-
* @param {function(TransitionEvent):void} callback
|
|
178
|
-
* @param {number} [expectedDuration]
|
|
179
|
-
* @return {Function} removeListener
|
|
180
|
-
*/
|
|
181
|
-
function buildTransitionEndListener(element, property, callback, expectedDuration) {
|
|
182
|
-
let hasEnded = false;
|
|
183
|
-
const onTransitionEnd = (/** @type {TransitionEvent} */ event) => {
|
|
184
|
-
if (event.propertyName !== property) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
hasEnded = true;
|
|
188
|
-
element.removeEventListener('transitionend', onTransitionEnd);
|
|
189
|
-
callback(event);
|
|
190
|
-
};
|
|
191
|
-
element.addEventListener('transitionend', onTransitionEnd);
|
|
192
|
-
if (expectedDuration) {
|
|
193
|
-
setTimeout(() => {
|
|
194
|
-
element.removeEventListener('transitionend', onTransitionEnd);
|
|
195
|
-
if (!hasEnded) {
|
|
196
|
-
callback(null);
|
|
197
|
-
}
|
|
198
|
-
}, expectedDuration + 500);
|
|
199
|
-
}
|
|
200
|
-
return () => {
|
|
201
|
-
element.removeEventListener('transitionend', onTransitionEnd);
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* @typedef {Object} TransitionElementOptions
|
|
207
|
-
* @prop {HTMLElement} fromShapeElement
|
|
208
|
-
* @prop {HTMLElement} toShapeElement
|
|
209
|
-
* @prop {HTMLElement} fromContentElement
|
|
210
|
-
* @prop {HTMLElement} toContentElement
|
|
211
|
-
* @prop {number} [duration=250|300] (250ms collapse or 300ms expand)
|
|
212
|
-
* @prop {boolean} [revertFrom=false] Revert from elements on completion
|
|
213
|
-
* @prop {function(TransitionElementOptions):any} [onTransitionEnd]
|
|
214
|
-
* @prop {function(TransitionElementOptions):any} [onComplete]
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* @param {TransitionElementOptions} options
|
|
219
|
-
* @return {function():void} revertAllElements()
|
|
220
|
-
*/
|
|
221
|
-
export function transitionElement(options) {
|
|
222
|
-
const toStyleSyle = window.getComputedStyle(options.toShapeElement);
|
|
223
|
-
|
|
224
|
-
const shapeTransform = getShapeTransform(options.fromShapeElement, options.toShapeElement, toStyleSyle);
|
|
225
|
-
const contentTransform = getShapeTransform(options.toContentElement, options.fromContentElement);
|
|
226
|
-
|
|
227
|
-
const transitionProperties = [
|
|
228
|
-
'transition',
|
|
229
|
-
'transform-origin',
|
|
230
|
-
'transform',
|
|
231
|
-
'background-color',
|
|
232
|
-
'border-radius',
|
|
233
|
-
'box-shadow',
|
|
234
|
-
'z-index',
|
|
235
|
-
'filter',
|
|
236
|
-
'opacity',
|
|
237
|
-
'visibility',
|
|
238
|
-
];
|
|
239
|
-
|
|
240
|
-
/** @type {Record<string,string>} */
|
|
241
|
-
const oldFromShapeProperties = {};
|
|
242
|
-
/** @type {Record<string,string>} */
|
|
243
|
-
const oldToShapeProperties = {};
|
|
244
|
-
/** @type {Record<string,string>} */
|
|
245
|
-
const oldFromContentProperties = {};
|
|
246
|
-
/** @type {Record<string,string>} */
|
|
247
|
-
const oldToContentProperties = {};
|
|
248
|
-
/** @type {Record<string,string>} */
|
|
249
|
-
const newFromShapeProperties = {};
|
|
250
|
-
for (const prop of transitionProperties) {
|
|
251
|
-
oldFromShapeProperties[prop] = options.fromShapeElement.style.getPropertyValue(prop);
|
|
252
|
-
oldToShapeProperties[prop] = options.toShapeElement.style.getPropertyValue(prop);
|
|
253
|
-
oldFromContentProperties[prop] = options.fromContentElement.style.getPropertyValue(prop);
|
|
254
|
-
oldToContentProperties[prop] = options.toContentElement.style.getPropertyValue(prop);
|
|
255
|
-
if (prop === 'box-shadow') {
|
|
256
|
-
newFromShapeProperties[prop] = convertBoxShadow(
|
|
257
|
-
toStyleSyle.getPropertyValue(prop),
|
|
258
|
-
shapeTransform.scaleX,
|
|
259
|
-
shapeTransform.scaleY,
|
|
260
|
-
);
|
|
261
|
-
} else if (prop === 'border-radius') {
|
|
262
|
-
const topLeft = convertBorderRadius(
|
|
263
|
-
toStyleSyle.getPropertyValue('border-top-left-radius'),
|
|
264
|
-
shapeTransform.originWidth,
|
|
265
|
-
shapeTransform.originHeight,
|
|
266
|
-
);
|
|
267
|
-
const topRight = convertBorderRadius(
|
|
268
|
-
toStyleSyle.getPropertyValue('border-top-right-radius'),
|
|
269
|
-
shapeTransform.originWidth,
|
|
270
|
-
shapeTransform.originHeight,
|
|
271
|
-
);
|
|
272
|
-
const bottomLeft = convertBorderRadius(
|
|
273
|
-
toStyleSyle.getPropertyValue('border-bottom-left-radius'),
|
|
274
|
-
shapeTransform.originWidth,
|
|
275
|
-
shapeTransform.originHeight,
|
|
276
|
-
);
|
|
277
|
-
const bottomRight = convertBorderRadius(
|
|
278
|
-
toStyleSyle.getPropertyValue('border-bottom-right-radius'),
|
|
279
|
-
shapeTransform.originWidth,
|
|
280
|
-
shapeTransform.originHeight,
|
|
281
|
-
);
|
|
282
|
-
const horizontalRadii = [
|
|
283
|
-
`${topLeft.horizontal / shapeTransform.scaleX}px`,
|
|
284
|
-
`${topRight.horizontal / shapeTransform.scaleX}px`,
|
|
285
|
-
`${bottomLeft.horizontal / shapeTransform.scaleX}px`,
|
|
286
|
-
`${bottomRight.horizontal / shapeTransform.scaleX}px`,
|
|
287
|
-
].join(' ');
|
|
288
|
-
const verticalRadii = [
|
|
289
|
-
`${topLeft.vertical / shapeTransform.scaleY}px`,
|
|
290
|
-
`${topRight.vertical / shapeTransform.scaleY}px`,
|
|
291
|
-
`${bottomLeft.vertical / shapeTransform.scaleY}px`,
|
|
292
|
-
`${bottomRight.vertical / shapeTransform.scaleY}px`,
|
|
293
|
-
].join(' ');
|
|
294
|
-
newFromShapeProperties[prop] = `${horizontalRadii} / ${verticalRadii}`;
|
|
295
|
-
} else {
|
|
296
|
-
newFromShapeProperties[prop] = toStyleSyle.getPropertyValue(prop);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
options.fromShapeElement.setAttribute('mdw-transition-busy', '');
|
|
301
|
-
options.toShapeElement.setAttribute('mdw-transition-busy', '');
|
|
302
|
-
options.toContentElement.setAttribute('mdw-transition-busy', '');
|
|
303
|
-
options.fromContentElement.setAttribute('mdw-transition-busy', '');
|
|
304
|
-
|
|
305
|
-
// Hide toContentElement and overlay over fromContentElement immediately
|
|
306
|
-
options.toContentElement.style.setProperty('opacity', '0');
|
|
307
|
-
options.toContentElement.style.setProperty('transition', 'none');
|
|
308
|
-
options.toContentElement.style.setProperty('transform-origin', '0 0 0');
|
|
309
|
-
options.toContentElement.style.setProperty('transform', contentTransform.toString());
|
|
310
|
-
options.toContentElement.style.setProperty('z-index', '9');
|
|
311
|
-
options.toContentElement.style.setProperty('visibility', 'visible');
|
|
312
|
-
|
|
313
|
-
options.fromContentElement.style.setProperty('opacity', '1');
|
|
314
|
-
|
|
315
|
-
options.fromShapeElement.style.setProperty('transition', 'none');
|
|
316
|
-
options.fromShapeElement.style.setProperty('transform-origin', '0 0 0');
|
|
317
|
-
options.fromShapeElement.style.setProperty('transform', 'none');
|
|
318
|
-
options.fromShapeElement.style.setProperty('z-index', '8');
|
|
319
|
-
|
|
320
|
-
options.toShapeElement.style.setProperty('background-color', 'transparent');
|
|
321
|
-
options.toShapeElement.style.setProperty('filter', 'none');
|
|
322
|
-
options.toShapeElement.style.setProperty('box-shadow', 'none');
|
|
323
|
-
options.toShapeElement.style.setProperty('visibility', 'visible');
|
|
324
|
-
|
|
325
|
-
const revertFunction = () => {
|
|
326
|
-
for (const prop of transitionProperties) {
|
|
327
|
-
if (oldFromShapeProperties[prop] == null) {
|
|
328
|
-
options.fromShapeElement.style.removeProperty(prop);
|
|
329
|
-
} else {
|
|
330
|
-
options.fromShapeElement.style.setProperty(prop, oldFromShapeProperties[prop]);
|
|
331
|
-
}
|
|
332
|
-
if (oldToShapeProperties[prop] == null) {
|
|
333
|
-
options.toShapeElement.style.removeProperty(prop);
|
|
334
|
-
} else {
|
|
335
|
-
options.toShapeElement.style.setProperty(prop, oldToShapeProperties[prop]);
|
|
336
|
-
}
|
|
337
|
-
if (oldFromContentProperties[prop] == null) {
|
|
338
|
-
options.fromContentElement.style.removeProperty(prop);
|
|
339
|
-
} else {
|
|
340
|
-
options.fromContentElement.style.setProperty(prop, oldFromContentProperties[prop]);
|
|
341
|
-
}
|
|
342
|
-
if (oldToContentProperties[prop] == null) {
|
|
343
|
-
options.toContentElement.style.removeProperty(prop);
|
|
344
|
-
} else {
|
|
345
|
-
options.toContentElement.style.setProperty(prop, oldToContentProperties[prop]);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
requestAnimationFrame(() => {
|
|
351
|
-
requestAnimationFrame(() => {
|
|
352
|
-
const calculatedDuration = options.duration
|
|
353
|
-
?? ((shapeTransform.scaleX * shapeTransform.scaleY >= 1) ? EXPAND_DURATION_MS : COLLAPSE_DURATION_MS);
|
|
354
|
-
const totalDuration = calculatedDuration.toString(10);
|
|
355
|
-
const fadeInTime = (calculatedDuration * 0.7).toString(10);
|
|
356
|
-
const fadeOutTime = (calculatedDuration * 0.3).toString(10);
|
|
357
|
-
const transformTransition = transitionProperties
|
|
358
|
-
.filter((prop) => prop !== 'transform-origin' && prop !== 'opacity' && prop !== 'transition')
|
|
359
|
-
.map((prop) => `${prop} ${totalDuration}ms cubic-bezier(0.4, 0.0, 0.2, 1) 0s`)
|
|
360
|
-
.join(', ');
|
|
361
|
-
const fadeInTransition = `opacity ${fadeInTime}ms cubic-bezier(0.0, 0.0, 0.2, 1) ${fadeOutTime}ms`;
|
|
362
|
-
const fadeOutTransition = [
|
|
363
|
-
`opacity ${fadeOutTime}ms cubic-bezier(0.0, 0.0, 0.2, 1) 0ms`,
|
|
364
|
-
`visibility ${fadeOutTime}ms cubic-bezier(0.0, 0.0, 0.2, 1) 0ms`,
|
|
365
|
-
].join(', ');
|
|
366
|
-
|
|
367
|
-
options.fromShapeElement.style.setProperty('transition', transformTransition);
|
|
368
|
-
for (const prop of transitionProperties) {
|
|
369
|
-
switch (prop) {
|
|
370
|
-
case 'transform': {
|
|
371
|
-
options.fromShapeElement.style.setProperty('transform', shapeTransform.toString());
|
|
372
|
-
continue;
|
|
373
|
-
}
|
|
374
|
-
case 'transition': continue;
|
|
375
|
-
case 'transform-origin':
|
|
376
|
-
options.fromShapeElement.style.setProperty('transform-origin', '0 0 0');
|
|
377
|
-
continue;
|
|
378
|
-
case 'z-index':
|
|
379
|
-
options.fromShapeElement.style.setProperty('z-index', '8');
|
|
380
|
-
continue;
|
|
381
|
-
case 'visibility':
|
|
382
|
-
options.fromShapeElement.style.setProperty('visibility', 'hidden');
|
|
383
|
-
continue;
|
|
384
|
-
default:
|
|
385
|
-
if (newFromShapeProperties[prop] == null) {
|
|
386
|
-
options.fromShapeElement.style.removeProperty(prop);
|
|
387
|
-
} else {
|
|
388
|
-
options.fromShapeElement.style.setProperty(prop, newFromShapeProperties[prop]);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
requestAnimationFrame(() => {
|
|
394
|
-
buildTransitionEndListener(options.fromShapeElement, 'transform', () => {
|
|
395
|
-
for (const prop of transitionProperties) {
|
|
396
|
-
if (prop === 'transition') {
|
|
397
|
-
options.toShapeElement.style.setProperty('transition', 'none');
|
|
398
|
-
options.toContentElement.style.setProperty('transition', 'none');
|
|
399
|
-
} else {
|
|
400
|
-
if (oldToShapeProperties[prop] == null) {
|
|
401
|
-
options.toShapeElement.style.removeProperty(prop);
|
|
402
|
-
} else {
|
|
403
|
-
options.toShapeElement.style.setProperty(prop, oldToShapeProperties[prop]);
|
|
404
|
-
}
|
|
405
|
-
if (oldToContentProperties[prop] == null) {
|
|
406
|
-
options.toContentElement.style.removeProperty(prop);
|
|
407
|
-
} else {
|
|
408
|
-
options.toContentElement.style.setProperty(prop, oldToContentProperties[prop]);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
if (prop === 'visibility' && !options.revertFrom) continue;
|
|
413
|
-
|
|
414
|
-
if (oldFromContentProperties[prop] == null) {
|
|
415
|
-
options.fromContentElement.style.removeProperty(prop);
|
|
416
|
-
} else {
|
|
417
|
-
options.fromContentElement.style.setProperty(prop, oldFromContentProperties[prop]);
|
|
418
|
-
}
|
|
419
|
-
if (oldFromShapeProperties[prop] == null) {
|
|
420
|
-
options.fromShapeElement.style.removeProperty(prop);
|
|
421
|
-
} else {
|
|
422
|
-
options.fromShapeElement.style.setProperty(prop, oldFromShapeProperties[prop]);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
if (options.onTransitionEnd) {
|
|
426
|
-
options.onTransitionEnd(options);
|
|
427
|
-
}
|
|
428
|
-
requestAnimationFrame(() => {
|
|
429
|
-
if (oldToShapeProperties.transition == null) {
|
|
430
|
-
options.toShapeElement.style.removeProperty('transition');
|
|
431
|
-
} else {
|
|
432
|
-
options.toShapeElement.style.setProperty('transition', oldToShapeProperties.transition);
|
|
433
|
-
}
|
|
434
|
-
if (oldToContentProperties.transition == null) {
|
|
435
|
-
options.toContentElement.style.removeProperty('transition');
|
|
436
|
-
} else {
|
|
437
|
-
options.toContentElement.style.setProperty('transition', oldToContentProperties.transition);
|
|
438
|
-
}
|
|
439
|
-
options.fromShapeElement.removeAttribute('mdw-transition-busy');
|
|
440
|
-
options.toShapeElement.removeAttribute('mdw-transition-busy');
|
|
441
|
-
options.toContentElement.removeAttribute('mdw-transition-busy');
|
|
442
|
-
options.fromContentElement.removeAttribute('mdw-transition-busy');
|
|
443
|
-
if (options.onComplete) {
|
|
444
|
-
options.onComplete(options);
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
}, calculatedDuration);
|
|
448
|
-
});
|
|
449
|
-
|
|
450
|
-
// Fade out fromContent while shaping into new content
|
|
451
|
-
options.fromContentElement.style.setProperty('transition', fadeOutTransition);
|
|
452
|
-
options.fromContentElement.style.setProperty('opacity', '0');
|
|
453
|
-
options.fromContentElement.style.setProperty('visibility', 'hidden');
|
|
454
|
-
|
|
455
|
-
options.toContentElement.style.setProperty('transition', [
|
|
456
|
-
transformTransition,
|
|
457
|
-
fadeInTransition,
|
|
458
|
-
].join(', '));
|
|
459
|
-
options.toContentElement.style.setProperty('opacity', '1');
|
|
460
|
-
options.toContentElement.style.setProperty('transform', 'none');
|
|
461
|
-
});
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
return revertFunction;
|
|
465
|
-
}
|
package/docs/_flex.scss
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
.display-flex {
|
|
2
|
-
display: flex;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.flex-column {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
[flex-column] {
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[flex-justify-content="center"] {
|
|
15
|
-
justify-content: center;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
[flex-align-items="center"] {
|
|
19
|
-
align-items: center;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.flex-wrap {
|
|
23
|
-
flex-wrap: wrap;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.flex-1 {
|
|
27
|
-
flex: 1;
|
|
28
|
-
}
|