@apexcura/ui-components 0.0.9-Beta14 → 0.0.9-Beta3
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/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +9 -3
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -17,7 +17,10 @@ type ElementType = {
|
|
|
17
17
|
suffix?: React.ReactNode;
|
|
18
18
|
maxLength?: number;
|
|
19
19
|
fieldNames?: any[];
|
|
20
|
-
onChange?: (value: string | number | boolean | any[]
|
|
20
|
+
onChange?: (value: string | number | boolean | any[] | {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}[]) => void;
|
|
21
24
|
dropDownOptions: any[];
|
|
22
25
|
};
|
|
23
26
|
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,10 @@ type ElementType = {
|
|
|
17
17
|
suffix?: React.ReactNode;
|
|
18
18
|
maxLength?: number;
|
|
19
19
|
fieldNames?: any[];
|
|
20
|
-
onChange?: (value: string | number | boolean | any[]
|
|
20
|
+
onChange?: (value: string | number | boolean | any[] | {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}[]) => void;
|
|
21
24
|
dropDownOptions: any[];
|
|
22
25
|
};
|
|
23
26
|
|
package/dist/index.js
CHANGED
|
@@ -325,9 +325,15 @@ var SingleSelectElement = (props) => {
|
|
|
325
325
|
var import_react11 = __toESM(require("react"));
|
|
326
326
|
var import_antd9 = require("antd");
|
|
327
327
|
var MultipleSelectElement = (props) => {
|
|
328
|
-
const handleChange = (
|
|
328
|
+
const handleChange = (selectedValues) => {
|
|
329
|
+
const transformedValues = selectedValues.map((option) => ({
|
|
330
|
+
id: option.id,
|
|
331
|
+
value: option.title
|
|
332
|
+
}));
|
|
333
|
+
console.log("transformedValues", transformedValues);
|
|
329
334
|
if (props.onChange) {
|
|
330
|
-
|
|
335
|
+
console.log(transformedValues);
|
|
336
|
+
props.onChange(transformedValues);
|
|
331
337
|
}
|
|
332
338
|
};
|
|
333
339
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
@@ -336,7 +342,7 @@ var MultipleSelectElement = (props) => {
|
|
|
336
342
|
mode: "multiple",
|
|
337
343
|
placeholder: props.placeholder,
|
|
338
344
|
onChange: handleChange,
|
|
339
|
-
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
|
|
345
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
340
346
|
}
|
|
341
347
|
);
|
|
342
348
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -279,9 +279,15 @@ var SingleSelectElement = (props) => {
|
|
|
279
279
|
import React10 from "react";
|
|
280
280
|
import { Select as Select3 } from "antd";
|
|
281
281
|
var MultipleSelectElement = (props) => {
|
|
282
|
-
const handleChange = (
|
|
282
|
+
const handleChange = (selectedValues) => {
|
|
283
|
+
const transformedValues = selectedValues.map((option) => ({
|
|
284
|
+
id: option.id,
|
|
285
|
+
value: option.title
|
|
286
|
+
}));
|
|
287
|
+
console.log("transformedValues", transformedValues);
|
|
283
288
|
if (props.onChange) {
|
|
284
|
-
|
|
289
|
+
console.log(transformedValues);
|
|
290
|
+
props.onChange(transformedValues);
|
|
285
291
|
}
|
|
286
292
|
};
|
|
287
293
|
return /* @__PURE__ */ React10.createElement(
|
|
@@ -290,7 +296,7 @@ var MultipleSelectElement = (props) => {
|
|
|
290
296
|
mode: "multiple",
|
|
291
297
|
placeholder: props.placeholder,
|
|
292
298
|
onChange: handleChange,
|
|
293
|
-
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
|
|
299
|
+
options: props.dropDownOptions?.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title), id: String(eachOption.id) }))
|
|
294
300
|
}
|
|
295
301
|
);
|
|
296
302
|
};
|