@apexcura/ui-components 0.0.9-Beta3 → 0.0.9-Beta5
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 +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +6 -8
- package/dist/index.mjs +6 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -17,10 +17,7 @@ type ElementType = {
|
|
|
17
17
|
suffix?: React.ReactNode;
|
|
18
18
|
maxLength?: number;
|
|
19
19
|
fieldNames?: any[];
|
|
20
|
-
onChange?: (value: string | number | boolean | any[]
|
|
21
|
-
id: string;
|
|
22
|
-
title: string;
|
|
23
|
-
}[]) => void;
|
|
20
|
+
onChange?: (value: string | number | boolean | any[]) => void;
|
|
24
21
|
dropDownOptions: any[];
|
|
25
22
|
};
|
|
26
23
|
|
package/dist/index.d.ts
CHANGED
|
@@ -17,10 +17,7 @@ type ElementType = {
|
|
|
17
17
|
suffix?: React.ReactNode;
|
|
18
18
|
maxLength?: number;
|
|
19
19
|
fieldNames?: any[];
|
|
20
|
-
onChange?: (value: string | number | boolean | any[]
|
|
21
|
-
id: string;
|
|
22
|
-
title: string;
|
|
23
|
-
}[]) => void;
|
|
20
|
+
onChange?: (value: string | number | boolean | any[]) => void;
|
|
24
21
|
dropDownOptions: any[];
|
|
25
22
|
};
|
|
26
23
|
|
package/dist/index.js
CHANGED
|
@@ -325,15 +325,13 @@ 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 = (
|
|
329
|
-
const transformedValues = selectedValues.map((option) => ({
|
|
330
|
-
id: option.id,
|
|
331
|
-
value: option.title
|
|
332
|
-
}));
|
|
333
|
-
console.log("transformedValues", transformedValues);
|
|
328
|
+
const handleChange = (values) => {
|
|
334
329
|
if (props.onChange) {
|
|
335
|
-
|
|
336
|
-
|
|
330
|
+
const selectedOptions = values.map((value) => {
|
|
331
|
+
const option = props.dropDownOptions.find((option2) => String(option2.title) === value);
|
|
332
|
+
return { id: option?.id, value };
|
|
333
|
+
});
|
|
334
|
+
props.onChange(selectedOptions);
|
|
337
335
|
}
|
|
338
336
|
};
|
|
339
337
|
return /* @__PURE__ */ import_react11.default.createElement(
|
package/dist/index.mjs
CHANGED
|
@@ -279,15 +279,13 @@ 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 = (
|
|
283
|
-
const transformedValues = selectedValues.map((option) => ({
|
|
284
|
-
id: option.id,
|
|
285
|
-
value: option.title
|
|
286
|
-
}));
|
|
287
|
-
console.log("transformedValues", transformedValues);
|
|
282
|
+
const handleChange = (values) => {
|
|
288
283
|
if (props.onChange) {
|
|
289
|
-
|
|
290
|
-
|
|
284
|
+
const selectedOptions = values.map((value) => {
|
|
285
|
+
const option = props.dropDownOptions.find((option2) => String(option2.title) === value);
|
|
286
|
+
return { id: option?.id, value };
|
|
287
|
+
});
|
|
288
|
+
props.onChange(selectedOptions);
|
|
291
289
|
}
|
|
292
290
|
};
|
|
293
291
|
return /* @__PURE__ */ React10.createElement(
|