@conboai/storybook.components 0.2.94 → 0.2.96
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.
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { IChipsMultiSelect } from '../../interfaces/chipsMultiSelect';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
export interface IChipsMultiSelect {
|
|
4
|
+
options: string[];
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | string[];
|
|
7
|
+
onChange: (value: string | string[]) => void;
|
|
8
|
+
size?: "small" | "medium";
|
|
9
|
+
isSingle?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function ChipsMultiSelect({ options, label, value, onChange, size, isSingle }: IChipsMultiSelect): React.JSX.Element;
|
|
5
12
|
export default ChipsMultiSelect;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export interface IChipsMultiSelect {
|
|
2
2
|
options: string[];
|
|
3
3
|
label: string;
|
|
4
|
-
value: string[];
|
|
4
|
+
value: string | string[];
|
|
5
|
+
onChange: (value: string | string[]) => void;
|
|
5
6
|
size?: "small" | "medium";
|
|
6
|
-
|
|
7
|
+
isSingle?: boolean;
|
|
7
8
|
}
|
|
@@ -46228,31 +46228,47 @@ function cre({
|
|
|
46228
46228
|
label: e,
|
|
46229
46229
|
value: n,
|
|
46230
46230
|
onChange: r,
|
|
46231
|
-
size: i = "small"
|
|
46231
|
+
size: i = "small",
|
|
46232
|
+
isSingle: o = !1
|
|
46232
46233
|
}) {
|
|
46233
|
-
const
|
|
46234
|
+
const s = (u) => {
|
|
46234
46235
|
const {
|
|
46235
|
-
target: { value:
|
|
46236
|
-
} =
|
|
46237
|
-
|
|
46238
|
-
|
|
46236
|
+
target: { value: d }
|
|
46237
|
+
} = u;
|
|
46238
|
+
let h;
|
|
46239
|
+
typeof d == "string" ? h = d.split(",") : h = d, !(o && h.length > 1) && (r(h), console.log("value", h));
|
|
46240
|
+
}, l = (u) => (typeof u == "string" && (u = [u]), /* @__PURE__ */ te.jsx(It, { sx: AK, children: u.map((d) => /* @__PURE__ */ te.jsx(
|
|
46241
|
+
Jc,
|
|
46242
|
+
{
|
|
46243
|
+
label: d,
|
|
46244
|
+
sx: o ? {
|
|
46245
|
+
backgroundColor: "transparent",
|
|
46246
|
+
border: "none",
|
|
46247
|
+
height: "1.5em",
|
|
46248
|
+
lineHeight: "1.5em",
|
|
46249
|
+
padding: "0",
|
|
46250
|
+
fontSize: "inherit"
|
|
46251
|
+
} : {}
|
|
46252
|
+
},
|
|
46253
|
+
d
|
|
46254
|
+
)) })), c = {
|
|
46239
46255
|
small: "small",
|
|
46240
46256
|
medium: "normal"
|
|
46241
46257
|
};
|
|
46242
46258
|
return /* @__PURE__ */ te.jsxs(yl, { fullWidth: !0, children: [
|
|
46243
|
-
/* @__PURE__ */ te.jsx(Ws, { sx: eL, size:
|
|
46259
|
+
/* @__PURE__ */ te.jsx(Ws, { sx: eL, size: c[i], children: e }),
|
|
46244
46260
|
/* @__PURE__ */ te.jsx(
|
|
46245
46261
|
ea,
|
|
46246
46262
|
{
|
|
46247
46263
|
input: /* @__PURE__ */ te.jsx(tu, { label: e }),
|
|
46248
46264
|
multiple: !0,
|
|
46249
46265
|
value: n,
|
|
46250
|
-
onChange:
|
|
46266
|
+
onChange: s,
|
|
46251
46267
|
fullWidth: !0,
|
|
46252
46268
|
size: i,
|
|
46253
|
-
renderValue:
|
|
46269
|
+
renderValue: l,
|
|
46254
46270
|
sx: Jk,
|
|
46255
|
-
children: t.map((
|
|
46271
|
+
children: t.map((u) => /* @__PURE__ */ te.jsx(Js, { value: u, children: u }, u))
|
|
46256
46272
|
}
|
|
46257
46273
|
)
|
|
46258
46274
|
] });
|