@studiometa/js-toolkit 2.11.2 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Base/Base.d.ts +2 -2
- package/Base/Base.js +142 -79
- package/Base/Base.js.map +2 -2
- package/Base/features.d.ts +10 -2
- package/Base/features.js +23 -1
- package/Base/features.js.map +2 -2
- package/Base/managers/AbstractManager.d.ts +3 -3
- package/Base/managers/AbstractManager.js +21 -0
- package/Base/managers/AbstractManager.js.map +1 -1
- package/Base/managers/ActionManager.d.ts +4 -0
- package/Base/managers/ActionManager.js +10 -0
- package/Base/managers/ActionManager.js.map +7 -0
- package/Base/managers/ChildrenManager.d.ts +1 -1
- package/Base/managers/ChildrenManager.js +41 -8
- package/Base/managers/ChildrenManager.js.map +2 -2
- package/Base/managers/EventsManager.js +88 -7
- package/Base/managers/EventsManager.js.map +2 -2
- package/Base/managers/OptionsManager.js +25 -2
- package/Base/managers/OptionsManager.js.map +2 -2
- package/Base/managers/RefsManager.js +27 -6
- package/Base/managers/RefsManager.js.map +2 -2
- package/Base/managers/ResponsiveOptionsManager.js +22 -6
- package/Base/managers/ResponsiveOptionsManager.js.map +2 -2
- package/Base/managers/ServicesManager.d.ts +2 -4
- package/Base/managers/ServicesManager.js +56 -7
- package/Base/managers/ServicesManager.js.map +2 -2
- package/Base/utils.js +5 -1
- package/Base/utils.js.map +2 -2
- package/decorators/index.d.ts +0 -1
- package/decorators/index.js +0 -1
- package/decorators/index.js.map +2 -2
- package/decorators/withBreakpointManager.js +14 -4
- package/decorators/withBreakpointManager.js.map +2 -2
- package/decorators/withBreakpointObserver.js +13 -3
- package/decorators/withBreakpointObserver.js.map +2 -2
- package/decorators/withDrag.js +6 -0
- package/decorators/withDrag.js.map +1 -1
- package/decorators/withExtraConfig.js +3 -0
- package/decorators/withExtraConfig.js.map +1 -1
- package/decorators/withFreezedOptions.js +8 -0
- package/decorators/withFreezedOptions.js.map +1 -1
- package/decorators/withIntersectionObserver.js +10 -1
- package/decorators/withIntersectionObserver.js.map +2 -2
- package/decorators/withMountOnMediaQuery.js +17 -1
- package/decorators/withMountOnMediaQuery.js.map +2 -2
- package/decorators/withMountWhenInView.js +22 -1
- package/decorators/withMountWhenInView.js.map +2 -2
- package/decorators/withRelativePointer.js +6 -0
- package/decorators/withRelativePointer.js.map +1 -1
- package/decorators/withResponsiveOptions.js +3 -0
- package/decorators/withResponsiveOptions.js.map +1 -1
- package/decorators/withScrolledInView/utils.d.ts +12 -1
- package/decorators/withScrolledInView/utils.js +7 -7
- package/decorators/withScrolledInView/utils.js.map +2 -2
- package/decorators/withScrolledInView/withScrolledInView.js +13 -35
- package/decorators/withScrolledInView/withScrolledInView.js.map +2 -2
- package/helpers/createApp.d.ts +2 -1
- package/helpers/createApp.js +2 -2
- package/helpers/createApp.js.map +2 -2
- package/helpers/getDirectChildren.js.map +1 -1
- package/helpers/importOnInteraction.js +4 -4
- package/helpers/importOnInteraction.js.map +2 -2
- package/helpers/importWhenVisible.js +2 -1
- package/helpers/importWhenVisible.js.map +2 -2
- package/package.json +2 -10
- package/services/drag.js +8 -8
- package/services/drag.js.map +2 -2
- package/services/index.d.ts +1 -1
- package/services/index.js.map +2 -2
- package/services/key.js +2 -2
- package/services/key.js.map +2 -2
- package/services/load.js +3 -0
- package/services/load.js.map +1 -1
- package/services/pointer.d.ts +1 -1
- package/services/pointer.js +7 -7
- package/services/pointer.js.map +2 -2
- package/services/raf.js +4 -6
- package/services/raf.js.map +2 -2
- package/services/resize.d.ts +7 -6
- package/services/resize.js +19 -26
- package/services/resize.js.map +2 -2
- package/services/scroll.js +8 -8
- package/services/scroll.js.map +2 -2
- package/services/service.js +2 -2
- package/services/service.js.map +2 -2
- package/utils/Queue.js +30 -0
- package/utils/Queue.js.map +1 -1
- package/utils/SmartQueue.d.ts +1 -1
- package/utils/SmartQueue.js +13 -1
- package/utils/SmartQueue.js.map +2 -2
- package/utils/collide/collidePointRect.js +4 -1
- package/utils/collide/collidePointRect.js.map +1 -1
- package/utils/collide/collideRectRect.js +4 -1
- package/utils/collide/collideRectRect.js.map +1 -1
- package/utils/css/animate.d.ts +33 -15
- package/utils/css/animate.js +80 -34
- package/utils/css/animate.js.map +2 -2
- package/utils/css/classes.js +2 -3
- package/utils/css/classes.js.map +2 -2
- package/utils/css/getOffsetSizes.js +2 -2
- package/utils/css/getOffsetSizes.js.map +1 -1
- package/utils/css/index.d.ts +2 -1
- package/utils/css/index.js +4 -4
- package/utils/css/index.js.map +2 -2
- package/utils/css/matrix.d.ts +1 -1
- package/utils/css/matrix.js.map +2 -2
- package/utils/css/styles.js +2 -2
- package/utils/css/styles.js.map +2 -2
- package/utils/css/transform.d.ts +1 -1
- package/utils/css/transform.js +1 -1
- package/utils/css/transform.js.map +2 -2
- package/utils/css/transition.js +15 -0
- package/utils/css/transition.js.map +1 -1
- package/utils/css/utils.d.ts +1 -1
- package/utils/css/utils.js +1 -1
- package/utils/css/utils.js.map +2 -2
- package/utils/history.js +6 -5
- package/utils/history.js.map +2 -2
- package/utils/index.d.ts +5 -4
- package/utils/index.js +16 -16
- package/utils/index.js.map +2 -2
- package/utils/is.d.ts +12 -0
- package/utils/is.js +17 -0
- package/utils/is.js.map +2 -2
- package/utils/math/ease.d.ts +1 -0
- package/utils/math/ease.js +2 -0
- package/utils/math/ease.js.map +2 -2
- package/utils/math/index.d.ts +4 -3
- package/utils/math/index.js +5 -3
- package/utils/math/index.js.map +2 -2
- package/utils/math/mean.d.ts +1 -0
- package/utils/math/mean.js +17 -0
- package/utils/math/mean.js.map +7 -0
- package/utils/nextFrame.d.ts +4 -22
- package/utils/nextFrame.js +3 -10
- package/utils/nextFrame.js.map +2 -2
- package/utils/nextMicrotask.d.ts +4 -1
- package/utils/nextMicrotask.js +3 -3
- package/utils/nextMicrotask.js.map +2 -2
- package/utils/nextTick.d.ts +4 -1
- package/utils/nextTick.js +3 -3
- package/utils/nextTick.js.map +2 -2
- package/utils/random.d.ts +15 -0
- package/utils/random.js +15 -0
- package/utils/random.js.map +7 -0
- package/utils/scheduler.js +4 -4
- package/utils/scheduler.js.map +2 -2
- package/utils/scrollTo.d.ts +30 -6
- package/utils/scrollTo.js +97 -43
- package/utils/scrollTo.js.map +2 -2
- package/utils/string/endsWith.d.ts +8 -0
- package/utils/string/endsWith.js +13 -0
- package/utils/string/endsWith.js.map +7 -0
- package/utils/string/index.d.ts +2 -0
- package/utils/string/index.js +2 -0
- package/utils/string/index.js.map +2 -2
- package/utils/string/startsWith.d.ts +8 -0
- package/utils/string/startsWith.js +13 -0
- package/utils/string/startsWith.js.map +7 -0
- package/utils/string/withLeadingCharacters.js.map +1 -1
- package/utils/string/withTrailingCharacters.js.map +1 -1
- package/utils/string/withoutLeadingCharacters.js.map +1 -1
- package/utils/string/withoutLeadingCharactersRecursive.js.map +1 -1
- package/utils/string/withoutTrailingCharacters.js.map +1 -1
- package/utils/string/withoutTrailingCharactersRecursive.js.map +1 -1
- package/utils/{focusTrap.d.ts → trapFocus.d.ts} +2 -10
- package/utils/{focusTrap.js → trapFocus.js} +5 -9
- package/utils/trapFocus.js.map +7 -0
- package/utils/tween.d.ts +59 -10
- package/utils/tween.js +24 -18
- package/utils/tween.js.map +2 -2
- package/Base/Base.cjs +0 -325
- package/Base/Base.cjs.map +0 -7
- package/Base/features.cjs +0 -27
- package/Base/features.cjs.map +0 -7
- package/Base/index.cjs +0 -21
- package/Base/index.cjs.map +0 -7
- package/Base/managers/AbstractManager.cjs +0 -57
- package/Base/managers/AbstractManager.cjs.map +0 -7
- package/Base/managers/ChildrenManager.cjs +0 -123
- package/Base/managers/ChildrenManager.cjs.map +0 -7
- package/Base/managers/EventsManager.cjs +0 -220
- package/Base/managers/EventsManager.cjs.map +0 -7
- package/Base/managers/OptionsManager.cjs +0 -171
- package/Base/managers/OptionsManager.cjs.map +0 -7
- package/Base/managers/RefsManager.cjs +0 -104
- package/Base/managers/RefsManager.cjs.map +0 -7
- package/Base/managers/ResponsiveOptionsManager.cjs +0 -63
- package/Base/managers/ResponsiveOptionsManager.cjs.map +0 -7
- package/Base/managers/ServicesManager.cjs +0 -111
- package/Base/managers/ServicesManager.cjs.map +0 -7
- package/Base/managers/index.cjs +0 -39
- package/Base/managers/index.cjs.map +0 -7
- package/Base/types.cjs +0 -19
- package/Base/types.cjs.map +0 -7
- package/Base/utils.cjs +0 -91
- package/Base/utils.cjs.map +0 -7
- package/decorators/index.cjs +0 -33
- package/decorators/index.cjs.map +0 -7
- package/decorators/withBreakpointManager.cjs +0 -92
- package/decorators/withBreakpointManager.cjs.map +0 -7
- package/decorators/withBreakpointObserver.cjs +0 -118
- package/decorators/withBreakpointObserver.cjs.map +0 -7
- package/decorators/withDrag.cjs +0 -50
- package/decorators/withDrag.cjs.map +0 -7
- package/decorators/withExtraConfig.cjs +0 -43
- package/decorators/withExtraConfig.cjs.map +0 -7
- package/decorators/withFreezedOptions.cjs +0 -42
- package/decorators/withFreezedOptions.cjs.map +0 -7
- package/decorators/withIntersectionObserver.cjs +0 -62
- package/decorators/withIntersectionObserver.cjs.map +0 -7
- package/decorators/withMountOnMediaQuery.cjs +0 -70
- package/decorators/withMountOnMediaQuery.cjs.map +0 -7
- package/decorators/withMountWhenInView.cjs +0 -71
- package/decorators/withMountWhenInView.cjs.map +0 -7
- package/decorators/withMountWhenPrefersMotion.cjs +0 -30
- package/decorators/withMountWhenPrefersMotion.cjs.map +0 -7
- package/decorators/withRelativePointer.cjs +0 -50
- package/decorators/withRelativePointer.cjs.map +0 -7
- package/decorators/withResponsiveOptions.cjs +0 -38
- package/decorators/withResponsiveOptions.cjs.map +0 -7
- package/decorators/withScrolledInView/index.cjs +0 -22
- package/decorators/withScrolledInView/index.cjs.map +0 -7
- package/decorators/withScrolledInView/types.cjs +0 -19
- package/decorators/withScrolledInView/types.cjs.map +0 -7
- package/decorators/withScrolledInView/utils.cjs +0 -99
- package/decorators/withScrolledInView/utils.cjs.map +0 -7
- package/decorators/withScrolledInView/withScrolledInView.cjs +0 -216
- package/decorators/withScrolledInView/withScrolledInView.cjs.map +0 -7
- package/decorators/withVue2.cjs +0 -65
- package/decorators/withVue2.cjs.map +0 -7
- package/decorators/withVue2.d.ts +0 -16
- package/decorators/withVue2.js +0 -43
- package/decorators/withVue2.js.map +0 -7
- package/helpers/createApp.cjs +0 -58
- package/helpers/createApp.cjs.map +0 -7
- package/helpers/getClosestParent.cjs +0 -41
- package/helpers/getClosestParent.cjs.map +0 -7
- package/helpers/getDirectChildren.cjs +0 -47
- package/helpers/getDirectChildren.cjs.map +0 -7
- package/helpers/getInstanceFromElement.cjs +0 -32
- package/helpers/getInstanceFromElement.cjs.map +0 -7
- package/helpers/importOnInteraction.cjs +0 -48
- package/helpers/importOnInteraction.cjs.map +0 -7
- package/helpers/importOnMediaQuery.cjs +0 -44
- package/helpers/importOnMediaQuery.cjs.map +0 -7
- package/helpers/importWhenIdle.cjs +0 -46
- package/helpers/importWhenIdle.cjs.map +0 -7
- package/helpers/importWhenPrefersMotion.cjs +0 -36
- package/helpers/importWhenPrefersMotion.cjs.map +0 -7
- package/helpers/importWhenVisible.cjs +0 -43
- package/helpers/importWhenVisible.cjs.map +0 -7
- package/helpers/index.cjs +0 -49
- package/helpers/index.cjs.map +0 -7
- package/helpers/utils.cjs +0 -37
- package/helpers/utils.cjs.map +0 -7
- package/index.cjs +0 -31
- package/index.cjs.map +0 -7
- package/services/drag.cjs +0 -227
- package/services/drag.cjs.map +0 -7
- package/services/index.cjs +0 -47
- package/services/index.cjs.map +0 -7
- package/services/key.cjs +0 -93
- package/services/key.cjs.map +0 -7
- package/services/load.cjs +0 -57
- package/services/load.cjs.map +0 -7
- package/services/pointer.cjs +0 -145
- package/services/pointer.cjs.map +0 -7
- package/services/raf.cjs +0 -80
- package/services/raf.cjs.map +0 -7
- package/services/resize.cjs +0 -103
- package/services/resize.cjs.map +0 -7
- package/services/scroll.cjs +0 -115
- package/services/scroll.cjs.map +0 -7
- package/services/service.cjs +0 -69
- package/services/service.cjs.map +0 -7
- package/utils/Queue.cjs +0 -63
- package/utils/Queue.cjs.map +0 -7
- package/utils/SmartQueue.cjs +0 -57
- package/utils/SmartQueue.cjs.map +0 -7
- package/utils/collide/boundingRectToCircle.cjs +0 -36
- package/utils/collide/boundingRectToCircle.cjs.map +0 -7
- package/utils/collide/collideCircleCircle.cjs +0 -35
- package/utils/collide/collideCircleCircle.cjs.map +0 -7
- package/utils/collide/collideCircleRect.cjs +0 -47
- package/utils/collide/collideCircleRect.cjs.map +0 -7
- package/utils/collide/collidePointCircle.cjs +0 -32
- package/utils/collide/collidePointCircle.cjs.map +0 -7
- package/utils/collide/collidePointRect.cjs +0 -29
- package/utils/collide/collidePointRect.cjs.map +0 -7
- package/utils/collide/collideRectRect.cjs +0 -29
- package/utils/collide/collideRectRect.cjs.map +0 -7
- package/utils/collide/index.cjs +0 -43
- package/utils/collide/index.cjs.map +0 -7
- package/utils/css/animate.cjs +0 -193
- package/utils/css/animate.cjs.map +0 -7
- package/utils/css/classes.cjs +0 -52
- package/utils/css/classes.cjs.map +0 -7
- package/utils/css/getOffsetSizes.cjs +0 -48
- package/utils/css/getOffsetSizes.cjs.map +0 -7
- package/utils/css/index.cjs +0 -48
- package/utils/css/index.cjs.map +0 -7
- package/utils/css/matrix.cjs +0 -30
- package/utils/css/matrix.cjs.map +0 -7
- package/utils/css/styles.cjs +0 -45
- package/utils/css/styles.cjs.map +0 -7
- package/utils/css/transform.cjs +0 -91
- package/utils/css/transform.cjs.map +0 -7
- package/utils/css/transition.cjs +0 -126
- package/utils/css/transition.cjs.map +0 -7
- package/utils/css/utils.cjs +0 -32
- package/utils/css/utils.cjs.map +0 -7
- package/utils/debounce.cjs +0 -35
- package/utils/debounce.cjs.map +0 -7
- package/utils/dom/ancestors.cjs +0 -37
- package/utils/dom/ancestors.cjs.map +0 -7
- package/utils/dom/index.cjs +0 -21
- package/utils/dom/index.cjs.map +0 -7
- package/utils/focusTrap.cjs +0 -89
- package/utils/focusTrap.cjs.map +0 -7
- package/utils/focusTrap.js.map +0 -7
- package/utils/getComponentResolver.cjs +0 -38
- package/utils/getComponentResolver.cjs.map +0 -7
- package/utils/has.cjs +0 -29
- package/utils/has.cjs.map +0 -7
- package/utils/history.cjs +0 -91
- package/utils/history.cjs.map +0 -7
- package/utils/index.cjs +0 -72
- package/utils/index.cjs.map +0 -7
- package/utils/is.cjs +0 -41
- package/utils/is.cjs.map +0 -7
- package/utils/keyCodes.cjs +0 -36
- package/utils/keyCodes.cjs.map +0 -7
- package/utils/math/clamp.cjs +0 -29
- package/utils/math/clamp.cjs.map +0 -7
- package/utils/math/clamp01.cjs +0 -36
- package/utils/math/clamp01.cjs.map +0 -7
- package/utils/math/createEases.cjs +0 -33
- package/utils/math/createEases.cjs.map +0 -7
- package/utils/math/damp.cjs +0 -29
- package/utils/math/damp.cjs.map +0 -7
- package/utils/math/ease.cjs +0 -82
- package/utils/math/ease.cjs.map +0 -7
- package/utils/math/index.cjs +0 -50
- package/utils/math/index.cjs.map +0 -7
- package/utils/math/inertiaFinalValue.cjs +0 -43
- package/utils/math/inertiaFinalValue.cjs.map +0 -7
- package/utils/math/lerp.cjs +0 -29
- package/utils/math/lerp.cjs.map +0 -7
- package/utils/math/map.cjs +0 -29
- package/utils/math/map.cjs.map +0 -7
- package/utils/math/round.cjs +0 -29
- package/utils/math/round.cjs.map +0 -7
- package/utils/memoize.cjs +0 -48
- package/utils/memoize.cjs.map +0 -7
- package/utils/nextFrame.cjs +0 -41
- package/utils/nextFrame.cjs.map +0 -7
- package/utils/nextMicrotask.cjs +0 -30
- package/utils/nextMicrotask.cjs.map +0 -7
- package/utils/nextTick.cjs +0 -31
- package/utils/nextTick.cjs.map +0 -7
- package/utils/noop.cjs +0 -32
- package/utils/noop.cjs.map +0 -7
- package/utils/object/autoBind.cjs +0 -54
- package/utils/object/autoBind.cjs.map +0 -7
- package/utils/object/autoBind.d.ts +0 -14
- package/utils/object/autoBind.js +0 -26
- package/utils/object/autoBind.js.map +0 -7
- package/utils/object/getAllProperties.cjs +0 -39
- package/utils/object/getAllProperties.cjs.map +0 -7
- package/utils/object/index.cjs +0 -35
- package/utils/object/index.cjs.map +0 -7
- package/utils/object/index.d.ts +0 -2
- package/utils/object/index.js +0 -7
- package/utils/object/index.js.map +0 -7
- package/utils/scheduler.cjs +0 -75
- package/utils/scheduler.cjs.map +0 -7
- package/utils/scrollTo.cjs +0 -84
- package/utils/scrollTo.cjs.map +0 -7
- package/utils/string/index.cjs +0 -51
- package/utils/string/index.cjs.map +0 -7
- package/utils/string/withLeadingCharacters.cjs +0 -36
- package/utils/string/withLeadingCharacters.cjs.map +0 -7
- package/utils/string/withLeadingSlash.cjs +0 -36
- package/utils/string/withLeadingSlash.cjs.map +0 -7
- package/utils/string/withTrailingCharacters.cjs +0 -36
- package/utils/string/withTrailingCharacters.cjs.map +0 -7
- package/utils/string/withTrailingSlash.cjs +0 -36
- package/utils/string/withTrailingSlash.cjs.map +0 -7
- package/utils/string/withoutLeadingCharacters.cjs +0 -29
- package/utils/string/withoutLeadingCharacters.cjs.map +0 -7
- package/utils/string/withoutLeadingCharactersRecursive.cjs +0 -41
- package/utils/string/withoutLeadingCharactersRecursive.cjs.map +0 -7
- package/utils/string/withoutLeadingSlash.cjs +0 -36
- package/utils/string/withoutLeadingSlash.cjs.map +0 -7
- package/utils/string/withoutTrailingCharacters.cjs +0 -29
- package/utils/string/withoutTrailingCharacters.cjs.map +0 -7
- package/utils/string/withoutTrailingCharactersRecursive.cjs +0 -41
- package/utils/string/withoutTrailingCharactersRecursive.cjs.map +0 -7
- package/utils/string/withoutTrailingSlash.cjs +0 -36
- package/utils/string/withoutTrailingSlash.cjs.map +0 -7
- package/utils/throttle.cjs +0 -37
- package/utils/throttle.cjs.map +0 -7
- package/utils/tween.cjs +0 -118
- package/utils/tween.cjs.map +0 -7
- package/utils/wait.cjs +0 -31
- package/utils/wait.cjs.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/css/transform.ts"],
|
|
4
|
-
"sourcesContent": ["import { isDefined } from '../is.js';\n// eslint-disable-next-line import/extensions\nimport { eachElements } from './utils.js';\n\nexport type TransformProps = Partial<{\n x: number;\n y: number;\n z: number;\n rotate: number;\n rotateX: number;\n rotateY: number;\n rotateZ: number;\n scale: number;\n scaleX: number;\n scaleY: number;\n scaleZ: number;\n skew: number;\n skewX: number;\n skewY: number;\n}>;\n\nexport const TRANSFORM_PROPS = [\n 'x',\n 'y',\n 'z',\n 'rotate',\n 'rotateX',\n 'rotateY',\n 'rotateZ',\n 'scale',\n 'scaleX',\n 'scaleY',\n 'scaleZ',\n 'skew',\n 'skewX',\n 'skewY',\n];\n\n/**\n * Generate a CSS transform.\n */\nexport default function transform(\n elementOrElements: HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>,\n props: TransformProps,\n): string {\n let value = '';\n\n if (isDefined(props.x) || isDefined(props.y) || isDefined(props.z)) {\n value += `translate3d(${props.x ?? 0}px, ${props.y ?? 0}px, ${props.z ?? 0}px) `;\n }\n\n if (isDefined(props.rotate)) {\n value += `rotate(${props.rotate}deg) `;\n } else {\n if (isDefined(props.rotateX)) {\n value += `rotateX(${props.rotateX}deg) `;\n }\n\n if (isDefined(props.rotateY)) {\n value += `rotateY(${props.rotateY}deg) `;\n }\n\n if (isDefined(props.rotateZ)) {\n value += `rotateZ(${props.rotateZ}deg) `;\n }\n }\n\n if (isDefined(props.scale)) {\n value += `scale(${props.scale}) `;\n } else {\n if (isDefined(props.scaleX)) {\n value += `scaleX(${props.scaleX}) `;\n }\n\n if (isDefined(props.scaleY)) {\n value += `scaleY(${props.scaleY}) `;\n }\n\n if (isDefined(props.scaleZ)) {\n value += `scaleZ(${props.scaleZ}) `;\n }\n }\n\n if (isDefined(props.skew)) {\n value += `skew(${props.skew}deg) `;\n } else {\n if (isDefined(props.skewX)) {\n value += `skewX(${props.skewX}deg) `;\n }\n\n if (isDefined(props.skewY)) {\n value += `skewY(${props.skewY}deg) `;\n }\n }\n\n eachElements(elementOrElements, (element) => {\n element.style.transform = value;\n });\n return value;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA0B;AAE1B,mBAA6B;AAmBtB,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAKe,SAAR,UACL,mBACA,OACQ;AACR,MAAI,QAAQ;AAEZ,UAAI,qBAAU,MAAM,CAAC,SAAK,qBAAU,MAAM,CAAC,SAAK,qBAAU,MAAM,CAAC,GAAG;AAClE,aAAS,eAAe,MAAM,KAAK,QAAQ,MAAM,KAAK,QAAQ,MAAM,KAAK;AAAA,EAC3E;AAEA,UAAI,qBAAU,MAAM,MAAM,GAAG;AAC3B,aAAS,UAAU,MAAM;AAAA,EAC3B,OAAO;AACL,YAAI,qBAAU,MAAM,OAAO,GAAG;AAC5B,eAAS,WAAW,MAAM;AAAA,IAC5B;AAEA,YAAI,qBAAU,MAAM,OAAO,GAAG;AAC5B,eAAS,WAAW,MAAM;AAAA,IAC5B;AAEA,YAAI,qBAAU,MAAM,OAAO,GAAG;AAC5B,eAAS,WAAW,MAAM;AAAA,IAC5B;AAAA,EACF;AAEA,UAAI,qBAAU,MAAM,KAAK,GAAG;AAC1B,aAAS,SAAS,MAAM;AAAA,EAC1B,OAAO;AACL,YAAI,qBAAU,MAAM,MAAM,GAAG;AAC3B,eAAS,UAAU,MAAM;AAAA,IAC3B;AAEA,YAAI,qBAAU,MAAM,MAAM,GAAG;AAC3B,eAAS,UAAU,MAAM;AAAA,IAC3B;AAEA,YAAI,qBAAU,MAAM,MAAM,GAAG;AAC3B,eAAS,UAAU,MAAM;AAAA,IAC3B;AAAA,EACF;AAEA,UAAI,qBAAU,MAAM,IAAI,GAAG;AACzB,aAAS,QAAQ,MAAM;AAAA,EACzB,OAAO;AACL,YAAI,qBAAU,MAAM,KAAK,GAAG;AAC1B,eAAS,SAAS,MAAM;AAAA,IAC1B;AAEA,YAAI,qBAAU,MAAM,KAAK,GAAG;AAC1B,eAAS,SAAS,MAAM;AAAA,IAC1B;AAAA,EACF;AAEA,iCAAa,mBAAmB,CAAC,YAAY;AAC3C,YAAQ,MAAM,YAAY;AAAA,EAC5B,CAAC;AACD,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/css/transition.cjs
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
-
mod
|
|
22
|
-
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
|
|
25
|
-
// packages/js-toolkit/utils/css/transition.ts
|
|
26
|
-
var transition_exports = {};
|
|
27
|
-
__export(transition_exports, {
|
|
28
|
-
default: () => transition,
|
|
29
|
-
setClassesOrStyles: () => setClassesOrStyles
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(transition_exports);
|
|
32
|
-
var import_nextFrame = require("../nextFrame.cjs");
|
|
33
|
-
var classes = __toESM(require("./classes.cjs"), 1);
|
|
34
|
-
var styles = __toESM(require("./styles.cjs"), 1);
|
|
35
|
-
var import_is = require("../is.cjs");
|
|
36
|
-
var import_has = require("../has.cjs");
|
|
37
|
-
var import_utils = require("./utils.cjs");
|
|
38
|
-
var cache = /* @__PURE__ */ new WeakMap();
|
|
39
|
-
var Transition = class {
|
|
40
|
-
isTransitioning = false;
|
|
41
|
-
transitionEndHandler = null;
|
|
42
|
-
constructor(element) {
|
|
43
|
-
cache.set(element, this);
|
|
44
|
-
}
|
|
45
|
-
static getInstance(element) {
|
|
46
|
-
let instance = cache.get(element);
|
|
47
|
-
if (!instance) {
|
|
48
|
-
instance = new this(element);
|
|
49
|
-
}
|
|
50
|
-
return instance;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function setClassesOrStyles(element, classesOrStyles, method = "add") {
|
|
54
|
-
if ((0, import_is.isString)(classesOrStyles) || (0, import_is.isArray)(classesOrStyles)) {
|
|
55
|
-
classes[method](element, classesOrStyles);
|
|
56
|
-
} else {
|
|
57
|
-
styles[method](element, classesOrStyles);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function testTransition(element) {
|
|
61
|
-
if (!(0, import_has.hasWindow)()) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
const { transitionDuration } = window.getComputedStyle(element);
|
|
65
|
-
return !!transitionDuration && transitionDuration !== "0s";
|
|
66
|
-
}
|
|
67
|
-
async function start(element, classesOrStyles) {
|
|
68
|
-
const trs = Transition.getInstance(element);
|
|
69
|
-
trs.isTransitioning = true;
|
|
70
|
-
setClassesOrStyles(element, classesOrStyles.from);
|
|
71
|
-
await (0, import_nextFrame.nextFrame)();
|
|
72
|
-
setClassesOrStyles(element, classesOrStyles.active);
|
|
73
|
-
}
|
|
74
|
-
async function next(element, classesOrStyles) {
|
|
75
|
-
const hasTransition = testTransition(element);
|
|
76
|
-
return new Promise(async (resolve) => {
|
|
77
|
-
if (hasTransition) {
|
|
78
|
-
const trs = Transition.getInstance(element);
|
|
79
|
-
trs.transitionEndHandler = () => resolve();
|
|
80
|
-
element.addEventListener("transitionend", trs.transitionEndHandler, false);
|
|
81
|
-
}
|
|
82
|
-
setClassesOrStyles(element, classesOrStyles.from, "remove");
|
|
83
|
-
setClassesOrStyles(element, classesOrStyles.to);
|
|
84
|
-
await (0, import_nextFrame.nextFrame)();
|
|
85
|
-
if (!hasTransition) {
|
|
86
|
-
resolve();
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
function end(element, classesOrStyles, mode = "remove") {
|
|
91
|
-
const trs = Transition.getInstance(element);
|
|
92
|
-
element.removeEventListener("transitionend", trs.transitionEndHandler, false);
|
|
93
|
-
if (mode === "remove") {
|
|
94
|
-
setClassesOrStyles(element, classesOrStyles.to, "remove");
|
|
95
|
-
}
|
|
96
|
-
setClassesOrStyles(element, classesOrStyles.active, "remove");
|
|
97
|
-
trs.isTransitioning = false;
|
|
98
|
-
trs.transitionEndHandler = null;
|
|
99
|
-
}
|
|
100
|
-
async function singleTransition(element, name, endMode = "remove") {
|
|
101
|
-
const classesOrStyles = (0, import_is.isString)(name) ? {
|
|
102
|
-
from: `${name}-from`,
|
|
103
|
-
active: `${name}-active`,
|
|
104
|
-
to: `${name}-to`
|
|
105
|
-
} : {
|
|
106
|
-
from: "",
|
|
107
|
-
active: "",
|
|
108
|
-
to: "",
|
|
109
|
-
...name
|
|
110
|
-
};
|
|
111
|
-
const trs = Transition.getInstance(element);
|
|
112
|
-
if (trs.isTransitioning) {
|
|
113
|
-
end(element, classesOrStyles);
|
|
114
|
-
}
|
|
115
|
-
await start(element, classesOrStyles);
|
|
116
|
-
await next(element, classesOrStyles);
|
|
117
|
-
end(element, classesOrStyles, endMode);
|
|
118
|
-
return Promise.resolve();
|
|
119
|
-
}
|
|
120
|
-
async function transition(elementOrElements, name, endMode = "remove") {
|
|
121
|
-
await Promise.all(
|
|
122
|
-
(0, import_utils.eachElements)(elementOrElements, (element) => singleTransition(element, name, endMode))
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
126
|
-
//# sourceMappingURL=transition.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/css/transition.ts"],
|
|
4
|
-
"sourcesContent": ["import { nextFrame } from '../nextFrame.js';\nimport * as classes from './classes.js';\nimport * as styles from './styles.js';\nimport { isArray, isString } from '../is.js';\nimport { hasWindow } from '../has.js';\n// eslint-disable-next-line import/extensions\nimport { eachElements } from './utils.js';\n\n/** WeakMap to hold the transition instances. */\nconst cache = new WeakMap();\n\nexport type ClassesOrStyles = string | string[] | Partial<CSSStyleDeclaration>;\n\nexport type TransitionStyles = {\n from?: ClassesOrStyles;\n active?: ClassesOrStyles;\n to?: ClassesOrStyles;\n};\n\n/**\n * Transition class.\n */\nclass Transition {\n /**\n * Is a transition currently running?\n */\n isTransitioning = false;\n\n /**\n * A callback to execute when the transition ends.\n */\n transitionEndHandler: EventListenerOrEventListenerObject | null = null;\n\n /**\n * Instantiate and save the instance to the cache.\n */\n constructor(element: HTMLElement) {\n cache.set(element, this);\n }\n\n /**\n * Get the transition class attached to the given element.\n *\n * @param {HTMLElement} element The HTML element concerned by the transition.\n * @returns {Transition} The transition instance tied to the given element.\n */\n static getInstance(element: HTMLElement): Transition {\n let instance = cache.get(element);\n\n if (!instance) {\n instance = new this(element);\n }\n\n return instance;\n }\n}\n\n/**\n * Update either the classes or the styles of an element with the given method.\n */\nexport function setClassesOrStyles(\n element: HTMLElement,\n classesOrStyles: ClassesOrStyles,\n method: 'add' | 'remove' = 'add',\n) {\n if (isString(classesOrStyles) || isArray(classesOrStyles)) {\n classes[method](element, classesOrStyles);\n } else {\n styles[method](element, classesOrStyles);\n }\n}\n\n/**\n * Test if the given element has a transition duration.\n */\nfunction testTransition(element: HTMLElement) {\n if (!hasWindow()) {\n return false;\n }\n\n const { transitionDuration } = window.getComputedStyle(element);\n return !!transitionDuration && transitionDuration !== '0s';\n}\n\n/**\n * Apply the from state.\n */\nasync function start(element: HTMLElement, classesOrStyles: TransitionStyles) {\n const trs = Transition.getInstance(element);\n trs.isTransitioning = true;\n setClassesOrStyles(element, classesOrStyles.from);\n await nextFrame();\n setClassesOrStyles(element, classesOrStyles.active);\n}\n\n/**\n * Apply the active state.\n */\nasync function next(element: HTMLElement, classesOrStyles: TransitionStyles): Promise<void> {\n const hasTransition = testTransition(element);\n\n /* eslint-disable-next-line */\n return new Promise(async (resolve) => {\n if (hasTransition) {\n const trs = Transition.getInstance(element);\n trs.transitionEndHandler = () => resolve();\n element.addEventListener('transitionend', trs.transitionEndHandler, false);\n }\n setClassesOrStyles(element, classesOrStyles.from, 'remove');\n setClassesOrStyles(element, classesOrStyles.to);\n await nextFrame();\n if (!hasTransition) {\n resolve();\n }\n });\n}\n\n/**\n * Apply the final state.\n */\nfunction end(\n element: HTMLElement,\n classesOrStyles: TransitionStyles,\n mode: 'keep' | 'remove' = 'remove',\n) {\n const trs = Transition.getInstance(element);\n element.removeEventListener('transitionend', trs.transitionEndHandler, false);\n if (mode === 'remove') {\n setClassesOrStyles(element, classesOrStyles.to, 'remove');\n }\n setClassesOrStyles(element, classesOrStyles.active, 'remove');\n trs.isTransitioning = false;\n trs.transitionEndHandler = null;\n}\n\n/**\n * Manage CSS transition with class.\n *\n * This is inspired by the Vue `<transition>` component\n * and the `@barba/css` package, many thanks to them!\n *\n * @param {HTMLElement} element The target element.\n * @param {string|TransitionStyles} name The name of the transition or an object with the hooks classesOrStyles.\n * @param {string} endMode Whether to remove or keep the `to` classes/styles\n * @returns {Promise<void>} A promise resolving at the end of the transition.\n */\nasync function singleTransition(\n element: HTMLElement,\n name: string | TransitionStyles,\n endMode: 'keep' | 'remove' = 'remove',\n): Promise<void> {\n /** @type {TransitionStyles} */\n const classesOrStyles = isString(name)\n ? {\n from: `${name}-from`,\n active: `${name}-active`,\n to: `${name}-to`,\n }\n : {\n from: '',\n active: '',\n to: '',\n ...name,\n };\n\n const trs = Transition.getInstance(element);\n // End any previous transition running on the element.\n if (trs.isTransitioning) {\n end(element, classesOrStyles);\n }\n\n await start(element, classesOrStyles);\n await next(element, classesOrStyles);\n end(element, classesOrStyles, endMode);\n return Promise.resolve();\n}\n\n/**\n * Manage CSS transition with class.\n *\n * @param {HTMLElement|HTMLElement[]|NodeListOf<HTMLElement>} elementOrElements The target element or elements.\n * @param {string|TransitionStyles} name The name of the transition or an object with the hooks classesOrStyles.\n * @param {string} endMode Whether to remove or keep the `to` classes/styles\n * @returns {Promise<void>} A promise resolving at the end of the transition.\n */\nexport default async function transition(\n elementOrElements: HTMLElement | HTMLElement[] | NodeListOf<HTMLElement>,\n name: string | TransitionStyles,\n endMode: 'keep' | 'remove' = 'remove',\n) {\n await Promise.all(\n eachElements(elementOrElements, (element) => singleTransition(element, name, endMode)),\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0B;AAC1B,cAAyB;AACzB,aAAwB;AACxB,gBAAkC;AAClC,iBAA0B;AAE1B,mBAA6B;AAG7B,IAAM,QAAQ,oBAAI,QAAQ;AAa1B,IAAM,aAAN,MAAiB;AAAA,EAIf,kBAAkB;AAAA,EAKlB,uBAAkE;AAAA,EAKlE,YAAY,SAAsB;AAChC,UAAM,IAAI,SAAS,IAAI;AAAA,EACzB;AAAA,EAQA,OAAO,YAAY,SAAkC;AACnD,QAAI,WAAW,MAAM,IAAI,OAAO;AAEhC,QAAI,CAAC,UAAU;AACb,iBAAW,IAAI,KAAK,OAAO;AAAA,IAC7B;AAEA,WAAO;AAAA,EACT;AACF;AAKO,SAAS,mBACd,SACA,iBACA,SAA2B,OAC3B;AACA,UAAI,oBAAS,eAAe,SAAK,mBAAQ,eAAe,GAAG;AACzD,YAAQ,QAAQ,SAAS,eAAe;AAAA,EAC1C,OAAO;AACL,WAAO,QAAQ,SAAS,eAAe;AAAA,EACzC;AACF;AAKA,SAAS,eAAe,SAAsB;AAC5C,MAAI,KAAC,sBAAU,GAAG;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,mBAAmB,IAAI,OAAO,iBAAiB,OAAO;AAC9D,SAAO,CAAC,CAAC,sBAAsB,uBAAuB;AACxD;AAKA,eAAe,MAAM,SAAsB,iBAAmC;AAC5E,QAAM,MAAM,WAAW,YAAY,OAAO;AAC1C,MAAI,kBAAkB;AACtB,qBAAmB,SAAS,gBAAgB,IAAI;AAChD,YAAM,4BAAU;AAChB,qBAAmB,SAAS,gBAAgB,MAAM;AACpD;AAKA,eAAe,KAAK,SAAsB,iBAAkD;AAC1F,QAAM,gBAAgB,eAAe,OAAO;AAG5C,SAAO,IAAI,QAAQ,OAAO,YAAY;AACpC,QAAI,eAAe;AACjB,YAAM,MAAM,WAAW,YAAY,OAAO;AAC1C,UAAI,uBAAuB,MAAM,QAAQ;AACzC,cAAQ,iBAAiB,iBAAiB,IAAI,sBAAsB,KAAK;AAAA,IAC3E;AACA,uBAAmB,SAAS,gBAAgB,MAAM,QAAQ;AAC1D,uBAAmB,SAAS,gBAAgB,EAAE;AAC9C,cAAM,4BAAU;AAChB,QAAI,CAAC,eAAe;AAClB,cAAQ;AAAA,IACV;AAAA,EACF,CAAC;AACH;AAKA,SAAS,IACP,SACA,iBACA,OAA0B,UAC1B;AACA,QAAM,MAAM,WAAW,YAAY,OAAO;AAC1C,UAAQ,oBAAoB,iBAAiB,IAAI,sBAAsB,KAAK;AAC5E,MAAI,SAAS,UAAU;AACrB,uBAAmB,SAAS,gBAAgB,IAAI,QAAQ;AAAA,EAC1D;AACA,qBAAmB,SAAS,gBAAgB,QAAQ,QAAQ;AAC5D,MAAI,kBAAkB;AACtB,MAAI,uBAAuB;AAC7B;AAaA,eAAe,iBACb,SACA,MACA,UAA6B,UACd;AAEf,QAAM,sBAAkB,oBAAS,IAAI,IACjC;AAAA,IACE,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,IAAI,GAAG;AAAA,EACT,IACA;AAAA,IACE,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,GAAG;AAAA,EACL;AAEJ,QAAM,MAAM,WAAW,YAAY,OAAO;AAE1C,MAAI,IAAI,iBAAiB;AACvB,QAAI,SAAS,eAAe;AAAA,EAC9B;AAEA,QAAM,MAAM,SAAS,eAAe;AACpC,QAAM,KAAK,SAAS,eAAe;AACnC,MAAI,SAAS,iBAAiB,OAAO;AACrC,SAAO,QAAQ,QAAQ;AACzB;AAUA,eAAO,WACL,mBACA,MACA,UAA6B,UAC7B;AACA,QAAM,QAAQ;AAAA,QACZ,2BAAa,mBAAmB,CAAC,YAAY,iBAAiB,SAAS,MAAM,OAAO,CAAC;AAAA,EACvF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/css/utils.cjs
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/css/utils.ts
|
|
20
|
-
var utils_exports = {};
|
|
21
|
-
__export(utils_exports, {
|
|
22
|
-
eachElements: () => eachElements
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(utils_exports);
|
|
25
|
-
function eachElements(elementOrElements, callback) {
|
|
26
|
-
if (elementOrElements instanceof Node) {
|
|
27
|
-
return [callback(elementOrElements)];
|
|
28
|
-
}
|
|
29
|
-
return Array.from(elementOrElements).map(callback);
|
|
30
|
-
}
|
|
31
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
32
|
-
//# sourceMappingURL=utils.cjs.map
|
package/utils/css/utils.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/css/utils.ts"],
|
|
4
|
-
"sourcesContent": ["export function eachElements<S extends Node = Node, T = void>(\n elementOrElements: S | S[] | NodeListOf<S>,\n callback: (element: S, index?: number, elements?: S[]) => T,\n): T[] {\n if (elementOrElements instanceof Node) {\n return [callback(elementOrElements)];\n }\n\n return Array.from(elementOrElements).map(callback);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,SAAS,aACd,mBACA,UACK;AACL,MAAI,6BAA6B,MAAM;AACrC,WAAO,CAAC,SAAS,iBAAiB,CAAC;AAAA,EACrC;AAEA,SAAO,MAAM,KAAK,iBAAiB,EAAE,IAAI,QAAQ;AACnD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/debounce.cjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/debounce.ts
|
|
20
|
-
var debounce_exports = {};
|
|
21
|
-
__export(debounce_exports, {
|
|
22
|
-
default: () => debounce
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(debounce_exports);
|
|
25
|
-
function debounce(fn, delay = 300) {
|
|
26
|
-
let timeout;
|
|
27
|
-
return function debounced(...args) {
|
|
28
|
-
clearTimeout(timeout);
|
|
29
|
-
timeout = setTimeout(() => {
|
|
30
|
-
fn(...args);
|
|
31
|
-
}, delay);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
35
|
-
//# sourceMappingURL=debounce.cjs.map
|
package/utils/debounce.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/debounce.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Returns a function, that, as long as it continues to be invoked,\n * will not be triggered. The function will be called after it stops\n * being called for N milliseconds.\n *\n * @param {(...args:unknown[]) => void} fn The function to call.\n * @param {number} [delay=300] The delay in ms to wait before calling the function.\n * @returns {(...args:unknown[]) => void} The debounced function.\n */\nexport default function debounce(\n fn: (...args: unknown[]) => void,\n delay = 300,\n): (...args: unknown[]) => void {\n let timeout;\n return function debounced(...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASe,SAAR,SACL,IACA,QAAQ,KACsB;AAC9B,MAAI;AACJ,SAAO,SAAS,aAAa,MAAM;AACjC,iBAAa,OAAO;AACpB,cAAU,WAAW,MAAM;AACzB,SAAG,GAAG,IAAI;AAAA,IACZ,GAAG,KAAK;AAAA,EACV;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/dom/ancestors.cjs
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/dom/ancestors.ts
|
|
20
|
-
var ancestors_exports = {};
|
|
21
|
-
__export(ancestors_exports, {
|
|
22
|
-
getAncestorWhere: () => getAncestorWhere,
|
|
23
|
-
getAncestorWhereUntil: () => getAncestorWhereUntil
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(ancestors_exports);
|
|
26
|
-
function getAncestorWhere(element, condition) {
|
|
27
|
-
if (!element) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
const ancestor = element.parentElement;
|
|
31
|
-
return condition(ancestor) ? ancestor : getAncestorWhere(ancestor, condition);
|
|
32
|
-
}
|
|
33
|
-
function getAncestorWhereUntil(element, condition, until) {
|
|
34
|
-
return getAncestorWhere(element, (el) => condition(el) || until(el));
|
|
35
|
-
}
|
|
36
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
37
|
-
//# sourceMappingURL=ancestors.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../packages/js-toolkit/utils/dom/ancestors.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Get an ancestor matching the given condition.\n */\nexport function getAncestorWhere(element: HTMLElement, condition: (el: HTMLElement) => boolean) {\n if (!element) {\n return null;\n }\n\n const ancestor = element.parentElement;\n\n return condition(ancestor) ? ancestor : getAncestorWhere(ancestor, condition);\n}\n\n/**\n * Get an ancestor matching the given condition, stop when the until function is truthy.\n */\nexport function getAncestorWhereUntil(\n element: HTMLElement,\n condition: (el: HTMLElement) => boolean,\n until: (el: HTMLElement) => boolean,\n): HTMLElement | null {\n return getAncestorWhere(element, (el) => condition(el) || until(el));\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,iBAAiB,SAAsB,WAAyC;AAC9F,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,QAAQ;AAEzB,SAAO,UAAU,QAAQ,IAAI,WAAW,iBAAiB,UAAU,SAAS;AAC9E;AAKO,SAAS,sBACd,SACA,WACA,OACoB;AACpB,SAAO,iBAAiB,SAAS,CAAC,OAAO,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;AACrE;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/dom/index.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
|
6
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
-
for (let key of __getOwnPropNames(from))
|
|
8
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
-
}
|
|
11
|
-
return to;
|
|
12
|
-
};
|
|
13
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
|
|
16
|
-
// packages/js-toolkit/utils/dom/index.ts
|
|
17
|
-
var dom_exports = {};
|
|
18
|
-
module.exports = __toCommonJS(dom_exports);
|
|
19
|
-
__reExport(dom_exports, require("./ancestors.cjs"), module.exports);
|
|
20
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
21
|
-
//# sourceMappingURL=index.cjs.map
|
package/utils/dom/index.cjs.map
DELETED
package/utils/focusTrap.cjs
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
-
mod
|
|
22
|
-
));
|
|
23
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
|
|
25
|
-
// packages/js-toolkit/utils/focusTrap.ts
|
|
26
|
-
var focusTrap_exports = {};
|
|
27
|
-
__export(focusTrap_exports, {
|
|
28
|
-
default: () => useFocusTrap,
|
|
29
|
-
saveActiveElement: () => saveActiveElement,
|
|
30
|
-
trap: () => trap,
|
|
31
|
-
untrap: () => untrap
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(focusTrap_exports);
|
|
34
|
-
var import_keyCodes = __toESM(require("./keyCodes.cjs"), 1);
|
|
35
|
-
var import_is = require("./is.cjs");
|
|
36
|
-
var FOCUSABLE_ELEMENTS = [
|
|
37
|
-
'a[href]:not([tabindex^="-"]):not([inert])',
|
|
38
|
-
'area[href]:not([tabindex^="-"]):not([inert])',
|
|
39
|
-
"input:not([disabled]):not([inert])",
|
|
40
|
-
"select:not([disabled]):not([inert])",
|
|
41
|
-
"textarea:not([disabled]):not([inert])",
|
|
42
|
-
"button:not([disabled]):not([inert])",
|
|
43
|
-
'iframe:not([tabindex^="-"]):not([inert])',
|
|
44
|
-
'audio:not([tabindex^="-"]):not([inert])',
|
|
45
|
-
'video:not([tabindex^="-"]):not([inert])',
|
|
46
|
-
'[contenteditable]:not([tabindex^="-"]):not([inert])',
|
|
47
|
-
'[tabindex]:not([tabindex^="-"]):not([inert])'
|
|
48
|
-
];
|
|
49
|
-
var focusedBefore;
|
|
50
|
-
function saveActiveElement() {
|
|
51
|
-
focusedBefore = document.activeElement;
|
|
52
|
-
}
|
|
53
|
-
function trap(element, event) {
|
|
54
|
-
if (event.keyCode !== import_keyCodes.default.TAB) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (!focusedBefore) {
|
|
58
|
-
focusedBefore = document.activeElement;
|
|
59
|
-
}
|
|
60
|
-
const focusableChildren = Array.from(
|
|
61
|
-
element.querySelectorAll(FOCUSABLE_ELEMENTS.join(", "))
|
|
62
|
-
);
|
|
63
|
-
const focusedItemIndex = document.activeElement instanceof HTMLElement ? focusableChildren.indexOf(document.activeElement) : -1;
|
|
64
|
-
if (!focusableChildren.length) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
if (focusedItemIndex < 0) {
|
|
68
|
-
focusableChildren[0].focus();
|
|
69
|
-
event.preventDefault();
|
|
70
|
-
}
|
|
71
|
-
if (event.shiftKey && focusedItemIndex === 0) {
|
|
72
|
-
focusableChildren.at(-1).focus();
|
|
73
|
-
event.preventDefault();
|
|
74
|
-
} else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {
|
|
75
|
-
focusableChildren[0].focus();
|
|
76
|
-
event.preventDefault();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function untrap() {
|
|
80
|
-
if (focusedBefore && (0, import_is.isFunction)(focusedBefore.focus)) {
|
|
81
|
-
focusedBefore.focus();
|
|
82
|
-
focusedBefore = null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
function useFocusTrap() {
|
|
86
|
-
return { trap, untrap, saveActiveElement };
|
|
87
|
-
}
|
|
88
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
89
|
-
//# sourceMappingURL=focusTrap.cjs.map
|
package/utils/focusTrap.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/focusTrap.ts"],
|
|
4
|
-
"sourcesContent": ["import keyCodes from './keyCodes.js';\nimport { isFunction } from './is.js';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]:not([tabindex^=\"-\"]):not([inert])',\n 'area[href]:not([tabindex^=\"-\"]):not([inert])',\n 'input:not([disabled]):not([inert])',\n 'select:not([disabled]):not([inert])',\n 'textarea:not([disabled]):not([inert])',\n 'button:not([disabled]):not([inert])',\n 'iframe:not([tabindex^=\"-\"]):not([inert])',\n 'audio:not([tabindex^=\"-\"]):not([inert])',\n 'video:not([tabindex^=\"-\"]):not([inert])',\n '[contenteditable]:not([tabindex^=\"-\"]):not([inert])',\n '[tabindex]:not([tabindex^=\"-\"]):not([inert])',\n];\n\nlet focusedBefore;\n\n/**\n * Save the current active element.\n */\nexport function saveActiveElement() {\n focusedBefore = document.activeElement;\n}\n\n/**\n * Trap tab navigation inside the given element.\n *\n * @param {HTMLElement} element The element in which to trap the tabulations.\n * @param {KeyboardEvent} event The keydown or keyup event.\n */\nexport function trap(element: HTMLElement, event: KeyboardEvent) {\n if (event.keyCode !== keyCodes.TAB) {\n return;\n }\n\n // Save the previous focused element\n if (!focusedBefore) {\n focusedBefore = document.activeElement;\n }\n\n const focusableChildren: HTMLElement[] = Array.from(\n element.querySelectorAll(FOCUSABLE_ELEMENTS.join(', ')),\n );\n const focusedItemIndex =\n document.activeElement instanceof HTMLElement\n ? focusableChildren.indexOf(document.activeElement)\n : -1;\n\n if (!focusableChildren.length) {\n return;\n }\n\n if (focusedItemIndex < 0) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is being pressed while tabbing (moving backwards) and\n // the currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableChildren.at(-1).focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is not being pressed (moving forwards) and the currently\n // focused item is the last one, move the focus to the first focusable item\n // from the dialog element\n else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n}\n\n/**\n * Untrap the tab navigation.\n */\nexport function untrap() {\n if (focusedBefore && isFunction(focusedBefore.focus)) {\n focusedBefore.focus();\n focusedBefore = null;\n }\n}\n\n/**\n * Use a trap/untrap tabs logic.\n */\nexport default function useFocusTrap() {\n return { trap, untrap, saveActiveElement };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAqB;AACrB,gBAA2B;AAE3B,IAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAI;AAKG,SAAS,oBAAoB;AAClC,kBAAgB,SAAS;AAC3B;AAQO,SAAS,KAAK,SAAsB,OAAsB;AAC/D,MAAI,MAAM,YAAY,gBAAAA,QAAS,KAAK;AAClC;AAAA,EACF;AAGA,MAAI,CAAC,eAAe;AAClB,oBAAgB,SAAS;AAAA,EAC3B;AAEA,QAAM,oBAAmC,MAAM;AAAA,IAC7C,QAAQ,iBAAiB,mBAAmB,KAAK,IAAI,CAAC;AAAA,EACxD;AACA,QAAM,mBACJ,SAAS,yBAAyB,cAC9B,kBAAkB,QAAQ,SAAS,aAAa,IAChD;AAEN,MAAI,CAAC,kBAAkB,QAAQ;AAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB,GAAG;AACxB,sBAAkB,GAAG,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AAKA,MAAI,MAAM,YAAY,qBAAqB,GAAG;AAC5C,sBAAkB,GAAG,EAAE,EAAE,MAAM;AAC/B,UAAM,eAAe;AAAA,EACvB,WAKS,CAAC,MAAM,YAAY,qBAAqB,kBAAkB,SAAS,GAAG;AAC7E,sBAAkB,GAAG,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AACF;AAKO,SAAS,SAAS;AACvB,MAAI,qBAAiB,sBAAW,cAAc,KAAK,GAAG;AACpD,kBAAc,MAAM;AACpB,oBAAgB;AAAA,EAClB;AACF;AAKe,SAAR,eAAgC;AACrC,SAAO,EAAE,MAAM,QAAQ,kBAAkB;AAC3C;",
|
|
6
|
-
"names": ["keyCodes"]
|
|
7
|
-
}
|
package/utils/focusTrap.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/focusTrap.ts"],
|
|
4
|
-
"sourcesContent": ["import keyCodes from './keyCodes.js';\nimport { isFunction } from './is.js';\n\nconst FOCUSABLE_ELEMENTS = [\n 'a[href]:not([tabindex^=\"-\"]):not([inert])',\n 'area[href]:not([tabindex^=\"-\"]):not([inert])',\n 'input:not([disabled]):not([inert])',\n 'select:not([disabled]):not([inert])',\n 'textarea:not([disabled]):not([inert])',\n 'button:not([disabled]):not([inert])',\n 'iframe:not([tabindex^=\"-\"]):not([inert])',\n 'audio:not([tabindex^=\"-\"]):not([inert])',\n 'video:not([tabindex^=\"-\"]):not([inert])',\n '[contenteditable]:not([tabindex^=\"-\"]):not([inert])',\n '[tabindex]:not([tabindex^=\"-\"]):not([inert])',\n];\n\nlet focusedBefore;\n\n/**\n * Save the current active element.\n */\nexport function saveActiveElement() {\n focusedBefore = document.activeElement;\n}\n\n/**\n * Trap tab navigation inside the given element.\n *\n * @param {HTMLElement} element The element in which to trap the tabulations.\n * @param {KeyboardEvent} event The keydown or keyup event.\n */\nexport function trap(element: HTMLElement, event: KeyboardEvent) {\n if (event.keyCode !== keyCodes.TAB) {\n return;\n }\n\n // Save the previous focused element\n if (!focusedBefore) {\n focusedBefore = document.activeElement;\n }\n\n const focusableChildren: HTMLElement[] = Array.from(\n element.querySelectorAll(FOCUSABLE_ELEMENTS.join(', ')),\n );\n const focusedItemIndex =\n document.activeElement instanceof HTMLElement\n ? focusableChildren.indexOf(document.activeElement)\n : -1;\n\n if (!focusableChildren.length) {\n return;\n }\n\n if (focusedItemIndex < 0) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is being pressed while tabbing (moving backwards) and\n // the currently focused item is the first one, move the focus to the last\n // focusable item from the dialog element\n if (event.shiftKey && focusedItemIndex === 0) {\n focusableChildren.at(-1).focus();\n event.preventDefault();\n }\n\n // If the SHIFT key is not being pressed (moving forwards) and the currently\n // focused item is the last one, move the focus to the first focusable item\n // from the dialog element\n else if (!event.shiftKey && focusedItemIndex === focusableChildren.length - 1) {\n focusableChildren[0].focus();\n event.preventDefault();\n }\n}\n\n/**\n * Untrap the tab navigation.\n */\nexport function untrap() {\n if (focusedBefore && isFunction(focusedBefore.focus)) {\n focusedBefore.focus();\n focusedBefore = null;\n }\n}\n\n/**\n * Use a trap/untrap tabs logic.\n */\nexport default function useFocusTrap() {\n return { trap, untrap, saveActiveElement };\n}\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,cAAc;AACrB,SAAS,kBAAkB;AAE3B,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAI;AAKG,SAAS,oBAAoB;AAClC,kBAAgB,SAAS;AAC3B;AAQO,SAAS,KAAK,SAAsB,OAAsB;AAC/D,MAAI,MAAM,YAAY,SAAS,KAAK;AAClC;AAAA,EACF;AAGA,MAAI,CAAC,eAAe;AAClB,oBAAgB,SAAS;AAAA,EAC3B;AAEA,QAAM,oBAAmC,MAAM;AAAA,IAC7C,QAAQ,iBAAiB,mBAAmB,KAAK,IAAI,CAAC;AAAA,EACxD;AACA,QAAM,mBACJ,SAAS,yBAAyB,cAC9B,kBAAkB,QAAQ,SAAS,aAAa,IAChD;AAEN,MAAI,CAAC,kBAAkB,QAAQ;AAC7B;AAAA,EACF;AAEA,MAAI,mBAAmB,GAAG;AACxB,sBAAkB,GAAG,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AAKA,MAAI,MAAM,YAAY,qBAAqB,GAAG;AAC5C,sBAAkB,GAAG,EAAE,EAAE,MAAM;AAC/B,UAAM,eAAe;AAAA,EACvB,WAKS,CAAC,MAAM,YAAY,qBAAqB,kBAAkB,SAAS,GAAG;AAC7E,sBAAkB,GAAG,MAAM;AAC3B,UAAM,eAAe;AAAA,EACvB;AACF;AAKO,SAAS,SAAS;AACvB,MAAI,iBAAiB,WAAW,cAAc,KAAK,GAAG;AACpD,kBAAc,MAAM;AACpB,oBAAgB;AAAA,EAClB;AACF;AAKe,SAAR,eAAgC;AACrC,SAAO,EAAE,MAAM,QAAQ,kBAAkB;AAC3C;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/getComponentResolver.ts
|
|
20
|
-
var getComponentResolver_exports = {};
|
|
21
|
-
__export(getComponentResolver_exports, {
|
|
22
|
-
default: () => getComponentResolver
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(getComponentResolver_exports);
|
|
25
|
-
var import_is = require("./is.cjs");
|
|
26
|
-
function getComponentResolver(fn) {
|
|
27
|
-
return (resolve, cb) => {
|
|
28
|
-
fn().then((module2) => {
|
|
29
|
-
const ResolvedClass = module2.default ?? module2;
|
|
30
|
-
resolve(ResolvedClass);
|
|
31
|
-
if ((0, import_is.isFunction)(cb)) {
|
|
32
|
-
cb();
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
38
|
-
//# sourceMappingURL=getComponentResolver.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/getComponentResolver.ts"],
|
|
4
|
-
"sourcesContent": ["import { isFunction } from './is.js';\n\n/**\n * Default component resolver\n *\n * @param {Function} fn\n * @returns {Function}\n */\nexport default function getComponentResolver(fn) {\n return (resolve, cb?: () => unknown) => {\n fn().then((module) => {\n const ResolvedClass = module.default ?? module;\n resolve(ResolvedClass);\n\n if (isFunction(cb)) {\n cb();\n }\n });\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAQZ,SAAR,qBAAsC,IAAI;AAC/C,SAAO,CAAC,SAAS,OAAuB;AACtC,OAAG,EAAE,KAAK,CAACA,YAAW;AACpB,YAAM,gBAAgBA,QAAO,WAAWA;AACxC,cAAQ,aAAa;AAErB,cAAI,sBAAW,EAAE,GAAG;AAClB,WAAG;AAAA,MACL;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
-
"names": ["module"]
|
|
7
|
-
}
|
package/utils/has.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/has.ts
|
|
20
|
-
var has_exports = {};
|
|
21
|
-
__export(has_exports, {
|
|
22
|
-
hasWindow: () => hasWindow
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(has_exports);
|
|
25
|
-
function hasWindow() {
|
|
26
|
-
return typeof window !== "undefined";
|
|
27
|
-
}
|
|
28
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
29
|
-
//# sourceMappingURL=has.cjs.map
|
package/utils/has.cjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../packages/js-toolkit/utils/has.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Test if the current context as a global `window` object available.\n */\nexport function hasWindow() {\n return typeof window !== 'undefined';\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,SAAS,YAAY;AAC1B,SAAO,OAAO,WAAW;AAC3B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/utils/history.cjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
|
|
19
|
-
// packages/js-toolkit/utils/history.ts
|
|
20
|
-
var history_exports = {};
|
|
21
|
-
__export(history_exports, {
|
|
22
|
-
objectToURLSearchParams: () => objectToURLSearchParams,
|
|
23
|
-
push: () => push,
|
|
24
|
-
replace: () => replace
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(history_exports);
|
|
27
|
-
var import_is = require("./is.cjs");
|
|
28
|
-
var import_has = require("./has.cjs");
|
|
29
|
-
function updateUrlSearchParam(params, name, value) {
|
|
30
|
-
if (value === "" || value === null || value === void 0) {
|
|
31
|
-
if (params.has(name)) {
|
|
32
|
-
params.delete(name);
|
|
33
|
-
}
|
|
34
|
-
return params;
|
|
35
|
-
}
|
|
36
|
-
if ((0, import_is.isArray)(value)) {
|
|
37
|
-
value.forEach((val, index) => {
|
|
38
|
-
const arrayName = `${name}[${index}]`;
|
|
39
|
-
updateUrlSearchParam(params, arrayName, val);
|
|
40
|
-
});
|
|
41
|
-
return params;
|
|
42
|
-
}
|
|
43
|
-
if ((0, import_is.isObject)(value)) {
|
|
44
|
-
Object.entries(value).forEach(([key, val]) => {
|
|
45
|
-
const objectName = `${name}[${key}]`;
|
|
46
|
-
updateUrlSearchParam(params, objectName, val);
|
|
47
|
-
});
|
|
48
|
-
return params;
|
|
49
|
-
}
|
|
50
|
-
params.set(name, value);
|
|
51
|
-
return params;
|
|
52
|
-
}
|
|
53
|
-
function objectToURLSearchParams(obj, defaultSearch = (0, import_has.hasWindow)() ? window.location.search : "") {
|
|
54
|
-
return Object.entries(obj).reduce(
|
|
55
|
-
(urlSearchParams, [name, value]) => updateUrlSearchParam(urlSearchParams, name, value),
|
|
56
|
-
new URLSearchParams(defaultSearch)
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
function updateHistory(mode, options, data = {}, title = "") {
|
|
60
|
-
if (!window.history) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const { path, search, hash } = {
|
|
64
|
-
path: window.location.pathname,
|
|
65
|
-
search: new URLSearchParams(window.location.search),
|
|
66
|
-
hash: window.location.hash,
|
|
67
|
-
...options
|
|
68
|
-
};
|
|
69
|
-
let url = path;
|
|
70
|
-
const mergedSearch = search instanceof URLSearchParams ? search : objectToURLSearchParams(search);
|
|
71
|
-
if (mergedSearch.toString()) {
|
|
72
|
-
url += `?${mergedSearch.toString()}`;
|
|
73
|
-
}
|
|
74
|
-
if (hash) {
|
|
75
|
-
if (hash.startsWith("#")) {
|
|
76
|
-
url += hash;
|
|
77
|
-
} else {
|
|
78
|
-
url += `#${hash}`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const method = `${mode}State`;
|
|
82
|
-
window.history[method](data, title, url);
|
|
83
|
-
}
|
|
84
|
-
function push(options, data = {}, title = "") {
|
|
85
|
-
updateHistory("push", options, data, title);
|
|
86
|
-
}
|
|
87
|
-
function replace(options, data = {}, title = "") {
|
|
88
|
-
updateHistory("replace", options, data, title);
|
|
89
|
-
}
|
|
90
|
-
if (module.exports.default) module.exports = module.exports.default;
|
|
91
|
-
//# sourceMappingURL=history.cjs.map
|