@studiometa/ui 0.2.13 → 0.2.14
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/atoms/AnchorScrollTo/AnchorScrollTo.cjs +3 -3
- package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +8 -15
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +26 -1
- package/atoms/AnchorScrollTo/index.cjs +20 -0
- package/atoms/AnchorScrollTo/index.d.ts +1 -0
- package/atoms/AnchorScrollTo/index.js +1 -0
- package/atoms/Cursor/Cursor.cjs +16 -9
- package/atoms/Cursor/Cursor.d.ts +19 -117
- package/atoms/Cursor/Cursor.js +111 -1
- package/atoms/Cursor/index.cjs +20 -0
- package/atoms/Cursor/index.d.ts +1 -0
- package/atoms/Cursor/index.js +1 -0
- package/atoms/Figure/Figure.cjs +15 -9
- package/atoms/Figure/Figure.d.ts +18 -53
- package/atoms/Figure/Figure.js +56 -1
- package/atoms/Figure/FigureTwicPics.cjs +10 -10
- package/atoms/Figure/FigureTwicPics.d.ts +16 -37
- package/atoms/Figure/FigureTwicPics.js +51 -1
- package/atoms/Figure/index.cjs +4 -14
- package/atoms/Figure/index.d.ts +2 -2
- package/atoms/Figure/index.js +2 -1
- package/atoms/LargeText/LargeText.cjs +17 -10
- package/atoms/LargeText/LargeText.d.ts +19 -40
- package/atoms/LargeText/LargeText.js +68 -1
- package/atoms/LargeText/index.cjs +20 -0
- package/atoms/LargeText/index.d.ts +1 -0
- package/atoms/LargeText/index.js +1 -0
- package/atoms/LazyInclude/LazyInclude.cjs +2 -2
- package/atoms/LazyInclude/LazyInclude.d.ts +17 -36
- package/atoms/LazyInclude/LazyInclude.js +46 -1
- package/atoms/LazyInclude/index.cjs +20 -0
- package/atoms/LazyInclude/index.d.ts +1 -0
- package/atoms/LazyInclude/index.js +1 -0
- package/atoms/Prefetch/AbstractPrefetch.cjs +6 -6
- package/atoms/Prefetch/AbstractPrefetch.d.ts +12 -35
- package/atoms/Prefetch/AbstractPrefetch.js +58 -1
- package/atoms/Prefetch/PrefetchWhenOver.cjs +5 -8
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +8 -14
- package/atoms/Prefetch/PrefetchWhenOver.js +19 -1
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +5 -8
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +10 -14
- package/atoms/Prefetch/PrefetchWhenVisible.js +20 -1
- package/atoms/Prefetch/index.cjs +5 -16
- package/atoms/Prefetch/index.d.ts +3 -3
- package/atoms/Prefetch/index.js +3 -1
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +17 -14
- package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +19 -89
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js +67 -1
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +5 -14
- package/atoms/ScrollAnimation/ScrollAnimation.d.ts +13 -51
- package/atoms/ScrollAnimation/ScrollAnimation.js +21 -1
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +37 -14
- package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +19 -6
- package/atoms/ScrollAnimation/ScrollAnimationChild.js +53 -1
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +6 -9
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +8 -2
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +17 -1
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +8 -8
- package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +14 -26
- package/atoms/ScrollAnimation/ScrollAnimationParent.js +27 -1
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +6 -9
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +15 -2
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +17 -1
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +24 -16
- package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +10 -8
- package/atoms/ScrollAnimation/animationScrollWithEase.js +36 -1
- package/atoms/ScrollAnimation/index.cjs +9 -24
- package/atoms/ScrollAnimation/index.d.ts +7 -7
- package/atoms/ScrollAnimation/index.js +7 -1
- package/atoms/ScrollReveal/ScrollReveal.cjs +7 -4
- package/atoms/ScrollReveal/ScrollReveal.d.ts +16 -59
- package/atoms/ScrollReveal/ScrollReveal.js +54 -1
- package/atoms/ScrollReveal/index.cjs +3 -12
- package/atoms/ScrollReveal/index.d.ts +1 -1
- package/atoms/ScrollReveal/index.js +1 -1
- package/atoms/index.cjs +5 -18
- package/atoms/index.d.ts +8 -8
- package/atoms/index.js +8 -1
- package/decorators/index.cjs +3 -12
- package/decorators/index.d.ts +1 -1
- package/decorators/index.js +1 -1
- package/decorators/withTransition.cjs +44 -29
- package/decorators/withTransition.d.ts +21 -33
- package/decorators/withTransition.js +60 -1
- package/index.cjs +1 -1
- package/index.d.ts +5 -5
- package/index.js +5 -1
- package/molecules/Accordion/Accordion.cjs +7 -10
- package/molecules/Accordion/Accordion.d.ts +5 -23
- package/molecules/Accordion/Accordion.js +19 -1
- package/molecules/Accordion/AccordionCore.cjs +6 -8
- package/molecules/Accordion/AccordionCore.d.ts +22 -70
- package/molecules/Accordion/AccordionCore.js +32 -1
- package/molecules/Accordion/AccordionItem.cjs +39 -23
- package/molecules/Accordion/AccordionItem.d.ts +24 -94
- package/molecules/Accordion/AccordionItem.js +153 -1
- package/molecules/Accordion/index.cjs +21 -0
- package/molecules/Accordion/index.d.ts +2 -0
- package/molecules/Accordion/index.js +2 -0
- package/molecules/Menu/Menu.cjs +6 -10
- package/molecules/Menu/Menu.d.ts +24 -84
- package/molecules/Menu/Menu.js +114 -1
- package/molecules/Menu/MenuBtn.cjs +7 -5
- package/molecules/Menu/MenuBtn.d.ts +7 -9
- package/molecules/Menu/MenuBtn.js +30 -1
- package/molecules/Menu/MenuList.cjs +13 -11
- package/molecules/Menu/MenuList.d.ts +16 -53
- package/molecules/Menu/MenuList.js +113 -1
- package/molecules/Menu/index.cjs +5 -16
- package/molecules/Menu/index.d.ts +3 -3
- package/molecules/Menu/index.js +3 -1
- package/molecules/Modal/Modal.cjs +42 -13
- package/molecules/Modal/Modal.d.ts +69 -140
- package/molecules/Modal/Modal.js +163 -1
- package/molecules/Modal/ModalWithTransition.cjs +4 -7
- package/molecules/Modal/ModalWithTransition.d.ts +6 -22
- package/molecules/Modal/ModalWithTransition.js +46 -1
- package/molecules/Modal/index.cjs +21 -0
- package/molecules/Modal/index.d.ts +2 -0
- package/molecules/Modal/index.js +2 -0
- package/molecules/Panel/Panel.cjs +41 -26
- package/molecules/Panel/Panel.d.ts +22 -21
- package/molecules/Panel/Panel.js +108 -1
- package/molecules/Panel/index.cjs +20 -0
- package/molecules/Panel/index.d.ts +1 -0
- package/molecules/Panel/index.js +1 -0
- package/molecules/Slider/AbstractSliderChild.cjs +7 -9
- package/molecules/Slider/AbstractSliderChild.d.ts +11 -30
- package/molecules/Slider/AbstractSliderChild.js +48 -1
- package/molecules/Slider/Slider.cjs +45 -30
- package/molecules/Slider/Slider.d.ts +40 -157
- package/molecules/Slider/Slider.js +279 -1
- package/molecules/Slider/SliderBtn.cjs +4 -7
- package/molecules/Slider/SliderBtn.d.ts +12 -23
- package/molecules/Slider/SliderBtn.js +34 -1
- package/molecules/Slider/SliderCount.cjs +4 -7
- package/molecules/Slider/SliderCount.d.ts +10 -16
- package/molecules/Slider/SliderCount.js +19 -1
- package/molecules/Slider/SliderDots.cjs +8 -8
- package/molecules/Slider/SliderDots.d.ts +11 -31
- package/molecules/Slider/SliderDots.js +32 -1
- package/molecules/Slider/SliderDrag.cjs +2 -2
- package/molecules/Slider/SliderDrag.d.ts +12 -30
- package/molecules/Slider/SliderDrag.js +34 -1
- package/molecules/Slider/SliderItem.cjs +12 -6
- package/molecules/Slider/SliderItem.d.ts +21 -33
- package/molecules/Slider/SliderItem.js +93 -1
- package/molecules/Slider/SliderProgress.cjs +4 -7
- package/molecules/Slider/SliderProgress.d.ts +10 -25
- package/molecules/Slider/SliderProgress.js +26 -1
- package/molecules/Slider/index.cjs +10 -26
- package/molecules/Slider/index.d.ts +8 -8
- package/molecules/Slider/index.js +8 -1
- package/molecules/Sticky/Sticky.cjs +16 -10
- package/molecules/Sticky/Sticky.d.ts +30 -68
- package/molecules/Sticky/Sticky.js +110 -1
- package/molecules/Sticky/index.cjs +20 -0
- package/molecules/Sticky/index.d.ts +1 -0
- package/molecules/Sticky/index.js +1 -0
- package/molecules/TableOfContent/TableOfContent.cjs +5 -8
- package/molecules/TableOfContent/TableOfContent.d.ts +19 -41
- package/molecules/TableOfContent/TableOfContent.js +42 -1
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +9 -5
- package/molecules/TableOfContent/TableOfContentAnchor.d.ts +14 -17
- package/molecules/TableOfContent/TableOfContentAnchor.js +43 -1
- package/molecules/TableOfContent/index.cjs +4 -14
- package/molecules/TableOfContent/index.d.ts +2 -2
- package/molecules/TableOfContent/index.js +2 -1
- package/molecules/Tabs/Tabs.cjs +42 -22
- package/molecules/Tabs/Tabs.d.ts +28 -90
- package/molecules/Tabs/Tabs.js +123 -1
- package/molecules/Tabs/index.cjs +20 -0
- package/molecules/Tabs/index.d.ts +1 -0
- package/molecules/Tabs/index.js +1 -0
- package/molecules/index.cjs +7 -24
- package/molecules/index.d.ts +9 -10
- package/molecules/index.js +9 -1
- package/organisms/Frame/Frame.cjs +20 -43
- package/organisms/Frame/Frame.d.ts +21 -98
- package/organisms/Frame/Frame.js +161 -1
- package/organisms/Frame/FrameAnchor.cjs +2 -2
- package/organisms/Frame/FrameAnchor.d.ts +7 -16
- package/organisms/Frame/FrameAnchor.js +18 -1
- package/organisms/Frame/FrameForm.cjs +2 -2
- package/organisms/Frame/FrameForm.d.ts +10 -16
- package/organisms/Frame/FrameForm.js +18 -1
- package/organisms/Frame/FrameTarget.cjs +15 -7
- package/organisms/Frame/FrameTarget.d.ts +17 -26
- package/organisms/Frame/FrameTarget.js +79 -1
- package/organisms/Frame/index.cjs +6 -18
- package/organisms/Frame/index.d.ts +4 -4
- package/organisms/Frame/index.js +4 -1
- package/organisms/index.cjs +1 -1
- package/organisms/index.d.ts +1 -1
- package/organisms/index.js +1 -1
- package/package.json +2 -2
- package/primitives/Draggable/Draggable.cjs +9 -6
- package/primitives/Draggable/Draggable.d.ts +10 -11
- package/primitives/Draggable/Draggable.js +33 -1
- package/primitives/Draggable/index.cjs +20 -0
- package/primitives/Draggable/index.d.ts +1 -0
- package/primitives/Draggable/index.js +1 -0
- package/primitives/Sentinel/Sentinel.cjs +2 -2
- package/primitives/Sentinel/Sentinel.d.ts +6 -5
- package/primitives/Sentinel/Sentinel.js +15 -1
- package/primitives/Sentinel/index.cjs +20 -0
- package/primitives/Sentinel/index.d.ts +1 -0
- package/primitives/Sentinel/index.js +1 -0
- package/primitives/Transition/Transition.cjs +12 -3
- package/primitives/Transition/Transition.d.ts +13 -7
- package/primitives/Transition/Transition.js +16 -1
- package/primitives/Transition/index.cjs +20 -0
- package/primitives/Transition/index.d.ts +1 -0
- package/primitives/Transition/index.js +1 -0
- package/primitives/index.cjs +5 -16
- package/primitives/index.d.ts +3 -3
- package/primitives/index.js +3 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,22 +15,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
19
|
var __publicField = (obj, key, value) => {
|
|
23
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
21
|
return value;
|
|
25
22
|
};
|
|
26
23
|
|
|
27
|
-
// packages/ui/molecules/Slider/SliderProgress.
|
|
24
|
+
// packages/ui/molecules/Slider/SliderProgress.ts
|
|
28
25
|
var SliderProgress_exports = {};
|
|
29
26
|
__export(SliderProgress_exports, {
|
|
30
|
-
|
|
27
|
+
SliderProgress: () => SliderProgress
|
|
31
28
|
});
|
|
32
29
|
module.exports = __toCommonJS(SliderProgress_exports);
|
|
33
30
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
34
|
-
var import_AbstractSliderChild =
|
|
35
|
-
var SliderProgress = class extends import_AbstractSliderChild.
|
|
31
|
+
var import_AbstractSliderChild = require("./AbstractSliderChild.cjs");
|
|
32
|
+
var SliderProgress = class extends import_AbstractSliderChild.AbstractSliderChild {
|
|
36
33
|
update(index) {
|
|
37
34
|
import_utils.domScheduler.read(() => {
|
|
38
35
|
const { progress } = this.$refs;
|
|
@@ -1,35 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
1
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
2
|
+
import { AbstractSliderChild } from './AbstractSliderChild.js';
|
|
3
|
+
export interface SliderProgressProps extends BaseProps {
|
|
4
|
+
$refs: {
|
|
5
|
+
progress: HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
9
8
|
/**
|
|
10
9
|
* SliderProgress class.
|
|
11
10
|
*/
|
|
12
|
-
export
|
|
11
|
+
export declare class SliderProgress<T extends BaseProps = BaseProps> extends AbstractSliderChild<T & SliderProgressProps> {
|
|
13
12
|
/**
|
|
14
13
|
* Config.
|
|
15
14
|
*/
|
|
16
|
-
static config:
|
|
17
|
-
name: string;
|
|
18
|
-
refs: string[];
|
|
19
|
-
};
|
|
15
|
+
static config: BaseConfig;
|
|
20
16
|
/**
|
|
21
17
|
* Update the progress indicator.
|
|
22
|
-
*
|
|
23
|
-
* @this {SliderProgressInterface}
|
|
24
|
-
* @param {number} index The new active index.
|
|
25
|
-
* @returns {void}
|
|
26
18
|
*/
|
|
27
|
-
update(
|
|
19
|
+
update(index: number): void;
|
|
28
20
|
}
|
|
29
|
-
export type SliderProgressInterface = SliderProgress & {
|
|
30
|
-
$refs: {
|
|
31
|
-
progress: HTMLElement;
|
|
32
|
-
};
|
|
33
|
-
$parent: import('./Slider.js').default;
|
|
34
|
-
};
|
|
35
|
-
import AbstractSliderChild from "./AbstractSliderChild.js";
|
|
@@ -1 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { transform, map, domScheduler } from "@studiometa/js-toolkit/utils";
|
|
8
|
+
import { AbstractSliderChild } from "./AbstractSliderChild.js";
|
|
9
|
+
class SliderProgress extends AbstractSliderChild {
|
|
10
|
+
update(index) {
|
|
11
|
+
domScheduler.read(() => {
|
|
12
|
+
const { progress } = this.$refs;
|
|
13
|
+
const x = map(index, 0, this.$parent.indexMax, progress.clientWidth * -1, 0);
|
|
14
|
+
domScheduler.write(() => {
|
|
15
|
+
transform(progress, { x });
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
__publicField(SliderProgress, "config", {
|
|
21
|
+
name: "SliderProgress",
|
|
22
|
+
refs: ["progress"]
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
SliderProgress
|
|
26
|
+
};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
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
5
|
var __copyProps = (to, from, except, desc) => {
|
|
12
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -16,28 +10,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
10
|
}
|
|
17
11
|
return to;
|
|
18
12
|
};
|
|
19
|
-
var
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
15
|
|
|
22
|
-
// packages/ui/molecules/Slider/index.
|
|
16
|
+
// packages/ui/molecules/Slider/index.ts
|
|
23
17
|
var Slider_exports = {};
|
|
24
|
-
__export(Slider_exports, {
|
|
25
|
-
AbstractSliderChild: () => import_AbstractSliderChild.default,
|
|
26
|
-
Slider: () => import_Slider.default,
|
|
27
|
-
SliderBtn: () => import_SliderBtn.default,
|
|
28
|
-
SliderCount: () => import_SliderCount.default,
|
|
29
|
-
SliderDots: () => import_SliderDots.default,
|
|
30
|
-
SliderDrag: () => import_SliderDrag.default,
|
|
31
|
-
SliderItem: () => import_SliderItem.default,
|
|
32
|
-
SliderProgress: () => import_SliderProgress.default
|
|
33
|
-
});
|
|
34
18
|
module.exports = __toCommonJS(Slider_exports);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
__reExport(Slider_exports, require("./AbstractSliderChild.cjs"), module.exports);
|
|
20
|
+
__reExport(Slider_exports, require("./Slider.cjs"), module.exports);
|
|
21
|
+
__reExport(Slider_exports, require("./SliderBtn.cjs"), module.exports);
|
|
22
|
+
__reExport(Slider_exports, require("./SliderCount.cjs"), module.exports);
|
|
23
|
+
__reExport(Slider_exports, require("./SliderDrag.cjs"), module.exports);
|
|
24
|
+
__reExport(Slider_exports, require("./SliderItem.cjs"), module.exports);
|
|
25
|
+
__reExport(Slider_exports, require("./SliderProgress.cjs"), module.exports);
|
|
26
|
+
__reExport(Slider_exports, require("./SliderDots.cjs"), module.exports);
|
|
43
27
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from './AbstractSliderChild.js';
|
|
2
|
+
export * from './Slider.js';
|
|
3
|
+
export * from './SliderBtn.js';
|
|
4
|
+
export * from './SliderCount.js';
|
|
5
|
+
export * from './SliderDrag.js';
|
|
6
|
+
export * from './SliderItem.js';
|
|
7
|
+
export * from './SliderProgress.js';
|
|
8
|
+
export * from './SliderDots.js';
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
export * from "./AbstractSliderChild.js";
|
|
2
|
+
export * from "./Slider.js";
|
|
3
|
+
export * from "./SliderBtn.js";
|
|
4
|
+
export * from "./SliderCount.js";
|
|
5
|
+
export * from "./SliderDrag.js";
|
|
6
|
+
export * from "./SliderItem.js";
|
|
7
|
+
export * from "./SliderProgress.js";
|
|
8
|
+
export * from "./SliderDots.js";
|
|
@@ -21,17 +21,20 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/molecules/Sticky/Sticky.
|
|
24
|
+
// packages/ui/molecules/Sticky/Sticky.ts
|
|
25
25
|
var Sticky_exports = {};
|
|
26
26
|
__export(Sticky_exports, {
|
|
27
|
-
|
|
27
|
+
Sticky: () => Sticky
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(Sticky_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
31
31
|
var import_primitives = require("../../primitives/index.cjs");
|
|
32
32
|
var _Sticky = class extends import_js_toolkit.Base {
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
__publicField(this, "isSticky", false);
|
|
36
|
+
__publicField(this, "isVisible", true);
|
|
37
|
+
}
|
|
35
38
|
set y(value) {
|
|
36
39
|
this.$refs.inner.style.transform = `translateY(${value}px) translateZ(0px)`;
|
|
37
40
|
}
|
|
@@ -80,8 +83,10 @@ var _Sticky = class extends import_js_toolkit.Base {
|
|
|
80
83
|
}
|
|
81
84
|
setSentinelSize() {
|
|
82
85
|
const { instances } = this;
|
|
83
|
-
const index = instances.
|
|
84
|
-
const height = instances.slice(0, index).filter(
|
|
86
|
+
const index = instances.indexOf(this);
|
|
87
|
+
const height = instances.slice(0, index).filter(
|
|
88
|
+
(instance) => this.closestRelativeElement(instance.$el).contains(this.$el)
|
|
89
|
+
).reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);
|
|
85
90
|
this.$refs.sentinelRef.style.height = `${height + 1}px`;
|
|
86
91
|
this.$el.style.top = `${height}px`;
|
|
87
92
|
this.$el.style.zIndex = String(this.$options.zIndex - index);
|
|
@@ -92,10 +97,11 @@ var _Sticky = class extends import_js_toolkit.Base {
|
|
|
92
97
|
return;
|
|
93
98
|
}
|
|
94
99
|
const { instances } = this;
|
|
95
|
-
index = index
|
|
96
|
-
this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce(
|
|
97
|
-
|
|
98
|
-
|
|
100
|
+
index = index != null ? index : instances.indexOf(this);
|
|
101
|
+
this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce(
|
|
102
|
+
(y, instance) => y - instance.$refs.inner.offsetHeight,
|
|
103
|
+
this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1
|
|
104
|
+
);
|
|
99
105
|
}
|
|
100
106
|
closestRelativeElement(element) {
|
|
101
107
|
let parent = element.parentElement;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
+
import { Sentinel } from '../../primitives/index.js';
|
|
1
4
|
/**
|
|
2
5
|
* @typedef {Object} StickyRefs
|
|
3
6
|
* @property {HTMLElement} inner
|
|
@@ -9,80 +12,64 @@
|
|
|
9
12
|
* @property {{ zIndex: number, hideWhenUp: boolean, hideWhenDown: boolean }} $options
|
|
10
13
|
* @property {{ Sentinel: Sentinel[] }} $children
|
|
11
14
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
export interface StickyProps extends BaseProps {
|
|
16
|
+
$refs: {
|
|
17
|
+
inner: HTMLElement;
|
|
18
|
+
sentinelRef: HTMLElement;
|
|
19
|
+
};
|
|
20
|
+
$options: {
|
|
21
|
+
zIndex: number;
|
|
22
|
+
hideWhenUp: boolean;
|
|
23
|
+
hideWhenDown: boolean;
|
|
24
|
+
};
|
|
25
|
+
$children: {
|
|
26
|
+
Sentinel: Sentinel[];
|
|
27
|
+
};
|
|
28
|
+
}
|
|
15
29
|
/**
|
|
16
30
|
* Sticky class.
|
|
17
31
|
*/
|
|
18
|
-
export
|
|
32
|
+
export declare class Sticky<T extends BaseProps = BaseProps> extends Base<T & StickyProps> {
|
|
19
33
|
/**
|
|
20
34
|
* Config.
|
|
21
35
|
*/
|
|
22
|
-
static config:
|
|
23
|
-
name: string;
|
|
24
|
-
refs: string[];
|
|
25
|
-
components: {
|
|
26
|
-
Sentinel: typeof Sentinel;
|
|
27
|
-
};
|
|
28
|
-
options: {
|
|
29
|
-
zIndex: {
|
|
30
|
-
type: NumberConstructor;
|
|
31
|
-
default: number;
|
|
32
|
-
};
|
|
33
|
-
hideWhenUp: BooleanConstructor;
|
|
34
|
-
hideWhenDown: BooleanConstructor;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
36
|
+
static config: BaseConfig;
|
|
37
37
|
/**
|
|
38
38
|
* Holder for all instances.
|
|
39
|
-
* @type {Set<StickyInterface>}
|
|
40
39
|
*/
|
|
41
|
-
static instances: Set<
|
|
40
|
+
static instances: Set<Sticky>;
|
|
42
41
|
/**
|
|
43
42
|
* Is the component sticky?
|
|
44
|
-
* @type {boolean}
|
|
45
43
|
*/
|
|
46
44
|
isSticky: boolean;
|
|
47
45
|
/**
|
|
48
46
|
* Is the component visible?
|
|
49
|
-
* @type {Boolean}
|
|
50
47
|
*/
|
|
51
48
|
isVisible: boolean;
|
|
52
49
|
/**
|
|
53
50
|
* Set the Y value.
|
|
54
|
-
*
|
|
55
|
-
* @this {StickyInterface}
|
|
56
|
-
* @param {number} value
|
|
57
|
-
* @returns {void}
|
|
58
51
|
*/
|
|
59
|
-
set y(
|
|
52
|
+
set y(value: number);
|
|
60
53
|
/**
|
|
61
54
|
* Get instances as array.
|
|
62
|
-
* @return {Array<StickyInterface>}
|
|
63
55
|
*/
|
|
64
|
-
get instances():
|
|
56
|
+
get instances(): Sticky[];
|
|
65
57
|
/**
|
|
66
58
|
* Mounted hook.
|
|
67
|
-
* @this {StickyInterface}
|
|
68
59
|
*/
|
|
69
|
-
mounted(
|
|
60
|
+
mounted(): void;
|
|
70
61
|
/**
|
|
71
62
|
* Resized hook.
|
|
72
|
-
* @this {StickyInterface}
|
|
73
|
-
* @returns {void}
|
|
74
63
|
*/
|
|
75
|
-
resized(
|
|
64
|
+
resized(): void;
|
|
76
65
|
/**
|
|
77
66
|
* Destroyed hook.
|
|
78
|
-
* @this {StickyInterface}
|
|
79
67
|
*/
|
|
80
|
-
destroyed(
|
|
68
|
+
destroyed(): void;
|
|
81
69
|
/**
|
|
82
70
|
* Scrolled hook.
|
|
83
|
-
* @this {StickyInterface}
|
|
84
71
|
*/
|
|
85
|
-
scrolled(
|
|
72
|
+
scrolled(props: any): void;
|
|
86
73
|
/**
|
|
87
74
|
* Listen to the sentinel's `intersected` event to set the `isSticky` value.
|
|
88
75
|
*
|
|
@@ -92,50 +79,25 @@ export default class Sticky extends Base {
|
|
|
92
79
|
onSentinelIntersected([entry]: IntersectionObserverEntry[]): void;
|
|
93
80
|
/**
|
|
94
81
|
* Hide the sticky component when another one is sticky.
|
|
95
|
-
* @this {StickyInterface}
|
|
96
82
|
*/
|
|
97
|
-
hide(
|
|
83
|
+
hide(): void;
|
|
98
84
|
/**
|
|
99
85
|
* Show the sticky component when the other one is not sticky anymore.
|
|
100
|
-
* @this {StickyInterface}
|
|
101
86
|
*/
|
|
102
|
-
show(
|
|
87
|
+
show(): void;
|
|
103
88
|
/**
|
|
104
89
|
* Set the sentinel height based on the previous instances.
|
|
105
|
-
* @this {StickyInterface}
|
|
106
90
|
*/
|
|
107
|
-
setSentinelSize(
|
|
91
|
+
setSentinelSize(): void;
|
|
108
92
|
/**
|
|
109
93
|
* Set the component's position.
|
|
110
94
|
*
|
|
111
|
-
* @this {StickyInterface}
|
|
112
95
|
* @param {number} [index] The instance index in all the pages' instances.
|
|
113
96
|
* @returns {void}
|
|
114
97
|
*/
|
|
115
|
-
setPosition(
|
|
98
|
+
setPosition(index?: number): void;
|
|
116
99
|
/**
|
|
117
100
|
* Find the first parent which has a relative position.
|
|
118
|
-
*
|
|
119
|
-
* @param {HTMLElement} element
|
|
120
|
-
* @returns {HTMLElement}
|
|
121
101
|
*/
|
|
122
102
|
closestRelativeElement(element: HTMLElement): HTMLElement;
|
|
123
103
|
}
|
|
124
|
-
export type StickyRefs = {
|
|
125
|
-
inner: HTMLElement;
|
|
126
|
-
sentinelRef: HTMLElement;
|
|
127
|
-
};
|
|
128
|
-
export type StickyPrivateInterface = {
|
|
129
|
-
$refs: StickyRefs;
|
|
130
|
-
$options: {
|
|
131
|
-
zIndex: number;
|
|
132
|
-
hideWhenUp: boolean;
|
|
133
|
-
hideWhenDown: boolean;
|
|
134
|
-
};
|
|
135
|
-
$children: {
|
|
136
|
-
Sentinel: Sentinel[];
|
|
137
|
-
};
|
|
138
|
-
};
|
|
139
|
-
export type StickyInterface = Sticky & StickyPrivateInterface;
|
|
140
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
141
|
-
import { Sentinel } from "../../primitives/index.js";
|
|
@@ -1 +1,110 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
8
|
+
import { Sentinel } from "../../primitives/index.js";
|
|
9
|
+
const _Sticky = class extends Base {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
__publicField(this, "isSticky", false);
|
|
13
|
+
__publicField(this, "isVisible", true);
|
|
14
|
+
}
|
|
15
|
+
set y(value) {
|
|
16
|
+
this.$refs.inner.style.transform = `translateY(${value}px) translateZ(0px)`;
|
|
17
|
+
}
|
|
18
|
+
get instances() {
|
|
19
|
+
return Array.from(_Sticky.instances);
|
|
20
|
+
}
|
|
21
|
+
mounted() {
|
|
22
|
+
_Sticky.instances.add(this);
|
|
23
|
+
this.setSentinelSize();
|
|
24
|
+
}
|
|
25
|
+
resized() {
|
|
26
|
+
this.setSentinelSize();
|
|
27
|
+
}
|
|
28
|
+
destroyed() {
|
|
29
|
+
_Sticky.instances.delete(this);
|
|
30
|
+
}
|
|
31
|
+
scrolled(props) {
|
|
32
|
+
if (!this.isSticky || props.y === props.last.y) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (props.direction.y === "DOWN" && this.$options.hideWhenDown || props.direction.y === "UP" && this.$options.hideWhenUp) {
|
|
36
|
+
this.hide();
|
|
37
|
+
} else {
|
|
38
|
+
this.show();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
onSentinelIntersected([entry]) {
|
|
42
|
+
this.isSticky = entry.isIntersecting && entry.boundingClientRect.y < 0;
|
|
43
|
+
this.setPosition();
|
|
44
|
+
}
|
|
45
|
+
hide() {
|
|
46
|
+
if (!this.isVisible) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.isVisible = false;
|
|
50
|
+
this.$el.classList.add("pointer-events-none");
|
|
51
|
+
this.instances.forEach((instance, index) => instance.setPosition(index));
|
|
52
|
+
}
|
|
53
|
+
show() {
|
|
54
|
+
if (this.isVisible) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.isVisible = true;
|
|
58
|
+
this.$el.classList.remove("pointer-events-none");
|
|
59
|
+
this.instances.forEach((instance, index) => instance.setPosition(index));
|
|
60
|
+
}
|
|
61
|
+
setSentinelSize() {
|
|
62
|
+
const { instances } = this;
|
|
63
|
+
const index = instances.indexOf(this);
|
|
64
|
+
const height = instances.slice(0, index).filter(
|
|
65
|
+
(instance) => this.closestRelativeElement(instance.$el).contains(this.$el)
|
|
66
|
+
).reduce((acc, instance) => acc + instance.$el.offsetHeight, 0);
|
|
67
|
+
this.$refs.sentinelRef.style.height = `${height + 1}px`;
|
|
68
|
+
this.$el.style.top = `${height}px`;
|
|
69
|
+
this.$el.style.zIndex = String(this.$options.zIndex - index);
|
|
70
|
+
}
|
|
71
|
+
setPosition(index) {
|
|
72
|
+
if (!this.isSticky) {
|
|
73
|
+
this.y = 0;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const { instances } = this;
|
|
77
|
+
index = index != null ? index : instances.indexOf(this);
|
|
78
|
+
this.y = instances.slice(0, index).filter((instance) => instance.isSticky && !instance.isVisible).reduce(
|
|
79
|
+
(y, instance) => y - instance.$refs.inner.offsetHeight,
|
|
80
|
+
this.isVisible ? 0 : this.$refs.inner.offsetHeight * -1
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
closestRelativeElement(element) {
|
|
84
|
+
let parent = element.parentElement;
|
|
85
|
+
while (getComputedStyle(parent).position !== "relative" && parent.parentElement) {
|
|
86
|
+
parent = parent.parentElement;
|
|
87
|
+
}
|
|
88
|
+
return parent;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
let Sticky = _Sticky;
|
|
92
|
+
__publicField(Sticky, "config", {
|
|
93
|
+
name: "Sticky",
|
|
94
|
+
refs: ["inner", "sentinelRef"],
|
|
95
|
+
components: {
|
|
96
|
+
Sentinel
|
|
97
|
+
},
|
|
98
|
+
options: {
|
|
99
|
+
zIndex: {
|
|
100
|
+
type: Number,
|
|
101
|
+
default: 100
|
|
102
|
+
},
|
|
103
|
+
hideWhenUp: Boolean,
|
|
104
|
+
hideWhenDown: Boolean
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
__publicField(Sticky, "instances", /* @__PURE__ */ new Set());
|
|
108
|
+
export {
|
|
109
|
+
Sticky
|
|
110
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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/ui/molecules/Sticky/index.ts
|
|
17
|
+
var Sticky_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(Sticky_exports);
|
|
19
|
+
__reExport(Sticky_exports, require("./Sticky.cjs"), module.exports);
|
|
20
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Sticky.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Sticky.js";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,21 +15,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
19
|
var __publicField = (obj, key, value) => {
|
|
23
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
21
|
return value;
|
|
25
22
|
};
|
|
26
23
|
|
|
27
|
-
// packages/ui/molecules/TableOfContent/TableOfContent.
|
|
24
|
+
// packages/ui/molecules/TableOfContent/TableOfContent.ts
|
|
28
25
|
var TableOfContent_exports = {};
|
|
29
26
|
__export(TableOfContent_exports, {
|
|
30
|
-
|
|
27
|
+
TableOfContent: () => TableOfContent
|
|
31
28
|
});
|
|
32
29
|
module.exports = __toCommonJS(TableOfContent_exports);
|
|
33
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
34
|
-
var import_TableOfContentAnchor =
|
|
31
|
+
var import_TableOfContentAnchor = require("./TableOfContentAnchor.cjs");
|
|
35
32
|
var TableOfContent = class extends import_js_toolkit.Base {
|
|
36
33
|
mounted() {
|
|
37
34
|
if (this.$options.withTemplate) {
|
|
@@ -48,7 +45,7 @@ var TableOfContent = class extends import_js_toolkit.Base {
|
|
|
48
45
|
anchor.href = `#${section.id}`;
|
|
49
46
|
anchor.innerHTML = section.textContent;
|
|
50
47
|
anchor.dataset.component = "TableOfContentAnchor";
|
|
51
|
-
this.$refs.list.
|
|
48
|
+
this.$refs.list.append(li);
|
|
52
49
|
});
|
|
53
50
|
}
|
|
54
51
|
};
|
|
@@ -56,7 +53,7 @@ __publicField(TableOfContent, "config", {
|
|
|
56
53
|
name: "TableOfContent",
|
|
57
54
|
refs: ["itemTemplate", "list"],
|
|
58
55
|
components: {
|
|
59
|
-
TableOfContentAnchor: import_TableOfContentAnchor.
|
|
56
|
+
TableOfContentAnchor: import_TableOfContentAnchor.TableOfContentAnchor
|
|
60
57
|
},
|
|
61
58
|
options: {
|
|
62
59
|
contentSelector: String,
|