@studiometa/ui 0.2.13 → 0.2.15
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 +4 -3
- package/atoms/AnchorScrollTo/AnchorScrollTo.cjs.map +7 -0
- package/atoms/AnchorScrollTo/AnchorScrollTo.d.ts +8 -15
- package/atoms/AnchorScrollTo/AnchorScrollTo.js +21 -1
- package/atoms/AnchorScrollTo/AnchorScrollTo.js.map +7 -0
- package/atoms/AnchorScrollTo/index.cjs +21 -0
- package/atoms/AnchorScrollTo/index.cjs.map +7 -0
- package/atoms/AnchorScrollTo/index.d.ts +1 -0
- package/atoms/AnchorScrollTo/index.js +2 -0
- package/atoms/AnchorScrollTo/index.js.map +7 -0
- package/atoms/Cursor/Cursor.cjs +8 -3
- package/atoms/Cursor/Cursor.cjs.map +7 -0
- package/atoms/Cursor/Cursor.d.ts +19 -117
- package/atoms/Cursor/Cursor.js +103 -1
- package/atoms/Cursor/Cursor.js.map +7 -0
- package/atoms/Cursor/index.cjs +21 -0
- package/atoms/Cursor/index.cjs.map +7 -0
- package/atoms/Cursor/index.d.ts +1 -0
- package/atoms/Cursor/index.js +2 -0
- package/atoms/Cursor/index.js.map +7 -0
- package/atoms/Figure/Figure.cjs +16 -9
- package/atoms/Figure/Figure.cjs.map +7 -0
- package/atoms/Figure/Figure.d.ts +18 -53
- package/atoms/Figure/Figure.js +51 -1
- package/atoms/Figure/Figure.js.map +7 -0
- package/atoms/Figure/FigureTwicPics.cjs +11 -10
- package/atoms/Figure/FigureTwicPics.cjs.map +7 -0
- package/atoms/Figure/FigureTwicPics.d.ts +16 -37
- package/atoms/Figure/FigureTwicPics.js +46 -1
- package/atoms/Figure/FigureTwicPics.js.map +7 -0
- package/atoms/Figure/index.cjs +5 -14
- package/atoms/Figure/index.cjs.map +7 -0
- package/atoms/Figure/index.d.ts +2 -2
- package/atoms/Figure/index.js +3 -1
- package/atoms/Figure/index.js.map +7 -0
- package/atoms/LargeText/LargeText.cjs +8 -3
- package/atoms/LargeText/LargeText.cjs.map +7 -0
- package/atoms/LargeText/LargeText.d.ts +19 -40
- package/atoms/LargeText/LargeText.js +60 -1
- package/atoms/LargeText/LargeText.js.map +7 -0
- package/atoms/LargeText/index.cjs +21 -0
- package/atoms/LargeText/index.cjs.map +7 -0
- package/atoms/LargeText/index.d.ts +1 -0
- package/atoms/LargeText/index.js +2 -0
- package/atoms/LargeText/index.js.map +7 -0
- package/atoms/LazyInclude/LazyInclude.cjs +3 -2
- package/atoms/LazyInclude/LazyInclude.cjs.map +7 -0
- package/atoms/LazyInclude/LazyInclude.d.ts +17 -36
- package/atoms/LazyInclude/LazyInclude.js +41 -1
- package/atoms/LazyInclude/LazyInclude.js.map +7 -0
- package/atoms/LazyInclude/index.cjs +21 -0
- package/atoms/LazyInclude/index.cjs.map +7 -0
- package/atoms/LazyInclude/index.d.ts +1 -0
- package/atoms/LazyInclude/index.js +2 -0
- package/atoms/LazyInclude/index.js.map +7 -0
- package/atoms/Prefetch/AbstractPrefetch.cjs +7 -6
- package/atoms/Prefetch/AbstractPrefetch.cjs.map +7 -0
- package/atoms/Prefetch/AbstractPrefetch.d.ts +12 -35
- package/atoms/Prefetch/AbstractPrefetch.js +52 -1
- package/atoms/Prefetch/AbstractPrefetch.js.map +7 -0
- package/atoms/Prefetch/PrefetchWhenOver.cjs +6 -8
- package/atoms/Prefetch/PrefetchWhenOver.cjs.map +7 -0
- package/atoms/Prefetch/PrefetchWhenOver.d.ts +8 -14
- package/atoms/Prefetch/PrefetchWhenOver.js +14 -1
- package/atoms/Prefetch/PrefetchWhenOver.js.map +7 -0
- package/atoms/Prefetch/PrefetchWhenVisible.cjs +6 -8
- package/atoms/Prefetch/PrefetchWhenVisible.cjs.map +7 -0
- package/atoms/Prefetch/PrefetchWhenVisible.d.ts +10 -14
- package/atoms/Prefetch/PrefetchWhenVisible.js +15 -1
- package/atoms/Prefetch/PrefetchWhenVisible.js.map +7 -0
- package/atoms/Prefetch/index.cjs +6 -16
- package/atoms/Prefetch/index.cjs.map +7 -0
- package/atoms/Prefetch/index.d.ts +3 -3
- package/atoms/Prefetch/index.js +4 -1
- package/atoms/Prefetch/index.js.map +7 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs +18 -14
- package/atoms/ScrollAnimation/AbstractScrollAnimation.cjs.map +7 -0
- package/atoms/ScrollAnimation/AbstractScrollAnimation.d.ts +19 -89
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js +62 -1
- package/atoms/ScrollAnimation/AbstractScrollAnimation.js.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimation.cjs +6 -14
- package/atoms/ScrollAnimation/ScrollAnimation.cjs.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimation.d.ts +13 -51
- package/atoms/ScrollAnimation/ScrollAnimation.js +16 -1
- package/atoms/ScrollAnimation/ScrollAnimation.js.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs +31 -10
- package/atoms/ScrollAnimation/ScrollAnimationChild.cjs.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationChild.d.ts +19 -6
- package/atoms/ScrollAnimation/ScrollAnimationChild.js +45 -1
- package/atoms/ScrollAnimation/ScrollAnimationChild.js.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs +7 -9
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.cjs.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.d.ts +8 -2
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js +12 -1
- package/atoms/ScrollAnimation/ScrollAnimationChildWithEase.js.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs +9 -8
- package/atoms/ScrollAnimation/ScrollAnimationParent.cjs.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationParent.d.ts +14 -26
- package/atoms/ScrollAnimation/ScrollAnimationParent.js +22 -1
- package/atoms/ScrollAnimation/ScrollAnimationParent.js.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs +7 -9
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.cjs.map +7 -0
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.d.ts +15 -2
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js +12 -1
- package/atoms/ScrollAnimation/ScrollAnimationWithEase.js.map +7 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs +9 -5
- package/atoms/ScrollAnimation/animationScrollWithEase.cjs.map +7 -0
- package/atoms/ScrollAnimation/animationScrollWithEase.d.ts +10 -8
- package/atoms/ScrollAnimation/animationScrollWithEase.js +31 -1
- package/atoms/ScrollAnimation/animationScrollWithEase.js.map +7 -0
- package/atoms/ScrollAnimation/index.cjs +10 -24
- package/atoms/ScrollAnimation/index.cjs.map +7 -0
- package/atoms/ScrollAnimation/index.d.ts +7 -7
- package/atoms/ScrollAnimation/index.js +8 -1
- package/atoms/ScrollAnimation/index.js.map +7 -0
- package/atoms/ScrollReveal/ScrollReveal.cjs +6 -3
- package/atoms/ScrollReveal/ScrollReveal.cjs.map +7 -0
- package/atoms/ScrollReveal/ScrollReveal.d.ts +16 -59
- package/atoms/ScrollReveal/ScrollReveal.js +47 -1
- package/atoms/ScrollReveal/ScrollReveal.js.map +7 -0
- package/atoms/ScrollReveal/index.cjs +4 -12
- package/atoms/ScrollReveal/index.cjs.map +7 -0
- package/atoms/ScrollReveal/index.d.ts +1 -1
- package/atoms/ScrollReveal/index.js +2 -1
- package/atoms/ScrollReveal/index.js.map +7 -0
- package/atoms/index.cjs +6 -18
- package/atoms/index.cjs.map +7 -0
- package/atoms/index.d.ts +8 -8
- package/atoms/index.js +9 -1
- package/atoms/index.js.map +7 -0
- package/decorators/index.cjs +4 -12
- package/decorators/index.cjs.map +7 -0
- package/decorators/index.d.ts +1 -1
- package/decorators/index.js +2 -1
- package/decorators/index.js.map +7 -0
- package/decorators/withTransition.cjs +23 -17
- package/decorators/withTransition.cjs.map +7 -0
- package/decorators/withTransition.d.ts +21 -33
- package/decorators/withTransition.js +50 -1
- package/decorators/withTransition.js.map +7 -0
- package/index.cjs +2 -1
- package/index.cjs.map +7 -0
- package/index.d.ts +5 -5
- package/index.js +6 -1
- package/index.js.map +7 -0
- package/molecules/Accordion/Accordion.cjs +8 -10
- package/molecules/Accordion/Accordion.cjs.map +7 -0
- package/molecules/Accordion/Accordion.d.ts +5 -23
- package/molecules/Accordion/Accordion.js +14 -1
- package/molecules/Accordion/Accordion.js.map +7 -0
- package/molecules/Accordion/AccordionCore.cjs +7 -8
- package/molecules/Accordion/AccordionCore.cjs.map +7 -0
- package/molecules/Accordion/AccordionCore.d.ts +22 -70
- package/molecules/Accordion/AccordionCore.js +27 -1
- package/molecules/Accordion/AccordionCore.js.map +7 -0
- package/molecules/Accordion/AccordionItem.cjs +39 -23
- package/molecules/Accordion/AccordionItem.cjs.map +7 -0
- package/molecules/Accordion/AccordionItem.d.ts +24 -94
- package/molecules/Accordion/AccordionItem.js +146 -1
- package/molecules/Accordion/AccordionItem.js.map +7 -0
- package/molecules/Accordion/index.cjs +22 -0
- package/molecules/Accordion/index.cjs.map +7 -0
- package/molecules/Accordion/index.d.ts +2 -0
- package/molecules/Accordion/index.js +3 -0
- package/molecules/Accordion/index.js.map +7 -0
- package/molecules/Menu/Menu.cjs +7 -10
- package/molecules/Menu/Menu.cjs.map +7 -0
- package/molecules/Menu/Menu.d.ts +24 -84
- package/molecules/Menu/Menu.js +108 -1
- package/molecules/Menu/Menu.js.map +7 -0
- package/molecules/Menu/MenuBtn.cjs +4 -4
- package/molecules/Menu/MenuBtn.cjs.map +7 -0
- package/molecules/Menu/MenuBtn.d.ts +7 -9
- package/molecules/Menu/MenuBtn.js +22 -1
- package/molecules/Menu/MenuBtn.js.map +7 -0
- package/molecules/Menu/MenuList.cjs +9 -9
- package/molecules/Menu/MenuList.cjs.map +7 -0
- package/molecules/Menu/MenuList.d.ts +16 -53
- package/molecules/Menu/MenuList.js +104 -1
- package/molecules/Menu/MenuList.js.map +7 -0
- package/molecules/Menu/index.cjs +6 -16
- package/molecules/Menu/index.cjs.map +7 -0
- package/molecules/Menu/index.d.ts +3 -3
- package/molecules/Menu/index.js +4 -1
- package/molecules/Menu/index.js.map +7 -0
- package/molecules/Modal/Modal.cjs +35 -13
- package/molecules/Modal/Modal.cjs.map +7 -0
- package/molecules/Modal/Modal.d.ts +69 -140
- package/molecules/Modal/Modal.js +150 -1
- package/molecules/Modal/Modal.js.map +7 -0
- package/molecules/Modal/ModalWithTransition.cjs +5 -7
- package/molecules/Modal/ModalWithTransition.cjs.map +7 -0
- package/molecules/Modal/ModalWithTransition.d.ts +6 -22
- package/molecules/Modal/ModalWithTransition.js +41 -1
- package/molecules/Modal/ModalWithTransition.js.map +7 -0
- package/molecules/Modal/index.cjs +22 -0
- package/molecules/Modal/index.cjs.map +7 -0
- package/molecules/Modal/index.d.ts +2 -0
- package/molecules/Modal/index.js +3 -0
- package/molecules/Modal/index.js.map +7 -0
- package/molecules/Panel/Panel.cjs +38 -26
- package/molecules/Panel/Panel.cjs.map +7 -0
- package/molecules/Panel/Panel.d.ts +22 -21
- package/molecules/Panel/Panel.js +98 -1
- package/molecules/Panel/Panel.js.map +7 -0
- package/molecules/Panel/index.cjs +21 -0
- package/molecules/Panel/index.cjs.map +7 -0
- package/molecules/Panel/index.d.ts +1 -0
- package/molecules/Panel/index.js +2 -0
- package/molecules/Panel/index.js.map +7 -0
- package/molecules/Slider/AbstractSliderChild.cjs +8 -9
- package/molecules/Slider/AbstractSliderChild.cjs.map +7 -0
- package/molecules/Slider/AbstractSliderChild.d.ts +11 -30
- package/molecules/Slider/AbstractSliderChild.js +43 -1
- package/molecules/Slider/AbstractSliderChild.js.map +7 -0
- package/molecules/Slider/Slider.cjs +31 -18
- package/molecules/Slider/Slider.cjs.map +7 -0
- package/molecules/Slider/Slider.d.ts +40 -157
- package/molecules/Slider/Slider.js +271 -1
- package/molecules/Slider/Slider.js.map +7 -0
- package/molecules/Slider/SliderBtn.cjs +5 -7
- package/molecules/Slider/SliderBtn.cjs.map +7 -0
- package/molecules/Slider/SliderBtn.d.ts +12 -23
- package/molecules/Slider/SliderBtn.js +29 -1
- package/molecules/Slider/SliderBtn.js.map +7 -0
- package/molecules/Slider/SliderCount.cjs +5 -7
- package/molecules/Slider/SliderCount.cjs.map +7 -0
- package/molecules/Slider/SliderCount.d.ts +10 -16
- package/molecules/Slider/SliderCount.js +14 -1
- package/molecules/Slider/SliderCount.js.map +7 -0
- package/molecules/Slider/SliderDots.cjs +5 -7
- package/molecules/Slider/SliderDots.cjs.map +7 -0
- package/molecules/Slider/SliderDots.d.ts +11 -31
- package/molecules/Slider/SliderDots.js +24 -1
- package/molecules/Slider/SliderDots.js.map +7 -0
- package/molecules/Slider/SliderDrag.cjs +3 -2
- package/molecules/Slider/SliderDrag.cjs.map +7 -0
- package/molecules/Slider/SliderDrag.d.ts +12 -30
- package/molecules/Slider/SliderDrag.js +29 -1
- package/molecules/Slider/SliderDrag.js.map +7 -0
- package/molecules/Slider/SliderItem.cjs +7 -3
- package/molecules/Slider/SliderItem.cjs.map +7 -0
- package/molecules/Slider/SliderItem.d.ts +21 -33
- package/molecules/Slider/SliderItem.js +85 -1
- package/molecules/Slider/SliderItem.js.map +7 -0
- package/molecules/Slider/SliderProgress.cjs +5 -7
- package/molecules/Slider/SliderProgress.cjs.map +7 -0
- package/molecules/Slider/SliderProgress.d.ts +10 -25
- package/molecules/Slider/SliderProgress.js +21 -1
- package/molecules/Slider/SliderProgress.js.map +7 -0
- package/molecules/Slider/index.cjs +11 -26
- package/molecules/Slider/index.cjs.map +7 -0
- package/molecules/Slider/index.d.ts +8 -8
- package/molecules/Slider/index.js +9 -1
- package/molecules/Slider/index.js.map +7 -0
- package/molecules/Sticky/Sticky.cjs +12 -8
- package/molecules/Sticky/Sticky.cjs.map +7 -0
- package/molecules/Sticky/Sticky.d.ts +30 -68
- package/molecules/Sticky/Sticky.js +101 -1
- package/molecules/Sticky/Sticky.js.map +7 -0
- package/molecules/Sticky/index.cjs +21 -0
- package/molecules/Sticky/index.cjs.map +7 -0
- package/molecules/Sticky/index.d.ts +1 -0
- package/molecules/Sticky/index.js +2 -0
- package/molecules/Sticky/index.js.map +7 -0
- package/molecules/TableOfContent/TableOfContent.cjs +6 -8
- package/molecules/TableOfContent/TableOfContent.cjs.map +7 -0
- package/molecules/TableOfContent/TableOfContent.d.ts +19 -41
- package/molecules/TableOfContent/TableOfContent.js +37 -1
- package/molecules/TableOfContent/TableOfContent.js.map +7 -0
- package/molecules/TableOfContent/TableOfContentAnchor.cjs +7 -5
- package/molecules/TableOfContent/TableOfContentAnchor.cjs.map +7 -0
- package/molecules/TableOfContent/TableOfContentAnchor.d.ts +14 -17
- package/molecules/TableOfContent/TableOfContentAnchor.js +35 -1
- package/molecules/TableOfContent/TableOfContentAnchor.js.map +7 -0
- package/molecules/TableOfContent/index.cjs +5 -14
- package/molecules/TableOfContent/index.cjs.map +7 -0
- package/molecules/TableOfContent/index.d.ts +2 -2
- package/molecules/TableOfContent/index.js +3 -1
- package/molecules/TableOfContent/index.js.map +7 -0
- package/molecules/Tabs/Tabs.cjs +40 -22
- package/molecules/Tabs/Tabs.cjs.map +7 -0
- package/molecules/Tabs/Tabs.d.ts +28 -90
- package/molecules/Tabs/Tabs.js +115 -1
- package/molecules/Tabs/Tabs.js.map +7 -0
- package/molecules/Tabs/index.cjs +21 -0
- package/molecules/Tabs/index.cjs.map +7 -0
- package/molecules/Tabs/index.d.ts +1 -0
- package/molecules/Tabs/index.js +2 -0
- package/molecules/Tabs/index.js.map +7 -0
- package/molecules/index.cjs +8 -24
- package/molecules/index.cjs.map +7 -0
- package/molecules/index.d.ts +9 -10
- package/molecules/index.js +10 -1
- package/molecules/index.js.map +7 -0
- package/organisms/Frame/Frame.cjs +21 -43
- package/organisms/Frame/Frame.cjs.map +7 -0
- package/organisms/Frame/Frame.d.ts +21 -98
- package/organisms/Frame/Frame.js +155 -1
- package/organisms/Frame/Frame.js.map +7 -0
- package/organisms/Frame/FrameAnchor.cjs +3 -2
- package/organisms/Frame/FrameAnchor.cjs.map +7 -0
- package/organisms/Frame/FrameAnchor.d.ts +7 -16
- package/organisms/Frame/FrameAnchor.js +13 -1
- package/organisms/Frame/FrameAnchor.js.map +7 -0
- package/organisms/Frame/FrameForm.cjs +3 -2
- package/organisms/Frame/FrameForm.cjs.map +7 -0
- package/organisms/Frame/FrameForm.d.ts +10 -16
- package/organisms/Frame/FrameForm.js +13 -1
- package/organisms/Frame/FrameForm.js.map +7 -0
- package/organisms/Frame/FrameTarget.cjs +15 -9
- package/organisms/Frame/FrameTarget.cjs.map +7 -0
- package/organisms/Frame/FrameTarget.d.ts +17 -26
- package/organisms/Frame/FrameTarget.js +70 -1
- package/organisms/Frame/FrameTarget.js.map +7 -0
- package/organisms/Frame/index.cjs +7 -18
- package/organisms/Frame/index.cjs.map +7 -0
- package/organisms/Frame/index.d.ts +4 -4
- package/organisms/Frame/index.js +5 -1
- package/organisms/Frame/index.js.map +7 -0
- package/organisms/index.cjs +2 -1
- package/organisms/index.cjs.map +7 -0
- package/organisms/index.d.ts +1 -1
- package/organisms/index.js +2 -1
- package/organisms/index.js.map +7 -0
- package/package.json +2 -2
- package/primitives/Draggable/Draggable.cjs +3 -2
- package/primitives/Draggable/Draggable.cjs.map +7 -0
- package/primitives/Draggable/Draggable.d.ts +10 -11
- package/primitives/Draggable/Draggable.js +25 -1
- package/primitives/Draggable/Draggable.js.map +7 -0
- package/primitives/Draggable/index.cjs +21 -0
- package/primitives/Draggable/index.cjs.map +7 -0
- package/primitives/Draggable/index.d.ts +1 -0
- package/primitives/Draggable/index.js +2 -0
- package/primitives/Draggable/index.js.map +7 -0
- package/primitives/Sentinel/Sentinel.cjs +3 -2
- package/primitives/Sentinel/Sentinel.cjs.map +7 -0
- package/primitives/Sentinel/Sentinel.d.ts +6 -5
- package/primitives/Sentinel/Sentinel.js +10 -1
- package/primitives/Sentinel/Sentinel.js.map +7 -0
- package/primitives/Sentinel/index.cjs +21 -0
- package/primitives/Sentinel/index.cjs.map +7 -0
- package/primitives/Sentinel/index.d.ts +1 -0
- package/primitives/Sentinel/index.js +2 -0
- package/primitives/Sentinel/index.js.map +7 -0
- package/primitives/Transition/Transition.cjs +13 -3
- package/primitives/Transition/Transition.cjs.map +7 -0
- package/primitives/Transition/Transition.d.ts +13 -7
- package/primitives/Transition/Transition.js +11 -1
- package/primitives/Transition/Transition.js.map +7 -0
- package/primitives/Transition/index.cjs +21 -0
- package/primitives/Transition/index.cjs.map +7 -0
- package/primitives/Transition/index.d.ts +1 -0
- package/primitives/Transition/index.js +2 -0
- package/primitives/Transition/index.js.map +7 -0
- package/primitives/index.cjs +6 -16
- package/primitives/index.cjs.map +7 -0
- package/primitives/index.d.ts +3 -3
- package/primitives/index.js +4 -1
- package/primitives/index.js.map +7 -0
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
+
}
|
|
13
17
|
/**
|
|
14
18
|
* TableOfContent class.
|
|
15
19
|
*/
|
|
16
|
-
export
|
|
20
|
+
export declare class TableOfContent<T extends BaseProps = BaseProps> extends Base<T & TableOfContentProps> {
|
|
17
21
|
/**
|
|
18
22
|
* Config.
|
|
19
23
|
*/
|
|
20
|
-
static config:
|
|
21
|
-
name: string;
|
|
22
|
-
refs: string[];
|
|
23
|
-
components: {
|
|
24
|
-
TableOfContentAnchor: typeof TableOfContentAnchor;
|
|
25
|
-
};
|
|
26
|
-
options: {
|
|
27
|
-
contentSelector: StringConstructor;
|
|
28
|
-
withTemplate: BooleanConstructor;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
24
|
+
static config: BaseConfig;
|
|
31
25
|
/**
|
|
32
26
|
* Generate anchors on mount and update the component to instantiate the
|
|
33
27
|
* `TableOfContentAnchor` components.
|
|
34
|
-
* @returns {void}
|
|
35
28
|
*/
|
|
36
29
|
mounted(): void;
|
|
37
30
|
/**
|
|
@@ -39,21 +32,6 @@ export default class TableOfContent extends Base {
|
|
|
39
32
|
*
|
|
40
33
|
* @todo Read anchor template from a ref?
|
|
41
34
|
* @todo Better API to easily override the template function, maybe a `render` function?
|
|
42
|
-
*
|
|
43
|
-
* @this {TableOfContentInterface}
|
|
44
|
-
* @returns {void}
|
|
45
35
|
*/
|
|
46
|
-
generateAnchors(
|
|
36
|
+
generateAnchors(): void;
|
|
47
37
|
}
|
|
48
|
-
export type TableOfContentInterface = TableOfContent & {
|
|
49
|
-
$refs: {
|
|
50
|
-
itemTemplate: HTMLTemplateElement;
|
|
51
|
-
list: HTMLUListElement;
|
|
52
|
-
};
|
|
53
|
-
$options: {
|
|
54
|
-
contentSelector: string;
|
|
55
|
-
withTemplate: boolean;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
59
|
-
import TableOfContentAnchor from "./TableOfContentAnchor.js";
|
|
@@ -1 +1,37 @@
|
|
|
1
|
-
import{Base
|
|
1
|
+
import { Base } from "@studiometa/js-toolkit";
|
|
2
|
+
import { TableOfContentAnchor } from "./TableOfContentAnchor.js";
|
|
3
|
+
class TableOfContent extends Base {
|
|
4
|
+
static config = {
|
|
5
|
+
name: "TableOfContent",
|
|
6
|
+
refs: ["itemTemplate", "list"],
|
|
7
|
+
components: {
|
|
8
|
+
TableOfContentAnchor
|
|
9
|
+
},
|
|
10
|
+
options: {
|
|
11
|
+
contentSelector: String,
|
|
12
|
+
withTemplate: Boolean
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
mounted() {
|
|
16
|
+
if (this.$options.withTemplate) {
|
|
17
|
+
this.generateAnchors();
|
|
18
|
+
this.$update();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
generateAnchors() {
|
|
22
|
+
document.querySelectorAll(this.$options.contentSelector).forEach((section) => {
|
|
23
|
+
const tpl = document.createElement("div");
|
|
24
|
+
tpl.innerHTML = this.$refs.itemTemplate.innerHTML;
|
|
25
|
+
const li = tpl.querySelector("li");
|
|
26
|
+
const anchor = li.querySelector("a");
|
|
27
|
+
anchor.href = `#${section.id}`;
|
|
28
|
+
anchor.innerHTML = section.textContent;
|
|
29
|
+
anchor.dataset.component = "TableOfContentAnchor";
|
|
30
|
+
this.$refs.list.append(li);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
TableOfContent
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=TableOfContent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/TableOfContent/TableOfContent.ts"],
|
|
4
|
+
"sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { TableOfContentAnchor } from './TableOfContentAnchor.js';\n\nexport interface TableOfContentProps extends BaseProps {\n $refs: {\n itemTemplate: HTMLTemplateElement;\n list: HTMLUListElement;\n };\n $options: {\n contentSelector: string;\n withTemplate: boolean;\n };\n $children: {\n TableOfContentAnchor: TableOfContentAnchor[];\n };\n}\n\n/**\n * TableOfContent class.\n */\nexport class TableOfContent<T extends BaseProps = BaseProps> extends Base<T & TableOfContentProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'TableOfContent',\n refs: ['itemTemplate', 'list'],\n components: {\n TableOfContentAnchor,\n },\n options: {\n contentSelector: String,\n withTemplate: Boolean,\n },\n };\n\n /**\n * Generate anchors on mount and update the component to instantiate the\n * `TableOfContentAnchor` components.\n */\n mounted() {\n if (this.$options.withTemplate) {\n this.generateAnchors();\n this.$update();\n }\n }\n\n /**\n * Generate all anchors.\n *\n * @todo Read anchor template from a ref?\n * @todo Better API to easily override the template function, maybe a `render` function?\n */\n generateAnchors() {\n document.querySelectorAll(this.$options.contentSelector).forEach((section) => {\n const tpl = document.createElement('div');\n tpl.innerHTML = this.$refs.itemTemplate.innerHTML;\n const li = tpl.querySelector('li');\n const anchor = li.querySelector('a');\n anchor.href = `#${section.id}`;\n anchor.innerHTML = section.textContent;\n anchor.dataset.component = 'TableOfContentAnchor';\n this.$refs.list.append(li);\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,YAAY;AAErB,SAAS,4BAA4B;AAmB9B,MAAM,uBAAwD,KAA8B;AAAA,EAIjG,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,MAAM,CAAC,gBAAgB,MAAM;AAAA,IAC7B,YAAY;AAAA,MACV;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,iBAAiB;AAAA,MACjB,cAAc;AAAA,IAChB;AAAA,EACF;AAAA,EAMA,UAAU;AACR,QAAI,KAAK,SAAS,cAAc;AAC9B,WAAK,gBAAgB;AACrB,WAAK,QAAQ;AAAA,IACf;AAAA,EACF;AAAA,EAQA,kBAAkB;AAChB,aAAS,iBAAiB,KAAK,SAAS,eAAe,EAAE,QAAQ,CAAC,YAAY;AAC5E,YAAM,MAAM,SAAS,cAAc,KAAK;AACxC,UAAI,YAAY,KAAK,MAAM,aAAa;AACxC,YAAM,KAAK,IAAI,cAAc,IAAI;AACjC,YAAM,SAAS,GAAG,cAAc,GAAG;AACnC,aAAO,OAAO,IAAI,QAAQ;AAC1B,aAAO,YAAY,QAAQ;AAC3B,aAAO,QAAQ,YAAY;AAC3B,WAAK,MAAM,KAAK,OAAO,EAAE;AAAA,IAC3B,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -21,14 +21,15 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/molecules/TableOfContent/TableOfContentAnchor.
|
|
24
|
+
// packages/ui/molecules/TableOfContent/TableOfContentAnchor.ts
|
|
25
25
|
var TableOfContentAnchor_exports = {};
|
|
26
26
|
__export(TableOfContentAnchor_exports, {
|
|
27
|
-
|
|
27
|
+
TableOfContentAnchor: () => TableOfContentAnchor
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(TableOfContentAnchor_exports);
|
|
30
30
|
var import_atoms = require("../../atoms/index.cjs");
|
|
31
31
|
var TableOfContentAnchor = class extends import_atoms.AnchorScrollTo {
|
|
32
|
+
__observer;
|
|
32
33
|
get sentinel() {
|
|
33
34
|
return document.querySelector(this.targetSelector);
|
|
34
35
|
}
|
|
@@ -36,15 +37,15 @@ var TableOfContentAnchor = class extends import_atoms.AnchorScrollTo {
|
|
|
36
37
|
if (!this.sentinel) {
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
this.
|
|
40
|
+
this.__observer = new IntersectionObserver(([entry]) => {
|
|
40
41
|
const shouldActivate = entry.isIntersecting && entry.boundingClientRect.y < 100 && entry.boundingClientRect.y > 100;
|
|
41
42
|
this.$el.classList.toggle(this.$options.activeClass, shouldActivate);
|
|
42
43
|
this.$emit("should-activate", shouldActivate);
|
|
43
44
|
});
|
|
44
|
-
this.
|
|
45
|
+
this.__observer.observe(this.sentinel);
|
|
45
46
|
}
|
|
46
47
|
destroyed() {
|
|
47
|
-
this.
|
|
48
|
+
this.__observer.disconnect();
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
51
|
__publicField(TableOfContentAnchor, "config", {
|
|
@@ -58,3 +59,4 @@ __publicField(TableOfContentAnchor, "config", {
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
if (module.exports.default) module.exports = module.exports.default;
|
|
62
|
+
//# sourceMappingURL=TableOfContentAnchor.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/TableOfContent/TableOfContentAnchor.ts"],
|
|
4
|
+
"sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { AnchorScrollTo } from '../../atoms/index.js';\n\nexport interface TableOfContentAnchorProps extends BaseProps {\n $options: {\n activeClass: string;\n };\n}\n\n/**\n * TableOfContentAnchor class.\n */\nexport class TableOfContentAnchor<T extends BaseProps = BaseProps> extends AnchorScrollTo<\n T & TableOfContentAnchorProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'TableOfContentAnchor',\n emits: ['should-activate'],\n options: {\n activeClass: {\n type: String,\n default: 'is-active',\n },\n },\n };\n\n /**\n * Observer.\n * @private\n */\n __observer: IntersectionObserver;\n\n /**\n * Get the sentinel.\n */\n get sentinel():HTMLElement {\n return document.querySelector(this.targetSelector) as HTMLElement;\n }\n\n /**\n * Init observer on mount.\n */\n mounted() {\n if (!this.sentinel) {\n return;\n }\n\n this.__observer = new IntersectionObserver(([entry]) => {\n const shouldActivate =\n entry.isIntersecting &&\n entry.boundingClientRect.y < 100 &&\n entry.boundingClientRect.y > 100;\n this.$el.classList.toggle(this.$options.activeClass, shouldActivate);\n this.$emit('should-activate', shouldActivate);\n });\n\n this.__observer.observe(this.sentinel);\n }\n\n /**\n * Destroy observer on destroy.\n */\n destroyed() {\n this.__observer.disconnect();\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA+B;AAWxB,IAAM,uBAAN,cAAoE,4BAEzE;AAAA,EAmBA;AAAA,EAKA,IAAI,WAAuB;AACzB,WAAO,SAAS,cAAc,KAAK,cAAc;AAAA,EACnD;AAAA,EAKA,UAAU;AACR,QAAI,CAAC,KAAK,UAAU;AAClB;AAAA,IACF;AAEA,SAAK,aAAa,IAAI,qBAAqB,CAAC,CAAC,KAAK,MAAM;AACtD,YAAM,iBACJ,MAAM,kBACN,MAAM,mBAAmB,IAAI,OAC7B,MAAM,mBAAmB,IAAI;AAC/B,WAAK,IAAI,UAAU,OAAO,KAAK,SAAS,aAAa,cAAc;AACnE,WAAK,MAAM,mBAAmB,cAAc;AAAA,IAC9C,CAAC;AAED,SAAK,WAAW,QAAQ,KAAK,QAAQ;AAAA,EACvC;AAAA,EAKA,YAAY;AACV,SAAK,WAAW,WAAW;AAAA,EAC7B;AACF;AAlDE,cANW,sBAMJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,OAAO,CAAC,iBAAiB;AAAA,EACzB,SAAS;AAAA,IACP,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
2
|
+
import { AnchorScrollTo } from '../../atoms/index.js';
|
|
3
|
+
export interface TableOfContentAnchorProps extends BaseProps {
|
|
4
|
+
$options: {
|
|
5
|
+
activeClass: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
1
8
|
/**
|
|
2
9
|
* TableOfContentAnchor class.
|
|
3
10
|
*/
|
|
4
|
-
export
|
|
11
|
+
export declare class TableOfContentAnchor<T extends BaseProps = BaseProps> extends AnchorScrollTo<T & TableOfContentAnchorProps> {
|
|
5
12
|
/**
|
|
6
13
|
* Config.
|
|
7
14
|
*/
|
|
8
|
-
static config:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
default: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
};
|
|
15
|
+
static config: BaseConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Observer.
|
|
18
|
+
* @private
|
|
19
|
+
*/
|
|
20
|
+
__observer: IntersectionObserver;
|
|
18
21
|
/**
|
|
19
22
|
* Get the sentinel.
|
|
20
|
-
* @returns {HTMLElement}
|
|
21
23
|
*/
|
|
22
24
|
get sentinel(): HTMLElement;
|
|
23
25
|
/**
|
|
24
26
|
* Init observer on mount.
|
|
25
|
-
* @returns {void}
|
|
26
27
|
*/
|
|
27
28
|
mounted(): void;
|
|
28
|
-
observer: IntersectionObserver;
|
|
29
29
|
/**
|
|
30
30
|
* Destroy observer on destroy.
|
|
31
|
-
*
|
|
32
|
-
* @returns {void}
|
|
33
31
|
*/
|
|
34
32
|
destroyed(): void;
|
|
35
33
|
}
|
|
36
|
-
import { AnchorScrollTo } from "../../atoms/index.js";
|
|
@@ -1 +1,35 @@
|
|
|
1
|
-
import{AnchorScrollTo
|
|
1
|
+
import { AnchorScrollTo } from "../../atoms/index.js";
|
|
2
|
+
class TableOfContentAnchor extends AnchorScrollTo {
|
|
3
|
+
static config = {
|
|
4
|
+
name: "TableOfContentAnchor",
|
|
5
|
+
emits: ["should-activate"],
|
|
6
|
+
options: {
|
|
7
|
+
activeClass: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "is-active"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
__observer;
|
|
14
|
+
get sentinel() {
|
|
15
|
+
return document.querySelector(this.targetSelector);
|
|
16
|
+
}
|
|
17
|
+
mounted() {
|
|
18
|
+
if (!this.sentinel) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.__observer = new IntersectionObserver(([entry]) => {
|
|
22
|
+
const shouldActivate = entry.isIntersecting && entry.boundingClientRect.y < 100 && entry.boundingClientRect.y > 100;
|
|
23
|
+
this.$el.classList.toggle(this.$options.activeClass, shouldActivate);
|
|
24
|
+
this.$emit("should-activate", shouldActivate);
|
|
25
|
+
});
|
|
26
|
+
this.__observer.observe(this.sentinel);
|
|
27
|
+
}
|
|
28
|
+
destroyed() {
|
|
29
|
+
this.__observer.disconnect();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
TableOfContentAnchor
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TableOfContentAnchor.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/TableOfContent/TableOfContentAnchor.ts"],
|
|
4
|
+
"sourcesContent": ["import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { AnchorScrollTo } from '../../atoms/index.js';\n\nexport interface TableOfContentAnchorProps extends BaseProps {\n $options: {\n activeClass: string;\n };\n}\n\n/**\n * TableOfContentAnchor class.\n */\nexport class TableOfContentAnchor<T extends BaseProps = BaseProps> extends AnchorScrollTo<\n T & TableOfContentAnchorProps\n> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'TableOfContentAnchor',\n emits: ['should-activate'],\n options: {\n activeClass: {\n type: String,\n default: 'is-active',\n },\n },\n };\n\n /**\n * Observer.\n * @private\n */\n __observer: IntersectionObserver;\n\n /**\n * Get the sentinel.\n */\n get sentinel():HTMLElement {\n return document.querySelector(this.targetSelector) as HTMLElement;\n }\n\n /**\n * Init observer on mount.\n */\n mounted() {\n if (!this.sentinel) {\n return;\n }\n\n this.__observer = new IntersectionObserver(([entry]) => {\n const shouldActivate =\n entry.isIntersecting &&\n entry.boundingClientRect.y < 100 &&\n entry.boundingClientRect.y > 100;\n this.$el.classList.toggle(this.$options.activeClass, shouldActivate);\n this.$emit('should-activate', shouldActivate);\n });\n\n this.__observer.observe(this.sentinel);\n }\n\n /**\n * Destroy observer on destroy.\n */\n destroyed() {\n this.__observer.disconnect();\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,sBAAsB;AAWxB,MAAM,6BAA8D,eAEzE;AAAA,EAIA,OAAO,SAAqB;AAAA,IAC1B,MAAM;AAAA,IACN,OAAO,CAAC,iBAAiB;AAAA,IACzB,SAAS;AAAA,MACP,aAAa;AAAA,QACX,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EAMA;AAAA,EAKA,IAAI,WAAuB;AACzB,WAAO,SAAS,cAAc,KAAK,cAAc;AAAA,EACnD;AAAA,EAKA,UAAU;AACR,QAAI,CAAC,KAAK,UAAU;AAClB;AAAA,IACF;AAEA,SAAK,aAAa,IAAI,qBAAqB,CAAC,CAAC,KAAK,MAAM;AACtD,YAAM,iBACJ,MAAM,kBACN,MAAM,mBAAmB,IAAI,OAC7B,MAAM,mBAAmB,IAAI;AAC/B,WAAK,IAAI,UAAU,OAAO,KAAK,SAAS,aAAa,cAAc;AACnE,WAAK,MAAM,mBAAmB,cAAc;AAAA,IAC9C,CAAC;AAED,SAAK,WAAW,QAAQ,KAAK,QAAQ;AAAA,EACvC;AAAA,EAKA,YAAY;AACV,SAAK,WAAW,WAAW;AAAA,EAC7B;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -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,16 +10,13 @@ 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/TableOfContent/index.
|
|
16
|
+
// packages/ui/molecules/TableOfContent/index.ts
|
|
23
17
|
var TableOfContent_exports = {};
|
|
24
|
-
__export(TableOfContent_exports, {
|
|
25
|
-
TableOfContent: () => import_TableOfContent.default,
|
|
26
|
-
TableOfContentAnchor: () => import_TableOfContentAnchor.default
|
|
27
|
-
});
|
|
28
18
|
module.exports = __toCommonJS(TableOfContent_exports);
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
__reExport(TableOfContent_exports, require("./TableOfContent.cjs"), module.exports);
|
|
20
|
+
__reExport(TableOfContent_exports, require("./TableOfContentAnchor.cjs"), module.exports);
|
|
31
21
|
if (module.exports.default) module.exports = module.exports.default;
|
|
22
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/TableOfContent/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './TableOfContent.js';\nexport * from './TableOfContentAnchor.js';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,mCAAc,iCAAd;AACA,mCAAc,uCADd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './TableOfContent.js';
|
|
2
|
+
export * from './TableOfContentAnchor.js';
|
package/molecules/Tabs/Tabs.cjs
CHANGED
|
@@ -21,15 +21,16 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/molecules/Tabs/Tabs.
|
|
24
|
+
// packages/ui/molecules/Tabs/Tabs.ts
|
|
25
25
|
var Tabs_exports = {};
|
|
26
26
|
__export(Tabs_exports, {
|
|
27
|
-
|
|
27
|
+
Tabs: () => Tabs
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(Tabs_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
31
31
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
32
32
|
var Tabs = class extends import_js_toolkit.Base {
|
|
33
|
+
items;
|
|
33
34
|
mounted() {
|
|
34
35
|
this.items = this.$refs.btn.map((btn, index) => {
|
|
35
36
|
const id = `${this.$id}-${index}`;
|
|
@@ -64,16 +65,24 @@ var Tabs = class extends import_js_toolkit.Base {
|
|
|
64
65
|
content.setAttribute("aria-hidden", "false");
|
|
65
66
|
this.$emit("enable", item);
|
|
66
67
|
return Promise.all([
|
|
67
|
-
(0, import_utils.transition)(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
(0, import_utils.transition)(
|
|
69
|
+
btn,
|
|
70
|
+
{
|
|
71
|
+
from: btnStyles.closed,
|
|
72
|
+
active: btnStyles.active,
|
|
73
|
+
to: btnStyles.open
|
|
74
|
+
},
|
|
75
|
+
"keep"
|
|
76
|
+
),
|
|
77
|
+
(0, import_utils.transition)(
|
|
78
|
+
content,
|
|
79
|
+
{
|
|
80
|
+
from: contentStyles.closed,
|
|
81
|
+
active: contentStyles.active,
|
|
82
|
+
to: contentStyles.open
|
|
83
|
+
},
|
|
84
|
+
"keep"
|
|
85
|
+
)
|
|
77
86
|
]).then(() => Promise.resolve(this));
|
|
78
87
|
}
|
|
79
88
|
async disableItem(item) {
|
|
@@ -87,16 +96,24 @@ var Tabs = class extends import_js_toolkit.Base {
|
|
|
87
96
|
content.setAttribute("aria-hidden", "true");
|
|
88
97
|
this.$emit("disable", item);
|
|
89
98
|
return Promise.all([
|
|
90
|
-
(0, import_utils.transition)(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
(0, import_utils.transition)(
|
|
100
|
+
btn,
|
|
101
|
+
{
|
|
102
|
+
from: btnStyles.open,
|
|
103
|
+
active: btnStyles.active,
|
|
104
|
+
to: btnStyles.closed
|
|
105
|
+
},
|
|
106
|
+
"keep"
|
|
107
|
+
),
|
|
108
|
+
(0, import_utils.transition)(
|
|
109
|
+
content,
|
|
110
|
+
{
|
|
111
|
+
from: contentStyles.open,
|
|
112
|
+
active: contentStyles.active,
|
|
113
|
+
to: contentStyles.closed
|
|
114
|
+
},
|
|
115
|
+
"keep"
|
|
116
|
+
)
|
|
100
117
|
]).then(() => Promise.resolve(this));
|
|
101
118
|
}
|
|
102
119
|
};
|
|
@@ -122,3 +139,4 @@ __publicField(Tabs, "config", {
|
|
|
122
139
|
}
|
|
123
140
|
});
|
|
124
141
|
if (module.exports.default) module.exports = module.exports.default;
|
|
142
|
+
//# sourceMappingURL=Tabs.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../packages/ui/molecules/Tabs/Tabs.ts"],
|
|
4
|
+
"sourcesContent": ["import { Base } from '@studiometa/js-toolkit';\nimport type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';\nimport { transition } from '@studiometa/js-toolkit/utils';\n\ntype TabItem = {\n btn: HTMLElement;\n content: HTMLElement;\n isEnabled: boolean;\n};\n\ntype TabsStates = Partial<\n Record<'open' | 'active' | 'closed', string | Partial<CSSStyleDeclaration>>\n>;\n// eslint-disable-next-line no-use-before-define\ntype TabsStylesOption = Partial<Record<keyof TabsProps['$refs'], TabsStates>>;\n\nexport interface TabsProps extends BaseProps {\n $options: {\n styles: TabsStylesOption;\n };\n $refs: {\n btn: HTMLElement[];\n content: HTMLElement[];\n };\n}\n\n/**\n * Tabs class.\n */\nexport class Tabs<T extends BaseProps = BaseProps> extends Base<T & TabsProps> {\n /**\n * Config.\n */\n static config: BaseConfig = {\n name: 'Tabs',\n refs: ['btn[]', 'content[]'],\n emits: ['enable', 'disable'],\n options: {\n styles: {\n type: Object,\n default: (): TabsStylesOption => ({\n content: {\n closed: {\n position: 'absolute',\n opacity: '0',\n pointerEvents: 'none',\n visibility: 'hidden',\n },\n },\n }),\n merge: true,\n },\n },\n };\n\n items: TabItem[];\n\n /**\n * Initialize the component's behaviours.\n * @returns {void}\n */\n mounted() {\n this.items = this.$refs.btn.map((btn, index) => {\n const id = `${this.$id}-${index}`;\n const content = this.$refs.content[index];\n btn.setAttribute('id', id);\n content.setAttribute('aria-labelledby', id);\n\n const item = { btn, content, isEnabled: index > 0 };\n if (index > 0) {\n this.disableItem(item);\n } else {\n this.enableItem(item);\n }\n return item;\n });\n }\n\n /**\n * Switch tab on button click.\n */\n onBtnClick(event:MouseEvent, index:number) {\n this.items.forEach((item, i) => {\n if (i !== index) {\n this.disableItem(item);\n }\n });\n\n this.enableItem(this.items[index]);\n }\n\n /**\n * Enable the given tab and its associated content.\n */\n async enableItem(item:TabItem):Promise<this> {\n if (!item || item.isEnabled) {\n return Promise.resolve(this);\n }\n\n item.isEnabled = true;\n const { btn, content } = item;\n const btnStyles = this.$options.styles.btn || {};\n const contentStyles = this.$options.styles.content || {};\n\n content.setAttribute('aria-hidden', 'false');\n this.$emit('enable', item);\n\n return Promise.all([\n transition(\n btn,\n {\n from: btnStyles.closed,\n active: btnStyles.active,\n to: btnStyles.open,\n },\n 'keep',\n ),\n transition(\n content,\n {\n from: contentStyles.closed,\n active: contentStyles.active,\n to: contentStyles.open,\n },\n 'keep',\n ),\n ]).then(() => Promise.resolve(this));\n }\n\n /**\n * Disable the given tab and its associated content.\n */\n async disableItem(item:TabItem):Promise<this> {\n if (!item || !item.isEnabled) {\n return Promise.resolve(this);\n }\n\n item.isEnabled = false;\n const { btn, content } = item;\n const btnStyles = this.$options.styles.btn || {};\n const contentStyles = this.$options.styles.content || {};\n\n content.setAttribute('aria-hidden', 'true');\n this.$emit('disable', item);\n\n return Promise.all([\n transition(\n btn,\n {\n from: btnStyles.open,\n active: btnStyles.active,\n to: btnStyles.closed,\n },\n 'keep',\n ),\n transition(\n content,\n {\n from: contentStyles.open,\n active: contentStyles.active,\n to: contentStyles.closed,\n },\n 'keep',\n ),\n ]).then(() => Promise.resolve(this));\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAqB;AAErB,mBAA2B;AA2BpB,IAAM,OAAN,cAAoD,uBAAoB;AAAA,EA0B7E;AAAA,EAMA,UAAU;AACR,SAAK,QAAQ,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,UAAU;AAC9C,YAAM,KAAK,GAAG,KAAK,OAAO;AAC1B,YAAM,UAAU,KAAK,MAAM,QAAQ;AACnC,UAAI,aAAa,MAAM,EAAE;AACzB,cAAQ,aAAa,mBAAmB,EAAE;AAE1C,YAAM,OAAO,EAAE,KAAK,SAAS,WAAW,QAAQ,EAAE;AAClD,UAAI,QAAQ,GAAG;AACb,aAAK,YAAY,IAAI;AAAA,MACvB,OAAO;AACL,aAAK,WAAW,IAAI;AAAA,MACtB;AACA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAAA,EAKA,WAAW,OAAkB,OAAc;AACzC,SAAK,MAAM,QAAQ,CAAC,MAAM,MAAM;AAC9B,UAAI,MAAM,OAAO;AACf,aAAK,YAAY,IAAI;AAAA,MACvB;AAAA,IACF,CAAC;AAED,SAAK,WAAW,KAAK,MAAM,MAAM;AAAA,EACnC;AAAA,EAKA,MAAM,WAAW,MAA4B;AAC3C,QAAI,CAAC,QAAQ,KAAK,WAAW;AAC3B,aAAO,QAAQ,QAAQ,IAAI;AAAA,IAC7B;AAEA,SAAK,YAAY;AACjB,UAAM,EAAE,KAAK,QAAQ,IAAI;AACzB,UAAM,YAAY,KAAK,SAAS,OAAO,OAAO,CAAC;AAC/C,UAAM,gBAAgB,KAAK,SAAS,OAAO,WAAW,CAAC;AAEvD,YAAQ,aAAa,eAAe,OAAO;AAC3C,SAAK,MAAM,UAAU,IAAI;AAEzB,WAAO,QAAQ,IAAI;AAAA,UACjB;AAAA,QACE;AAAA,QACA;AAAA,UACE,MAAM,UAAU;AAAA,UAChB,QAAQ,UAAU;AAAA,UAClB,IAAI,UAAU;AAAA,QAChB;AAAA,QACA;AAAA,MACF;AAAA,UACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,MAAM,cAAc;AAAA,UACpB,QAAQ,cAAc;AAAA,UACtB,IAAI,cAAc;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC,EAAE,KAAK,MAAM,QAAQ,QAAQ,IAAI,CAAC;AAAA,EACrC;AAAA,EAKA,MAAM,YAAY,MAA4B;AAC5C,QAAI,CAAC,QAAQ,CAAC,KAAK,WAAW;AAC5B,aAAO,QAAQ,QAAQ,IAAI;AAAA,IAC7B;AAEA,SAAK,YAAY;AACjB,UAAM,EAAE,KAAK,QAAQ,IAAI;AACzB,UAAM,YAAY,KAAK,SAAS,OAAO,OAAO,CAAC;AAC/C,UAAM,gBAAgB,KAAK,SAAS,OAAO,WAAW,CAAC;AAEvD,YAAQ,aAAa,eAAe,MAAM;AAC1C,SAAK,MAAM,WAAW,IAAI;AAE1B,WAAO,QAAQ,IAAI;AAAA,UACjB;AAAA,QACE;AAAA,QACA;AAAA,UACE,MAAM,UAAU;AAAA,UAChB,QAAQ,UAAU;AAAA,UAClB,IAAI,UAAU;AAAA,QAChB;AAAA,QACA;AAAA,MACF;AAAA,UACA;AAAA,QACE;AAAA,QACA;AAAA,UACE,MAAM,cAAc;AAAA,UACpB,QAAQ,cAAc;AAAA,UACtB,IAAI,cAAc;AAAA,QACpB;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC,EAAE,KAAK,MAAM,QAAQ,QAAQ,IAAI,CAAC;AAAA,EACrC;AACF;AArIE,cAJW,MAIJ,UAAqB;AAAA,EAC1B,MAAM;AAAA,EACN,MAAM,CAAC,SAAS,WAAW;AAAA,EAC3B,OAAO,CAAC,UAAU,SAAS;AAAA,EAC3B,SAAS;AAAA,IACP,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS,OAAyB;AAAA,QAChC,SAAS;AAAA,UACP,QAAQ;AAAA,YACN,UAAU;AAAA,YACV,SAAS;AAAA,YACT,eAAe;AAAA,YACf,YAAY;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/molecules/Tabs/Tabs.d.ts
CHANGED
|
@@ -1,108 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @typedef {Object} TabsOptions
|
|
21
|
-
* @property {TabsStylesOption} styles
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* @typedef {Object} TabsPrivateInterface
|
|
25
|
-
* @property {TabsOptions} $options
|
|
26
|
-
* @property {TabsRefs} $refs
|
|
27
|
-
* @property {Array<TabItem>} items
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {Tabs & TabsPrivateInterface} TabsInterface
|
|
31
|
-
*/
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseProps, BaseConfig } from '@studiometa/js-toolkit';
|
|
3
|
+
declare type TabItem = {
|
|
4
|
+
btn: HTMLElement;
|
|
5
|
+
content: HTMLElement;
|
|
6
|
+
isEnabled: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare type TabsStates = Partial<Record<'open' | 'active' | 'closed', string | Partial<CSSStyleDeclaration>>>;
|
|
9
|
+
declare type TabsStylesOption = Partial<Record<keyof TabsProps['$refs'], TabsStates>>;
|
|
10
|
+
export interface TabsProps extends BaseProps {
|
|
11
|
+
$options: {
|
|
12
|
+
styles: TabsStylesOption;
|
|
13
|
+
};
|
|
14
|
+
$refs: {
|
|
15
|
+
btn: HTMLElement[];
|
|
16
|
+
content: HTMLElement[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
32
19
|
/**
|
|
33
20
|
* Tabs class.
|
|
34
21
|
*/
|
|
35
|
-
export
|
|
22
|
+
export declare class Tabs<T extends BaseProps = BaseProps> extends Base<T & TabsProps> {
|
|
36
23
|
/**
|
|
37
|
-
*
|
|
24
|
+
* Config.
|
|
38
25
|
*/
|
|
39
|
-
static config:
|
|
40
|
-
|
|
41
|
-
refs: string[];
|
|
42
|
-
emits: string[];
|
|
43
|
-
options: {
|
|
44
|
-
styles: {
|
|
45
|
-
type: ObjectConstructor;
|
|
46
|
-
/**
|
|
47
|
-
* @return {TabsStylesOption}
|
|
48
|
-
*/
|
|
49
|
-
default: () => TabsStylesOption;
|
|
50
|
-
merge: boolean;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
};
|
|
26
|
+
static config: BaseConfig;
|
|
27
|
+
items: TabItem[];
|
|
54
28
|
/**
|
|
55
29
|
* Initialize the component's behaviours.
|
|
56
|
-
* @
|
|
57
|
-
* @return {void}
|
|
30
|
+
* @returns {void}
|
|
58
31
|
*/
|
|
59
|
-
mounted(
|
|
60
|
-
items: any;
|
|
32
|
+
mounted(): void;
|
|
61
33
|
/**
|
|
62
34
|
* Switch tab on button click.
|
|
63
|
-
*
|
|
64
|
-
* @this {TabsInterface}
|
|
65
|
-
* @param {Event} event The click event object.
|
|
66
|
-
* @param {number} index The index of the clicked button.
|
|
67
|
-
* @return {void}
|
|
68
35
|
*/
|
|
69
|
-
onBtnClick(
|
|
36
|
+
onBtnClick(event: MouseEvent, index: number): void;
|
|
70
37
|
/**
|
|
71
38
|
* Enable the given tab and its associated content.
|
|
72
|
-
*
|
|
73
|
-
* @this {TabsInterface}
|
|
74
|
-
* @param {TabItem} item The item to enable.
|
|
75
|
-
* @return {Promise<TabsInterface>} Tabs instance.
|
|
76
39
|
*/
|
|
77
|
-
enableItem(
|
|
40
|
+
enableItem(item: TabItem): Promise<this>;
|
|
78
41
|
/**
|
|
79
42
|
* Disable the given tab and its associated content.
|
|
80
|
-
*
|
|
81
|
-
* @this {TabsInterface}
|
|
82
|
-
* @param {TabItem} item The item to disable.
|
|
83
|
-
* @return {Promise<TabsInterface>} The Tabs instance.
|
|
84
43
|
*/
|
|
85
|
-
disableItem(
|
|
44
|
+
disableItem(item: TabItem): Promise<this>;
|
|
86
45
|
}
|
|
87
|
-
export
|
|
88
|
-
export type TabItem = {
|
|
89
|
-
btn: HTMLElement;
|
|
90
|
-
content: HTMLElement;
|
|
91
|
-
isEnabled: boolean;
|
|
92
|
-
};
|
|
93
|
-
export type TabsRefs = {
|
|
94
|
-
btn: HTMLElement[];
|
|
95
|
-
content: HTMLElement[];
|
|
96
|
-
};
|
|
97
|
-
export type TabsStates = Partial<Record<'open' | 'active' | 'closed', string | Partial<CSSStyleDeclaration>>>;
|
|
98
|
-
export type TabsStylesOption = Partial<Record<keyof TabsRefs, TabsStates>>;
|
|
99
|
-
export type TabsOptions = {
|
|
100
|
-
styles: TabsStylesOption;
|
|
101
|
-
};
|
|
102
|
-
export type TabsPrivateInterface = {
|
|
103
|
-
$options: TabsOptions;
|
|
104
|
-
$refs: TabsRefs;
|
|
105
|
-
items: Array<TabItem>;
|
|
106
|
-
};
|
|
107
|
-
export type TabsInterface = Tabs & TabsPrivateInterface;
|
|
108
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
46
|
+
export {};
|