@functionalui/functionalui 0.2.6 → 0.2.8
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/Admonition-BVd4bXl_.cjs +1 -0
- package/dist/Admonition-CReUUZzJ.js +88 -0
- package/dist/{Avatar-CQA0mEVW.js → Avatar-CkxjB_cU.js} +4 -4
- package/dist/AvatarGroup-CbohU2rq.cjs +1 -0
- package/dist/AvatarGroup-FpaQP2H4.js +52 -0
- package/dist/{Button-CpTXDsI7.js → Button-DLwud-g7.js} +8 -8
- package/dist/{Checkbox-C29jP71p.js → Checkbox-CNpy1wvA.js} +3 -3
- package/dist/Checkboxes-CQVptWR8.cjs +1 -0
- package/dist/Checkboxes-Cj740f5X.js +80 -0
- package/dist/Chip-DgSZZTgy.js +132 -0
- package/dist/Chip-HOh--tbB.cjs +1 -0
- package/dist/ColorPicker-DUz0qcHd.js +234 -0
- package/dist/ColorPicker-rxR_V4EW.cjs +1 -0
- package/dist/DivMeasure-C398kYvk.js +26 -0
- package/dist/DivMeasure-oi_fzKlp.cjs +1 -0
- package/dist/GalleryModal-DjCnCkbg.js +464 -0
- package/dist/GalleryModal-wFC9x3Em.cjs +1 -0
- package/dist/InputImage-CInJWoGb.cjs +1 -0
- package/dist/InputImage-ZST0lvcI.js +106 -0
- package/dist/InputText-Bjhoe-Tm.cjs +1 -0
- package/dist/InputText-DnR7KYJS.js +246 -0
- package/dist/InsetGroup-BHxpHwpd.js +105 -0
- package/dist/InsetGroup-CGACEEbB.cjs +1 -0
- package/dist/{LabelText-D7QIWtWj.js → LabelText-WYEq5keJ.js} +3 -3
- package/dist/LoadingSpinner-BC0eMoVW.js +101 -0
- package/dist/LoadingSpinner-DykDI5-W.cjs +1 -0
- package/dist/{Modal-DXLyt-j4.js → Modal-Di5ye0Cr.js} +4 -4
- package/dist/NotificationSystem-B5NXsG0a.js +158 -0
- package/dist/NotificationSystem-D4ydo2Lk.cjs +1 -0
- package/dist/Radio-Dd5W2Lpf.js +121 -0
- package/dist/Radio-QbaBzLpf.cjs +1 -0
- package/dist/SelectSpring-BOfRXdag.js +471 -0
- package/dist/SelectSpring-DFKWTbF1.cjs +1 -0
- package/dist/SpringEnter-CPw1YgNg.cjs +1 -0
- package/dist/SpringEnter-CoVZpW-c.js +44 -0
- package/dist/{SpringEnterOffsetBy-DMSIQgV3.js → SpringEnterOffsetBy-BKglENgZ.js} +2 -2
- package/dist/SpringMenuTransition-B_PoFoqO.cjs +1 -0
- package/dist/SpringMenuTransition-CzSfyvDZ.js +42 -0
- package/dist/SpringOpenCloseHeight-COvFkc30.js +18 -0
- package/dist/SpringOpenCloseHeight-CyxsSgRD.cjs +1 -0
- package/dist/TableGrid-BYBVHJt9.cjs +1 -0
- package/dist/TableGrid-QlKM9Sdp.js +49 -0
- package/dist/{TableHeader-Da0XxILB.js → TableHeader-D3V5Z3JL.js} +4 -4
- package/dist/{TableRow-BlJSvake.js → TableRow-DKC9qdjQ.js} +3 -3
- package/dist/Tabs-BkUyxceG.js +134 -0
- package/dist/Tabs-C8VAb1g0.cjs +1 -0
- package/dist/{TagColor-BYKxfOU6.js → TagColor-Bd3n3RCF.js} +3 -3
- package/dist/TextArea-Bsm5M8lo.cjs +1 -0
- package/dist/TextArea-Cd3q9BMN.js +160 -0
- package/dist/ToggleSwitch-BNAk1Wp6.js +100 -0
- package/dist/ToggleSwitch-D6ltRmPy.cjs +1 -0
- package/dist/{UIcon-BHzbeYWw.js → UIcon-Cc5PX9WJ.js} +3 -3
- package/dist/UiContexts-36wfLVYv.cjs +1 -0
- package/dist/UiContexts-BMJZJR8C.js +35 -0
- package/dist/admonition/index.cjs +1 -1
- package/dist/admonition/index.mjs +2 -86
- package/dist/avatar/index.mjs +1 -1
- package/dist/avatar-group/index.cjs +1 -1
- package/dist/avatar-group/index.mjs +2 -50
- package/dist/button/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/checkboxes/index.cjs +1 -1
- package/dist/checkboxes/index.mjs +2 -78
- package/dist/chip/index.cjs +1 -1
- package/dist/chip/index.mjs +2 -130
- package/dist/color-picker/index.cjs +1 -1
- package/dist/color-picker/index.mjs +2 -232
- package/dist/{component-CW2JPBAq.js → component-89pO-V2r.js} +1 -1
- package/dist/{component-BvHdlcdE.js → component-BbiEBU5H.js} +1 -1
- package/dist/component-BvmPGrYv.cjs +1 -0
- package/dist/{component-C1Gs4nVu.js → component-CGEZuC_0.js} +1 -1
- package/dist/{component-DRXQXr2G.js → component-CLzFHaNK.js} +1 -1
- package/dist/{component-D0wwK4KY.js → component-D-bBH8nL.js} +1 -1
- package/dist/{component-DCHO9d6d.js → component-DBDhHeDP.js} +1 -1
- package/dist/{component-D5nxKQnT.js → component-DP7cQasn.js} +1 -1
- package/dist/{component-CBIQe7z5.js → component-JelkpADf.js} +1 -1
- package/dist/{component-DdQu0mLI.js → component-SecZNuYG.js} +1 -1
- package/dist/component-cHg1BfVy.js +28 -0
- package/dist/container/index.mjs +1 -1
- package/dist/contexts/ui/index.cjs +1 -1
- package/dist/contexts/ui/index.mjs +3 -32
- package/dist/{createTextElement-Cgrvdwvh.js → createTextElement-d3-b9Lvn.js} +1 -1
- package/dist/css/index.css +1 -1
- package/dist/div-measure/index.cjs +1 -1
- package/dist/div-measure/index.mjs +2 -23
- package/dist/gallery-modal/index.cjs +1 -1
- package/dist/gallery-modal/index.mjs +2 -461
- package/dist/icons/index.mjs +1 -1
- package/dist/input-image/index.cjs +1 -1
- package/dist/input-image/index.mjs +2 -103
- package/dist/input-text/index.cjs +1 -1
- package/dist/input-text/index.mjs +2 -243
- package/dist/inset-group/index.cjs +1 -1
- package/dist/inset-group/index.mjs +2 -102
- package/dist/label-text/index.mjs +1 -1
- package/dist/layout/index.mjs +1 -1
- package/dist/lib/styles/types/types.d.ts +12 -12
- package/dist/loading-spinner/index.cjs +1 -1
- package/dist/loading-spinner/index.mjs +3 -98
- package/dist/main.cjs +1 -0
- package/dist/main.mjs +95 -0
- package/dist/modal/index.mjs +1 -1
- package/dist/notification-system/index.cjs +1 -1
- package/dist/notification-system/index.mjs +2 -155
- package/dist/radio/index.cjs +1 -1
- package/dist/radio/index.mjs +2 -118
- package/dist/{react-spring_web.modern-DgQDaJ06.js → react-spring_web.modern-DUf5COpz.js} +3 -3
- package/dist/select-spring/index.cjs +1 -1
- package/dist/select-spring/index.mjs +2 -468
- package/dist/spring-enter/index.cjs +1 -1
- package/dist/spring-enter/index.mjs +2 -42
- package/dist/spring-enter-offset-by/index.mjs +1 -1
- package/dist/spring-menu-transition/index.cjs +1 -1
- package/dist/spring-menu-transition/index.mjs +2 -40
- package/dist/spring-open-close-height/index.cjs +1 -1
- package/dist/spring-open-close-height/index.mjs +2 -16
- package/dist/styled/button/index.mjs +1 -1
- package/dist/styled/inputs/text/index.mjs +1 -1
- package/dist/styled/inputs/text-area/index.mjs +1 -1
- package/dist/styled/li/index.mjs +1 -1
- package/dist/styled/ul/index.mjs +1 -1
- package/dist/table-grid/index.cjs +1 -1
- package/dist/table-grid/index.mjs +2 -46
- package/dist/table-header/index.mjs +1 -1
- package/dist/table-row/index.mjs +1 -1
- package/dist/tabs/index.cjs +1 -1
- package/dist/tabs/index.mjs +2 -132
- package/dist/tag-color/index.mjs +1 -1
- package/dist/text-area/index.cjs +1 -1
- package/dist/text-area/index.mjs +2 -157
- package/dist/texts/header/index.cjs +1 -1
- package/dist/texts/header/index.mjs +2 -26
- package/dist/texts/p/index.mjs +1 -1
- package/dist/texts/span/index.mjs +1 -1
- package/dist/toggle-switch/index.cjs +1 -1
- package/dist/toggle-switch/index.mjs +2 -98
- package/dist/{types-BNUi2DUD.js → types-xFemYgmc.js} +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.mjs +33 -33
- package/package.json +9 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
3
|
+
import { d as k, c as I, u as L } from "./react-spring_web.modern-DUf5COpz.js";
|
|
4
|
+
import { C as i } from "./component-CGEZuC_0.js";
|
|
5
|
+
import { L as w } from "./component-CLzFHaNK.js";
|
|
6
|
+
import { C as d } from "./generics-D33J7ILI.js";
|
|
7
|
+
import { a as u } from "./values-CSE3dLnv.js";
|
|
8
|
+
import { S as F } from "./generics-C-WSPclF.js";
|
|
9
|
+
import { h as R, b as A } from "./classes-CVxy1f4M.js";
|
|
10
|
+
import { S as E } from "./generics-BrMr2-Gs.js";
|
|
11
|
+
import { useState as y, useEffect as g } from "react";
|
|
12
|
+
const W = ({
|
|
13
|
+
id: t,
|
|
14
|
+
checked: e,
|
|
15
|
+
size: a = E.Size3,
|
|
16
|
+
handleChange: s = () => {
|
|
17
|
+
},
|
|
18
|
+
vertigo: l,
|
|
19
|
+
ref: c,
|
|
20
|
+
children: h,
|
|
21
|
+
...C
|
|
22
|
+
}) => {
|
|
23
|
+
const [r, m] = y(e), [f, p] = y(!1), S = (n) => {
|
|
24
|
+
m(n), s(t, n);
|
|
25
|
+
};
|
|
26
|
+
return g(() => {
|
|
27
|
+
const n = (b) => {
|
|
28
|
+
!f || r || b.key === " " && S(!0);
|
|
29
|
+
};
|
|
30
|
+
return document && document.addEventListener("keydown", n, !1), () => {
|
|
31
|
+
document && document.removeEventListener("keydown", n, !1);
|
|
32
|
+
};
|
|
33
|
+
}, [f, r]), g(() => {
|
|
34
|
+
m(e);
|
|
35
|
+
}, [e]), /* @__PURE__ */ o(
|
|
36
|
+
i,
|
|
37
|
+
{
|
|
38
|
+
onClick: () => {
|
|
39
|
+
l && r || (m(!r), s(t, r));
|
|
40
|
+
},
|
|
41
|
+
style: { cursor: "pointer" },
|
|
42
|
+
tabIndex: 0,
|
|
43
|
+
role: "button",
|
|
44
|
+
onFocus: () => p(!0),
|
|
45
|
+
onBlur: () => p(!1),
|
|
46
|
+
children: /* @__PURE__ */ x(w, { display: A.Flex, flexAlignItem: R.Center, children: [
|
|
47
|
+
/* @__PURE__ */ o(j, { checked: r, size: a }),
|
|
48
|
+
/* @__PURE__ */ o(
|
|
49
|
+
i,
|
|
50
|
+
{
|
|
51
|
+
marginLeft: F.Size1,
|
|
52
|
+
style: { transform: "translateY(-1px)", userSelect: "none" },
|
|
53
|
+
children: h
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ o(
|
|
57
|
+
"input",
|
|
58
|
+
{
|
|
59
|
+
ref: c,
|
|
60
|
+
id: t,
|
|
61
|
+
checked: r,
|
|
62
|
+
onChange: () => {
|
|
63
|
+
},
|
|
64
|
+
type: "radio",
|
|
65
|
+
style: {
|
|
66
|
+
appearance: "none",
|
|
67
|
+
backgroundColor: "transparent",
|
|
68
|
+
margin: 0,
|
|
69
|
+
display: "none"
|
|
70
|
+
},
|
|
71
|
+
...C
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}, j = ({ checked: t, size: e }) => {
|
|
78
|
+
const a = k(t, {
|
|
79
|
+
from: { opacity: 0, scale: 0.6 },
|
|
80
|
+
enter: { opacity: 1, scale: 1 },
|
|
81
|
+
leave: { opacity: 0, scale: 0.6 },
|
|
82
|
+
config: {
|
|
83
|
+
...I.stiff
|
|
84
|
+
}
|
|
85
|
+
}), s = L({
|
|
86
|
+
borderColor: t ? u[d.Primary5] : u[d.Grey5]
|
|
87
|
+
});
|
|
88
|
+
return /* @__PURE__ */ o(
|
|
89
|
+
i,
|
|
90
|
+
{
|
|
91
|
+
style: {
|
|
92
|
+
...s,
|
|
93
|
+
width: e,
|
|
94
|
+
height: e,
|
|
95
|
+
borderRadius: "50%",
|
|
96
|
+
borderWidth: 2,
|
|
97
|
+
borderStyle: "solid",
|
|
98
|
+
display: "flex",
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
alignItems: "center"
|
|
101
|
+
},
|
|
102
|
+
children: a(
|
|
103
|
+
(l, c) => c && /* @__PURE__ */ o(
|
|
104
|
+
i,
|
|
105
|
+
{
|
|
106
|
+
style: {
|
|
107
|
+
...l,
|
|
108
|
+
width: e - 10,
|
|
109
|
+
height: e - 10,
|
|
110
|
+
borderRadius: "50%",
|
|
111
|
+
backgroundColor: u[d.Primary5]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
export {
|
|
120
|
+
W as R
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),f=require("./react-spring_web.modern-W3Nkoq_6.cjs"),c=require("./component-D-EEi7NI.cjs"),q=require("./component-B1mkowwk.cjs"),y=require("./generics-DE1oV0MV.cjs"),p=require("./values-C40_Fyfk.cjs"),L=require("./generics-9F1CmKPb.cjs"),C=require("./classes-HsjFV5aN.cjs"),j=require("./generics-nyvJhwQE.cjs"),i=require("react"),k=({id:r,checked:e,size:a=j.Sizings.Size3,handleChange:o=()=>{},vertigo:l,ref:u,children:S,...x})=>{const[n,d]=i.useState(e),[m,g]=i.useState(!1),h=s=>{d(s),o(r,s)};return i.useEffect(()=>{const s=b=>{!m||n||b.key===" "&&h(!0)};return document&&document.addEventListener("keydown",s,!1),()=>{document&&document.removeEventListener("keydown",s,!1)}},[m,n]),i.useEffect(()=>{d(e)},[e]),t.jsx(c.Container,{onClick:()=>{l&&n||(d(!n),o(r,n))},style:{cursor:"pointer"},tabIndex:0,role:"button",onFocus:()=>g(!0),onBlur:()=>g(!1),children:t.jsxs(q.Layout,{display:C.Displays.Flex,flexAlignItem:C.FlexAlignItems.Center,children:[t.jsx(R,{checked:n,size:a}),t.jsx(c.Container,{marginLeft:L.Spacings.Size1,style:{transform:"translateY(-1px)",userSelect:"none"},children:S}),t.jsx("input",{ref:u,id:r,checked:n,onChange:()=>{},type:"radio",style:{appearance:"none",backgroundColor:"transparent",margin:0,display:"none"},...x})]})})},R=({checked:r,size:e})=>{const a=f.useTransition(r,{from:{opacity:0,scale:.6},enter:{opacity:1,scale:1},leave:{opacity:0,scale:.6},config:{...f.config.stiff}}),o=f.useSpring({borderColor:r?p.COLOR_VALUES[y.ColorPalettes.Primary5]:p.COLOR_VALUES[y.ColorPalettes.Grey5]});return t.jsx(c.Container,{style:{...o,width:e,height:e,borderRadius:"50%",borderWidth:2,borderStyle:"solid",display:"flex",justifyContent:"center",alignItems:"center"},children:a((l,u)=>u&&t.jsx(c.Container,{style:{...l,width:e-10,height:e-10,borderRadius:"50%",backgroundColor:p.COLOR_VALUES[y.ColorPalettes.Primary5]}}))})};exports.Radio=k;
|
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n, Fragment as Y, jsxs as I } from "react/jsx-runtime";
|
|
3
|
+
import { L as G } from "./component-CLzFHaNK.js";
|
|
4
|
+
import { C as T, a as oe } from "./generics-D33J7ILI.js";
|
|
5
|
+
import { j as ne, h as ie, b as U, i as se } from "./classes-CVxy1f4M.js";
|
|
6
|
+
import { D as M, a as p, b as m, c as J, e as A, S as z, d as C } from "./types-Bh_j-nXM.js";
|
|
7
|
+
import { useState as Z, useEffect as D, useReducer as ae } from "react";
|
|
8
|
+
import { u as V } from "./web-B_p0FWHf.js";
|
|
9
|
+
import { u as le } from "./useClickOutsideDOM-CBmttEFU.js";
|
|
10
|
+
import { C as R } from "./component-CGEZuC_0.js";
|
|
11
|
+
import { T as O } from "./component-BbiEBU5H.js";
|
|
12
|
+
import { S as l, R as x, C as de } from "./generics-C-WSPclF.js";
|
|
13
|
+
import { d as X, c as ce, u as $ } from "./react-spring_web.modern-DUf5COpz.js";
|
|
14
|
+
import { F as K } from "./component-DP7cQasn.js";
|
|
15
|
+
import { F as ue } from "./component-DBDhHeDP.js";
|
|
16
|
+
import { a as v, c as N } from "./values-CSE3dLnv.js";
|
|
17
|
+
import { U as pe } from "./UIcon-Cc5PX9WJ.js";
|
|
18
|
+
const fe = "_ul_5jv7w_1", me = "_li_5jv7w_5", W = {
|
|
19
|
+
ul: fe,
|
|
20
|
+
li: me
|
|
21
|
+
}, F = {
|
|
22
|
+
[p.Top]: {
|
|
23
|
+
from: { y: -10 },
|
|
24
|
+
enter: { y: -1 },
|
|
25
|
+
leave: { y: -10 }
|
|
26
|
+
},
|
|
27
|
+
[p.Bottom]: {
|
|
28
|
+
from: { y: 10 },
|
|
29
|
+
enter: { y: -1 },
|
|
30
|
+
leave: { y: 10 }
|
|
31
|
+
}
|
|
32
|
+
}, he = ({
|
|
33
|
+
dropdownHeightStyle: e,
|
|
34
|
+
isOpen: t,
|
|
35
|
+
dropdownPosition: o,
|
|
36
|
+
position: r,
|
|
37
|
+
selectState: i,
|
|
38
|
+
children: s
|
|
39
|
+
}) => {
|
|
40
|
+
switch (e) {
|
|
41
|
+
case M.Default:
|
|
42
|
+
return /* @__PURE__ */ n(
|
|
43
|
+
j,
|
|
44
|
+
{
|
|
45
|
+
dropdownHeightStyle: e,
|
|
46
|
+
isOpen: t,
|
|
47
|
+
dropdownPosition: o,
|
|
48
|
+
position: r,
|
|
49
|
+
selectState: i,
|
|
50
|
+
children: s
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
case M.AutoHeight:
|
|
54
|
+
return /* @__PURE__ */ n(
|
|
55
|
+
Se,
|
|
56
|
+
{
|
|
57
|
+
dropdownHeightStyle: e,
|
|
58
|
+
isOpen: t,
|
|
59
|
+
dropdownPosition: o,
|
|
60
|
+
position: r,
|
|
61
|
+
selectState: i,
|
|
62
|
+
children: s
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
default:
|
|
66
|
+
return /* @__PURE__ */ n(
|
|
67
|
+
j,
|
|
68
|
+
{
|
|
69
|
+
dropdownHeightStyle: e,
|
|
70
|
+
isOpen: t,
|
|
71
|
+
dropdownPosition: o,
|
|
72
|
+
position: r,
|
|
73
|
+
selectState: i,
|
|
74
|
+
children: s
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}, j = ({
|
|
79
|
+
isOpen: e,
|
|
80
|
+
dropdownPosition: t,
|
|
81
|
+
// dropdownHeightStyle,
|
|
82
|
+
// hasSelect,
|
|
83
|
+
position: o,
|
|
84
|
+
children: r
|
|
85
|
+
}) => X(e, {
|
|
86
|
+
from: {
|
|
87
|
+
opacity: 0,
|
|
88
|
+
...F[t].from
|
|
89
|
+
},
|
|
90
|
+
enter: {
|
|
91
|
+
opacity: 1,
|
|
92
|
+
...F[t].enter
|
|
93
|
+
},
|
|
94
|
+
leave: {
|
|
95
|
+
opacity: 0,
|
|
96
|
+
...F[t].leave
|
|
97
|
+
}
|
|
98
|
+
})(
|
|
99
|
+
(s, a) => a && /* @__PURE__ */ n(
|
|
100
|
+
K,
|
|
101
|
+
{
|
|
102
|
+
style: {
|
|
103
|
+
...s,
|
|
104
|
+
transformOrigin: t === p.Top ? "bottom center" : t === p.Bottom ? "top center" : o < 0 ? "bottom center" : "top center"
|
|
105
|
+
},
|
|
106
|
+
className: W.ul,
|
|
107
|
+
children: r
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
), Se = ({
|
|
111
|
+
isOpen: e,
|
|
112
|
+
// dropdownHeightStyle,
|
|
113
|
+
// hasSelect,
|
|
114
|
+
dropdownPosition: t,
|
|
115
|
+
position: o,
|
|
116
|
+
children: r
|
|
117
|
+
}) => X(e, {
|
|
118
|
+
from: {
|
|
119
|
+
opacity: 0,
|
|
120
|
+
scaleY: 0
|
|
121
|
+
},
|
|
122
|
+
enter: {
|
|
123
|
+
opacity: 1,
|
|
124
|
+
scaleY: 1
|
|
125
|
+
},
|
|
126
|
+
leave: {
|
|
127
|
+
opacity: 0,
|
|
128
|
+
scaleY: 0.5
|
|
129
|
+
},
|
|
130
|
+
config(s, a, d) {
|
|
131
|
+
return d === "leave" ? { duration: 100 } : ce.default;
|
|
132
|
+
}
|
|
133
|
+
})(
|
|
134
|
+
(s, a) => a && /* @__PURE__ */ n(
|
|
135
|
+
K,
|
|
136
|
+
{
|
|
137
|
+
style: {
|
|
138
|
+
...s,
|
|
139
|
+
transformOrigin: t === p.Top ? "bottom center" : t === p.Bottom ? "top center" : o < 0 ? "bottom center" : "top center"
|
|
140
|
+
},
|
|
141
|
+
className: W.ul,
|
|
142
|
+
children: r
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
), ge = ({
|
|
146
|
+
handleSelectItem: e,
|
|
147
|
+
id: t,
|
|
148
|
+
idx: o,
|
|
149
|
+
children: r,
|
|
150
|
+
colorSet: i
|
|
151
|
+
}) => {
|
|
152
|
+
const [s, a] = $(() => ({
|
|
153
|
+
backgroundColor: v[T.Grey2]
|
|
154
|
+
// same as SelectHeader bgColor
|
|
155
|
+
}));
|
|
156
|
+
return /* @__PURE__ */ n(
|
|
157
|
+
ue,
|
|
158
|
+
{
|
|
159
|
+
className: W.li,
|
|
160
|
+
paddingTop: l.Size1,
|
|
161
|
+
paddingBottom: l.Size1,
|
|
162
|
+
paddingLeft: l.Size2,
|
|
163
|
+
paddingRight: l.Size2,
|
|
164
|
+
marginTop: l.Size0,
|
|
165
|
+
style: {
|
|
166
|
+
listStyle: "none",
|
|
167
|
+
cursor: "pointer",
|
|
168
|
+
userSelect: "none",
|
|
169
|
+
...s
|
|
170
|
+
},
|
|
171
|
+
onMouseEnter: () => {
|
|
172
|
+
a.start({
|
|
173
|
+
backgroundColor: v[N[i][0] + 2]
|
|
174
|
+
});
|
|
175
|
+
},
|
|
176
|
+
onMouseLeave: () => {
|
|
177
|
+
a.start({ backgroundColor: v[T.Grey2] });
|
|
178
|
+
},
|
|
179
|
+
onMouseDown: () => {
|
|
180
|
+
a.start({
|
|
181
|
+
backgroundColor: v[N[i][0] + 3]
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
onClick: () => e(t, o),
|
|
185
|
+
children: r
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
}, ye = (e, t) => {
|
|
189
|
+
const [o, r] = Z(null);
|
|
190
|
+
D(() => {
|
|
191
|
+
const s = () => {
|
|
192
|
+
r({
|
|
193
|
+
width: window ? window.innerWidth : 0,
|
|
194
|
+
height: window ? window.innerHeight : 0
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
return window && window.addEventListener("resize", s), () => {
|
|
198
|
+
window && window.removeEventListener("resize", s);
|
|
199
|
+
};
|
|
200
|
+
}, []);
|
|
201
|
+
const i = e.height + 10;
|
|
202
|
+
return o && i + e.top > o.height ? -1 : 1;
|
|
203
|
+
}, we = ({
|
|
204
|
+
isSelectOpen: e,
|
|
205
|
+
selectOptions: t,
|
|
206
|
+
handleSelectItem: o,
|
|
207
|
+
selectState: r,
|
|
208
|
+
dropdownHeightStyle: i,
|
|
209
|
+
dropdownPosition: s = p.Bottom,
|
|
210
|
+
colorSet: a,
|
|
211
|
+
headerHeight: d,
|
|
212
|
+
w: S
|
|
213
|
+
// closeSelect,
|
|
214
|
+
}) => {
|
|
215
|
+
const [L, g] = V(), y = ye(g), h = y > 0 ? d - 1 : -g.height;
|
|
216
|
+
return /* @__PURE__ */ n(
|
|
217
|
+
R,
|
|
218
|
+
{
|
|
219
|
+
ref: L,
|
|
220
|
+
borderRadius: m[r].dropdown.borderRadius,
|
|
221
|
+
borderBottomLeftRadius: x.Size0,
|
|
222
|
+
borderBottomRightRadius: x.Size0,
|
|
223
|
+
borderWidth: m[r].header.borderWidth,
|
|
224
|
+
borderColor: m[r].header.borderColor,
|
|
225
|
+
style: {
|
|
226
|
+
maxHeight: 250,
|
|
227
|
+
width: S,
|
|
228
|
+
overflowY: "scroll",
|
|
229
|
+
position: "absolute",
|
|
230
|
+
transform: `translateY(${h}px)`,
|
|
231
|
+
overscrollBehaviorY: "none"
|
|
232
|
+
},
|
|
233
|
+
children: /* @__PURE__ */ n(
|
|
234
|
+
he,
|
|
235
|
+
{
|
|
236
|
+
dropdownHeightStyle: i,
|
|
237
|
+
isOpen: e,
|
|
238
|
+
dropdownPosition: s,
|
|
239
|
+
selectState: r,
|
|
240
|
+
position: y,
|
|
241
|
+
children: t.map((c, w) => /* @__PURE__ */ n(
|
|
242
|
+
ge,
|
|
243
|
+
{
|
|
244
|
+
handleSelectItem: o,
|
|
245
|
+
id: c.id,
|
|
246
|
+
idx: w,
|
|
247
|
+
colorSet: a,
|
|
248
|
+
children: /* @__PURE__ */ n(
|
|
249
|
+
R,
|
|
250
|
+
{
|
|
251
|
+
paddingTop: l.Size1,
|
|
252
|
+
paddingBottom: l.Size1,
|
|
253
|
+
paddingLeft: l.Size2,
|
|
254
|
+
paddingRight: l.Size2,
|
|
255
|
+
children: /* @__PURE__ */ n(O, { children: c.text })
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
},
|
|
259
|
+
c.id
|
|
260
|
+
))
|
|
261
|
+
}
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
);
|
|
265
|
+
}, be = ({
|
|
266
|
+
selectedValues: e,
|
|
267
|
+
doubleZero: t,
|
|
268
|
+
title: o,
|
|
269
|
+
selectedValueStyles: r = A.Text,
|
|
270
|
+
sizes: i = J.Medium
|
|
271
|
+
}) => (e.length === 1 && e[0].text, e.length < 1 ? /* @__PURE__ */ n(ve, { sizes: i, title: o }) : r === A.Text ? /* @__PURE__ */ n(Y, { children: e.map((s, a) => /* @__PURE__ */ n(O, { fontSize: z[i].font.size, children: s.text }, a)) }) : (
|
|
272
|
+
// @todo_20240503_1350("chip")
|
|
273
|
+
/* @__PURE__ */ n(Y, { children: e.map((s, a) => /* @__PURE__ */ n(O, { fontSize: z[i].font.size, children: s.text }, a)) })
|
|
274
|
+
)), ve = ({ title: e, sizes: t }) => /* @__PURE__ */ n(O, { fontSize: z[t].font.size, children: e }), Ce = ({
|
|
275
|
+
// w,
|
|
276
|
+
setOpenDropdown: e,
|
|
277
|
+
openDropdown: t,
|
|
278
|
+
title: o,
|
|
279
|
+
doubleZero: r,
|
|
280
|
+
selectState: i,
|
|
281
|
+
// selectedItemIdx,
|
|
282
|
+
selectedValues: s,
|
|
283
|
+
selectedValueStyles: a,
|
|
284
|
+
sizes: d = J.Medium
|
|
285
|
+
}) => /* @__PURE__ */ n(
|
|
286
|
+
R,
|
|
287
|
+
{
|
|
288
|
+
style: { cursor: "pointer" },
|
|
289
|
+
paddingTop: l.Size1,
|
|
290
|
+
paddingBottom: l.Size1,
|
|
291
|
+
paddingLeft: l.Size2,
|
|
292
|
+
paddingRight: l.Size2,
|
|
293
|
+
borderRadius: m[i].header.borderRadius,
|
|
294
|
+
borderWidth: m[i].header.borderWidth,
|
|
295
|
+
borderColor: m[i].header.borderColor,
|
|
296
|
+
borderTopLeftRadius: t ? x.Size0 : void 0,
|
|
297
|
+
borderTopRightRadius: t ? x.Size0 : void 0,
|
|
298
|
+
bgColor: m[i].header.bgColor,
|
|
299
|
+
onClick: () => e((S) => !S),
|
|
300
|
+
children: /* @__PURE__ */ I(
|
|
301
|
+
G,
|
|
302
|
+
{
|
|
303
|
+
display: U.Flex,
|
|
304
|
+
flexAlignItem: ie.Center,
|
|
305
|
+
flexJustifyContent: ne.SpaceBetween,
|
|
306
|
+
children: [
|
|
307
|
+
/* @__PURE__ */ n(
|
|
308
|
+
be,
|
|
309
|
+
{
|
|
310
|
+
sizes: d,
|
|
311
|
+
selectedValues: s,
|
|
312
|
+
doubleZero: r,
|
|
313
|
+
title: o,
|
|
314
|
+
selectedValueStyles: a
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
/* @__PURE__ */ n("div", { className: "icon", children: /* @__PURE__ */ n(De, { isSelectOpen: t, sizes: d }) })
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
), De = ({
|
|
323
|
+
isSelectOpen: e,
|
|
324
|
+
sizes: t,
|
|
325
|
+
cursor: o = de.Pointer
|
|
326
|
+
}) => {
|
|
327
|
+
const r = $({
|
|
328
|
+
rotateX: e ? 180 : 0
|
|
329
|
+
});
|
|
330
|
+
return (
|
|
331
|
+
// @todo_20241105_1045("tech debt")
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
333
|
+
// @ts-expect-error
|
|
334
|
+
/* @__PURE__ */ n(R, { style: r, children: /* @__PURE__ */ n(
|
|
335
|
+
pe,
|
|
336
|
+
{
|
|
337
|
+
name: "chevron-down",
|
|
338
|
+
colorLight: T.Grey5,
|
|
339
|
+
colorDark: T.Grey5,
|
|
340
|
+
size: z[t].icon.size,
|
|
341
|
+
cursor: o
|
|
342
|
+
}
|
|
343
|
+
) })
|
|
344
|
+
);
|
|
345
|
+
};
|
|
346
|
+
function Te(e, t) {
|
|
347
|
+
switch (t.type) {
|
|
348
|
+
case "field":
|
|
349
|
+
return { ...e, [t.field]: t.value };
|
|
350
|
+
case "select":
|
|
351
|
+
return {
|
|
352
|
+
...e,
|
|
353
|
+
selectedItemIdx: t.value,
|
|
354
|
+
selectOptions: e.selectOptions.map(
|
|
355
|
+
(o, r) => t.value === r ? { ...o, selected: !0 } : { ...o, selected: !1 }
|
|
356
|
+
),
|
|
357
|
+
openDropdown: !1,
|
|
358
|
+
selectState: C.Selected
|
|
359
|
+
};
|
|
360
|
+
case "open":
|
|
361
|
+
return { ...e, openDropdown: !0 };
|
|
362
|
+
case "close":
|
|
363
|
+
return { ...e, openDropdown: !1 };
|
|
364
|
+
case "open-close":
|
|
365
|
+
return { ...e, openDropdown: !e.openDropdown };
|
|
366
|
+
case "parent-update-selected":
|
|
367
|
+
return {
|
|
368
|
+
...e,
|
|
369
|
+
selectedItemIdx: t.value,
|
|
370
|
+
selectOptions: e.selectOptions.map((o, r) => ({
|
|
371
|
+
...o,
|
|
372
|
+
selected: r === t.value
|
|
373
|
+
}))
|
|
374
|
+
};
|
|
375
|
+
default:
|
|
376
|
+
return e;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
const je = ({
|
|
380
|
+
id: e,
|
|
381
|
+
title: t,
|
|
382
|
+
options: o,
|
|
383
|
+
selectedIdx: r = null,
|
|
384
|
+
w: i = 225,
|
|
385
|
+
doubleZero: s = !1,
|
|
386
|
+
required: a = !1,
|
|
387
|
+
dropdownHeightStyle: d = M.AutoHeight,
|
|
388
|
+
state: S = C.Default,
|
|
389
|
+
selectedValuesStyle: L = A.Text,
|
|
390
|
+
colorSet: g = oe.Primarys,
|
|
391
|
+
dropdownPosition: y = p.Bottom,
|
|
392
|
+
setSelectedIdx: h,
|
|
393
|
+
setInput: c
|
|
394
|
+
}) => {
|
|
395
|
+
const [w, Q] = Z(!1), [q, u] = ae(Te, {
|
|
396
|
+
selectState: S,
|
|
397
|
+
openDropdown: !1,
|
|
398
|
+
selectedItemIdx: r,
|
|
399
|
+
selectOptions: o
|
|
400
|
+
}), { openDropdown: b, selectedItemIdx: _, selectOptions: B, selectState: k } = q;
|
|
401
|
+
D(() => {
|
|
402
|
+
Q(!0), typeof r == "number" && (h && h(r), c && c((f) => ({ ...f, [e]: o[r] })));
|
|
403
|
+
}, []), D(() => {
|
|
404
|
+
typeof r == "number" && u({ type: "parent-update-selected", value: r });
|
|
405
|
+
}, [r]), D(() => {
|
|
406
|
+
a && w && !b && u(typeof _ == "number" && _ !== -1 ? {
|
|
407
|
+
type: "field",
|
|
408
|
+
field: "selectState",
|
|
409
|
+
value: C.Default
|
|
410
|
+
} : {
|
|
411
|
+
type: "field",
|
|
412
|
+
field: "selectState",
|
|
413
|
+
value: C.Error
|
|
414
|
+
});
|
|
415
|
+
}, [w, b, a, _]);
|
|
416
|
+
const P = (f, E) => {
|
|
417
|
+
u({ type: "select", value: E }), h && h(E), c && c((re) => ({
|
|
418
|
+
...re,
|
|
419
|
+
[f]: B[E]
|
|
420
|
+
}));
|
|
421
|
+
}, ee = le(() => {
|
|
422
|
+
u({ type: "close" });
|
|
423
|
+
}), [te, H] = V();
|
|
424
|
+
return (
|
|
425
|
+
// <div ref={nodeDOM}>
|
|
426
|
+
/* @__PURE__ */ I(
|
|
427
|
+
G,
|
|
428
|
+
{
|
|
429
|
+
ref: ee,
|
|
430
|
+
display: U.Flex,
|
|
431
|
+
flexDirection: se.Column,
|
|
432
|
+
style: { width: i, maxWidth: i },
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ n("div", { ref: te, children: /* @__PURE__ */ n(
|
|
435
|
+
Ce,
|
|
436
|
+
{
|
|
437
|
+
w: i,
|
|
438
|
+
setOpenDropdown: () => u({ type: "open-close" }),
|
|
439
|
+
selectState: k,
|
|
440
|
+
setSelectState: (f) => u({ type: "field", field: "selectState", value: f }),
|
|
441
|
+
openDropdown: b,
|
|
442
|
+
title: t,
|
|
443
|
+
doubleZero: s,
|
|
444
|
+
selectedValues: B.filter((f) => f.selected === !0),
|
|
445
|
+
selectedValueStyles: L,
|
|
446
|
+
options: o
|
|
447
|
+
}
|
|
448
|
+
) }),
|
|
449
|
+
/* @__PURE__ */ n(
|
|
450
|
+
we,
|
|
451
|
+
{
|
|
452
|
+
isSelectOpen: b,
|
|
453
|
+
closeSelect: () => u({ type: "close" }),
|
|
454
|
+
selectOptions: B,
|
|
455
|
+
handleSelectItem: P,
|
|
456
|
+
selectState: k,
|
|
457
|
+
dropdownHeightStyle: d,
|
|
458
|
+
dropdownPosition: y,
|
|
459
|
+
colorSet: g,
|
|
460
|
+
headerHeight: H.height,
|
|
461
|
+
w: H.width
|
|
462
|
+
}
|
|
463
|
+
)
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
);
|
|
468
|
+
};
|
|
469
|
+
export {
|
|
470
|
+
je as S
|
|
471
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";const r=require("react/jsx-runtime"),M=require("./component-B1mkowwk.cjs"),T=require("./generics-DE1oV0MV.cjs"),y=require("./classes-HsjFV5aN.cjs"),n=require("./types-DevrYOgX.cjs"),f=require("react"),F=require("./web-yC_cLoAC.cjs"),N=require("./useClickOutsideDOM-Dd6ewH8B.cjs"),_=require("./component-D-EEi7NI.cjs"),b=require("./component-Bh3EPTN0.cjs"),a=require("./generics-9F1CmKPb.cjs"),w=require("./react-spring_web.modern-W3Nkoq_6.cjs"),k=require("./component-D_igOAz3.cjs"),V=require("./component-BbvCmqLI.cjs"),h=require("./values-C40_Fyfk.cjs"),$=require("./UIcon-B5rpDmHC.cjs"),Z="_ul_5jv7w_1",G="_li_5jv7w_5",z={ul:Z,li:G},R={[n.DropdownPositions.Top]:{from:{y:-10},enter:{y:-1},leave:{y:-10}},[n.DropdownPositions.Bottom]:{from:{y:10},enter:{y:-1},leave:{y:10}}},J=({dropdownHeightStyle:e,isOpen:t,dropdownPosition:s,position:o,selectState:i,children:l})=>{switch(e){case n.DropdownHeightStyles.Default:return r.jsx(B,{dropdownHeightStyle:e,isOpen:t,dropdownPosition:s,position:o,selectState:i,children:l});case n.DropdownHeightStyles.AutoHeight:return r.jsx(X,{dropdownHeightStyle:e,isOpen:t,dropdownPosition:s,position:o,selectState:i,children:l});default:return r.jsx(B,{dropdownHeightStyle:e,isOpen:t,dropdownPosition:s,position:o,selectState:i,children:l})}},B=({isOpen:e,dropdownPosition:t,position:s,children:o})=>w.useTransition(e,{from:{opacity:0,...R[t].from},enter:{opacity:1,...R[t].enter},leave:{opacity:0,...R[t].leave}})((l,c)=>c&&r.jsx(k.F__Ul,{style:{...l,transformOrigin:t===n.DropdownPositions.Top?"bottom center":t===n.DropdownPositions.Bottom?"top center":s<0?"bottom center":"top center"},className:z.ul,children:o})),X=({isOpen:e,dropdownPosition:t,position:s,children:o})=>w.useTransition(e,{from:{opacity:0,scaleY:0},enter:{opacity:1,scaleY:1},leave:{opacity:0,scaleY:.5},config(l,c,d){return d==="leave"?{duration:100}:w.config.default}})((l,c)=>c&&r.jsx(k.F__Ul,{style:{...l,transformOrigin:t===n.DropdownPositions.Top?"bottom center":t===n.DropdownPositions.Bottom?"top center":s<0?"bottom center":"top center"},className:z.ul,children:o})),K=({handleSelectItem:e,id:t,idx:s,children:o,colorSet:i})=>{const[l,c]=w.useSpring(()=>({backgroundColor:h.COLOR_VALUES[T.ColorPalettes.Grey2]}));return r.jsx(V.F__Li,{className:z.li,paddingTop:a.Spacings.Size1,paddingBottom:a.Spacings.Size1,paddingLeft:a.Spacings.Size2,paddingRight:a.Spacings.Size2,marginTop:a.Spacings.Size0,style:{listStyle:"none",cursor:"pointer",userSelect:"none",...l},onMouseEnter:()=>{c.start({backgroundColor:h.COLOR_VALUES[h.ColorRanges[i][0]+2]})},onMouseLeave:()=>{c.start({backgroundColor:h.COLOR_VALUES[T.ColorPalettes.Grey2]})},onMouseDown:()=>{c.start({backgroundColor:h.COLOR_VALUES[h.ColorRanges[i][0]+3]})},onClick:()=>e(t,s),children:o})},Q=(e,t)=>{const[s,o]=f.useState(null);f.useEffect(()=>{const l=()=>{o({width:window?window.innerWidth:0,height:window?window.innerHeight:0})};return window&&window.addEventListener("resize",l),()=>{window&&window.removeEventListener("resize",l)}},[]);const i=e.height+10;return s&&i+e.top>s.height?-1:1},ee=({isSelectOpen:e,selectOptions:t,handleSelectItem:s,selectState:o,dropdownHeightStyle:i,dropdownPosition:l=n.DropdownPositions.Bottom,colorSet:c,headerHeight:d,w:m})=>{const[v,x]=F.useMeasure(),C=Q(x),g=C>0?d-1:-x.height;return r.jsx(_.Container,{ref:v,borderRadius:n.SELECT_STATES[o].dropdown.borderRadius,borderBottomLeftRadius:a.Radiuses.Size0,borderBottomRightRadius:a.Radiuses.Size0,borderWidth:n.SELECT_STATES[o].header.borderWidth,borderColor:n.SELECT_STATES[o].header.borderColor,style:{maxHeight:250,width:m,overflowY:"scroll",position:"absolute",transform:`translateY(${g}px)`,overscrollBehaviorY:"none"},children:r.jsx(J,{dropdownHeightStyle:i,isOpen:e,dropdownPosition:l,selectState:o,position:C,children:t.map((u,E)=>r.jsx(K,{handleSelectItem:s,id:u.id,idx:E,colorSet:c,children:r.jsx(_.Container,{paddingTop:a.Spacings.Size1,paddingBottom:a.Spacings.Size1,paddingLeft:a.Spacings.Size2,paddingRight:a.Spacings.Size2,children:r.jsx(b.Text_Span,{children:u.text})})},u.id))})})},te=({selectedValues:e,doubleZero:t,title:s,selectedValueStyles:o=n.SelectedValuesStyles.Text,sizes:i=n.SelectSizes.Medium})=>(e.length===1&&e[0].text,e.length<1?r.jsx(oe,{sizes:i,title:s}):o===n.SelectedValuesStyles.Text?r.jsx(r.Fragment,{children:e.map((l,c)=>r.jsx(b.Text_Span,{fontSize:n.SELECT_SIZES[i].font.size,children:l.text},c))}):r.jsx(r.Fragment,{children:e.map((l,c)=>r.jsx(b.Text_Span,{fontSize:n.SELECT_SIZES[i].font.size,children:l.text},c))})),oe=({title:e,sizes:t})=>r.jsx(b.Text_Span,{fontSize:n.SELECT_SIZES[t].font.size,children:e}),ne=({setOpenDropdown:e,openDropdown:t,title:s,doubleZero:o,selectState:i,selectedValues:l,selectedValueStyles:c,sizes:d=n.SelectSizes.Medium})=>r.jsx(_.Container,{style:{cursor:"pointer"},paddingTop:a.Spacings.Size1,paddingBottom:a.Spacings.Size1,paddingLeft:a.Spacings.Size2,paddingRight:a.Spacings.Size2,borderRadius:n.SELECT_STATES[i].header.borderRadius,borderWidth:n.SELECT_STATES[i].header.borderWidth,borderColor:n.SELECT_STATES[i].header.borderColor,borderTopLeftRadius:t?a.Radiuses.Size0:void 0,borderTopRightRadius:t?a.Radiuses.Size0:void 0,bgColor:n.SELECT_STATES[i].header.bgColor,onClick:()=>e(m=>!m),children:r.jsxs(M.Layout,{display:y.Displays.Flex,flexAlignItem:y.FlexAlignItems.Center,flexJustifyContent:y.FlexJustifyContents.SpaceBetween,children:[r.jsx(te,{sizes:d,selectedValues:l,doubleZero:o,title:s,selectedValueStyles:c}),r.jsx("div",{className:"icon",children:r.jsx(re,{isSelectOpen:t,sizes:d})})]})}),re=({isSelectOpen:e,sizes:t,cursor:s=a.Cursors.Pointer})=>{const o=w.useSpring({rotateX:e?180:0});return r.jsx(_.Container,{style:o,children:r.jsx($.UIcon,{name:"chevron-down",colorLight:T.ColorPalettes.Grey5,colorDark:T.ColorPalettes.Grey5,size:n.SELECT_SIZES[t].icon.size,cursor:s})})};function se(e,t){switch(t.type){case"field":return{...e,[t.field]:t.value};case"select":return{...e,selectedItemIdx:t.value,selectOptions:e.selectOptions.map((s,o)=>t.value===o?{...s,selected:!0}:{...s,selected:!1}),openDropdown:!1,selectState:n.SelectStates.Selected};case"open":return{...e,openDropdown:!0};case"close":return{...e,openDropdown:!1};case"open-close":return{...e,openDropdown:!e.openDropdown};case"parent-update-selected":return{...e,selectedItemIdx:t.value,selectOptions:e.selectOptions.map((s,o)=>({...s,selected:o===t.value}))};default:return e}}const ie=({id:e,title:t,options:s,selectedIdx:o=null,w:i=225,doubleZero:l=!1,required:c=!1,dropdownHeightStyle:d=n.DropdownHeightStyles.AutoHeight,state:m=n.SelectStates.Default,selectedValuesStyle:v=n.SelectedValuesStyles.Text,colorSet:x=T.ColorSets.Primarys,dropdownPosition:C=n.DropdownPositions.Bottom,setSelectedIdx:g,setInput:u})=>{const[E,H]=f.useState(!1),[I,p]=f.useReducer(se,{selectState:m,openDropdown:!1,selectedItemIdx:o,selectOptions:s}),{openDropdown:D,selectedItemIdx:L,selectOptions:j,selectState:A}=I;f.useEffect(()=>{H(!0),typeof o=="number"&&(g&&g(o),u&&u(S=>({...S,[e]:s[o]})))},[]),f.useEffect(()=>{typeof o=="number"&&p({type:"parent-update-selected",value:o})},[o]),f.useEffect(()=>{c&&E&&!D&&p(typeof L=="number"&&L!==-1?{type:"field",field:"selectState",value:n.SelectStates.Default}:{type:"field",field:"selectState",value:n.SelectStates.Error})},[E,D,c,L]);const P=(S,O)=>{p({type:"select",value:O}),g&&g(O),u&&u(Y=>({...Y,[S]:j[O]}))},W=N.useClickOutsideDOM(()=>{p({type:"close"})}),[U,q]=F.useMeasure();return r.jsxs(M.Layout,{ref:W,display:y.Displays.Flex,flexDirection:y.FlexDirections.Column,style:{width:i,maxWidth:i},children:[r.jsx("div",{ref:U,children:r.jsx(ne,{w:i,setOpenDropdown:()=>p({type:"open-close"}),selectState:A,setSelectState:S=>p({type:"field",field:"selectState",value:S}),openDropdown:D,title:t,doubleZero:l,selectedValues:j.filter(S=>S.selected===!0),selectedValueStyles:v,options:s})}),r.jsx(ee,{isSelectOpen:D,closeSelect:()=>p({type:"close"}),selectOptions:j,handleSelectItem:P,selectState:A,dropdownHeightStyle:d,dropdownPosition:C,colorSet:x,headerHeight:q.height,w:q.width})]})};exports.SelectSpring=ie;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),c=require("./react-spring_web.modern-W3Nkoq_6.cjs"),l=require("./component-D-EEi7NI.cjs"),r={horizontal:{from:{x:10},enter:{x:0},leave:{x:-10}},vertical:{from:{y:10},enter:{y:0},leave:{y:-10}},verticalInverted:{from:{y:-10},enter:{y:0},leave:{y:10}}},y=({direction:e,isShown:t=!0,children:i})=>{const o=c.useTransition(t,{from:{...r[e].from,opacity:0,display:"none"},enter:{...r[e].enter,opacity:1,display:"block"},leave:{...r[e].leave,opacity:0,display:"none"}});return n.jsx(n.Fragment,{children:o((a,s)=>s&&n.jsx(l.Container,{style:{...a,height:"inherit",width:"inherit",overflow:"hidden"},children:i}))})};exports.SpringEnter=y;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as t, Fragment as s } from "react/jsx-runtime";
|
|
2
|
+
import { d as m } from "./react-spring_web.modern-DUf5COpz.js";
|
|
3
|
+
import { C as y } from "./component-CGEZuC_0.js";
|
|
4
|
+
const r = {
|
|
5
|
+
horizontal: {
|
|
6
|
+
from: { x: 10 },
|
|
7
|
+
enter: { x: 0 },
|
|
8
|
+
leave: { x: -10 }
|
|
9
|
+
},
|
|
10
|
+
vertical: {
|
|
11
|
+
from: { y: 10 },
|
|
12
|
+
enter: { y: 0 },
|
|
13
|
+
leave: { y: -10 }
|
|
14
|
+
},
|
|
15
|
+
verticalInverted: {
|
|
16
|
+
from: { y: -10 },
|
|
17
|
+
enter: { y: 0 },
|
|
18
|
+
leave: { y: 10 }
|
|
19
|
+
}
|
|
20
|
+
}, v = ({ direction: e, isShown: n = !0, children: o }) => {
|
|
21
|
+
const i = m(n, {
|
|
22
|
+
from: { ...r[e].from, opacity: 0, display: "none" },
|
|
23
|
+
enter: { ...r[e].enter, opacity: 1, display: "block" },
|
|
24
|
+
leave: { ...r[e].leave, opacity: 0, display: "none" }
|
|
25
|
+
// delay: 150,
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ t(s, { children: i(
|
|
28
|
+
(a, l) => l && /* @__PURE__ */ t(
|
|
29
|
+
y,
|
|
30
|
+
{
|
|
31
|
+
style: {
|
|
32
|
+
...a,
|
|
33
|
+
height: "inherit",
|
|
34
|
+
width: "inherit",
|
|
35
|
+
overflow: "hidden"
|
|
36
|
+
},
|
|
37
|
+
children: o
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
) });
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
v as S
|
|
44
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { d as p } from "./react-spring_web.modern-
|
|
3
|
-
import { C as h } from "./component-
|
|
2
|
+
import { d as p } from "./react-spring_web.modern-DUf5COpz.js";
|
|
3
|
+
import { C as h } from "./component-CGEZuC_0.js";
|
|
4
4
|
const e = {
|
|
5
5
|
horizontal: {
|
|
6
6
|
from: (o) => ({ x: 10 * o }),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),c=require("./react-spring_web.modern-W3Nkoq_6.cjs"),u=require("./component-D-EEi7NI.cjs"),h=require("./generics-9F1CmKPb.cjs"),a=require("./web-yC_cLoAC.cjs"),d=({isOpen:e,children:n})=>{const[r,t]=a.useMeasure(),[o,s]=c.useSpring(()=>({opacity:0,height:0,width:0}));return s.start({opacity:e?1:0,height:e?t.height:0,width:e?t.width:0}),i.jsx(u.Container,{style:{position:"absolute",overflow:"hidden",...o},boxSizing:h.BoxSizings.BorderBox,children:i.jsx("div",{ref:r,style:{width:"max-content",height:"max-content",boxSizing:"border-box"},children:n})})};exports.SpringMenuTransition=d;
|