@studiometa/ui 0.2.12 → 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 +46 -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
|
@@ -21,15 +21,18 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/molecules/Menu/MenuBtn.
|
|
24
|
+
// packages/ui/molecules/Menu/MenuBtn.ts
|
|
25
25
|
var MenuBtn_exports = {};
|
|
26
26
|
__export(MenuBtn_exports, {
|
|
27
|
-
|
|
27
|
+
MenuBtn: () => MenuBtn
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(MenuBtn_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
31
31
|
var MenuBtn = class extends import_js_toolkit.Base {
|
|
32
|
-
|
|
32
|
+
constructor() {
|
|
33
|
+
super(...arguments);
|
|
34
|
+
__publicField(this, "isHover", false);
|
|
35
|
+
}
|
|
33
36
|
onClick(event) {
|
|
34
37
|
event.stopPropagation();
|
|
35
38
|
}
|
|
@@ -43,7 +46,6 @@ var MenuBtn = class extends import_js_toolkit.Base {
|
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
__publicField(MenuBtn, "config", {
|
|
46
|
-
name: "MenuBtn"
|
|
47
|
-
debug: true
|
|
49
|
+
name: "MenuBtn"
|
|
48
50
|
});
|
|
49
51
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { Base } from '@studiometa/js-toolkit';
|
|
2
|
+
import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
|
|
1
3
|
/**
|
|
2
4
|
* MenuBtn class.
|
|
3
5
|
*/
|
|
4
|
-
export
|
|
6
|
+
export declare class MenuBtn<T extends BaseProps = BaseProps> extends Base<T> {
|
|
5
7
|
/**
|
|
6
8
|
* Config.
|
|
7
9
|
*/
|
|
8
|
-
static config:
|
|
9
|
-
name: string;
|
|
10
|
-
debug: boolean;
|
|
11
|
-
};
|
|
10
|
+
static config: BaseConfig;
|
|
12
11
|
/**
|
|
13
12
|
* Wether the button is hovered or not.
|
|
14
13
|
* @type {boolean}
|
|
@@ -20,19 +19,18 @@ export default class MenuBtn extends Base {
|
|
|
20
19
|
* @param {MouseEvent} event
|
|
21
20
|
* @returns {void}
|
|
22
21
|
*/
|
|
23
|
-
onClick(event:
|
|
22
|
+
onClick(event: any): void;
|
|
24
23
|
/**
|
|
25
24
|
* Dispatch the mouseenter event.
|
|
26
25
|
*
|
|
27
26
|
* @param {MouseEvent} event
|
|
28
27
|
* @returns {void}
|
|
29
28
|
*/
|
|
30
|
-
onMouseenter(event:
|
|
29
|
+
onMouseenter(event: any): void;
|
|
31
30
|
/**
|
|
32
31
|
* Dispatch the mouseleave event.
|
|
33
32
|
* @param {MouseEvent} event
|
|
34
33
|
* @returns {void}
|
|
35
34
|
*/
|
|
36
|
-
onMouseleave(event:
|
|
35
|
+
onMouseleave(event: any): void;
|
|
37
36
|
}
|
|
38
|
-
import { Base } from "@studiometa/js-toolkit";
|
|
@@ -1 +1,30 @@
|
|
|
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
|
+
class MenuBtn extends Base {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
__publicField(this, "isHover", false);
|
|
12
|
+
}
|
|
13
|
+
onClick(event) {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
}
|
|
16
|
+
onMouseenter(event) {
|
|
17
|
+
this.isHover = true;
|
|
18
|
+
event.stopPropagation();
|
|
19
|
+
}
|
|
20
|
+
onMouseleave(event) {
|
|
21
|
+
this.isHover = false;
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
__publicField(MenuBtn, "config", {
|
|
26
|
+
name: "MenuBtn"
|
|
27
|
+
});
|
|
28
|
+
export {
|
|
29
|
+
MenuBtn
|
|
30
|
+
};
|
|
@@ -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,20 +15,19 @@ 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/Menu/MenuList.
|
|
24
|
+
// packages/ui/molecules/Menu/MenuList.ts
|
|
28
25
|
var MenuList_exports = {};
|
|
29
26
|
__export(MenuList_exports, {
|
|
30
|
-
|
|
27
|
+
MenuList: () => MenuList
|
|
31
28
|
});
|
|
32
29
|
module.exports = __toCommonJS(MenuList_exports);
|
|
33
|
-
var
|
|
30
|
+
var import_primitives = require("../../primitives/index.cjs");
|
|
34
31
|
var FOCUSABLE_ELEMENTS = [
|
|
35
32
|
"a[href]:not([inert])",
|
|
36
33
|
"area[href]:not([inert])",
|
|
@@ -44,9 +41,12 @@ var FOCUSABLE_ELEMENTS = [
|
|
|
44
41
|
"[contenteditable]:not([inert])",
|
|
45
42
|
"[tabindex]:not([inert])"
|
|
46
43
|
].join(",");
|
|
47
|
-
var _MenuList = class extends
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
var _MenuList = class extends import_primitives.Transition {
|
|
45
|
+
constructor() {
|
|
46
|
+
super(...arguments);
|
|
47
|
+
__publicField(this, "isOpen", false);
|
|
48
|
+
__publicField(this, "isHover", false);
|
|
49
|
+
}
|
|
50
50
|
get $options() {
|
|
51
51
|
const options = super.$options;
|
|
52
52
|
options.leaveKeep = true;
|
|
@@ -103,7 +103,9 @@ var _MenuList = class extends import_Transition.default {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
__updateTabIndexes(mode = "open") {
|
|
106
|
-
const focusableItems = Array.from(this.$el.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(
|
|
106
|
+
const focusableItems = Array.from(this.$el.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(
|
|
107
|
+
(item) => this.__filterFocusableItems(item)
|
|
108
|
+
);
|
|
107
109
|
focusableItems.forEach((item) => {
|
|
108
110
|
if (mode === "close") {
|
|
109
111
|
item.setAttribute("tabindex", "-1");
|
|
@@ -122,7 +124,7 @@ var _MenuList = class extends import_Transition.default {
|
|
|
122
124
|
};
|
|
123
125
|
var MenuList = _MenuList;
|
|
124
126
|
__publicField(MenuList, "config", {
|
|
125
|
-
...
|
|
127
|
+
...import_primitives.Transition.config,
|
|
126
128
|
name: "MenuList",
|
|
127
129
|
emits: ["items-open", "items-close", "items-mouseleave"],
|
|
128
130
|
components: {
|
|
@@ -1,99 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* $children: {
|
|
9
|
-
* MenuList: MenuList[]
|
|
10
|
-
* }
|
|
11
|
-
* }} MenuListInterface
|
|
12
|
-
*/
|
|
1
|
+
import type { BaseConfig, BaseProps } from '@studiometa/js-toolkit';
|
|
2
|
+
import { Transition } from '../../primitives/index.js';
|
|
3
|
+
export interface MenuListProps extends BaseProps {
|
|
4
|
+
$children: {
|
|
5
|
+
MenuList: MenuList[];
|
|
6
|
+
};
|
|
7
|
+
}
|
|
13
8
|
/**
|
|
14
9
|
* MenuList class.
|
|
15
10
|
*/
|
|
16
|
-
export
|
|
11
|
+
export declare class MenuList<T extends BaseProps = BaseProps> extends Transition<T & MenuListProps> {
|
|
17
12
|
/**
|
|
18
13
|
* Config.
|
|
19
14
|
*/
|
|
20
|
-
static config:
|
|
21
|
-
name: string;
|
|
22
|
-
emits: string[];
|
|
23
|
-
components: {
|
|
24
|
-
MenuList: typeof MenuList;
|
|
25
|
-
};
|
|
26
|
-
debug?: boolean;
|
|
27
|
-
log?: boolean;
|
|
28
|
-
refs?: string[];
|
|
29
|
-
options?: import("@studiometa/js-toolkit/Base/managers/OptionsManager.js").OptionsSchema;
|
|
30
|
-
};
|
|
15
|
+
static config: BaseConfig;
|
|
31
16
|
/**
|
|
32
17
|
* Are the menu items visible?
|
|
33
|
-
* @type {boolean}
|
|
34
18
|
*/
|
|
35
19
|
isOpen: boolean;
|
|
36
20
|
/**
|
|
37
21
|
* Wether the component is hovered.
|
|
38
|
-
* @type {boolean}
|
|
39
22
|
*/
|
|
40
23
|
isHover: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Override `Transition` options.
|
|
26
|
+
*/
|
|
27
|
+
get $options(): import("@studiometa/js-toolkit/Base/managers/OptionsManager.js").default & import("@studiometa/js-toolkit/Base/index.js").BaseOptions & (T & MenuListProps & import("../../index.js").TransitionProps)["$options"];
|
|
41
28
|
/**
|
|
42
29
|
* Update tab indexes on mount.
|
|
43
|
-
*
|
|
44
|
-
* @returns {void}
|
|
45
30
|
*/
|
|
46
31
|
mounted(): void;
|
|
47
32
|
/**
|
|
48
33
|
* Set hover state.
|
|
49
|
-
*
|
|
50
|
-
* @returns {void}
|
|
51
34
|
*/
|
|
52
35
|
onMouseenter(): void;
|
|
53
36
|
/**
|
|
54
37
|
* Unset hover state.
|
|
55
|
-
*
|
|
56
|
-
* @returns {void}
|
|
57
38
|
*/
|
|
58
39
|
onMouseleave(): void;
|
|
59
40
|
/**
|
|
60
41
|
* Display the menu items.
|
|
61
|
-
*
|
|
62
|
-
* @returns {void}
|
|
63
42
|
*/
|
|
64
43
|
open(): void;
|
|
65
44
|
/**
|
|
66
45
|
* Hide the menu items.
|
|
67
|
-
*
|
|
68
|
-
* @this {MenuListInterface}
|
|
69
|
-
* @returns {void}
|
|
70
46
|
*/
|
|
71
|
-
close(
|
|
47
|
+
close(): void;
|
|
72
48
|
/**
|
|
73
49
|
* Toggle the menu items.
|
|
74
|
-
* @returns {void}
|
|
75
50
|
*/
|
|
76
51
|
toggle(): void;
|
|
77
52
|
/**
|
|
78
53
|
* Update `tabindex` attribute of child focusable elements.
|
|
79
|
-
*
|
|
80
54
|
* @private
|
|
81
|
-
* @param {'open'|'close'} mode
|
|
82
|
-
* @returns {void}
|
|
83
55
|
*/
|
|
84
|
-
|
|
56
|
+
__updateTabIndexes(mode?: 'open' | 'close'): void;
|
|
85
57
|
/**
|
|
86
58
|
* Filter out items which are inside a child `MenuList` instance.
|
|
87
|
-
*
|
|
88
59
|
* @private
|
|
89
|
-
* @param {HTMLElement} item
|
|
90
|
-
* @returns {boolean}
|
|
91
60
|
*/
|
|
92
|
-
|
|
61
|
+
__filterFocusableItems(item: HTMLElement): boolean;
|
|
93
62
|
}
|
|
94
|
-
export type MenuListInterface = MenuList & {
|
|
95
|
-
$children: {
|
|
96
|
-
MenuList: MenuList[];
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
export {};
|
|
@@ -1 +1,113 @@
|
|
|
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 { Transition } from "../../primitives/index.js";
|
|
8
|
+
const FOCUSABLE_ELEMENTS = [
|
|
9
|
+
"a[href]:not([inert])",
|
|
10
|
+
"area[href]:not([inert])",
|
|
11
|
+
"input:not([disabled]):not([inert])",
|
|
12
|
+
"select:not([disabled]):not([inert])",
|
|
13
|
+
"textarea:not([disabled]):not([inert])",
|
|
14
|
+
"button:not([disabled]):not([inert])",
|
|
15
|
+
"iframe:not([inert])",
|
|
16
|
+
"audio:not([inert])",
|
|
17
|
+
"video:not([inert])",
|
|
18
|
+
"[contenteditable]:not([inert])",
|
|
19
|
+
"[tabindex]:not([inert])"
|
|
20
|
+
].join(",");
|
|
21
|
+
const _MenuList = class extends Transition {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
__publicField(this, "isOpen", false);
|
|
25
|
+
__publicField(this, "isHover", false);
|
|
26
|
+
}
|
|
27
|
+
get $options() {
|
|
28
|
+
const options = super.$options;
|
|
29
|
+
options.leaveKeep = true;
|
|
30
|
+
options.enterKeep = true;
|
|
31
|
+
return options;
|
|
32
|
+
}
|
|
33
|
+
mounted() {
|
|
34
|
+
this.__updateTabIndexes("close");
|
|
35
|
+
}
|
|
36
|
+
onMouseenter() {
|
|
37
|
+
this.isHover = true;
|
|
38
|
+
}
|
|
39
|
+
onMouseleave() {
|
|
40
|
+
this.isHover = false;
|
|
41
|
+
}
|
|
42
|
+
open() {
|
|
43
|
+
if (this.isOpen) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const clickOutsideHandler = (event) => {
|
|
47
|
+
if (!this.$el.contains(event.target)) {
|
|
48
|
+
document.removeEventListener("click", clickOutsideHandler);
|
|
49
|
+
this.close();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener("click", clickOutsideHandler);
|
|
53
|
+
this.__updateTabIndexes("open");
|
|
54
|
+
this.$el.setAttribute("aria-hidden", "false");
|
|
55
|
+
this.isOpen = true;
|
|
56
|
+
this.enter();
|
|
57
|
+
this.$emit("items-open");
|
|
58
|
+
}
|
|
59
|
+
close() {
|
|
60
|
+
if (!this.isOpen) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.$children.MenuList.forEach((menuItem) => {
|
|
64
|
+
menuItem.close();
|
|
65
|
+
});
|
|
66
|
+
if (document.activeElement instanceof HTMLElement && this.$el.contains(document.activeElement)) {
|
|
67
|
+
document.activeElement.blur();
|
|
68
|
+
}
|
|
69
|
+
this.$el.setAttribute("aria-hidden", "true");
|
|
70
|
+
this.__updateTabIndexes("close");
|
|
71
|
+
this.isOpen = false;
|
|
72
|
+
this.leave();
|
|
73
|
+
this.$emit("items-close");
|
|
74
|
+
}
|
|
75
|
+
toggle() {
|
|
76
|
+
if (this.isOpen) {
|
|
77
|
+
this.close();
|
|
78
|
+
} else {
|
|
79
|
+
this.open();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
__updateTabIndexes(mode = "open") {
|
|
83
|
+
const focusableItems = Array.from(this.$el.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(
|
|
84
|
+
(item) => this.__filterFocusableItems(item)
|
|
85
|
+
);
|
|
86
|
+
focusableItems.forEach((item) => {
|
|
87
|
+
if (mode === "close") {
|
|
88
|
+
item.setAttribute("tabindex", "-1");
|
|
89
|
+
} else {
|
|
90
|
+
item.removeAttribute("tabindex");
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
__filterFocusableItems(item) {
|
|
95
|
+
let ancestor = item.parentElement;
|
|
96
|
+
while (ancestor && (!ancestor.__base__ || !ancestor.__base__.has(this.constructor))) {
|
|
97
|
+
ancestor = ancestor.parentElement;
|
|
98
|
+
}
|
|
99
|
+
return ancestor === null || ancestor === this.$el;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
let MenuList = _MenuList;
|
|
103
|
+
__publicField(MenuList, "config", {
|
|
104
|
+
...Transition.config,
|
|
105
|
+
name: "MenuList",
|
|
106
|
+
emits: ["items-open", "items-close", "items-mouseleave"],
|
|
107
|
+
components: {
|
|
108
|
+
MenuList: _MenuList
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
export {
|
|
112
|
+
MenuList
|
|
113
|
+
};
|
package/molecules/Menu/index.cjs
CHANGED
|
@@ -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,18 +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/Menu/index.
|
|
16
|
+
// packages/ui/molecules/Menu/index.ts
|
|
23
17
|
var Menu_exports = {};
|
|
24
|
-
__export(Menu_exports, {
|
|
25
|
-
Menu: () => import_Menu.default,
|
|
26
|
-
MenuBtn: () => import_MenuBtn.default,
|
|
27
|
-
MenuList: () => import_MenuList.default
|
|
28
|
-
});
|
|
29
18
|
module.exports = __toCommonJS(Menu_exports);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
__reExport(Menu_exports, require("./Menu.cjs"), module.exports);
|
|
20
|
+
__reExport(Menu_exports, require("./MenuBtn.cjs"), module.exports);
|
|
21
|
+
__reExport(Menu_exports, require("./MenuList.cjs"), module.exports);
|
|
33
22
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './Menu.js';
|
|
2
|
+
export * from './MenuBtn.js';
|
|
3
|
+
export * from './MenuList.js';
|
package/molecules/Menu/index.js
CHANGED
|
@@ -21,16 +21,29 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
return value;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
// packages/ui/molecules/Modal/Modal.
|
|
24
|
+
// packages/ui/molecules/Modal/Modal.ts
|
|
25
25
|
var Modal_exports = {};
|
|
26
26
|
__export(Modal_exports, {
|
|
27
|
-
|
|
27
|
+
Modal: () => Modal
|
|
28
28
|
});
|
|
29
29
|
module.exports = __toCommonJS(Modal_exports);
|
|
30
30
|
var import_js_toolkit = require("@studiometa/js-toolkit");
|
|
31
31
|
var import_utils = require("@studiometa/js-toolkit/utils");
|
|
32
|
+
function delegateTransition(elementOrElements, name, endMode) {
|
|
33
|
+
return (0, import_utils.isArray)(elementOrElements) || elementOrElements instanceof NodeList ? Promise.all(
|
|
34
|
+
Array.from(elementOrElements).map((el) => (0, import_utils.transition)(el, name, endMode))
|
|
35
|
+
) : (0, import_utils.transition)(elementOrElements, name, endMode);
|
|
36
|
+
}
|
|
32
37
|
var { trap, untrap, saveActiveElement } = (0, import_utils.focusTrap)();
|
|
33
38
|
var Modal = class extends import_js_toolkit.Base {
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
__publicField(this, "isOpen", false);
|
|
42
|
+
__publicField(this, "__refsBackup");
|
|
43
|
+
__publicField(this, "__refModalPlaceholder");
|
|
44
|
+
__publicField(this, "__refModalParentBackup");
|
|
45
|
+
__publicField(this, "__refModalUnbindGetRefFilter");
|
|
46
|
+
}
|
|
34
47
|
get onOpenClick() {
|
|
35
48
|
return this.open;
|
|
36
49
|
}
|
|
@@ -49,7 +62,7 @@ var Modal = class extends import_js_toolkit.Base {
|
|
|
49
62
|
this.__refModalPlaceholder = document.createComment("");
|
|
50
63
|
this.__refModalParentBackup = this.$refs.modal.parentElement || this.$el;
|
|
51
64
|
this.__refModalParentBackup.insertBefore(this.__refModalPlaceholder, this.$refs.modal);
|
|
52
|
-
target.
|
|
65
|
+
target.append(this.$refs.modal);
|
|
53
66
|
}
|
|
54
67
|
}
|
|
55
68
|
get $refs() {
|
|
@@ -95,11 +108,19 @@ var Modal = class extends import_js_toolkit.Base {
|
|
|
95
108
|
this.isOpen = true;
|
|
96
109
|
this.$emit("open");
|
|
97
110
|
const refs = this.$refs;
|
|
98
|
-
return Promise.all(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
return Promise.all(
|
|
112
|
+
Object.entries(this.$options.styles).map(
|
|
113
|
+
([refName, { open, active, closed } = { open: "", active: "", closed: "" }]) => delegateTransition(
|
|
114
|
+
refs[refName],
|
|
115
|
+
{
|
|
116
|
+
from: closed,
|
|
117
|
+
active,
|
|
118
|
+
to: open
|
|
119
|
+
},
|
|
120
|
+
"keep"
|
|
121
|
+
)
|
|
122
|
+
)
|
|
123
|
+
).then(() => {
|
|
103
124
|
if (this.$options.autofocus && this.$refs.modal.querySelector(this.$options.autofocus)) {
|
|
104
125
|
saveActiveElement();
|
|
105
126
|
const autofocusElement = this.$refs.modal.querySelector(this.$options.autofocus);
|
|
@@ -120,11 +141,19 @@ var Modal = class extends import_js_toolkit.Base {
|
|
|
120
141
|
untrap();
|
|
121
142
|
this.$emit("close");
|
|
122
143
|
const refs = this.$refs;
|
|
123
|
-
return Promise.all(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
144
|
+
return Promise.all(
|
|
145
|
+
Object.entries(this.$options.styles).map(
|
|
146
|
+
([refName, { open, active, closed } = { open: "", active: "", closed: "" }]) => delegateTransition(
|
|
147
|
+
refs[refName],
|
|
148
|
+
{
|
|
149
|
+
from: open,
|
|
150
|
+
active,
|
|
151
|
+
to: closed
|
|
152
|
+
},
|
|
153
|
+
"keep"
|
|
154
|
+
)
|
|
155
|
+
)
|
|
156
|
+
).then(() => Promise.resolve());
|
|
128
157
|
}
|
|
129
158
|
};
|
|
130
159
|
__publicField(Modal, "config", {
|