@studiometa/ui 1.0.0-beta.1 → 1.0.0-rc.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/AnchorScrollTo/AnchorScrollTo.d.ts +2 -2
- package/AnchorScrollTo/AnchorScrollTo.js +0 -1
- package/AnchorScrollTo/AnchorScrollTo.js.map +2 -2
- package/Button/Button.twig +12 -9
- package/Button/StyledButton.twig +40 -5
- package/Button/StyledButtonRounded.twig +12 -42
- package/CircularMarquee/CircularMarquee.twig +30 -18
- package/Data/DataBind.js +1 -1
- package/Data/DataBind.js.map +2 -2
- package/Draggable/Draggable.js +7 -2
- package/Draggable/Draggable.js.map +2 -2
- package/Figure/Figure.d.ts +1 -0
- package/Figure/Figure.js.map +2 -2
- package/Frame/AbstractFrameTrigger.d.ts +43 -0
- package/Frame/AbstractFrameTrigger.js +72 -0
- package/Frame/AbstractFrameTrigger.js.map +7 -0
- package/Frame/Frame.d.ts +55 -27
- package/Frame/Frame.js +132 -138
- package/Frame/Frame.js.map +3 -3
- package/Frame/FrameAnchor.d.ts +7 -4
- package/Frame/FrameAnchor.js +8 -5
- package/Frame/FrameAnchor.js.map +2 -2
- package/Frame/FrameForm.d.ts +22 -4
- package/Frame/FrameForm.js +43 -6
- package/Frame/FrameForm.js.map +2 -2
- package/Frame/FrameLoader.d.ts +22 -0
- package/Frame/FrameLoader.js +22 -0
- package/Frame/FrameLoader.js.map +7 -0
- package/Frame/FrameTarget.d.ts +6 -17
- package/Frame/FrameTarget.js +25 -60
- package/Frame/FrameTarget.js.map +2 -2
- package/Frame/FrameTriggerLoader.d.ts +13 -0
- package/Frame/FrameTriggerLoader.js +13 -0
- package/Frame/FrameTriggerLoader.js.map +7 -0
- package/Frame/index.d.ts +4 -0
- package/Frame/index.js +4 -0
- package/Frame/index.js.map +2 -2
- package/Frame/types.d.ts +12 -0
- package/Frame/types.js +1 -0
- package/Frame/types.js.map +7 -0
- package/Frame/utils.d.ts +9 -0
- package/Frame/utils.js +13 -0
- package/Frame/utils.js.map +7 -0
- package/LICENSE.md +110 -0
- package/Reinsurance/Reinsurance.twig +6 -6
- package/Slider/AbstractSliderChild.d.ts +5 -9
- package/Slider/AbstractSliderChild.js +0 -11
- package/Slider/AbstractSliderChild.js.map +2 -2
- package/Slider/Slider.d.ts +23 -30
- package/Slider/Slider.js +40 -100
- package/Slider/Slider.js.map +2 -2
- package/Slider/SliderBtn.d.ts +0 -3
- package/Slider/SliderBtn.js +3 -7
- package/Slider/SliderBtn.js.map +2 -2
- package/Slider/SliderCount.d.ts +0 -2
- package/Slider/SliderCount.js +4 -3
- package/Slider/SliderCount.js.map +2 -2
- package/Slider/SliderDots.d.ts +0 -3
- package/Slider/SliderDots.js +6 -7
- package/Slider/SliderDots.js.map +2 -2
- package/Slider/SliderDrag.d.ts +0 -2
- package/Slider/SliderDrag.js +0 -2
- package/Slider/SliderDrag.js.map +2 -2
- package/Slider/SliderItem.d.ts +10 -26
- package/Slider/SliderItem.js +9 -41
- package/Slider/SliderItem.js.map +2 -2
- package/Tabs/Tabs.twig +73 -9
- package/decorators/withTransition.d.ts +4 -0
- package/decorators/withTransition.js +40 -45
- package/decorators/withTransition.js.map +2 -2
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +2 -2
- package/package.json +4 -3
- package/LICENSE +0 -21
- package/TableOfContent/TableOfContent.d.ts +0 -39
- package/TableOfContent/TableOfContent.js +0 -50
- package/TableOfContent/TableOfContent.js.map +0 -7
- package/TableOfContent/TableOfContentAnchor.d.ts +0 -36
- package/TableOfContent/TableOfContentAnchor.js +0 -54
- package/TableOfContent/TableOfContentAnchor.js.map +0 -7
- package/TableOfContent/index.d.ts +0 -2
- package/TableOfContent/index.js +0 -3
- package/TableOfContent/index.js.map +0 -7
package/Slider/SliderDots.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/Slider/SliderDots.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { withTransition } from '../decorators/index.js';\nimport { AbstractSliderChild } from './AbstractSliderChild.js';\n\nexport interface SliderDotsProps extends BaseProps {\n $refs: {\n dots: HTMLButtonElement[];\n };\n}\n\n/**\n * SliderDots class.\n */\nexport class SliderDots<\n T extends BaseProps = BaseProps,\n> extends withTransition<AbstractSliderChild>(AbstractSliderChild)<T & SliderDotsProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderDots',\n refs: ['dots[]'],\n };\n\n /**\n * Get target.\n
|
|
5
|
-
"mappings": "AACA,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AAW7B,MAAM,mBAEH,eAAoC,mBAAmB,EAAuB;AAAA;AAAA;AAAA;AAAA,EAItF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,QAAQ;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { withTransition } from '../decorators/index.js';\nimport { AbstractSliderChild } from './AbstractSliderChild.js';\n\nexport interface SliderDotsProps extends BaseProps {\n $refs: {\n dots: HTMLButtonElement[];\n };\n}\n\n/**\n * SliderDots class.\n */\nexport class SliderDots<\n T extends BaseProps = BaseProps,\n> extends withTransition<AbstractSliderChild>(AbstractSliderChild)<T & SliderDotsProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderDots',\n refs: ['dots[]'],\n };\n\n /**\n * Get target.\n */\n get target() {\n return this.$refs.dots;\n }\n\n /**\n * The current active index.\n */\n currentIndex = -1;\n\n /**\n * Update dots classes according to the new index.\n */\n update(index: number) {\n if (index !== this.currentIndex) {\n this.leave(this.$refs.dots[this.currentIndex]);\n this.enter(this.$refs.dots[index]);\n this.currentIndex = index;\n }\n }\n\n /**\n * Go to the given index on dot click.\n */\n onDotsClick({ index }: { index: number }) {\n this.$parent.goTo(index);\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AAW7B,MAAM,mBAEH,eAAoC,mBAAmB,EAAuB;AAAA;AAAA;AAAA;AAAA,EAItF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,QAAQ;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI,SAAS;AACX,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAKA,eAAe;AAAA;AAAA;AAAA;AAAA,EAKf,OAAO,OAAe;AACpB,QAAI,UAAU,KAAK,cAAc;AAC/B,WAAK,MAAM,KAAK,MAAM,KAAK,KAAK,YAAY,CAAC;AAC7C,WAAK,MAAM,KAAK,MAAM,KAAK,KAAK,CAAC;AACjC,WAAK,eAAe;AAAA,IACtB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY,EAAE,MAAM,GAAsB;AACxC,SAAK,QAAQ,KAAK,KAAK;AAAA,EACzB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/Slider/SliderDrag.d.ts
CHANGED
package/Slider/SliderDrag.js
CHANGED
package/Slider/SliderDrag.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/Slider/SliderDrag.ts"],
|
|
4
|
-
"sourcesContent": ["import type { BaseProps, BaseConfig, DragServiceProps } from '@studiometa/js-toolkit';\nimport { Base, withDrag } from '@studiometa/js-toolkit';\n\nexport interface SliderDragProps extends BaseProps {\n $options: {\n scrollLockThreshold: number;\n };\n}\n\n/**\n * SliderDrag class.\n */\nexport class SliderDrag<T extends BaseProps = BaseProps> extends withDrag(Base)<\n T & SliderDragProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderDrag',\n emits: ['start', 'drag', 'drop', 'inertia', 'stop'],\n options: {\n scrollLockThreshold: {\n type: Number,\n default: 10,\n },\n },\n };\n\n /**\n * Test if the scroll should be blocked. Used with the touchmove event to prevent\n * scrolling vertically when trying to drag the slider.\n */\n get shouldPreventScroll() {\n const { distance } = this.$services.get('dragged') as DragServiceProps;\n return (\n Math.abs(distance.x) > this.$options.scrollLockThreshold &&\n Math.abs(distance.x) > Math.abs(distance.y)\n );\n }\n\n /**\n * Touchmove handler.\n
|
|
5
|
-
"mappings": "AACA,SAAS,MAAM,gBAAgB;AAWxB,MAAM,mBAAoD,SAAS,IAAI,EAE5E;AAAA;AAAA;AAAA;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,OAAO,CAAC,SAAS,QAAQ,QAAQ,WAAW,MAAM;AAAA,IAClD,SAAS;AAAA,MACP,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,sBAAsB;AACxB,UAAM,EAAE,SAAS,IAAI,KAAK,UAAU,IAAI,SAAS;AACjD,WACE,KAAK,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,uBACrC,KAAK,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,SAAS,CAAC;AAAA,EAE9C;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import type { BaseProps, BaseConfig, DragServiceProps } from '@studiometa/js-toolkit';\nimport { Base, withDrag } from '@studiometa/js-toolkit';\n\nexport interface SliderDragProps extends BaseProps {\n $options: {\n scrollLockThreshold: number;\n };\n}\n\n/**\n * SliderDrag class.\n */\nexport class SliderDrag<T extends BaseProps = BaseProps> extends withDrag(Base)<\n T & SliderDragProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderDrag',\n emits: ['start', 'drag', 'drop', 'inertia', 'stop'],\n options: {\n scrollLockThreshold: {\n type: Number,\n default: 10,\n },\n },\n };\n\n /**\n * Test if the scroll should be blocked. Used with the touchmove event to prevent\n * scrolling vertically when trying to drag the slider.\n */\n get shouldPreventScroll() {\n const { distance } = this.$services.get('dragged') as DragServiceProps;\n return (\n Math.abs(distance.x) > this.$options.scrollLockThreshold &&\n Math.abs(distance.x) > Math.abs(distance.y)\n );\n }\n\n /**\n * Touchmove handler.\n */\n onTouchmove({ event }: { event: TouchEvent }) {\n if (this.shouldPreventScroll) {\n event.preventDefault();\n }\n }\n\n /**\n * Emit drag events.\n */\n dragged(props: DragServiceProps) {\n this.$emit(props.mode, props);\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,MAAM,gBAAgB;AAWxB,MAAM,mBAAoD,SAAS,IAAI,EAE5E;AAAA;AAAA;AAAA;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,OAAO,CAAC,SAAS,QAAQ,QAAQ,WAAW,MAAM;AAAA,IAClD,SAAS;AAAA,MACP,qBAAqB;AAAA,QACnB,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,sBAAsB;AACxB,UAAM,EAAE,SAAS,IAAI,KAAK,UAAU,IAAI,SAAS;AACjD,WACE,KAAK,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS,uBACrC,KAAK,IAAI,SAAS,CAAC,IAAI,KAAK,IAAI,SAAS,CAAC;AAAA,EAE9C;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY,EAAE,MAAM,GAA0B;AAC5C,QAAI,KAAK,qBAAqB;AAC5B,YAAM,eAAe;AAAA,IACvB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,QAAQ,OAAyB;AAC/B,SAAK,MAAM,MAAM,MAAM,KAAK;AAAA,EAC9B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/Slider/SliderItem.d.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
import { Base } from '@studiometa/js-toolkit';
|
|
2
2
|
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
-
|
|
3
|
+
export interface SliderItemProps extends BaseProps {
|
|
4
|
+
}
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* SliderItem class.
|
|
6
7
|
*/
|
|
7
|
-
export declare class SliderItem<T extends BaseProps = BaseProps> extends
|
|
8
|
+
export declare class SliderItem<T extends BaseProps = BaseProps> extends Base<T & SliderItemProps> {
|
|
8
9
|
/**
|
|
9
10
|
* Config.
|
|
10
11
|
*/
|
|
11
12
|
static config: BaseConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Wether the SliderItem is visible or not.
|
|
14
|
-
* @type {boolean}
|
|
15
|
-
*/
|
|
16
|
-
isVisible: boolean;
|
|
17
13
|
/**
|
|
18
14
|
* The SliderItem `x` position.
|
|
19
|
-
* @type {number}
|
|
20
15
|
*/
|
|
21
16
|
x: number;
|
|
22
17
|
/**
|
|
23
18
|
* The smoothed `x` position.
|
|
24
|
-
* @type {number}
|
|
25
19
|
*/
|
|
26
20
|
dampedX: number;
|
|
27
21
|
/**
|
|
@@ -37,7 +31,13 @@ export declare class SliderItem<T extends BaseProps = BaseProps> extends SliderI
|
|
|
37
31
|
width: number;
|
|
38
32
|
height: number;
|
|
39
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Wether the slider item size should be evaluated or not.
|
|
36
|
+
*/
|
|
40
37
|
shouldEvaluateRect: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Size of the slider item.
|
|
40
|
+
*/
|
|
41
41
|
get rect(): {
|
|
42
42
|
x: number;
|
|
43
43
|
y: number;
|
|
@@ -60,16 +60,11 @@ export declare class SliderItem<T extends BaseProps = BaseProps> extends SliderI
|
|
|
60
60
|
* Reset position to `0` on destroy.
|
|
61
61
|
*/
|
|
62
62
|
destroyed(): void;
|
|
63
|
-
/**
|
|
64
|
-
* Intersected hook.
|
|
65
|
-
*/
|
|
66
|
-
intersected([{ intersectionRatio, isIntersecting }]: IntersectionObserverEntry[]): void;
|
|
67
63
|
/**
|
|
68
64
|
* Ticked hook.
|
|
69
65
|
* @todo create AbstractSliderItem with `render` method
|
|
70
66
|
* @todo add state to SliderItem
|
|
71
67
|
* @todo add origin to SliderItem
|
|
72
|
-
* @returns {void}
|
|
73
68
|
*/
|
|
74
69
|
ticked(): void;
|
|
75
70
|
/**
|
|
@@ -96,15 +91,4 @@ export declare class SliderItem<T extends BaseProps = BaseProps> extends SliderI
|
|
|
96
91
|
* Render the component.
|
|
97
92
|
*/
|
|
98
93
|
render(): void;
|
|
99
|
-
/**
|
|
100
|
-
* Check if SliderItem is partially visible for the given target position.
|
|
101
|
-
*/
|
|
102
|
-
willBeVisible(targetPosition: number): boolean;
|
|
103
|
-
/**
|
|
104
|
-
* Check if SliderItem is fully visible for the given target position.
|
|
105
|
-
* @param {number} targetPosition
|
|
106
|
-
* @returns {boolean}
|
|
107
|
-
*/
|
|
108
|
-
willBeFullyVisible(targetPosition: any): boolean;
|
|
109
94
|
}
|
|
110
|
-
export {};
|
package/Slider/SliderItem.js
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
|
-
import { Base
|
|
1
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
2
2
|
import { damp, domScheduler, transform } from "@studiometa/js-toolkit/utils";
|
|
3
|
-
class SliderItem extends
|
|
4
|
-
threshold: [0, 1]
|
|
5
|
-
}) {
|
|
3
|
+
class SliderItem extends Base {
|
|
6
4
|
/**
|
|
7
5
|
* Config.
|
|
8
6
|
*/
|
|
9
7
|
static config = {
|
|
10
|
-
name: "SliderItem"
|
|
11
|
-
emits: ["is-fully-visible", "is-partially-visible", "is-hidden"]
|
|
8
|
+
name: "SliderItem"
|
|
12
9
|
};
|
|
13
|
-
/**
|
|
14
|
-
* Wether the SliderItem is visible or not.
|
|
15
|
-
* @type {boolean}
|
|
16
|
-
*/
|
|
17
|
-
isVisible = false;
|
|
18
10
|
/**
|
|
19
11
|
* The SliderItem `x` position.
|
|
20
|
-
* @type {number}
|
|
21
12
|
*/
|
|
22
13
|
x = 0;
|
|
23
14
|
/**
|
|
24
15
|
* The smoothed `x` position.
|
|
25
|
-
* @type {number}
|
|
26
16
|
*/
|
|
27
17
|
dampedX = 0;
|
|
28
18
|
/**
|
|
29
19
|
* Item original position.
|
|
30
20
|
*/
|
|
31
21
|
__rect;
|
|
22
|
+
/**
|
|
23
|
+
* Wether the slider item size should be evaluated or not.
|
|
24
|
+
*/
|
|
32
25
|
shouldEvaluateRect = false;
|
|
26
|
+
/**
|
|
27
|
+
* Size of the slider item.
|
|
28
|
+
*/
|
|
33
29
|
get rect() {
|
|
34
30
|
if (!this.__rect || this.shouldEvaluateRect) {
|
|
35
31
|
this.shouldEvaluateRect = false;
|
|
@@ -62,25 +58,11 @@ class SliderItem extends withIntersectionObserver(Base, {
|
|
|
62
58
|
destroyed() {
|
|
63
59
|
this.moveInstantly(0);
|
|
64
60
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Intersected hook.
|
|
67
|
-
*/
|
|
68
|
-
intersected([{ intersectionRatio, isIntersecting }]) {
|
|
69
|
-
if (intersectionRatio >= 1) {
|
|
70
|
-
this.$emit("is-fully-visible");
|
|
71
|
-
} else if (intersectionRatio > 0) {
|
|
72
|
-
this.$emit("is-partially-visible");
|
|
73
|
-
} else {
|
|
74
|
-
this.$emit("is-hidden");
|
|
75
|
-
}
|
|
76
|
-
this.isVisible = isIntersecting;
|
|
77
|
-
}
|
|
78
61
|
/**
|
|
79
62
|
* Ticked hook.
|
|
80
63
|
* @todo create AbstractSliderItem with `render` method
|
|
81
64
|
* @todo add state to SliderItem
|
|
82
65
|
* @todo add origin to SliderItem
|
|
83
|
-
* @returns {void}
|
|
84
66
|
*/
|
|
85
67
|
ticked() {
|
|
86
68
|
this.dampedX = damp(this.x, this.dampedX, 0.1, 1e-5);
|
|
@@ -134,20 +116,6 @@ class SliderItem extends withIntersectionObserver(Base, {
|
|
|
134
116
|
transform(this.$el, { x: this.dampedX });
|
|
135
117
|
});
|
|
136
118
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Check if SliderItem is partially visible for the given target position.
|
|
139
|
-
*/
|
|
140
|
-
willBeVisible(targetPosition) {
|
|
141
|
-
return this.rect.x + targetPosition < window.innerWidth * 1.5 && this.rect.x + targetPosition + this.rect.width > window.innerWidth * -0.5;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Check if SliderItem is fully visible for the given target position.
|
|
145
|
-
* @param {number} targetPosition
|
|
146
|
-
* @returns {boolean}
|
|
147
|
-
*/
|
|
148
|
-
willBeFullyVisible(targetPosition) {
|
|
149
|
-
return this.rect.x + targetPosition < window.innerWidth && this.rect.x + targetPosition > 0 && this.rect.x + targetPosition + this.rect.width < window.innerWidth && this.rect.x + targetPosition + this.rect.width > 0;
|
|
150
|
-
}
|
|
151
119
|
}
|
|
152
120
|
export {
|
|
153
121
|
SliderItem
|
package/Slider/SliderItem.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/Slider/SliderItem.ts"],
|
|
4
|
-
"sourcesContent": ["import { Base
|
|
5
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { damp, domScheduler, transform } from '@studiometa/js-toolkit/utils';\n\nexport interface SliderItemProps extends BaseProps {}\n\n/**\n * SliderItem class.\n */\nexport class SliderItem<T extends BaseProps = BaseProps> extends Base<T & SliderItemProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'SliderItem',\n };\n\n /**\n * The SliderItem `x` position.\n */\n x = 0;\n\n /**\n * The smoothed `x` position.\n */\n dampedX = 0;\n\n /**\n * Item original position.\n */\n __rect: {\n x: number;\n y: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n width: number;\n height: number;\n };\n\n /**\n * Wether the slider item size should be evaluated or not.\n */\n shouldEvaluateRect = false;\n\n /**\n * Size of the slider item.\n */\n get rect() {\n if (!this.__rect || this.shouldEvaluateRect) {\n this.shouldEvaluateRect = false;\n const x = this.x * -1;\n const rect = this.$el.getBoundingClientRect().toJSON();\n this.__rect = {\n ...rect,\n left: rect.left + x,\n right: rect.left + x + rect.width,\n x: rect.left + x,\n };\n }\n\n return this.__rect;\n }\n\n /**\n * Mounted hook\n */\n mounted() {\n this.setAccessibilityAttributes();\n }\n\n /**\n * Update SliderItem bounding rectangle on resize.\n */\n resized() {\n this.shouldEvaluateRect = true;\n }\n\n /**\n * Reset position to `0` on destroy.\n */\n destroyed() {\n this.moveInstantly(0);\n }\n\n /**\n * Ticked hook.\n * @todo create AbstractSliderItem with `render` method\n * @todo add state to SliderItem\n * @todo add origin to SliderItem\n */\n ticked() {\n this.dampedX = damp(this.x, this.dampedX, 0.1, 0.00001);\n this.render();\n\n if (this.dampedX === this.x) {\n this.$services.disable('ticked');\n }\n }\n\n /**\n * Set accessibility attributes for the component\n */\n setAccessibilityAttributes() {\n this.$el.setAttribute('role', 'group');\n this.$el.setAttribute('aria-roledescription', 'slide');\n this.$el.setAttribute('aria-label', this.$id);\n }\n\n /**\n * Enable the SliderItem.\n */\n activate() {\n this.$el.classList.add('is-active');\n }\n\n /**\n * Disable the SliderItem.\n */\n disactivate() {\n this.$el.classList.remove('is-active');\n }\n\n /**\n * Move the SliderItem to the given target position.\n */\n move(targetPosition: number) {\n this.x = targetPosition;\n\n if (!this.$services.has('ticked')) {\n this.$services.enable('ticked');\n }\n }\n\n /**\n * Move the SliderItem instantly to the given target position.\n */\n moveInstantly(targetPosition: number) {\n this.x = targetPosition;\n this.dampedX = targetPosition;\n this.render();\n }\n\n /**\n * Render the component.\n */\n render() {\n domScheduler.write(() => {\n transform(this.$el, { x: this.dampedX });\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,MAAM,cAAc,iBAAiB;AAOvC,MAAM,mBAAoD,KAA0B;AAAA;AAAA;AAAA;AAAA,EAIzF,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAKA,IAAI;AAAA;AAAA;AAAA;AAAA,EAKJ,UAAU;AAAA;AAAA;AAAA;AAAA,EAKV;AAAA;AAAA;AAAA;AAAA,EAcA,qBAAqB;AAAA;AAAA;AAAA;AAAA,EAKrB,IAAI,OAAO;AACT,QAAI,CAAC,KAAK,UAAU,KAAK,oBAAoB;AAC3C,WAAK,qBAAqB;AAC1B,YAAM,IAAI,KAAK,IAAI;AACnB,YAAM,OAAO,KAAK,IAAI,sBAAsB,EAAE,OAAO;AACrD,WAAK,SAAS;AAAA,QACZ,GAAG;AAAA,QACH,MAAM,KAAK,OAAO;AAAA,QAClB,OAAO,KAAK,OAAO,IAAI,KAAK;AAAA,QAC5B,GAAG,KAAK,OAAO;AAAA,MACjB;AAAA,IACF;AAEA,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,SAAK,2BAA2B;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU;AACR,SAAK,qBAAqB;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY;AACV,SAAK,cAAc,CAAC;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,SAAS;AACP,SAAK,UAAU,KAAK,KAAK,GAAG,KAAK,SAAS,KAAK,IAAO;AACtD,SAAK,OAAO;AAEZ,QAAI,KAAK,YAAY,KAAK,GAAG;AAC3B,WAAK,UAAU,QAAQ,QAAQ;AAAA,IACjC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,6BAA6B;AAC3B,SAAK,IAAI,aAAa,QAAQ,OAAO;AACrC,SAAK,IAAI,aAAa,wBAAwB,OAAO;AACrD,SAAK,IAAI,aAAa,cAAc,KAAK,GAAG;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA,EAKA,WAAW;AACT,SAAK,IAAI,UAAU,IAAI,WAAW;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,cAAc;AACZ,SAAK,IAAI,UAAU,OAAO,WAAW;AAAA,EACvC;AAAA;AAAA;AAAA;AAAA,EAKA,KAAK,gBAAwB;AAC3B,SAAK,IAAI;AAET,QAAI,CAAC,KAAK,UAAU,IAAI,QAAQ,GAAG;AACjC,WAAK,UAAU,OAAO,QAAQ;AAAA,IAChC;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,cAAc,gBAAwB;AACpC,SAAK,IAAI;AACT,SAAK,UAAU;AACf,SAAK,OAAO;AAAA,EACd;AAAA;AAAA;AAAA;AAAA,EAKA,SAAS;AACP,iBAAa,MAAM,MAAM;AACvB,gBAAU,KAAK,KAAK,EAAE,GAAG,KAAK,QAAQ,CAAC;AAAA,IACzC,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/Tabs/Tabs.twig
CHANGED
|
@@ -1,7 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
{#
|
|
2
|
+
/**
|
|
3
|
+
* @file
|
|
4
|
+
* Tabs component.
|
|
5
|
+
*
|
|
6
|
+
* @param array $items
|
|
7
|
+
* @param array $attr
|
|
8
|
+
* Custom attributes for the root element.
|
|
9
|
+
*
|
|
10
|
+
* @block $title_wrapper
|
|
11
|
+
* @block $title
|
|
12
|
+
* @block $content_wrapper
|
|
13
|
+
* @block $content
|
|
14
|
+
*/
|
|
15
|
+
#}
|
|
16
|
+
|
|
17
|
+
{% set attributes =
|
|
18
|
+
merge_html_attributes(
|
|
19
|
+
attr ?? null,
|
|
20
|
+
{
|
|
21
|
+
data_component: 'Tabs',
|
|
22
|
+
data_option_styles: {
|
|
23
|
+
btn: {
|
|
24
|
+
open: {
|
|
25
|
+
borderBottomColor: '#fff'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
{}
|
|
31
|
+
)
|
|
32
|
+
%}
|
|
33
|
+
|
|
34
|
+
{% set btn_attributes =
|
|
35
|
+
merge_html_attributes(
|
|
36
|
+
btn_attr ?? null,
|
|
37
|
+
{
|
|
38
|
+
type: 'button',
|
|
39
|
+
data_ref: 'btn[]',
|
|
40
|
+
style: {
|
|
41
|
+
borderBottom: '1px solid transparent'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{}
|
|
45
|
+
)
|
|
46
|
+
%}
|
|
47
|
+
|
|
48
|
+
{% set content_attributes =
|
|
49
|
+
merge_html_attributes(
|
|
50
|
+
content_attr ?? null,
|
|
51
|
+
{
|
|
52
|
+
data_ref: 'content[]',
|
|
53
|
+
aria_hidden: 'false'
|
|
54
|
+
},
|
|
55
|
+
{}
|
|
56
|
+
)
|
|
57
|
+
%}
|
|
58
|
+
|
|
59
|
+
<div {{ html_attributes(attributes) }}>
|
|
2
60
|
{% block title_wrapper %}
|
|
3
61
|
{% for item in items %}
|
|
4
|
-
|
|
62
|
+
{% set current_btn_attributes =
|
|
63
|
+
merge_html_attributes(item.btn_attr ?? null, btn_attributes)
|
|
64
|
+
%}
|
|
65
|
+
<button {{ html_attributes(current_btn_attributes) }}>
|
|
5
66
|
{% block title %}
|
|
6
67
|
{{ item.title }}
|
|
7
68
|
{% endblock %}
|
|
@@ -9,12 +70,15 @@
|
|
|
9
70
|
{% endfor %}
|
|
10
71
|
{% endblock %}
|
|
11
72
|
{% block content_wrapper %}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
73
|
+
{% for item in items %}
|
|
74
|
+
{% set current_content_attributes =
|
|
75
|
+
merge_html_attributes(item.content_attr ?? null, content_attributes)
|
|
76
|
+
%}
|
|
77
|
+
<div {{ html_attributes(current_content_attributes) }}>
|
|
78
|
+
{% block content %}
|
|
79
|
+
{{ item.content }}
|
|
80
|
+
{% endblock %}
|
|
81
|
+
</div>
|
|
82
|
+
{% endfor %}
|
|
19
83
|
{% endblock %}
|
|
20
84
|
</div>
|
|
@@ -17,6 +17,10 @@ export interface TransitionInterface extends BaseInterface {
|
|
|
17
17
|
* Get the transition target.
|
|
18
18
|
*/
|
|
19
19
|
get target(): HTMLElement | HTMLElement[];
|
|
20
|
+
/**
|
|
21
|
+
* Get the group targets.
|
|
22
|
+
*/
|
|
23
|
+
get targets(): HTMLElement[];
|
|
20
24
|
/**
|
|
21
25
|
* Trigger the enter transition.
|
|
22
26
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getInstances } from "@studiometa/js-toolkit";
|
|
2
|
-
import { transition } from "@studiometa/js-toolkit/utils";
|
|
2
|
+
import { nextFrame, removeClass, transition } from "@studiometa/js-toolkit/utils";
|
|
3
3
|
function withTransition(BaseClass) {
|
|
4
4
|
class Transition extends BaseClass {
|
|
5
5
|
/**
|
|
@@ -25,59 +25,54 @@ function withTransition(BaseClass) {
|
|
|
25
25
|
get target() {
|
|
26
26
|
return this.$el;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the group targets.
|
|
30
|
+
*/
|
|
31
|
+
get targets() {
|
|
32
|
+
const { group } = this.$options;
|
|
33
|
+
const targets = [this.target];
|
|
34
|
+
if (group) {
|
|
35
|
+
for (const instance of getInstances(this.constructor)) {
|
|
36
|
+
if (instance !== this && instance.$options.group === group) {
|
|
37
|
+
targets.push(instance.target);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return targets.flat();
|
|
42
|
+
}
|
|
28
43
|
/**
|
|
29
44
|
* Trigger the enter transition.
|
|
30
45
|
*/
|
|
31
|
-
async enter(target
|
|
46
|
+
async enter(target) {
|
|
32
47
|
const { enterFrom, enterActive, enterTo, enterKeep, leaveTo } = this.$options;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
dispatch && this.dispatch("enter")
|
|
45
|
-
]);
|
|
48
|
+
removeClass(target ?? this.targets, leaveTo);
|
|
49
|
+
await nextFrame();
|
|
50
|
+
await transition(
|
|
51
|
+
target ?? this.targets,
|
|
52
|
+
{
|
|
53
|
+
from: enterFrom,
|
|
54
|
+
active: enterActive,
|
|
55
|
+
to: enterTo
|
|
56
|
+
},
|
|
57
|
+
enterKeep ? "keep" : void 0
|
|
58
|
+
);
|
|
46
59
|
}
|
|
47
60
|
/**
|
|
48
61
|
* Trigger the leave transition.
|
|
49
62
|
*/
|
|
50
|
-
async leave(target
|
|
63
|
+
async leave(target) {
|
|
51
64
|
const { leaveFrom, leaveActive, leaveTo, leaveKeep, enterTo } = this.$options;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
dispatch && this.dispatch("leave")
|
|
64
|
-
]);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Dispatch the callback to related instances.
|
|
68
|
-
*/
|
|
69
|
-
async dispatch(method) {
|
|
70
|
-
const { group } = this.$options;
|
|
71
|
-
if (!group) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const promises = [];
|
|
75
|
-
for (const instance of getInstances(Transition)) {
|
|
76
|
-
if (instance !== this && instance.$options.group === group) {
|
|
77
|
-
promises.push(instance[method](void 0, { dispatch: false }));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
await Promise.all(promises);
|
|
65
|
+
removeClass(target ?? this.targets, enterTo);
|
|
66
|
+
await nextFrame();
|
|
67
|
+
await transition(
|
|
68
|
+
target ?? this.targets,
|
|
69
|
+
{
|
|
70
|
+
from: leaveFrom,
|
|
71
|
+
active: leaveActive,
|
|
72
|
+
to: leaveTo
|
|
73
|
+
},
|
|
74
|
+
leaveKeep ? "keep" : void 0
|
|
75
|
+
);
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
return Transition;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../packages/ui/decorators/withTransition.ts"],
|
|
4
|
-
"sourcesContent": ["import { getInstances } from '@studiometa/js-toolkit';\nimport { transition } from '@studiometa/js-toolkit/utils';\nimport type {\n Base,\n BaseDecorator,\n BaseProps,\n BaseConfig,\n BaseInterface,\n} from '@studiometa/js-toolkit';\n\nexport interface TransitionProps extends BaseProps {\n $options: {\n enterFrom: string;\n enterActive: string;\n enterTo: string;\n enterKeep: boolean;\n leaveFrom: string;\n leaveActive: string;\n leaveTo: string;\n leaveKeep: boolean;\n group: string;\n };\n}\n\nexport interface TransitionInterface extends BaseInterface {\n /**\n * Get the transition target.\n */\n get target(): HTMLElement | HTMLElement[];\n /**\n * Trigger the enter transition.\n */\n enter(target?: HTMLElement | HTMLElement[]): Promise<void>;\n /**\n * Trigger the leave transition.\n */\n leave(target?: HTMLElement | HTMLElement[]): Promise<void>;\n}\n\n/**\n * Extend a class to add transition capabilities.\n */\nexport function withTransition<S extends Base>(\n BaseClass: typeof Base,\n): BaseDecorator<TransitionInterface, S, TransitionProps> {\n /**\n * Class.\n */\n class Transition<T extends BaseProps = BaseProps> extends BaseClass<T & TransitionProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'Transition',\n options: {\n enterFrom: String,\n enterActive: String,\n enterTo: String,\n enterKeep: Boolean,\n leaveFrom: String,\n leaveActive: String,\n leaveTo: String,\n leaveKeep: Boolean,\n group: String,\n },\n };\n\n /**\n * Get the transition target.\n */\n get target(): HTMLElement | HTMLElement[] {\n return this.$el;\n }\n\n /**\n *
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;
|
|
4
|
+
"sourcesContent": ["import { getInstances } from '@studiometa/js-toolkit';\nimport { nextFrame, removeClass, transition } from '@studiometa/js-toolkit/utils';\nimport type {\n Base,\n BaseDecorator,\n BaseProps,\n BaseConfig,\n BaseInterface,\n} from '@studiometa/js-toolkit';\n\nexport interface TransitionProps extends BaseProps {\n $options: {\n enterFrom: string;\n enterActive: string;\n enterTo: string;\n enterKeep: boolean;\n leaveFrom: string;\n leaveActive: string;\n leaveTo: string;\n leaveKeep: boolean;\n group: string;\n };\n}\n\nexport interface TransitionInterface extends BaseInterface {\n /**\n * Get the transition target.\n */\n get target(): HTMLElement | HTMLElement[];\n /**\n * Get the group targets.\n */\n get targets(): HTMLElement[];\n /**\n * Trigger the enter transition.\n */\n enter(target?: HTMLElement | HTMLElement[]): Promise<void>;\n /**\n * Trigger the leave transition.\n */\n leave(target?: HTMLElement | HTMLElement[]): Promise<void>;\n}\n\n/**\n * Extend a class to add transition capabilities.\n */\nexport function withTransition<S extends Base>(\n BaseClass: typeof Base,\n): BaseDecorator<TransitionInterface, S, TransitionProps> {\n /**\n * Class.\n */\n class Transition<T extends BaseProps = BaseProps> extends BaseClass<T & TransitionProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'Transition',\n options: {\n enterFrom: String,\n enterActive: String,\n enterTo: String,\n enterKeep: Boolean,\n leaveFrom: String,\n leaveActive: String,\n leaveTo: String,\n leaveKeep: Boolean,\n group: String,\n },\n };\n\n /**\n * Get the transition target.\n */\n get target(): HTMLElement | HTMLElement[] {\n return this.$el;\n }\n\n /**\n * Get the group targets.\n */\n get targets(): HTMLElement[] {\n const { group } = this.$options;\n const targets = [this.target];\n\n if (group) {\n for (const instance of getInstances(this.constructor as typeof Transition)) {\n if (instance !== this && instance.$options.group === group) {\n targets.push(instance.target);\n }\n }\n }\n\n return targets.flat();\n }\n\n /**\n * Trigger the enter transition.\n */\n async enter(target?: HTMLElement | HTMLElement[]): Promise<void> {\n const { enterFrom, enterActive, enterTo, enterKeep, leaveTo } = this.$options;\n\n removeClass(target ?? this.targets, leaveTo);\n await nextFrame();\n await transition(\n target ?? this.targets,\n {\n from: enterFrom,\n active: enterActive as string,\n to: enterTo as string,\n },\n enterKeep ? 'keep' : undefined,\n );\n }\n\n /**\n * Trigger the leave transition.\n */\n async leave(target?: HTMLElement | HTMLElement[]): Promise<void> {\n const { leaveFrom, leaveActive, leaveTo, leaveKeep, enterTo } = this.$options;\n\n removeClass(target ?? this.targets, enterTo);\n await nextFrame();\n await transition(\n target ?? this.targets,\n {\n from: leaveFrom,\n active: leaveActive as string,\n to: leaveTo as string,\n },\n leaveKeep ? 'keep' : undefined,\n );\n }\n }\n\n // @ts-ignore\n return Transition;\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,WAAW,aAAa,kBAAkB;AA6C5C,SAAS,eACd,WACwD;AAAA,EAIxD,MAAM,mBAAoD,UAA+B;AAAA;AAAA;AAAA;AAAA,IAIvF,OAAO,SAAqB;AAAA,MAC1B,MAAM;AAAA,MACN,SAAS;AAAA,QACP,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,OAAO;AAAA,MACT;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,SAAsC;AACxC,aAAO,KAAK;AAAA,IACd;AAAA;AAAA;AAAA;AAAA,IAKA,IAAI,UAAyB;AAC3B,YAAM,EAAE,MAAM,IAAI,KAAK;AACvB,YAAM,UAAU,CAAC,KAAK,MAAM;AAE5B,UAAI,OAAO;AACT,mBAAW,YAAY,aAAa,KAAK,WAAgC,GAAG;AAC1E,cAAI,aAAa,QAAQ,SAAS,SAAS,UAAU,OAAO;AAC1D,oBAAQ,KAAK,SAAS,MAAM;AAAA,UAC9B;AAAA,QACF;AAAA,MACF;AAEA,aAAO,QAAQ,KAAK;AAAA,IACtB;AAAA;AAAA;AAAA;AAAA,IAKA,MAAM,MAAM,QAAqD;AAC/D,YAAM,EAAE,WAAW,aAAa,SAAS,WAAW,QAAQ,IAAI,KAAK;AAErE,kBAAY,UAAU,KAAK,SAAS,OAAO;AAC3C,YAAM,UAAU;AAChB,YAAM;AAAA,QACJ,UAAU,KAAK;AAAA,QACf;AAAA,UACE,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,IAAI;AAAA,QACN;AAAA,QACA,YAAY,SAAS;AAAA,MACvB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAKA,MAAM,MAAM,QAAqD;AAC/D,YAAM,EAAE,WAAW,aAAa,SAAS,WAAW,QAAQ,IAAI,KAAK;AAErE,kBAAY,UAAU,KAAK,SAAS,OAAO;AAC3C,YAAM,UAAU;AAChB,YAAM;AAAA,QACJ,UAAU,KAAK;AAAA,QACf;AAAA,UACE,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,IAAI;AAAA,QACN;AAAA,QACA,YAAY,SAAS;AAAA,MACvB;AAAA,IACF;AAAA,EACF;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/index.d.ts
CHANGED
|
@@ -21,6 +21,5 @@ export * from './ScrollReveal/index.js';
|
|
|
21
21
|
export * from './Sentinel/index.js';
|
|
22
22
|
export * from './Slider/index.js';
|
|
23
23
|
export * from './Sticky/index.js';
|
|
24
|
-
export * from './TableOfContent/index.js';
|
|
25
24
|
export * from './Tabs/index.js';
|
|
26
25
|
export * from './Transition/index.js';
|
package/index.js
CHANGED
|
@@ -21,7 +21,6 @@ export * from "./ScrollReveal/index.js";
|
|
|
21
21
|
export * from "./Sentinel/index.js";
|
|
22
22
|
export * from "./Slider/index.js";
|
|
23
23
|
export * from "./Sticky/index.js";
|
|
24
|
-
export * from "./TableOfContent/index.js";
|
|
25
24
|
export * from "./Tabs/index.js";
|
|
26
25
|
export * from "./Transition/index.js";
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../packages/ui/index.ts"],
|
|
4
|
-
"sourcesContent": ["export * from './Accordion/index.js';\nexport * from './Action/index.js';\nexport * from './AnchorNav/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Data/index.js';\nexport * from './decorators/index.js';\nexport * from './Draggable/index.js';\nexport * from './Figure/index.js';\nexport * from './FigureVideo/index.js';\nexport * from './Frame/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Menu/index.js';\nexport * from './Modal/index.js';\nexport * from './Panel/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\nexport * from './Sentinel/index.js';\nexport * from './Slider/index.js';\nexport * from './Sticky/index.js';\nexport * from './
|
|
5
|
-
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;
|
|
4
|
+
"sourcesContent": ["export * from './Accordion/index.js';\nexport * from './Action/index.js';\nexport * from './AnchorNav/index.js';\nexport * from './AnchorScrollTo/index.js';\nexport * from './CircularMarquee/index.js';\nexport * from './Cursor/index.js';\nexport * from './Data/index.js';\nexport * from './decorators/index.js';\nexport * from './Draggable/index.js';\nexport * from './Figure/index.js';\nexport * from './FigureVideo/index.js';\nexport * from './Frame/index.js';\nexport * from './LargeText/index.js';\nexport * from './LazyInclude/index.js';\nexport * from './Menu/index.js';\nexport * from './Modal/index.js';\nexport * from './Panel/index.js';\nexport * from './Prefetch/index.js';\nexport * from './ScrollAnimation/index.js';\nexport * from './ScrollReveal/index.js';\nexport * from './Sentinel/index.js';\nexport * from './Slider/index.js';\nexport * from './Sticky/index.js';\nexport * from './Tabs/index.js';\nexport * from './Transition/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiometa/ui",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"description": "A set of opiniated, unstyled and accessible components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/studiometa/ui#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"deepmerge": "^4.3.1"
|
|
32
|
+
"deepmerge": "^4.3.1",
|
|
33
|
+
"morphdom": "^2.7.5"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
|
-
"@studiometa/js-toolkit": "
|
|
36
|
+
"@studiometa/js-toolkit": "3.0.2"
|
|
36
37
|
},
|
|
37
38
|
"peerDependencies": {
|
|
38
39
|
"@studiometa/js-toolkit": "^3.0.0"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 Studio Meta
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
-
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
-
import { TableOfContentAnchor } from './TableOfContentAnchor.js';
|
|
4
|
-
export interface TableOfContentProps extends BaseProps {
|
|
5
|
-
$refs: {
|
|
6
|
-
itemTemplate: HTMLTemplateElement;
|
|
7
|
-
list: HTMLUListElement;
|
|
8
|
-
};
|
|
9
|
-
$options: {
|
|
10
|
-
contentSelector: string;
|
|
11
|
-
withTemplate: boolean;
|
|
12
|
-
};
|
|
13
|
-
$children: {
|
|
14
|
-
TableOfContentAnchor: TableOfContentAnchor[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
declare const TableOfContent_base: import("@studiometa/js-toolkit").BaseDecorator<import("../decorators/withDeprecation.js").DeprecationInterface, Base<BaseProps>, import("../decorators/withDeprecation.js").DeprecationProps>;
|
|
18
|
-
/**
|
|
19
|
-
* TableOfContent class.
|
|
20
|
-
* @deprecated
|
|
21
|
-
*/
|
|
22
|
-
export declare class TableOfContent<T extends BaseProps = BaseProps> extends TableOfContent_base<T & TableOfContentProps> {
|
|
23
|
-
/**
|
|
24
|
-
* Config.
|
|
25
|
-
*/
|
|
26
|
-
static config: BaseConfig;
|
|
27
|
-
/**
|
|
28
|
-
* Generate anchors on mount and update the component to instantiate the
|
|
29
|
-
* `TableOfContentAnchor` components.
|
|
30
|
-
*/
|
|
31
|
-
mounted(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Generate all anchors.
|
|
34
|
-
* @todo Read anchor template from a ref?
|
|
35
|
-
* @todo Better API to easily override the template function, maybe a `render` function?
|
|
36
|
-
*/
|
|
37
|
-
generateAnchors(): void;
|
|
38
|
-
}
|
|
39
|
-
export {};
|