anysystem-design 0.0.5 → 0.0.6
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/Icon/Icon.js +5 -6
- package/dist/components/Selectbox/FormSelectbox.d.ts +8 -0
- package/dist/components/Selectbox/FormSelectbox.js +20 -0
- package/dist/components/Selectbox/SelectboxBase.js +148 -121
- package/dist/components/Selectbox/SelectboxMultiple.js +971 -945
- package/dist/components/Text/Text.js +7 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Suspense as e } from "react";
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
2
|
import { I as s } from "../../index-TmOGnUkt.js";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return /* @__PURE__ */
|
|
3
|
+
const m = ({ name: o, ...t }) => {
|
|
4
|
+
const n = s[o];
|
|
5
|
+
return /* @__PURE__ */ r(n, { ...t });
|
|
7
6
|
};
|
|
8
7
|
export {
|
|
9
|
-
|
|
8
|
+
m as default
|
|
10
9
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectboxProps, SelectboxHandler } from './Selectbox';
|
|
3
|
+
|
|
4
|
+
export type FormSelectboxProps = SelectboxProps & {
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: React.ForwardRefExoticComponent<FormSelectboxProps & React.RefAttributes<SelectboxHandler>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import m from "react";
|
|
3
|
+
import { u as a } from "../../formik.esm-CcTVNwxQ.js";
|
|
4
|
+
import c from "./Selectbox.js";
|
|
5
|
+
const l = ({ name: e, ...r }, t) => {
|
|
6
|
+
const [o] = a(e);
|
|
7
|
+
return /* @__PURE__ */ f(
|
|
8
|
+
c,
|
|
9
|
+
{
|
|
10
|
+
ref: t,
|
|
11
|
+
...o,
|
|
12
|
+
value: (o == null ? void 0 : o.value) || "",
|
|
13
|
+
...r,
|
|
14
|
+
name: e
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
}, i = m.forwardRef(l);
|
|
18
|
+
export {
|
|
19
|
+
i as default
|
|
20
|
+
};
|
|
@@ -1,155 +1,182 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { u as H, a as
|
|
1
|
+
import { jsxs as i, jsx as l, Fragment as p } from "react/jsx-runtime";
|
|
2
|
+
import g, { Fragment as j } from "react";
|
|
3
|
+
import { u as H, a as M, b as A, c as C, d as z, e as B, M as D, U as G, H as I, X as P, G as X, V as _, o as $, f as O, s as q, g as J } from "../../index-BSptVng4.js";
|
|
4
4
|
import { b as K } from "../../index-wvw0O1v3.js";
|
|
5
|
-
import { t as
|
|
6
|
-
import { getValue as
|
|
7
|
-
const Q = (s,
|
|
5
|
+
import { t as v } from "../../bundle-mjs-SHnj3fHy.js";
|
|
6
|
+
import { getValue as n } from "./helper.js";
|
|
7
|
+
const Q = (s, a) => a.type === "SETVALUE" ? {
|
|
8
8
|
...s,
|
|
9
|
-
value:
|
|
10
|
-
selected: s.list.find((
|
|
11
|
-
} :
|
|
9
|
+
value: a.value,
|
|
10
|
+
selected: s.list.find((o) => n(o, s.valueField) === a.value) || null
|
|
11
|
+
} : a.type === "SETSELECT" ? {
|
|
12
12
|
...s,
|
|
13
|
-
selected:
|
|
14
|
-
value:
|
|
13
|
+
selected: a.selected,
|
|
14
|
+
value: n(a.selected, s.valueField) + ""
|
|
15
15
|
} : s, W = ({
|
|
16
16
|
id: s,
|
|
17
|
-
name:
|
|
18
|
-
value:
|
|
19
|
-
options:
|
|
20
|
-
onChange:
|
|
21
|
-
placeholder:
|
|
17
|
+
name: a,
|
|
18
|
+
value: o,
|
|
19
|
+
options: f,
|
|
20
|
+
onChange: c,
|
|
21
|
+
placeholder: h = "Select a option",
|
|
22
22
|
valueField: d = "value"
|
|
23
23
|
}, w) => {
|
|
24
|
-
var
|
|
25
|
-
const [
|
|
26
|
-
list:
|
|
27
|
-
value:
|
|
24
|
+
var b;
|
|
25
|
+
const [t, m] = g.useReducer(Q, {
|
|
26
|
+
list: f,
|
|
27
|
+
value: o,
|
|
28
28
|
valueField: d,
|
|
29
|
-
selected:
|
|
30
|
-
}), { refs: y, x: E, y:
|
|
29
|
+
selected: f.find((e) => n(e, d) === o || "") || null
|
|
30
|
+
}), { refs: y, x: E, y: N, strategy: S, floatingStyles: F, context: u } = H({
|
|
31
31
|
open: !0,
|
|
32
32
|
middleware: [$(10), O(), q()],
|
|
33
33
|
whileElementsMounted: J,
|
|
34
34
|
placement: "bottom"
|
|
35
|
-
}), T =
|
|
35
|
+
}), T = M(u, { move: !1 }), U = A(u), V = C(u), R = z(u, { role: "tooltip" }), { getReferenceProps: k, getFloatingProps: L } = B([
|
|
36
36
|
T,
|
|
37
|
-
R,
|
|
38
37
|
U,
|
|
39
|
-
V
|
|
38
|
+
V,
|
|
39
|
+
R
|
|
40
40
|
]);
|
|
41
|
-
return
|
|
41
|
+
return g.useImperativeHandle(w, () => ({
|
|
42
42
|
setValue: (e) => {
|
|
43
|
-
|
|
43
|
+
m({
|
|
44
44
|
type: "SETVALUE",
|
|
45
45
|
value: e + ""
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
})), /* @__PURE__ */
|
|
48
|
+
})), /* @__PURE__ */ i(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
|
-
className:
|
|
51
|
+
className: v(
|
|
52
52
|
"form-control relative inline-block text-left",
|
|
53
|
-
!
|
|
53
|
+
!t.value && "text-gray-300"
|
|
54
54
|
//empty
|
|
55
55
|
),
|
|
56
|
-
children:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/* @__PURE__ */ u(G, { className: "relative z-10 inline-flex w-full justify-between !p-0 focus:outline-none", children: [
|
|
72
|
-
/* @__PURE__ */ t("span", { children: a.value ? /* @__PURE__ */ t(f, { children: ((h = a.selected) == null ? void 0 : h.label) || "" }) : x }),
|
|
73
|
-
/* @__PURE__ */ t(
|
|
74
|
-
I,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ i(
|
|
58
|
+
"select",
|
|
59
|
+
{
|
|
60
|
+
className: "w-full bg-transparent outline-0 md:hidden",
|
|
61
|
+
onChange: (e) => {
|
|
62
|
+
m({
|
|
63
|
+
type: "SETVALUE",
|
|
64
|
+
value: e.target.value
|
|
65
|
+
}), c && c(e.target.value);
|
|
66
|
+
},
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ l("option", { value: "", children: h }),
|
|
69
|
+
t.list.map((e) => /* @__PURE__ */ l(
|
|
70
|
+
"option",
|
|
75
71
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
value: n(e, d),
|
|
73
|
+
disabled: e.enable === !1,
|
|
74
|
+
children: e.label
|
|
75
|
+
},
|
|
76
|
+
e.id
|
|
77
|
+
))
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ i(
|
|
82
|
+
D,
|
|
83
|
+
{
|
|
84
|
+
className: "hidden md:flex",
|
|
85
|
+
as: "div",
|
|
86
|
+
value: t.selected,
|
|
87
|
+
onChange: (e) => {
|
|
88
|
+
const r = n(e, d);
|
|
89
|
+
m({
|
|
90
|
+
type: "SETSELECT",
|
|
91
|
+
selected: e
|
|
92
|
+
}), c && c(r);
|
|
93
|
+
},
|
|
94
|
+
ref: y.setReference,
|
|
95
|
+
...k(),
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ i(G, { className: "relative z-10 inline-flex w-full justify-between !p-0 focus:outline-none", children: [
|
|
98
|
+
/* @__PURE__ */ l("span", { children: t.value ? /* @__PURE__ */ l(p, { children: ((b = t.selected) == null ? void 0 : b.label) || "" }) : h }),
|
|
99
|
+
/* @__PURE__ */ l(
|
|
100
|
+
I,
|
|
93
101
|
{
|
|
94
|
-
className: "
|
|
95
|
-
|
|
96
|
-
style: N,
|
|
97
|
-
...j({
|
|
98
|
-
style: {
|
|
99
|
-
position: S,
|
|
100
|
-
top: F ?? "",
|
|
101
|
-
left: E ?? ""
|
|
102
|
-
}
|
|
103
|
-
}),
|
|
104
|
-
children: /* @__PURE__ */ t("div", { className: "flex flex-col px-1 py-1", children: a.list.map((e) => {
|
|
105
|
-
var r, b;
|
|
106
|
-
return /* @__PURE__ */ t(
|
|
107
|
-
_,
|
|
108
|
-
{
|
|
109
|
-
className: m(
|
|
110
|
-
"relative flex cursor-pointer select-none justify-between px-5 py-4 text-black hover:bg-indigo-100",
|
|
111
|
-
e.enable === !1 && "cursor-not-allowed opacity-50",
|
|
112
|
-
((r = a.selected) == null ? void 0 : r.id) === e.id && "bg-indigo-100"
|
|
113
|
-
),
|
|
114
|
-
value: e,
|
|
115
|
-
disabled: e.enable === !1,
|
|
116
|
-
children: /* @__PURE__ */ u(f, { children: [
|
|
117
|
-
/* @__PURE__ */ t("span", { className: "pl-5", children: e.label }),
|
|
118
|
-
((b = a.selected) == null ? void 0 : b.id) === e.id ? /* @__PURE__ */ t(
|
|
119
|
-
"span",
|
|
120
|
-
{
|
|
121
|
-
className: m(
|
|
122
|
-
"absolute inset-y-0 left-0 flex items-center pl-3 text-indigo-600"
|
|
123
|
-
),
|
|
124
|
-
children: /* @__PURE__ */ t(K, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
125
|
-
}
|
|
126
|
-
) : /* @__PURE__ */ t(f, {})
|
|
127
|
-
] })
|
|
128
|
-
},
|
|
129
|
-
e.id
|
|
130
|
-
);
|
|
131
|
-
}) })
|
|
102
|
+
className: "h-5 w-5 text-gray-400",
|
|
103
|
+
"aria-hidden": "true"
|
|
132
104
|
}
|
|
133
105
|
)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ l(
|
|
108
|
+
P,
|
|
109
|
+
{
|
|
110
|
+
as: j,
|
|
111
|
+
enter: "transition duration-100 ease-out",
|
|
112
|
+
enterFrom: "scale-95 transform opacity-0",
|
|
113
|
+
enterTo: "scale-100 transform opacity-100",
|
|
114
|
+
leave: "transition duration-75 ease-in",
|
|
115
|
+
leaveFrom: "scale-100 transform opacity-100",
|
|
116
|
+
leaveTo: "scale-95 transform opacity-0",
|
|
117
|
+
children: /* @__PURE__ */ l(
|
|
118
|
+
X,
|
|
119
|
+
{
|
|
120
|
+
className: "absolute !z-[999] mt-2 inline-block w-full origin-top-right divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",
|
|
121
|
+
ref: y.setFloating,
|
|
122
|
+
style: F,
|
|
123
|
+
...L({
|
|
124
|
+
style: {
|
|
125
|
+
position: S,
|
|
126
|
+
top: N ?? "",
|
|
127
|
+
left: E ?? ""
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
children: /* @__PURE__ */ l("div", { className: "flex flex-col px-1 py-1", children: t.list.map((e) => {
|
|
131
|
+
var r, x;
|
|
132
|
+
return /* @__PURE__ */ l(
|
|
133
|
+
_,
|
|
134
|
+
{
|
|
135
|
+
className: v(
|
|
136
|
+
"relative flex cursor-pointer select-none justify-between px-5 py-4 text-black hover:bg-indigo-100",
|
|
137
|
+
e.enable === !1 && "cursor-not-allowed opacity-50",
|
|
138
|
+
((r = t.selected) == null ? void 0 : r.id) === e.id && "bg-indigo-100"
|
|
139
|
+
),
|
|
140
|
+
value: e,
|
|
141
|
+
disabled: e.enable === !1,
|
|
142
|
+
children: /* @__PURE__ */ i(p, { children: [
|
|
143
|
+
/* @__PURE__ */ l("span", { className: "pl-5", children: e.label }),
|
|
144
|
+
((x = t.selected) == null ? void 0 : x.id) === e.id ? /* @__PURE__ */ l(
|
|
145
|
+
"span",
|
|
146
|
+
{
|
|
147
|
+
className: v(
|
|
148
|
+
"absolute inset-y-0 left-0 flex items-center pl-3 text-indigo-600"
|
|
149
|
+
),
|
|
150
|
+
children: /* @__PURE__ */ l(K, { className: "h-5 w-5", "aria-hidden": "true" })
|
|
151
|
+
}
|
|
152
|
+
) : /* @__PURE__ */ l(p, {})
|
|
153
|
+
] })
|
|
154
|
+
},
|
|
155
|
+
e.id
|
|
156
|
+
);
|
|
157
|
+
}) })
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
/* @__PURE__ */ l(
|
|
166
|
+
"input",
|
|
167
|
+
{
|
|
168
|
+
type: "text",
|
|
169
|
+
id: s,
|
|
170
|
+
name: a,
|
|
171
|
+
style: { display: "none" },
|
|
172
|
+
value: t.value + "",
|
|
173
|
+
readOnly: !0
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
]
|
|
150
177
|
}
|
|
151
178
|
);
|
|
152
|
-
}, ae =
|
|
179
|
+
}, ae = g.forwardRef(W);
|
|
153
180
|
export {
|
|
154
181
|
ae as default
|
|
155
182
|
};
|