wimui 0.51.1 → 0.51.2
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/components/ai/ChatUI/ChatUI.cjs +1 -1
- package/dist/components/ai/ChatUI/ChatUI.js +10 -10
- package/dist/components/ai/ModelSelector/ModelSelector.cjs +1 -1
- package/dist/components/ai/ModelSelector/ModelSelector.js +121 -120
- package/dist/components/ai/ThreadList/ThreadList.cjs +1 -1
- package/dist/components/ai/ThreadList/ThreadList.js +63 -62
- package/dist/components/data-display/Accordion/accordion.module.cjs +1 -1
- package/dist/components/data-display/Accordion/accordion.module.js +1 -1
- package/dist/components/data-display/Carousel/Carousel.cjs +1 -1
- package/dist/components/data-display/Carousel/Carousel.js +46 -46
- package/dist/components/data-display/NodeGraph/NodeGraph.cjs +1 -1
- package/dist/components/data-display/NodeGraph/NodeGraph.js +48 -48
- package/dist/components/data-display/ScheduleView/ScheduleView.cjs +1 -1
- package/dist/components/data-display/ScheduleView/ScheduleView.js +49 -48
- package/dist/components/feedback/Tour/Tour.cjs +1 -1
- package/dist/components/feedback/Tour/Tour.js +125 -100
- package/dist/components/form/OtpInput/otp-input.module.cjs +1 -1
- package/dist/components/form/OtpInput/otp-input.module.js +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.cjs +1 -1
- package/dist/components/form/RangeSlider/RangeSlider.js +116 -115
- package/dist/components/form/RangeSlider/range-slider.module.cjs +1 -1
- package/dist/components/form/RangeSlider/range-slider.module.js +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.cjs +1 -1
- package/dist/components/form/ThemeToggle/ThemeToggle.js +66 -65
- package/dist/components/form/Transfer/Transfer.cjs +1 -1
- package/dist/components/form/Transfer/Transfer.d.ts +1 -1
- package/dist/components/form/Transfer/Transfer.js +104 -104
- package/dist/components/form/Transfer/transfer.module.cjs +1 -1
- package/dist/components/form/Transfer/transfer.module.js +6 -6
- package/dist/components/media/Audio/Audio.cjs +1 -1
- package/dist/components/media/Audio/Audio.js +45 -45
- package/dist/components/media/Audio/components/AudioCustomControls.cjs +1 -1
- package/dist/components/media/Audio/components/AudioCustomControls.js +113 -112
- package/dist/components/media/ImageCompare/ImageCompare.cjs +1 -1
- package/dist/components/media/ImageCompare/ImageCompare.js +73 -72
- package/dist/components/media/Video/Video.cjs +1 -1
- package/dist/components/media/Video/Video.js +36 -35
- package/dist/components/media/Video/components/VideoAdvancedMenu.cjs +1 -1
- package/dist/components/media/Video/components/VideoAdvancedMenu.js +138 -137
- package/dist/components/navigation/Tabs/tabs.module.cjs +1 -1
- package/dist/components/navigation/Tabs/tabs.module.js +1 -1
- package/dist/i18n/generated/keys.d.ts +1 -1
- package/dist/i18n/generated/resources.cjs +1 -1
- package/dist/i18n/generated/resources.js +192 -12
- package/dist/llms-full.txt +4 -4
- package/dist/llms.txt +1 -1
- package/dist/locales/en/common.json +53 -4
- package/dist/locales/en/components.json +3 -1
- package/dist/locales/ja/common.json +53 -4
- package/dist/locales/ja/components.json +3 -1
- package/dist/locales/pt/common.json +53 -4
- package/dist/locales/pt/components.json +3 -1
- package/dist/styles.css +2 -2
- package/dist/wimui.umd.css +1 -1
- package/dist/wimui.umd.js +3 -3
- package/package.json +7 -7
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/chevron-left.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./carousel.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=(e,t)=>typeof e==`number`?e:e?t>=1280&&e.xl?e.xl:t>=1024&&e.lg?e.lg:t>=768&&e.md?e.md:t>=640&&e.sm?e.sm:e.base||1:1,d=(0,s.forwardRef)(({children:e,autoPlay:d=!1,interval:f=5e3,showIndicators:p=!0,showControls:m=!0,controlsPlacement:h=`overlay`,loop:g=!0,slidesToShow:_=1,aspectRatio:v,objectFit:y=`cover`,labels:b,className:x,asChild:S,...C},w)=>{let T=S?t.Root:`div`,{t:E}=n.useWimTranslation(`components`),D={slideLabel:e=>E(`carousel.slide`,{number:e}),prevSlide:E(`carousel.prev_slide`),nextSlide:E(`carousel.next_slide`),goToSlide:e=>E(`carousel.go_to_slide`,{number:e}),...b},O=(0,s.useMemo)(()=>s.default.Children.toArray(e),[e]),k=O.length,[A,j]=(0,s.useState)(typeof window<`u`?window.innerWidth:0),[M,N]=(0,s.useState)(g?k:0),[P,F]=(0,s.useState)(!1),[I,L]=(0,s.useState)(!1),R=u(_,A),z=(0,s.useRef)(null),B=(0,s.useRef)(null),V=(0,s.useRef)(null),H=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=()=>j(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let U=(0,s.useMemo)(()=>!g||k===0?O:[...O,...O,...O],[O,g,k]),W=(0,s.useCallback)(()=>{if(!P){if(!g){N(e=>Math.min(e+1,k-R));return}F(!0),N(e=>e+1)}},[P,g,k,R]),G=(0,s.useCallback)(()=>{if(!P){if(!g){N(e=>Math.max(e-1,0));return}F(!0),N(e=>e-1)}},[P,g]),K=e=>{P||(g?(F(!0),N(e+k)):N(e))},q=()=>{g&&(F(!1),M>=k*2?N(M-k):M<k&&N(M+k))};(0,s.useEffect)(()=>(d&&!I&&k>R&&(z.current=window.setInterval(W,f)),()=>{z.current&&window.clearInterval(z.current)}),[d,f,W,k,R,I]);let J=e=>{e.key===`ArrowLeft`?G():e.key===`ArrowRight`&&W()},Y=e=>{V.current=e.targetTouches[0].clientX},X=e=>{H.current=e.targetTouches[0].clientX},Z=()=>{if(!V.current||!H.current)return;let e=V.current-H.current;e>50?W():e<-50&&G(),V.current=null,H.current=null};if(k===0)return null;let Q=100/R,$=-M*Q;return(0,l.jsxs)(T,{ref:w,className:(0,c.default)(`wim-carousel`,o.default.root,h===`outside`&&o.default.controlsOutside,x),onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onFocus:()=>L(!0),onBlur:()=>L(!1),onKeyDown:J,tabIndex:0,role:`region`,"aria-roledescription"
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../node_modules/@radix-ui/react-slot/dist/index.cjs"),n=require("../../../i18n/useWimTranslation.cjs"),r=require("../../../icon/chevron-left.cjs"),i=require("../../../icon/chevron-right.cjs"),a=require("../../media/Icon/Icon.cjs"),o=require("./carousel.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime");var u=(e,t)=>typeof e==`number`?e:e?t>=1280&&e.xl?e.xl:t>=1024&&e.lg?e.lg:t>=768&&e.md?e.md:t>=640&&e.sm?e.sm:e.base||1:1,d=(0,s.forwardRef)(({children:e,autoPlay:d=!1,interval:f=5e3,showIndicators:p=!0,showControls:m=!0,controlsPlacement:h=`overlay`,loop:g=!0,slidesToShow:_=1,aspectRatio:v,objectFit:y=`cover`,labels:b,className:x,asChild:S,...C},w)=>{let T=S?t.Root:`div`,{t:E}=n.useWimTranslation(`components`),D={slideLabel:e=>E(`carousel.slide`,{number:e}),prevSlide:E(`carousel.prev_slide`),nextSlide:E(`carousel.next_slide`),goToSlide:e=>E(`carousel.go_to_slide`,{number:e}),...b},O=(0,s.useMemo)(()=>s.default.Children.toArray(e),[e]),k=O.length,[A,j]=(0,s.useState)(typeof window<`u`?window.innerWidth:0),[M,N]=(0,s.useState)(g?k:0),[P,F]=(0,s.useState)(!1),[I,L]=(0,s.useState)(!1),R=u(_,A),z=(0,s.useRef)(null),B=(0,s.useRef)(null),V=(0,s.useRef)(null),H=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=()=>j(window.innerWidth);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let U=(0,s.useMemo)(()=>!g||k===0?O:[...O,...O,...O],[O,g,k]),W=(0,s.useCallback)(()=>{if(!P){if(!g){N(e=>Math.min(e+1,k-R));return}F(!0),N(e=>e+1)}},[P,g,k,R]),G=(0,s.useCallback)(()=>{if(!P){if(!g){N(e=>Math.max(e-1,0));return}F(!0),N(e=>e-1)}},[P,g]),K=e=>{P||(g?(F(!0),N(e+k)):N(e))},q=()=>{g&&(F(!1),M>=k*2?N(M-k):M<k&&N(M+k))};(0,s.useEffect)(()=>(d&&!I&&k>R&&(z.current=window.setInterval(W,f)),()=>{z.current&&window.clearInterval(z.current)}),[d,f,W,k,R,I]);let J=e=>{e.key===`ArrowLeft`?G():e.key===`ArrowRight`&&W()},Y=e=>{V.current=e.targetTouches[0].clientX},X=e=>{H.current=e.targetTouches[0].clientX},Z=()=>{if(!V.current||!H.current)return;let e=V.current-H.current;e>50?W():e<-50&&G(),V.current=null,H.current=null};if(k===0)return null;let Q=100/R,$=-M*Q;return(0,l.jsxs)(T,{ref:w,className:(0,c.default)(`wim-carousel`,o.default.root,h===`outside`&&o.default.controlsOutside,x),onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1),onFocus:()=>L(!0),onBlur:()=>L(!1),onKeyDown:J,tabIndex:0,role:`region`,"aria-roledescription":E(`carousel.roledescription`),...C,children:[(0,l.jsx)(`div`,{className:o.default.viewport,children:(0,l.jsx)(`div`,{ref:B,className:(0,c.default)(o.default.track,P&&o.default.transition),style:{transform:`translateX(${$}%)`},onTransitionEnd:q,onTouchStart:Y,onTouchMove:X,onTouchEnd:Z,children:U.map((e,t)=>(0,l.jsx)(`div`,{className:(0,c.default)(o.default.item,v&&o.default.hasAspectRatio),style:{flex:`0 0 ${Q}%`,width:`${Q}%`,...v?{aspectRatio:v,"--wim-carousel-object-fit":y}:{}},role:`group`,"aria-roledescription":E(`carousel.slide_roledescription`),"aria-label":D.slideLabel(t%k+1),children:e},t))})}),m&&k>R&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(`button`,{className:(0,c.default)(o.default.control,o.default.prev),onClick:G,"aria-label":D.prevSlide,disabled:!g&&M===0,tabIndex:-1,children:(0,l.jsx)(a.Icon,{component:r.default,size:`md`})}),(0,l.jsx)(`button`,{className:(0,c.default)(o.default.control,o.default.next),onClick:W,"aria-label":D.nextSlide,disabled:!g&&M>=k-R,tabIndex:-1,children:(0,l.jsx)(a.Icon,{component:i.default,size:`md`})})]}),p&&k>1&&(0,l.jsx)(`div`,{className:o.default.indicators,children:O.map((e,t)=>{let n=g?M%k===t:M===t;return(0,l.jsx)(`button`,{className:(0,c.default)(o.default.indicator,n&&o.default.active),onClick:()=>K(t),"aria-label":D.goToSlide(t+1),"aria-current":n?`true`:`false`},t)})})]})});d.displayName=`Carousel`,exports.Carousel=d;
|
|
@@ -5,33 +5,33 @@ import n from "../../../icon/chevron-left.js";
|
|
|
5
5
|
import r from "../../../icon/chevron-right.js";
|
|
6
6
|
import { Icon as i } from "../../media/Icon/Icon.js";
|
|
7
7
|
import a from "./carousel.module.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { Fragment as
|
|
8
|
+
import o, { forwardRef as s, useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
9
|
+
import p from "classnames";
|
|
10
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
11
|
//#region src/components/data-display/Carousel/Carousel.tsx
|
|
12
|
-
var
|
|
13
|
-
let j =
|
|
12
|
+
var _ = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >= 1024 && e.lg ? e.lg : t >= 768 && e.md ? e.md : t >= 640 && e.sm ? e.sm : e.base || 1 : 1, v = s(({ children: s, autoPlay: v = !1, interval: y = 5e3, showIndicators: b = !0, showControls: x = !0, controlsPlacement: S = "overlay", loop: C = !0, slidesToShow: w = 1, aspectRatio: T, objectFit: E = "cover", labels: D, className: O, asChild: ee, ...k }, A) => {
|
|
13
|
+
let j = ee ? e : "div", { t: M } = t("components"), N = {
|
|
14
14
|
slideLabel: (e) => M("carousel.slide", { number: e }),
|
|
15
15
|
prevSlide: M("carousel.prev_slide"),
|
|
16
16
|
nextSlide: M("carousel.next_slide"),
|
|
17
17
|
goToSlide: (e) => M("carousel.go_to_slide", { number: e }),
|
|
18
|
-
...
|
|
19
|
-
}, P =
|
|
20
|
-
|
|
18
|
+
...D
|
|
19
|
+
}, P = u(() => o.Children.toArray(s), [s]), F = P.length, [I, L] = f(typeof window < "u" ? window.innerWidth : 0), [R, z] = f(C ? F : 0), [B, V] = f(!1), [H, U] = f(!1), W = _(w, I), G = d(null), K = d(null), q = d(null), J = d(null);
|
|
20
|
+
l(() => {
|
|
21
21
|
let e = () => L(window.innerWidth);
|
|
22
22
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
23
23
|
}, []);
|
|
24
|
-
let Y =
|
|
24
|
+
let Y = u(() => !C || F === 0 ? P : [
|
|
25
25
|
...P,
|
|
26
26
|
...P,
|
|
27
27
|
...P
|
|
28
28
|
], [
|
|
29
29
|
P,
|
|
30
|
-
|
|
30
|
+
C,
|
|
31
31
|
F
|
|
32
|
-
]), X =
|
|
32
|
+
]), X = c(() => {
|
|
33
33
|
if (!B) {
|
|
34
|
-
if (!
|
|
34
|
+
if (!C) {
|
|
35
35
|
z((e) => Math.min(e + 1, F - W));
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -39,27 +39,27 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
39
39
|
}
|
|
40
40
|
}, [
|
|
41
41
|
B,
|
|
42
|
-
|
|
42
|
+
C,
|
|
43
43
|
F,
|
|
44
44
|
W
|
|
45
|
-
]), Z =
|
|
45
|
+
]), Z = c(() => {
|
|
46
46
|
if (!B) {
|
|
47
|
-
if (!
|
|
47
|
+
if (!C) {
|
|
48
48
|
z((e) => Math.max(e - 1, 0));
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
V(!0), z((e) => e - 1);
|
|
52
52
|
}
|
|
53
|
-
}, [B,
|
|
54
|
-
B || (
|
|
53
|
+
}, [B, C]), Q = (e) => {
|
|
54
|
+
B || (C ? (V(!0), z(e + F)) : z(e));
|
|
55
55
|
}, te = () => {
|
|
56
|
-
|
|
56
|
+
C && (V(!1), R >= F * 2 ? z(R - F) : R < F && z(R + F));
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
l(() => (v && !H && F > W && (G.current = window.setInterval(X, y)), () => {
|
|
59
59
|
G.current && window.clearInterval(G.current);
|
|
60
60
|
}), [
|
|
61
|
-
_,
|
|
62
61
|
v,
|
|
62
|
+
y,
|
|
63
63
|
X,
|
|
64
64
|
F,
|
|
65
65
|
W,
|
|
@@ -78,9 +78,9 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
78
78
|
};
|
|
79
79
|
if (F === 0) return null;
|
|
80
80
|
let $ = 100 / W, oe = -R * $;
|
|
81
|
-
return /* @__PURE__ */
|
|
81
|
+
return /* @__PURE__ */ g(j, {
|
|
82
82
|
ref: A,
|
|
83
|
-
className:
|
|
83
|
+
className: p("wim-carousel", a.root, S === "outside" && a.controlsOutside, O),
|
|
84
84
|
onMouseEnter: () => U(!0),
|
|
85
85
|
onMouseLeave: () => U(!1),
|
|
86
86
|
onFocus: () => U(!0),
|
|
@@ -88,63 +88,63 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
88
88
|
onKeyDown: ne,
|
|
89
89
|
tabIndex: 0,
|
|
90
90
|
role: "region",
|
|
91
|
-
"aria-roledescription": "carousel",
|
|
91
|
+
"aria-roledescription": M("carousel.roledescription"),
|
|
92
92
|
...k,
|
|
93
93
|
children: [
|
|
94
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ h("div", {
|
|
95
95
|
className: a.viewport,
|
|
96
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ h("div", {
|
|
97
97
|
ref: K,
|
|
98
|
-
className:
|
|
98
|
+
className: p(a.track, B && a.transition),
|
|
99
99
|
style: { transform: `translateX(${oe}%)` },
|
|
100
100
|
onTransitionEnd: te,
|
|
101
101
|
onTouchStart: re,
|
|
102
102
|
onTouchMove: ie,
|
|
103
103
|
onTouchEnd: ae,
|
|
104
|
-
children: Y.map((e, t) => /* @__PURE__ */
|
|
105
|
-
className:
|
|
104
|
+
children: Y.map((e, t) => /* @__PURE__ */ h("div", {
|
|
105
|
+
className: p(a.item, T && a.hasAspectRatio),
|
|
106
106
|
style: {
|
|
107
107
|
flex: `0 0 ${$}%`,
|
|
108
108
|
width: `${$}%`,
|
|
109
|
-
...
|
|
110
|
-
aspectRatio:
|
|
111
|
-
"--wim-carousel-object-fit":
|
|
109
|
+
...T ? {
|
|
110
|
+
aspectRatio: T,
|
|
111
|
+
"--wim-carousel-object-fit": E
|
|
112
112
|
} : {}
|
|
113
113
|
},
|
|
114
114
|
role: "group",
|
|
115
|
-
"aria-roledescription": "
|
|
115
|
+
"aria-roledescription": M("carousel.slide_roledescription"),
|
|
116
116
|
"aria-label": N.slideLabel(t % F + 1),
|
|
117
117
|
children: e
|
|
118
118
|
}, t))
|
|
119
119
|
})
|
|
120
120
|
}),
|
|
121
|
-
|
|
122
|
-
className:
|
|
121
|
+
x && F > W && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("button", {
|
|
122
|
+
className: p(a.control, a.prev),
|
|
123
123
|
onClick: Z,
|
|
124
124
|
"aria-label": N.prevSlide,
|
|
125
|
-
disabled: !
|
|
125
|
+
disabled: !C && R === 0,
|
|
126
126
|
tabIndex: -1,
|
|
127
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ h(i, {
|
|
128
128
|
component: n,
|
|
129
129
|
size: "md"
|
|
130
130
|
})
|
|
131
|
-
}), /* @__PURE__ */
|
|
132
|
-
className:
|
|
131
|
+
}), /* @__PURE__ */ h("button", {
|
|
132
|
+
className: p(a.control, a.next),
|
|
133
133
|
onClick: X,
|
|
134
134
|
"aria-label": N.nextSlide,
|
|
135
|
-
disabled: !
|
|
135
|
+
disabled: !C && R >= F - W,
|
|
136
136
|
tabIndex: -1,
|
|
137
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ h(i, {
|
|
138
138
|
component: r,
|
|
139
139
|
size: "md"
|
|
140
140
|
})
|
|
141
141
|
})] }),
|
|
142
|
-
|
|
142
|
+
b && F > 1 && /* @__PURE__ */ h("div", {
|
|
143
143
|
className: a.indicators,
|
|
144
144
|
children: P.map((e, t) => {
|
|
145
|
-
let n =
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
-
className:
|
|
145
|
+
let n = C ? R % F === t : R === t;
|
|
146
|
+
return /* @__PURE__ */ h("button", {
|
|
147
|
+
className: p(a.indicator, n && a.active),
|
|
148
148
|
onClick: () => Q(t),
|
|
149
149
|
"aria-label": N.goToSlide(t + 1),
|
|
150
150
|
"aria-current": n ? "true" : "false"
|
|
@@ -154,6 +154,6 @@ var g = (e, t) => typeof e == "number" ? e : e ? t >= 1280 && e.xl ? e.xl : t >=
|
|
|
154
154
|
]
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
|
-
|
|
157
|
+
v.displayName = "Carousel";
|
|
158
158
|
//#endregion
|
|
159
|
-
export {
|
|
159
|
+
export { v as Carousel };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/plus.cjs"),r=require("../../../icon/trash.cjs"),i=require("../../media/Icon/Icon.cjs");;/* empty css */const a=require("./node-graph.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime"),l=require("@xyflow/react");var u=[`Backspace`,`Delete`],d=180,f=80;function p(e){let t=1,n=new Set(e.map(e=>e.id));for(;n.has(`node-${t}`);)t+=1;return`node-${t}`}function m(e){if(e.length===0)return{x:f,y:f};let t=Math.max(...e.map(e=>e.position.x)),n=e[e.length-1]?.position.y??f;return{x:t+d,y:n}}var h=o.default.forwardRef(({nodes:e,edges:d,onNodesChange:f,onEdgesChange:h,onConnect:g,nodeTypes:_,edgeTypes:v,nodesDraggable:y=!0,nodesConnectable:b=!0,deleteKeyCode:x,showMiniMap:S=!1,showControls:
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../icon/plus.cjs"),r=require("../../../icon/trash.cjs"),i=require("../../media/Icon/Icon.cjs");;/* empty css */const a=require("./node-graph.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime"),l=require("@xyflow/react");var u=[`Backspace`,`Delete`],d=180,f=80;function p(e){let t=1,n=new Set(e.map(e=>e.id));for(;n.has(`node-${t}`);)t+=1;return`node-${t}`}function m(e){if(e.length===0)return{x:f,y:f};let t=Math.max(...e.map(e=>e.position.x)),n=e[e.length-1]?.position.y??f;return{x:t+d,y:n}}var h=o.default.forwardRef(({nodes:e,edges:d,onNodesChange:f,onEdgesChange:h,onConnect:g,nodeTypes:_,edgeTypes:v,nodesDraggable:y=!0,nodesConnectable:b=!0,deleteKeyCode:x,showMiniMap:S=!1,showControls:ee=!0,backgroundVariant:C=l.BackgroundVariant.Dots,fitView:w=!0,fitViewOptions:T,defaultEdgeOptions:E,className:D,"aria-label":O,...k},A)=>{let{t:j}=t.useWimTranslation(`common`),M=O??j(`nodeGraph.label`),N=j(`nodeGraph.add_node`),P=j(`nodeGraph.node_name`),F=j(`nodeGraph.new_node`),I=j(`a11y.delete`),L=x===void 0?[...u]:x,R=L!=null,[z,B]=(0,o.useState)(!1),[V,H]=(0,o.useState)(``),U=(0,o.useRef)(null),W=(0,o.useMemo)(()=>e.filter(e=>e.selected),[e]),G=(0,o.useMemo)(()=>d.filter(e=>e.selected),[d]),K=W.length>0||G.length>0,q=V.trim(),J=L==null?void 0:Array.isArray(L)?L.join(` `):L;(0,o.useEffect)(()=>{z&&U.current?.focus()},[z]);let Y=(0,o.useCallback)(()=>{R&&q&&(f([{type:`add`,item:{id:p(e),position:m(e),data:{label:q}}}]),B(!1),H(``))},[R,q,e,f]),X=(0,o.useCallback)(()=>{if(R){if(!z){B(!0);return}Y()}},[R,z,Y]),Z=(0,o.useCallback)(e=>{e.stopPropagation(),e.key===`Enter`&&(e.preventDefault(),Y()),e.key===`Escape`&&(e.preventDefault(),B(!1),H(``))},[Y]),Q=(0,o.useCallback)(()=>{if(!R||!K)return;let e=new Set(W.map(e=>e.id)),t=new Set(G.map(e=>e.id));for(let n of d)(e.has(n.source)||e.has(n.target))&&t.add(n.id);t.size>0&&h([...t].map(e=>({type:`remove`,id:e}))),e.size>0&&f([...e].map(e=>({type:`remove`,id:e})))},[R,K,W,G,d,h,f]),$=(0,o.useCallback)(e=>{e.stopPropagation()},[]);return(0,c.jsxs)(`div`,{ref:A,className:(0,s.default)(`wim-node-graph`,a.default.root,D),role:`region`,"aria-label":M,...k,children:[(0,c.jsxs)(l.ReactFlow,{nodes:e,edges:d,onNodesChange:f,onEdgesChange:h,onConnect:g,nodeTypes:_,edgeTypes:v,nodesDraggable:y,nodesConnectable:b,deleteKeyCode:L,fitView:w,fitViewOptions:T,defaultEdgeOptions:E,className:a.default.flow,children:[(0,c.jsx)(l.Background,{variant:C,className:a.default.background}),ee&&(0,c.jsx)(l.Controls,{className:a.default.controls}),S&&(0,c.jsx)(l.MiniMap,{className:a.default.miniMap})]}),R&&(0,c.jsxs)(`div`,{className:a.default.tools,children:[z&&(0,c.jsx)(`input`,{ref:U,className:(0,s.default)(`nodrag`,`nopan`,a.default.name),value:V,onChange:e=>H(e.target.value),onKeyDown:Z,onPointerDown:$,onMouseDown:$,"aria-label":P,placeholder:F}),(0,c.jsxs)(`div`,{className:a.default.toolRow,children:[(0,c.jsxs)(`button`,{type:`button`,className:(0,s.default)(`nodrag`,`nopan`,a.default.tool),disabled:z&&!q,onClick:X,onPointerDown:$,onMouseDown:$,"aria-label":N,"aria-expanded":z,children:[(0,c.jsx)(i.Icon,{component:n.default,size:`sm`}),N]}),(0,c.jsxs)(`button`,{type:`button`,className:(0,s.default)(`nodrag`,`nopan`,a.default.tool),disabled:!K,onClick:Q,onPointerDown:$,onMouseDown:$,"aria-label":I,"aria-keyshortcuts":J,children:[(0,c.jsx)(i.Icon,{component:r.default,size:`sm`}),I]})]})]})]})});h.displayName=`NodeGraph`,exports.NodeGraph=h;
|
|
@@ -8,36 +8,36 @@ import i from "./node-graph.module.js";
|
|
|
8
8
|
import a, { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
9
9
|
import d from "classnames";
|
|
10
10
|
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
-
import { Background as m, BackgroundVariant as h, Controls as
|
|
11
|
+
import { Background as m, BackgroundVariant as h, Controls as ee, MiniMap as te, ReactFlow as ne } from "@xyflow/react";
|
|
12
12
|
//#region src/components/data-display/NodeGraph/NodeGraph.tsx
|
|
13
|
-
var
|
|
14
|
-
function
|
|
13
|
+
var re = ["Backspace", "Delete"], g = 180, _ = 80;
|
|
14
|
+
function v(e) {
|
|
15
15
|
let t = 1, n = new Set(e.map((e) => e.id));
|
|
16
16
|
for (; n.has(`node-${t}`);) t += 1;
|
|
17
17
|
return `node-${t}`;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function y(e) {
|
|
20
20
|
if (e.length === 0) return {
|
|
21
|
-
x:
|
|
22
|
-
y:
|
|
21
|
+
x: _,
|
|
22
|
+
y: _
|
|
23
23
|
};
|
|
24
|
-
let t = Math.max(...e.map((e) => e.position.x)), n = e[e.length - 1]?.position.y ??
|
|
24
|
+
let t = Math.max(...e.map((e) => e.position.x)), n = e[e.length - 1]?.position.y ?? _;
|
|
25
25
|
return {
|
|
26
|
-
x: t +
|
|
26
|
+
x: t + g,
|
|
27
27
|
y: n
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
var
|
|
31
|
-
let { t:
|
|
30
|
+
var b = a.forwardRef(({ nodes: a, edges: g, onNodesChange: _, onEdgesChange: b, onConnect: x, nodeTypes: S, edgeTypes: C, nodesDraggable: w = !0, nodesConnectable: T = !0, deleteKeyCode: E, showMiniMap: ie = !1, showControls: ae = !0, backgroundVariant: D = h.Dots, fitView: O = !0, fitViewOptions: k, defaultEdgeOptions: A, className: j, "aria-label": M, ...N }, P) => {
|
|
31
|
+
let { t: F } = e("common"), I = M ?? F("nodeGraph.label"), L = F("nodeGraph.add_node"), R = F("nodeGraph.node_name"), z = F("nodeGraph.new_node"), B = F("a11y.delete"), V = E === void 0 ? [...re] : E, H = V != null, [U, W] = u(!1), [G, K] = u(""), q = l(null), J = c(() => a.filter((e) => e.selected), [a]), Y = c(() => g.filter((e) => e.selected), [g]), X = J.length > 0 || Y.length > 0, Z = G.trim(), oe = V == null ? void 0 : Array.isArray(V) ? V.join(" ") : V;
|
|
32
32
|
s(() => {
|
|
33
33
|
U && q.current?.focus();
|
|
34
34
|
}, [U]);
|
|
35
35
|
let Q = o(() => {
|
|
36
|
-
H && Z && (
|
|
36
|
+
H && Z && (_([{
|
|
37
37
|
type: "add",
|
|
38
38
|
item: {
|
|
39
|
-
id:
|
|
40
|
-
position:
|
|
39
|
+
id: v(a),
|
|
40
|
+
position: y(a),
|
|
41
41
|
data: { label: Z }
|
|
42
42
|
}
|
|
43
43
|
}]), W(!1), K(""));
|
|
@@ -45,8 +45,8 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
45
45
|
H,
|
|
46
46
|
Z,
|
|
47
47
|
a,
|
|
48
|
-
|
|
49
|
-
]),
|
|
48
|
+
_
|
|
49
|
+
]), se = o(() => {
|
|
50
50
|
if (H) {
|
|
51
51
|
if (!U) {
|
|
52
52
|
W(!0);
|
|
@@ -58,16 +58,16 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
58
58
|
H,
|
|
59
59
|
U,
|
|
60
60
|
Q
|
|
61
|
-
]),
|
|
61
|
+
]), ce = o((e) => {
|
|
62
62
|
e.stopPropagation(), e.key === "Enter" && (e.preventDefault(), Q()), e.key === "Escape" && (e.preventDefault(), W(!1), K(""));
|
|
63
|
-
}, [Q]),
|
|
63
|
+
}, [Q]), le = o(() => {
|
|
64
64
|
if (!H || !X) return;
|
|
65
65
|
let e = new Set(J.map((e) => e.id)), t = new Set(Y.map((e) => e.id));
|
|
66
|
-
for (let n of
|
|
67
|
-
t.size > 0 &&
|
|
66
|
+
for (let n of g) (e.has(n.source) || e.has(n.target)) && t.add(n.id);
|
|
67
|
+
t.size > 0 && b([...t].map((e) => ({
|
|
68
68
|
type: "remove",
|
|
69
69
|
id: e
|
|
70
|
-
}))), e.size > 0 &&
|
|
70
|
+
}))), e.size > 0 && _([...e].map((e) => ({
|
|
71
71
|
type: "remove",
|
|
72
72
|
id: e
|
|
73
73
|
})));
|
|
@@ -76,40 +76,40 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
76
76
|
X,
|
|
77
77
|
J,
|
|
78
78
|
Y,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
g,
|
|
80
|
+
b,
|
|
81
|
+
_
|
|
82
82
|
]), $ = o((e) => {
|
|
83
83
|
e.stopPropagation();
|
|
84
84
|
}, []);
|
|
85
85
|
return /* @__PURE__ */ p("div", {
|
|
86
|
-
ref:
|
|
87
|
-
className: d("wim-node-graph", i.root,
|
|
86
|
+
ref: P,
|
|
87
|
+
className: d("wim-node-graph", i.root, j),
|
|
88
88
|
role: "region",
|
|
89
|
-
"aria-label":
|
|
90
|
-
...
|
|
91
|
-
children: [/* @__PURE__ */ p(
|
|
89
|
+
"aria-label": I,
|
|
90
|
+
...N,
|
|
91
|
+
children: [/* @__PURE__ */ p(ne, {
|
|
92
92
|
nodes: a,
|
|
93
|
-
edges:
|
|
94
|
-
onNodesChange:
|
|
95
|
-
onEdgesChange:
|
|
96
|
-
onConnect:
|
|
97
|
-
nodeTypes:
|
|
98
|
-
edgeTypes:
|
|
99
|
-
nodesDraggable:
|
|
100
|
-
nodesConnectable:
|
|
93
|
+
edges: g,
|
|
94
|
+
onNodesChange: _,
|
|
95
|
+
onEdgesChange: b,
|
|
96
|
+
onConnect: x,
|
|
97
|
+
nodeTypes: S,
|
|
98
|
+
edgeTypes: C,
|
|
99
|
+
nodesDraggable: w,
|
|
100
|
+
nodesConnectable: T,
|
|
101
101
|
deleteKeyCode: V,
|
|
102
|
-
fitView:
|
|
103
|
-
fitViewOptions:
|
|
104
|
-
defaultEdgeOptions:
|
|
102
|
+
fitView: O,
|
|
103
|
+
fitViewOptions: k,
|
|
104
|
+
defaultEdgeOptions: A,
|
|
105
105
|
className: i.flow,
|
|
106
106
|
children: [
|
|
107
107
|
/* @__PURE__ */ f(m, {
|
|
108
|
-
variant:
|
|
108
|
+
variant: D,
|
|
109
109
|
className: i.background
|
|
110
110
|
}),
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
ae && /* @__PURE__ */ f(ee, { className: i.controls }),
|
|
112
|
+
ie && /* @__PURE__ */ f(te, { className: i.miniMap })
|
|
113
113
|
]
|
|
114
114
|
}), H && /* @__PURE__ */ p("div", {
|
|
115
115
|
className: i.tools,
|
|
@@ -118,7 +118,7 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
118
118
|
className: d("nodrag", "nopan", i.name),
|
|
119
119
|
value: G,
|
|
120
120
|
onChange: (e) => K(e.target.value),
|
|
121
|
-
onKeyDown:
|
|
121
|
+
onKeyDown: ce,
|
|
122
122
|
onPointerDown: $,
|
|
123
123
|
onMouseDown: $,
|
|
124
124
|
"aria-label": R,
|
|
@@ -129,7 +129,7 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
129
129
|
type: "button",
|
|
130
130
|
className: d("nodrag", "nopan", i.tool),
|
|
131
131
|
disabled: U && !Z,
|
|
132
|
-
onClick:
|
|
132
|
+
onClick: se,
|
|
133
133
|
onPointerDown: $,
|
|
134
134
|
onMouseDown: $,
|
|
135
135
|
"aria-label": L,
|
|
@@ -142,11 +142,11 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
142
142
|
type: "button",
|
|
143
143
|
className: d("nodrag", "nopan", i.tool),
|
|
144
144
|
disabled: !X,
|
|
145
|
-
onClick:
|
|
145
|
+
onClick: le,
|
|
146
146
|
onPointerDown: $,
|
|
147
147
|
onMouseDown: $,
|
|
148
148
|
"aria-label": B,
|
|
149
|
-
"aria-keyshortcuts":
|
|
149
|
+
"aria-keyshortcuts": oe,
|
|
150
150
|
children: [/* @__PURE__ */ f(r, {
|
|
151
151
|
component: n,
|
|
152
152
|
size: "sm"
|
|
@@ -156,6 +156,6 @@ var x = a.forwardRef(({ nodes: a, edges: _, onNodesChange: v, onEdgesChange: x,
|
|
|
156
156
|
})]
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
|
-
|
|
159
|
+
b.displayName = "NodeGraph";
|
|
160
160
|
//#endregion
|
|
161
|
-
export {
|
|
161
|
+
export { b as NodeGraph };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../hooks/useMergedRef.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../../hooks/useMergedRef.cjs"),r=require("../../../node_modules/@fullcalendar/core/locales/ja.cjs"),i=require("../../../node_modules/@fullcalendar/core/locales/pt.cjs"),a=require("../../../node_modules/@fullcalendar/core/locales/pt-br.cjs"),o=require("./schedule-view.module.cjs");let s=require("react");s=e.__toESM(s,1);let c=require("classnames");c=e.__toESM(c,1);let l=require("react/jsx-runtime"),u=require("@fullcalendar/react");u=e.__toESM(u,1);let d=require("@fullcalendar/timegrid");d=e.__toESM(d,1);let f=require("@fullcalendar/daygrid");f=e.__toESM(f,1);let p=require("@fullcalendar/interaction");p=e.__toESM(p,1);var m=[r.default,i.default,a.default],h=[d.default,f.default,p.default],g={left:`prev,next today`,center:`title`,right:`dayGridMonth,timeGridWeek,timeGridDay`},_=s.default.forwardRef(({events:e=[],initialView:r=`timeGridWeek`,editable:i=!0,selectable:a=!0,onEventClick:d,onEventDrop:f,onEventChange:p,onDateSelect:_,unselectAuto:v=!0,slotMinTime:y=`08:00:00`,slotMaxTime:b=`20:00:00`,slotDuration:x=`00:30:00`,locale:S=`en`,className:C,"aria-label":w,...T},E)=>{let{t:D}=t.useWimTranslation(`common`),O=w??D(`scheduleView.label`),k=(0,s.useRef)(null),A=(0,s.useRef)(null),j=n.useMergedRef(E,A);return(0,s.useEffect)(()=>{let e=A.current;if(!e)return;let t=()=>{e.querySelectorAll(`.fc-icon[role="img"]:not([aria-hidden])`).forEach(e=>e.setAttribute(`aria-hidden`,`true`)),e.querySelectorAll(`a.fc-more-link:not([role])`).forEach(e=>e.setAttribute(`role`,`button`)),e.querySelectorAll(`.fc-scroller`).forEach(e=>{let t=e;t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1?t.setAttribute(`tabindex`,`0`):t.getAttribute(`tabindex`)===`0`&&t.removeAttribute(`tabindex`)})};t();let n=new MutationObserver(t);n.observe(e,{childList:!0,subtree:!0});let r=typeof ResizeObserver>`u`?null:new ResizeObserver(t);return r?.observe(e),()=>{n.disconnect(),r?.disconnect()}},[]),(0,l.jsx)(`div`,{ref:j,className:(0,c.default)(`wim-schedule-view`,o.default.root,C),role:`region`,"aria-label":O,...T,children:(0,l.jsx)(u.default,{ref:k,plugins:h,initialView:r,headerToolbar:g,events:e,editable:i,selectable:a,selectMirror:!0,unselectAuto:v,dayMaxEvents:!0,weekends:!0,slotMinTime:y,slotMaxTime:b,slotDuration:x,locale:S,locales:m,eventColor:`var(--wim-color-primary)`,eventTextColor:`var(--wim-color-text-on-primary)`,eventClick:d,eventDrop:f,eventChange:p,select:_,height:`auto`})})});_.displayName=`ScheduleView`,exports.ScheduleView=_;
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import t from "../../../
|
|
4
|
-
import n from "../../../node_modules/@fullcalendar/core/locales/
|
|
5
|
-
import r from "../../../node_modules/@fullcalendar/core/locales/pt
|
|
6
|
-
import i from "
|
|
7
|
-
import a
|
|
8
|
-
import c from "
|
|
9
|
-
import
|
|
10
|
-
import u from "
|
|
11
|
-
import d from "@fullcalendar/
|
|
12
|
-
import f from "@fullcalendar/
|
|
13
|
-
import p from "@fullcalendar/
|
|
2
|
+
import { useWimTranslation as e } from "../../../i18n/useWimTranslation.js";
|
|
3
|
+
import { useMergedRef as t } from "../../../hooks/useMergedRef.js";
|
|
4
|
+
import n from "../../../node_modules/@fullcalendar/core/locales/ja.js";
|
|
5
|
+
import r from "../../../node_modules/@fullcalendar/core/locales/pt.js";
|
|
6
|
+
import i from "../../../node_modules/@fullcalendar/core/locales/pt-br.js";
|
|
7
|
+
import a from "./schedule-view.module.js";
|
|
8
|
+
import o, { useEffect as s, useRef as c } from "react";
|
|
9
|
+
import l from "classnames";
|
|
10
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
11
|
+
import d from "@fullcalendar/react";
|
|
12
|
+
import f from "@fullcalendar/timegrid";
|
|
13
|
+
import p from "@fullcalendar/daygrid";
|
|
14
|
+
import m from "@fullcalendar/interaction";
|
|
14
15
|
//#region src/components/data-display/ScheduleView/ScheduleView.tsx
|
|
15
|
-
var
|
|
16
|
-
t,
|
|
16
|
+
var h = [
|
|
17
17
|
n,
|
|
18
|
-
r
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
r,
|
|
19
|
+
i
|
|
20
|
+
], g = [
|
|
21
21
|
f,
|
|
22
|
-
p
|
|
23
|
-
|
|
22
|
+
p,
|
|
23
|
+
m
|
|
24
|
+
], _ = {
|
|
24
25
|
left: "prev,next today",
|
|
25
26
|
center: "title",
|
|
26
27
|
right: "dayGridMonth,timeGridWeek,timeGridDay"
|
|
27
|
-
},
|
|
28
|
-
let
|
|
29
|
-
return
|
|
30
|
-
let e =
|
|
28
|
+
}, v = o.forwardRef(({ events: n = [], initialView: r = "timeGridWeek", editable: i = !0, selectable: o = !0, onEventClick: f, onEventDrop: p, onEventChange: m, onDateSelect: v, unselectAuto: y = !0, slotMinTime: b = "08:00:00", slotMaxTime: x = "20:00:00", slotDuration: S = "00:30:00", locale: C = "en", className: w, "aria-label": T, ...E }, D) => {
|
|
29
|
+
let { t: O } = e("common"), k = T ?? O("scheduleView.label"), A = c(null), j = c(null), M = t(D, j);
|
|
30
|
+
return s(() => {
|
|
31
|
+
let e = j.current;
|
|
31
32
|
if (!e) return;
|
|
32
33
|
let t = () => {
|
|
33
34
|
e.querySelectorAll(".fc-icon[role=\"img\"]:not([aria-hidden])").forEach((e) => e.setAttribute("aria-hidden", "true")), e.querySelectorAll("a.fc-more-link:not([role])").forEach((e) => e.setAttribute("role", "button")), e.querySelectorAll(".fc-scroller").forEach((e) => {
|
|
@@ -45,39 +46,39 @@ var m = [
|
|
|
45
46
|
return r?.observe(e), () => {
|
|
46
47
|
n.disconnect(), r?.disconnect();
|
|
47
48
|
};
|
|
48
|
-
}, []), /* @__PURE__ */
|
|
49
|
-
ref:
|
|
50
|
-
className:
|
|
49
|
+
}, []), /* @__PURE__ */ u("div", {
|
|
50
|
+
ref: M,
|
|
51
|
+
className: l("wim-schedule-view", a.root, w),
|
|
51
52
|
role: "region",
|
|
52
|
-
"aria-label":
|
|
53
|
-
...
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
ref:
|
|
56
|
-
plugins:
|
|
57
|
-
initialView:
|
|
58
|
-
headerToolbar:
|
|
59
|
-
events:
|
|
60
|
-
editable:
|
|
61
|
-
selectable:
|
|
53
|
+
"aria-label": k,
|
|
54
|
+
...E,
|
|
55
|
+
children: /* @__PURE__ */ u(d, {
|
|
56
|
+
ref: A,
|
|
57
|
+
plugins: g,
|
|
58
|
+
initialView: r,
|
|
59
|
+
headerToolbar: _,
|
|
60
|
+
events: n,
|
|
61
|
+
editable: i,
|
|
62
|
+
selectable: o,
|
|
62
63
|
selectMirror: !0,
|
|
63
|
-
unselectAuto:
|
|
64
|
+
unselectAuto: y,
|
|
64
65
|
dayMaxEvents: !0,
|
|
65
66
|
weekends: !0,
|
|
66
|
-
slotMinTime:
|
|
67
|
-
slotMaxTime:
|
|
68
|
-
slotDuration:
|
|
69
|
-
locale:
|
|
70
|
-
locales:
|
|
67
|
+
slotMinTime: b,
|
|
68
|
+
slotMaxTime: x,
|
|
69
|
+
slotDuration: S,
|
|
70
|
+
locale: C,
|
|
71
|
+
locales: h,
|
|
71
72
|
eventColor: "var(--wim-color-primary)",
|
|
72
73
|
eventTextColor: "var(--wim-color-text-on-primary)",
|
|
73
|
-
eventClick:
|
|
74
|
-
eventDrop:
|
|
75
|
-
eventChange:
|
|
76
|
-
select:
|
|
74
|
+
eventClick: f,
|
|
75
|
+
eventDrop: p,
|
|
76
|
+
eventChange: m,
|
|
77
|
+
select: v,
|
|
77
78
|
height: "auto"
|
|
78
79
|
})
|
|
79
80
|
});
|
|
80
81
|
});
|
|
81
|
-
|
|
82
|
+
v.displayName = "ScheduleView";
|
|
82
83
|
//#endregion
|
|
83
|
-
export {
|
|
84
|
+
export { v as ScheduleView };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../overlay/Portal/Portal.cjs"),r=require("../../form/Button/Button.cjs"),
|
|
2
|
+
const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../../i18n/useWimTranslation.cjs"),n=require("../../overlay/Portal/Portal.cjs"),r=require("../../overlay/FocusTrap/FocusTrap.cjs"),i=require("../../form/Button/Button.cjs"),a=require("./tour.module.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("classnames");s=e.__toESM(s,1);let c=require("react/jsx-runtime");var l=16;function u(e){let t=getComputedStyle(e);return`${t.fontWeight} ${t.fontSize} ${t.fontFamily}`}async function d(e){let t=document.fonts;if(t&&typeof t.load==`function`){try{await t.load(u(e))}catch{}for(;t.status===`loading`;)await new Promise(e=>{t.addEventListener(`loadingdone`,()=>e(),{once:!0})})}}function f(e){let t=document.fonts;return!t||typeof t.load!=`function`?!1:t.status===`loading`||typeof t.check==`function`&&!t.check(u(e))}function p(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.width)===Math.round(t.width)&&Math.round(e.height)===Math.round(t.height)}function m(e){return e.top>=l&&e.bottom<=window.innerHeight-l&&e.left>=l&&e.right<=window.innerWidth-l}var h=({steps:e,open:l,onClose:u,onFinish:h})=>{let{t:g}=t.useWimTranslation(`common`),[_,v]=(0,o.useState)(0),[y,b]=(0,o.useState)(null),x=e[_],S=x?.target;(0,o.useLayoutEffect)(()=>{if(!l||!S){b(null);return}let e=!1,t=t=>{e||b(e=>t?e&&p(e,t)?e:t:null)},n=()=>{let e=document.querySelector(S);if(!e){t(null);return}m(e.getBoundingClientRect())||e.scrollIntoView({block:`center`,inline:`nearest`}),t(e.getBoundingClientRect())},r=()=>{let e=document.querySelector(S);t(e?e.getBoundingClientRect():null)},i=()=>{window.addEventListener(`resize`,r),window.addEventListener(`scroll`,r,!0)},a=async()=>{let t=document.querySelector(S);t&&await d(t),!e&&(n(),i())},o=document.querySelector(S);return o&&f(o)?a():(n(),i()),()=>{e=!0,window.removeEventListener(`resize`,r),window.removeEventListener(`scroll`,r,!0)}},[l,_,S]);let C=(0,o.useId)(),w=(0,o.useRef)(null),T=(0,o.useRef)(null),E=l&&!!x&&!!y;if((0,o.useEffect)(()=>{if(!E)return;let e=w.current;e&&!e.contains(document.activeElement)&&T.current?.focus()},[E,_]),(0,o.useEffect)(()=>{if(!l)return;let e=e=>{e.key===`Escape`&&(e.preventDefault(),u())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[l,u]),!l||!x)return null;let D=()=>{_<e.length-1?v(_+1):(h?h():u(),v(0))},O=()=>{_>0&&v(_-1)},k={},A=x.placement||`bottom`;if(y){let e=window.innerWidth,t=Math.min(300,e-32),n=A;if(e<640&&(n===`left`||n===`right`)&&(n=`bottom`),A=n,n===`top`||n===`bottom`){let r=y.left+y.width/2,i=t/2+16,a=e-t/2-16;r=i>a?e/2:Math.max(i,Math.min(a,r)),k.left=r,n===`top`?(k.top=y.top-12,k.transform=`translate(-50%, -100%)`):(k.top=y.bottom+12,k.transform=`translateX(-50%)`)}else n===`left`?(k.left=y.left-12,k.top=y.top+y.height/2,k.transform=`translate(-100%, -50%)`):n===`right`&&(k.left=y.right+12,k.top=y.top+y.height/2,k.transform=`translateY(-50%)`)}return(0,c.jsx)(n.Portal,{children:(0,c.jsx)(r.FocusTrap,{initialFocus:!1,children:(0,c.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":x.title,"aria-describedby":y?C:void 0,children:[y&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`div`,{className:a.default.highlight,style:{top:y.top-4,left:y.left-4,width:y.width+8,height:y.height+8}}),(0,c.jsx)(`div`,{ref:w,className:(0,s.default)(`wim-tour`,a.default.bubble),"data-placement":A,style:k,children:(0,c.jsxs)(`div`,{className:a.default.inner,children:[(0,c.jsx)(`h3`,{className:a.default.title,children:x.title}),(0,c.jsx)(`p`,{id:C,className:a.default.description,children:x.description}),(0,c.jsxs)(`div`,{className:a.default.footer,children:[(0,c.jsxs)(`span`,{className:a.default.progress,children:[_+1,` / `,e.length]}),(0,c.jsxs)(`div`,{className:a.default.buttons,children:[_>0&&(0,c.jsx)(i.Button,{size:`sm`,variant:`outline`,onClick:O,children:g(`action.back`)}),(0,c.jsx)(i.Button,{ref:T,size:`sm`,variant:`solid`,onClick:D,children:_===e.length-1?g(`action.finish`):g(`action.next`)})]})]})]})})]}),(0,c.jsx)(`div`,{className:a.default.mask,onClick:u,role:`button`,tabIndex:0,"aria-label":g(`a11y.close_tour`),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&u()}})]})})})};exports.Tour=h;
|