@inpageedit/core 0.4.1 → 0.5.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/dist/ActionButton-BgbTKTg7.js +24 -0
- package/dist/ActionButton-BgbTKTg7.js.map +1 -0
- package/dist/{RadioBox-BZFhTEo5.js → RadioBox-CaA8VgLu.js} +16 -16
- package/dist/{RadioBox-BZFhTEo5.js.map → RadioBox-CaA8VgLu.js.map} +1 -1
- package/dist/components/TwinSwapInput/index.d.ts +1 -0
- package/dist/components/index.js +21 -22
- package/dist/components/index.js.map +1 -1
- package/dist/index-BIgWRk98.js +4826 -0
- package/dist/index-BIgWRk98.js.map +1 -0
- package/dist/index-BMmKF_kG.js +165 -0
- package/dist/index-BMmKF_kG.js.map +1 -0
- package/dist/{index-BPsDFq9U.js → index-Bh70Udzi.js} +14 -13
- package/dist/index-Bh70Udzi.js.map +1 -0
- package/dist/index-CBphMyYJ.js +5170 -0
- package/dist/index-CBphMyYJ.js.map +1 -0
- package/dist/{index-X1X416tZ.js → index-CJLKdEqr.js} +41 -25
- package/dist/index-CJLKdEqr.js.map +1 -0
- package/dist/{index-BsYzf3Yw.js → index-CX5H4xCe.js} +12 -12
- package/dist/index-CX5H4xCe.js.map +1 -0
- package/dist/{index-BByzm2Fz.js → index-DNm9SNqM.js} +128 -120
- package/dist/{index-BByzm2Fz.js.map → index-DNm9SNqM.js.map} +1 -1
- package/dist/{index-Ch5DJDZZ.js → index-Djd6Ddcm.js} +125 -121
- package/dist/index-Djd6Ddcm.js.map +1 -0
- package/dist/index-Dk3xR25y.js +96 -0
- package/dist/index-Dk3xR25y.js.map +1 -0
- package/dist/{index-D-zQLFuZ.js → index-QF8lvEam.js} +14 -21
- package/dist/index-QF8lvEam.js.map +1 -0
- package/dist/index.js +9 -4639
- package/dist/index.js.map +1 -1
- package/dist/models/WikiPage/index.d.ts +5 -4
- package/dist/plugins/BasePlugin.d.ts +12 -4
- package/dist/plugins/_debug/index.d.ts +1 -1
- package/dist/plugins/quick-diff/PluginQuickDiffCore.d.ts +2 -1
- package/dist/plugins/quick-edit/index.d.ts +2 -1
- package/dist/plugins/quick-move/index.d.ts +1 -1
- package/dist/plugins/quick-preview/index.d.ts +4 -3
- package/dist/plugins/quick-redirect/index.d.ts +1 -1
- package/dist/plugins/toolbox/index.d.ts +2 -2
- package/dist/services/ModalService/IPEModal.d.ts +235 -0
- package/dist/services/ModalService/index.d.ts +35 -0
- package/dist/style.css +1 -1
- package/dist/utils/interpolate.d.ts +20 -0
- package/dist/utils/interpolate.spec.d.ts +1 -0
- package/lib/index.umd.js +32 -32
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +24 -25
- package/dist/ActionButton-ByMKIthQ.js +0 -24
- package/dist/ActionButton-ByMKIthQ.js.map +0 -1
- package/dist/index-BPsDFq9U.js.map +0 -1
- package/dist/index-BTngTj1f.js +0 -4682
- package/dist/index-BTngTj1f.js.map +0 -1
- package/dist/index-BsYzf3Yw.js.map +0 -1
- package/dist/index-Ch5DJDZZ.js.map +0 -1
- package/dist/index-Cq9xxVsu.js +0 -149
- package/dist/index-Cq9xxVsu.js.map +0 -1
- package/dist/index-D-zQLFuZ.js.map +0 -1
- package/dist/index-HyxA2rYz.js +0 -87
- package/dist/index-HyxA2rYz.js.map +0 -1
- package/dist/index-X1X416tZ.js.map +0 -1
- package/dist/services/SsiModalService.d.ts +0 -36
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { c as s } from "./index-CvhkVj_L.js";
|
|
2
|
+
const d = window?.location?.origin, p = ({
|
|
3
|
+
type: n,
|
|
4
|
+
tag: t,
|
|
5
|
+
href: i,
|
|
6
|
+
target: o,
|
|
7
|
+
children: a,
|
|
8
|
+
...e
|
|
9
|
+
}) => (t = t || (i ? "a" : "button"), typeof o > "u" && i && i.startsWith("http") && !i.startsWith(d) && (o = "_blank"), s(
|
|
10
|
+
t,
|
|
11
|
+
{
|
|
12
|
+
className: `theme-ipe ipe-action-button ipe-modal-btn is-${n || "default"}`,
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
href: t === "a" ? i : void 0,
|
|
15
|
+
target: t === "a" ? o : void 0,
|
|
16
|
+
"data-href": t !== "a" ? i : void 0,
|
|
17
|
+
...e
|
|
18
|
+
},
|
|
19
|
+
a
|
|
20
|
+
));
|
|
21
|
+
export {
|
|
22
|
+
p as A
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=ActionButton-BgbTKTg7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButton-BgbTKTg7.js","sources":["../src/components/ActionButton.tsx"],"sourcesContent":["import { h, JSX, ReactNode } from 'jsx-dom'\r\n\r\nexport interface ActionButtonProps {\r\n type?: 'primary' | 'secondary' | 'danger' | 'default'\r\n tag?: 'a' | 'button' | 'div'\r\n}\r\n\r\nconst origin = window?.location?.origin\r\n\r\nexport const ActionButton = ({\r\n type,\r\n tag,\r\n href,\r\n target,\r\n children,\r\n ...rest\r\n}: ActionButtonProps &\r\n Omit<JSX.IntrinsicElements['button'], 'type'> &\r\n JSX.IntrinsicElements['a']) => {\r\n tag = tag || (href ? 'a' : 'button')\r\n if (\r\n typeof target === 'undefined' &&\r\n href &&\r\n href.startsWith('http') &&\r\n !href.startsWith(origin)\r\n ) {\r\n target = '_blank'\r\n }\r\n return h(\r\n tag,\r\n {\r\n className: `theme-ipe ipe-action-button ipe-modal-btn is-${type || 'default'}`,\r\n // @ts-ignore\r\n href: tag === 'a' ? href : undefined,\r\n target: tag === 'a' ? target : undefined,\r\n 'data-href': tag !== 'a' ? href : undefined,\r\n ...rest,\r\n },\r\n children\r\n )\r\n}\r\n"],"names":["origin","ActionButton","type","tag","href","target","children","rest","h"],"mappings":";AAOA,MAAMA,IAAS,QAAQ,UAAU,QAEpBC,IAAe,CAAC;AAAA,EAC3B,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,OAGEJ,IAAMA,MAAQC,IAAO,MAAM,WAEzB,OAAOC,IAAW,OAClBD,KACAA,EAAK,WAAW,MAAM,KACtB,CAACA,EAAK,WAAWJ,CAAM,MAEvBK,IAAS,WAEJG;AAAAA,EACLL;AAAA,EACA;AAAA,IACE,WAAW,gDAAgDD,KAAQ,SAAS;AAAA;AAAA,IAE5E,MAAMC,MAAQ,MAAMC,IAAO;AAAA,IAC3B,QAAQD,MAAQ,MAAME,IAAS;AAAA,IAC/B,aAAaF,MAAQ,MAAMC,IAAO;AAAA,IAClC,GAAGG;AAAA,EAAA;AAAA,EAELD;AAAA;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as e } from "./index-CvhkVj_L.js";
|
|
2
|
-
const
|
|
3
|
-
mbox:
|
|
4
|
-
title:
|
|
5
|
-
content:
|
|
6
|
-
close:
|
|
7
|
-
},
|
|
2
|
+
const u = "_mbox_5x43w_1", _ = "_title_5x43w_12", f = "_content_5x43w_19", v = "_close_5x43w_27", s = {
|
|
3
|
+
mbox: u,
|
|
4
|
+
title: _,
|
|
5
|
+
content: f,
|
|
6
|
+
close: v
|
|
7
|
+
}, N = (i) => {
|
|
8
8
|
const {
|
|
9
9
|
type: t = "default",
|
|
10
10
|
title: n,
|
|
@@ -15,9 +15,9 @@ const f = "_mbox_v5fz5_1", u = "_title_v5fz5_12", v = "_content_v5fz5_19", _ = "
|
|
|
15
15
|
children: p,
|
|
16
16
|
...m
|
|
17
17
|
} = i;
|
|
18
|
-
let
|
|
19
|
-
typeof n > "u" && t !== "default" && (
|
|
20
|
-
const
|
|
18
|
+
let x = n;
|
|
19
|
+
typeof n > "u" && t !== "default" && (x = t[0].toUpperCase() + t.slice(1).toLowerCase());
|
|
20
|
+
const d = async () => {
|
|
21
21
|
if (!o)
|
|
22
22
|
return Promise.resolve();
|
|
23
23
|
const { promise: h, resolve: b } = Promise.withResolvers();
|
|
@@ -34,12 +34,12 @@ const f = "_mbox_v5fz5_1", u = "_title_v5fz5_12", v = "_content_v5fz5_19", _ = "
|
|
|
34
34
|
o.remove(), b();
|
|
35
35
|
}), h;
|
|
36
36
|
}, o = /* @__PURE__ */ e("div", { className: `theme-ipe ipe-mbox mbox-type-${t || "default"} ${s.mbox}`, ...m, children: [
|
|
37
|
-
|
|
37
|
+
x && /* @__PURE__ */ e("div", { className: `ipe-mbox-title ${s.title}`, ...a, children: x }),
|
|
38
38
|
/* @__PURE__ */ e("div", { className: `ipe-mbox-content ${s.content}`, ...r, children: p || c }),
|
|
39
|
-
l && /* @__PURE__ */ e("a", { onClick:
|
|
39
|
+
l && /* @__PURE__ */ e("a", { onClick: d, className: `ipe-mbox-close ${s.close}`, children: "×" })
|
|
40
40
|
] });
|
|
41
|
-
return o.close =
|
|
42
|
-
},
|
|
41
|
+
return o.close = d, o;
|
|
42
|
+
}, P = (i) => {
|
|
43
43
|
const { id: t, name: n, value: c, label: l, inputProps: a, labelProps: r, children: p, ...m } = i;
|
|
44
44
|
return /* @__PURE__ */ e("label", { className: "theme-ipe ipe-radio-box", ...m, children: [
|
|
45
45
|
/* @__PURE__ */ e("input", { type: "radio", id: t, name: n, value: c, ...a }),
|
|
@@ -48,7 +48,7 @@ const f = "_mbox_v5fz5_1", u = "_title_v5fz5_12", v = "_content_v5fz5_19", _ = "
|
|
|
48
48
|
] });
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
N as M,
|
|
52
|
+
P as R
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=RadioBox-
|
|
54
|
+
//# sourceMappingURL=RadioBox-CaA8VgLu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioBox-
|
|
1
|
+
{"version":3,"file":"RadioBox-CaA8VgLu.js","sources":["../src/components/MBox/index.tsx","../src/components/RadioBox.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\r\nimport { JSX } from 'jsx-dom/jsx-runtime'\r\nimport styles from './styles.module.sass'\r\n\r\nexport type MBoxProps = {\r\n type?:\r\n | ''\r\n | 'default'\r\n | 'note'\r\n | 'info'\r\n | 'tip'\r\n | 'success'\r\n | 'important'\r\n | 'done'\r\n | 'warning'\r\n | 'caution'\r\n | 'error'\r\n title?: ReactNode\r\n content?: ReactNode\r\n closeable?: boolean\r\n titleProps?: JSX.IntrinsicElements['div']\r\n contentProps?: JSX.IntrinsicElements['div']\r\n} & JSX.IntrinsicElements['div']\r\n\r\nexport type MBoxElement = HTMLElement & {\r\n close: () => Promise<void>\r\n}\r\n\r\nexport const MBox = (props: MBoxProps) => {\r\n const {\r\n type = 'default',\r\n title,\r\n content,\r\n closeable = true,\r\n titleProps,\r\n contentProps,\r\n children,\r\n ...rest\r\n } = props\r\n let titleContent = title\r\n if (typeof title === 'undefined' && type !== 'default') {\r\n titleContent = type[0].toUpperCase() + type.slice(1).toLowerCase()\r\n }\r\n\r\n const close = async () => {\r\n if (!box) {\r\n return Promise.resolve()\r\n }\r\n const { promise, resolve } = Promise.withResolvers<void>()\r\n\r\n const animation = box.animate(\r\n [\r\n { opacity: '1', height: box.clientHeight + 'px' },\r\n { opacity: '0', height: '0px', margin: '0px' },\r\n ],\r\n {\r\n duration: 300,\r\n easing: 'ease',\r\n }\r\n )\r\n\r\n animation.addEventListener('finish', () => {\r\n box.remove()\r\n resolve()\r\n })\r\n\r\n return promise\r\n }\r\n\r\n const box = (\r\n <div className={`theme-ipe ipe-mbox mbox-type-${type || 'default'} ${styles.mbox}`} {...rest}>\r\n {titleContent && (\r\n <div className={`ipe-mbox-title ${styles.title}`} {...titleProps}>\r\n {titleContent}\r\n </div>\r\n )}\r\n <div className={`ipe-mbox-content ${styles.content}`} {...contentProps}>\r\n {children || content}\r\n </div>\r\n {closeable && (\r\n <a onClick={close} className={`ipe-mbox-close ${styles.close}`}>\r\n ×\r\n </a>\r\n )}\r\n </div>\r\n ) as MBoxElement\r\n box.close = close\r\n return box\r\n}\r\n","import { JSX, ReactNode } from 'jsx-dom'\r\n\r\nexport type RadioBoxProps = {\r\n id?: string\r\n name: string\r\n value: string\r\n label?: string | HTMLElement\r\n inputProps?: JSX.IntrinsicElements['input']\r\n labelProps?: JSX.IntrinsicElements['span']\r\n} & JSX.IntrinsicElements['label']\r\n\r\nexport const RadioBox = (props: RadioBoxProps) => {\r\n const { id, name, value, label, inputProps, labelProps, children, ...rest } = props\r\n return (\r\n <label className=\"theme-ipe ipe-radio-box\" {...rest}>\r\n <input type=\"radio\" id={id} name={name} value={value} {...inputProps} />\r\n <span className=\"ipe-checkbox-box\"></span>\r\n <span {...labelProps}>{label || children}</span>\r\n </label>\r\n )\r\n}\r\n"],"names":["MBox","props","type","title","content","closeable","titleProps","contentProps","children","rest","titleContent","close","box","promise","resolve","jsxs","styles","jsx","RadioBox","id","name","value","label","inputProps","labelProps"],"mappings":";;;;;;GA4BaA,IAAO,CAACC,MAAqB;AACxC,QAAM;AAAA,IACJ,MAAAC,IAAO;AAAA,IACP,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,YAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDR;AACJ,MAAIS,IAAeP;AACnB,EAAI,OAAOA,IAAU,OAAeD,MAAS,cAC3CQ,IAAeR,EAAK,CAAC,EAAE,YAAA,IAAgBA,EAAK,MAAM,CAAC,EAAE,YAAA;AAGvD,QAAMS,IAAQ,YAAY;AACxB,QAAI,CAACC;AACH,aAAO,QAAQ,QAAA;AAEjB,UAAM,EAAE,SAAAC,GAAS,SAAAC,MAAY,QAAQ,cAAA;AAarC,WAXkBF,EAAI;AAAA,MACpB;AAAA,QACE,EAAE,SAAS,KAAK,QAAQA,EAAI,eAAe,KAAA;AAAA,QAC3C,EAAE,SAAS,KAAK,QAAQ,OAAO,QAAQ,MAAA;AAAA,MAAM;AAAA,MAE/C;AAAA,QACE,UAAU;AAAA,Q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
|
+
import { M as y, R as x } from "../RadioBox-CaA8VgLu.js";
|
|
2
|
+
import { j as n } from "../index-CvhkVj_L.js";
|
|
3
3
|
import { P as L } from "../index-CvhkVj_L.js";
|
|
4
|
-
import { T as
|
|
5
|
-
import { A as N } from "../ActionButton-
|
|
4
|
+
import { T as g } from "../index-Bh70Udzi.js";
|
|
5
|
+
import { A as N } from "../ActionButton-BgbTKTg7.js";
|
|
6
6
|
import { C as z, I as $ } from "../InputBox-FIzJ-rPN.js";
|
|
7
|
-
const r = "_tabview_zlbug_1", _ = "_labels_container_zlbug_4", b = "_label_zlbug_4", d = "_active_zlbug_32", m = "_contents_container_zlbug_35",
|
|
7
|
+
const r = "_tabview_zlbug_1", _ = "_labels_container_zlbug_4", b = "_label_zlbug_4", d = "_active_zlbug_32", m = "_contents_container_zlbug_35", i = {
|
|
8
8
|
tabview: r,
|
|
9
9
|
labels_container: _,
|
|
10
10
|
label: b,
|
|
11
11
|
active: d,
|
|
12
12
|
contents_container: m
|
|
13
13
|
};
|
|
14
|
-
console.log(t);
|
|
15
14
|
function h({
|
|
16
|
-
tabs:
|
|
15
|
+
tabs: t = [],
|
|
17
16
|
defaultActiveIndex: l = 0
|
|
18
17
|
}) {
|
|
19
|
-
const c = /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
18
|
+
const c = /* @__PURE__ */ n("div", { className: `ipe-tabView ${i.tabview}`, children: [
|
|
19
|
+
/* @__PURE__ */ n("ul", { className: `ipe-tabView__labels-container ${i.labels_container}`, children: t.map((a) => /* @__PURE__ */ n(f, { name: a.name, children: a.children }, a.name)) }),
|
|
20
|
+
/* @__PURE__ */ n("div", { className: `ipe-tabView__contents ${i.contents_container}`, children: t.map((a) => /* @__PURE__ */ n(p, { name: a.name, children: a.content }, a.name)) })
|
|
22
21
|
] }), s = c.querySelector(
|
|
23
22
|
`.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${l + 1})`
|
|
24
23
|
);
|
|
25
24
|
return s && s.click(), c;
|
|
26
25
|
}
|
|
27
|
-
function f({ name:
|
|
28
|
-
return /* @__PURE__ */
|
|
26
|
+
function f({ name: t, children: l }) {
|
|
27
|
+
return /* @__PURE__ */ n(
|
|
29
28
|
"li",
|
|
30
29
|
{
|
|
31
|
-
"data-tab-name":
|
|
32
|
-
className: `ipe-tabView__label ${
|
|
30
|
+
"data-tab-name": t,
|
|
31
|
+
className: `ipe-tabView__label ${i.label}`,
|
|
33
32
|
onClick: function(c) {
|
|
34
33
|
c.preventDefault();
|
|
35
34
|
const s = this.closest(".ipe-tabView");
|
|
@@ -38,24 +37,24 @@ function f({ name: n, children: l }) {
|
|
|
38
37
|
(e) => e.classList.contains("ipe-tabView__labels")
|
|
39
38
|
)?.children;
|
|
40
39
|
a && Array.from(a).forEach((e) => {
|
|
41
|
-
e.classList.remove(
|
|
42
|
-
}), this.classList.add(
|
|
40
|
+
e.classList.remove(i.active);
|
|
41
|
+
}), this.classList.add(i.active);
|
|
43
42
|
const o = Array.from(s.children).find(
|
|
44
43
|
(e) => e.classList.contains("ipe-tabView__contents")
|
|
45
44
|
)?.children;
|
|
46
45
|
o && Array.from(o).forEach((e) => {
|
|
47
|
-
e instanceof HTMLElement && (e.dataset.tabName ===
|
|
46
|
+
e instanceof HTMLElement && (e.dataset.tabName === t ? (e.style.display = "", e.classList.add(i.active)) : (e.style.display = "none", e.classList.remove(i.active)));
|
|
48
47
|
});
|
|
49
48
|
},
|
|
50
|
-
children: /* @__PURE__ */
|
|
49
|
+
children: /* @__PURE__ */ n("a", { children: l || t })
|
|
51
50
|
}
|
|
52
51
|
);
|
|
53
52
|
}
|
|
54
|
-
function p({ name:
|
|
55
|
-
return /* @__PURE__ */
|
|
53
|
+
function p({ name: t, children: l }) {
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
56
55
|
"div",
|
|
57
56
|
{
|
|
58
|
-
"data-tab-name":
|
|
57
|
+
"data-tab-name": t,
|
|
59
58
|
className: "ipe-tabView__content-body",
|
|
60
59
|
style: {
|
|
61
60
|
display: "none"
|
|
@@ -74,6 +73,6 @@ export {
|
|
|
74
73
|
p as TabContent,
|
|
75
74
|
f as TabLabel,
|
|
76
75
|
h as TabView,
|
|
77
|
-
|
|
76
|
+
g as TwinSwapInput
|
|
78
77
|
};
|
|
79
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\r\nimport styles from './styles.module.sass'\r\n\r\nexport interface TabViewLabelOptions {\r\n name: string\r\n children: ReactNode\r\n}\r\n\r\nconsole.log(styles)\r\n\r\nexport function TabView({\r\n tabs = [],\r\n defaultActiveIndex = 0,\r\n}: {\r\n tabs: (TabViewLabelOptions & { content: ReactNode })[]\r\n defaultActiveIndex?: number\r\n}) {\r\n const el = (\r\n <div className={`ipe-tabView ${styles.tabview}`}>\r\n <ul className={`ipe-tabView__labels-container ${styles.labels_container}`}>\r\n {tabs.map((tab) => (\r\n <TabLabel key={tab.name} name={tab.name}>\r\n {tab.children}\r\n </TabLabel>\r\n ))}\r\n </ul>\r\n <div className={`ipe-tabView__contents ${styles.contents_container}`}>\r\n {tabs.map((tab) => (\r\n <TabContent key={tab.name} name={tab.name}>\r\n {tab.content}\r\n </TabContent>\r\n ))}\r\n </div>\r\n </div>\r\n )\r\n\r\n const defaultActiveLabel = el.querySelector<HTMLAnchorElement>(\r\n `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${defaultActiveIndex + 1})`\r\n )\r\n if (defaultActiveLabel) {\r\n defaultActiveLabel.click()\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function TabLabel({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <li\r\n data-tab-name={name}\r\n className={`ipe-tabView__label ${styles.label}`}\r\n onClick={function (e) {\r\n e.preventDefault()\r\n const container = this.closest('.ipe-tabView')\r\n if (!container) return\r\n const labels = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__labels')\r\n )?.children\r\n if (labels) {\r\n Array.from(labels).forEach((label) => {\r\n label.classList.remove(styles.active)\r\n })\r\n }\r\n this.classList.add(styles.active)\r\n const contents = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__contents')\r\n )?.children\r\n if (contents) {\r\n Array.from(contents).forEach((content) => {\r\n if (content instanceof HTMLElement) {\r\n if (content.dataset.tabName === name) {\r\n content.style.display = ''\r\n content.classList.add(styles.active)\r\n } else {\r\n content.style.display = 'none'\r\n content.classList.remove(styles.active)\r\n }\r\n }\r\n })\r\n }\r\n }}\r\n >\r\n <a>{children || name}</a>\r\n </li>\r\n )\r\n}\r\n\r\nexport function TabContent({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <div\r\n data-tab-name={name}\r\n className=\"ipe-tabView__content-body\"\r\n style={{\r\n display: 'none',\r\n }}\r\n >\r\n {children}\r\n </div>\r\n )\r\n}\r\n"],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\r\nimport styles from './styles.module.sass'\r\n\r\nexport interface TabViewLabelOptions {\r\n name: string\r\n children: ReactNode\r\n}\r\n\r\nconsole.log(styles)\r\n\r\nexport function TabView({\r\n tabs = [],\r\n defaultActiveIndex = 0,\r\n}: {\r\n tabs: (TabViewLabelOptions & { content: ReactNode })[]\r\n defaultActiveIndex?: number\r\n}) {\r\n const el = (\r\n <div className={`ipe-tabView ${styles.tabview}`}>\r\n <ul className={`ipe-tabView__labels-container ${styles.labels_container}`}>\r\n {tabs.map((tab) => (\r\n <TabLabel key={tab.name} name={tab.name}>\r\n {tab.children}\r\n </TabLabel>\r\n ))}\r\n </ul>\r\n <div className={`ipe-tabView__contents ${styles.contents_container}`}>\r\n {tabs.map((tab) => (\r\n <TabContent key={tab.name} name={tab.name}>\r\n {tab.content}\r\n </TabContent>\r\n ))}\r\n </div>\r\n </div>\r\n )\r\n\r\n const defaultActiveLabel = el.querySelector<HTMLAnchorElement>(\r\n `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${defaultActiveIndex + 1})`\r\n )\r\n if (defaultActiveLabel) {\r\n defaultActiveLabel.click()\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function TabLabel({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <li\r\n data-tab-name={name}\r\n className={`ipe-tabView__label ${styles.label}`}\r\n onClick={function (e) {\r\n e.preventDefault()\r\n const container = this.closest('.ipe-tabView')\r\n if (!container) return\r\n const labels = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__labels')\r\n )?.children\r\n if (labels) {\r\n Array.from(labels).forEach((label) => {\r\n label.classList.remove(styles.active)\r\n })\r\n }\r\n this.classList.add(styles.active)\r\n const contents = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__contents')\r\n )?.children\r\n if (contents) {\r\n Array.from(contents).forEach((content) => {\r\n if (content instanceof HTMLElement) {\r\n if (content.dataset.tabName === name) {\r\n content.style.display = ''\r\n content.classList.add(styles.active)\r\n } else {\r\n content.style.display = 'none'\r\n content.classList.remove(styles.active)\r\n }\r\n }\r\n })\r\n }\r\n }}\r\n >\r\n <a>{children || name}</a>\r\n </li>\r\n )\r\n}\r\n\r\nexport function TabContent({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <div\r\n data-tab-name={name}\r\n className=\"ipe-tabView__content-body\"\r\n style={{\r\n display: 'none',\r\n }}\r\n >\r\n {children}\r\n </div>\r\n )\r\n}\r\n"],"names":["TabView","tabs","defaultActiveIndex","el","jsxs","styles","jsx","tab","TabLabel","TabContent","defaultActiveLabel","name","children","e","container","labels","label","contents","content"],"mappings":";;;;;;;;;;;;;AAUO,SAASA,EAAQ;AAAA,EACtB,MAAAC,IAAO,CAAA;AAAA,EACP,oBAAAC,IAAqB;AACvB,GAGG;AACD,QAAMC,IACJC,gBAAAA,EAAC,OA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