@apexcura/ui-components 0.0.8-Beta7 → 0.0.8-Beta9

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 CHANGED
@@ -18,7 +18,7 @@ type ElementType = {
18
18
  maxLength?: number;
19
19
  fieldNames?: any[];
20
20
  onChange?: (value: string | number | boolean | any[]) => void;
21
- options: any[];
21
+ dropDownOptions: any[];
22
22
  };
23
23
 
24
24
  interface ElementExecuterProps$3 extends ElementType {
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ type ElementType = {
18
18
  maxLength?: number;
19
19
  fieldNames?: any[];
20
20
  onChange?: (value: string | number | boolean | any[]) => void;
21
- options: any[];
21
+ dropDownOptions: any[];
22
22
  };
23
23
 
24
24
  interface ElementExecuterProps$3 extends ElementType {
package/dist/index.js CHANGED
@@ -159,7 +159,7 @@ var labelRender = (props) => {
159
159
  return /* @__PURE__ */ import_react5.default.createElement("span", null, "select gender");
160
160
  };
161
161
  var SelectElement = (props) => {
162
- const handleChange2 = (value) => {
162
+ const handleChange = (value) => {
163
163
  if (props.onChange) {
164
164
  props.onChange(value);
165
165
  }
@@ -178,7 +178,7 @@ var SelectElement = (props) => {
178
178
  style: props.styles,
179
179
  className: props.classNames,
180
180
  variant: props.variant,
181
- onChange: handleChange2
181
+ onChange: handleChange
182
182
  }
183
183
  );
184
184
  };
@@ -187,12 +187,12 @@ var SelectElement = (props) => {
187
187
  var import_react6 = __toESM(require("react"));
188
188
  var import_antd6 = require("antd");
189
189
  var RadioElement = (props) => {
190
- const handleChange2 = (e) => {
190
+ const handleChange = (e) => {
191
191
  if (props && props.onChange) {
192
192
  props.onChange(e.target.value);
193
193
  }
194
194
  };
195
- return /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 1, onChange: handleChange2 }, "A"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 2, onChange: handleChange2 }, "B"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 3, onChange: handleChange2 }, "C"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 4, onChange: handleChange2 }, "D"));
195
+ return /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 1, onChange: handleChange }, "A"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 2, onChange: handleChange }, "B"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 3, onChange: handleChange }, "C"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 4, onChange: handleChange }, "D"));
196
196
  };
197
197
 
198
198
  // src/Components/Checkbox.tsx
@@ -204,7 +204,7 @@ var defaultCheckedList = [];
204
204
  var CheckboxElement = (props) => {
205
205
  const [checkedList, setCheckedList] = (0, import_react7.useState)(defaultCheckedList);
206
206
  const checkAll = plainOptions.length === checkedList.length;
207
- const handleChange2 = (list) => {
207
+ const handleChange = (list) => {
208
208
  setCheckedList(list);
209
209
  if (props.onChange) {
210
210
  props.onChange(list);
@@ -236,7 +236,7 @@ var CheckboxElement = (props) => {
236
236
  className: props.classNames,
237
237
  options: plainOptions,
238
238
  value: checkedList,
239
- onChange: handleChange2
239
+ onChange: handleChange
240
240
  }
241
241
  ));
242
242
  };
@@ -302,7 +302,7 @@ var onSearch = (value) => {
302
302
  };
303
303
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
304
304
  var SingleSelectElement = (props) => {
305
- const handleChange2 = (value) => {
305
+ const handleChange = (value) => {
306
306
  if (props.onChange) {
307
307
  props.onChange(value);
308
308
  }
@@ -313,10 +313,10 @@ var SingleSelectElement = (props) => {
313
313
  showSearch: true,
314
314
  placeholder: props.placeholder,
315
315
  optionFilterProp: "children",
316
- onChange: handleChange2,
316
+ onChange: handleChange,
317
317
  onSearch,
318
318
  filterOption,
319
- options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
319
+ options: props.dropDownOptions.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
320
320
  }
321
321
  );
322
322
  };
@@ -324,20 +324,22 @@ var SingleSelectElement = (props) => {
324
324
  // src/Components/Select/MultipleSelectElement.tsx
325
325
  var import_react11 = __toESM(require("react"));
326
326
  var import_antd9 = require("antd");
327
- var handleChange = (value) => {
328
- console.log(`selected ${value}`);
327
+ var MultipleSelectElement = (props) => {
328
+ const handleChange = (value) => {
329
+ if (props.onChange) {
330
+ props.onChange(value);
331
+ }
332
+ };
333
+ return /* @__PURE__ */ import_react11.default.createElement(
334
+ import_antd9.Select,
335
+ {
336
+ mode: "multiple",
337
+ placeholder: props.placeholder,
338
+ onChange: handleChange,
339
+ options: props.dropDownOptions.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
340
+ }
341
+ );
329
342
  };
330
- var MultipleSelectElement = (props) => /* @__PURE__ */ import_react11.default.createElement(
331
- import_antd9.Select,
332
- {
333
- mode: "multiple",
334
- style: { width: "100%" },
335
- placeholder: "select one country",
336
- defaultValue: ["china"],
337
- onChange: handleChange,
338
- options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
339
- }
340
- );
341
343
 
342
344
  // src/Components/Button.tsx
343
345
  var import_react12 = __toESM(require("react"));
package/dist/index.mjs CHANGED
@@ -113,7 +113,7 @@ var labelRender = (props) => {
113
113
  return /* @__PURE__ */ React5.createElement("span", null, "select gender");
114
114
  };
115
115
  var SelectElement = (props) => {
116
- const handleChange2 = (value) => {
116
+ const handleChange = (value) => {
117
117
  if (props.onChange) {
118
118
  props.onChange(value);
119
119
  }
@@ -132,7 +132,7 @@ var SelectElement = (props) => {
132
132
  style: props.styles,
133
133
  className: props.classNames,
134
134
  variant: props.variant,
135
- onChange: handleChange2
135
+ onChange: handleChange
136
136
  }
137
137
  );
138
138
  };
@@ -141,12 +141,12 @@ var SelectElement = (props) => {
141
141
  import React6 from "react";
142
142
  import { Radio } from "antd";
143
143
  var RadioElement = (props) => {
144
- const handleChange2 = (e) => {
144
+ const handleChange = (e) => {
145
145
  if (props && props.onChange) {
146
146
  props.onChange(e.target.value);
147
147
  }
148
148
  };
149
- return /* @__PURE__ */ React6.createElement(Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ React6.createElement(Radio, { value: 1, onChange: handleChange2 }, "A"), /* @__PURE__ */ React6.createElement(Radio, { value: 2, onChange: handleChange2 }, "B"), /* @__PURE__ */ React6.createElement(Radio, { value: 3, onChange: handleChange2 }, "C"), /* @__PURE__ */ React6.createElement(Radio, { value: 4, onChange: handleChange2 }, "D"));
149
+ return /* @__PURE__ */ React6.createElement(Radio.Group, { name: "radiogroup", defaultValue: 1 }, /* @__PURE__ */ React6.createElement(Radio, { value: 1, onChange: handleChange }, "A"), /* @__PURE__ */ React6.createElement(Radio, { value: 2, onChange: handleChange }, "B"), /* @__PURE__ */ React6.createElement(Radio, { value: 3, onChange: handleChange }, "C"), /* @__PURE__ */ React6.createElement(Radio, { value: 4, onChange: handleChange }, "D"));
150
150
  };
151
151
 
152
152
  // src/Components/Checkbox.tsx
@@ -158,7 +158,7 @@ var defaultCheckedList = [];
158
158
  var CheckboxElement = (props) => {
159
159
  const [checkedList, setCheckedList] = useState2(defaultCheckedList);
160
160
  const checkAll = plainOptions.length === checkedList.length;
161
- const handleChange2 = (list) => {
161
+ const handleChange = (list) => {
162
162
  setCheckedList(list);
163
163
  if (props.onChange) {
164
164
  props.onChange(list);
@@ -190,7 +190,7 @@ var CheckboxElement = (props) => {
190
190
  className: props.classNames,
191
191
  options: plainOptions,
192
192
  value: checkedList,
193
- onChange: handleChange2
193
+ onChange: handleChange
194
194
  }
195
195
  ));
196
196
  };
@@ -256,7 +256,7 @@ var onSearch = (value) => {
256
256
  };
257
257
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
258
258
  var SingleSelectElement = (props) => {
259
- const handleChange2 = (value) => {
259
+ const handleChange = (value) => {
260
260
  if (props.onChange) {
261
261
  props.onChange(value);
262
262
  }
@@ -267,10 +267,10 @@ var SingleSelectElement = (props) => {
267
267
  showSearch: true,
268
268
  placeholder: props.placeholder,
269
269
  optionFilterProp: "children",
270
- onChange: handleChange2,
270
+ onChange: handleChange,
271
271
  onSearch,
272
272
  filterOption,
273
- options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
273
+ options: props.dropDownOptions.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
274
274
  }
275
275
  );
276
276
  };
@@ -278,20 +278,22 @@ var SingleSelectElement = (props) => {
278
278
  // src/Components/Select/MultipleSelectElement.tsx
279
279
  import React10 from "react";
280
280
  import { Select as Select3 } from "antd";
281
- var handleChange = (value) => {
282
- console.log(`selected ${value}`);
281
+ var MultipleSelectElement = (props) => {
282
+ const handleChange = (value) => {
283
+ if (props.onChange) {
284
+ props.onChange(value);
285
+ }
286
+ };
287
+ return /* @__PURE__ */ React10.createElement(
288
+ Select3,
289
+ {
290
+ mode: "multiple",
291
+ placeholder: props.placeholder,
292
+ onChange: handleChange,
293
+ options: props.dropDownOptions.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
294
+ }
295
+ );
283
296
  };
284
- var MultipleSelectElement = (props) => /* @__PURE__ */ React10.createElement(
285
- Select3,
286
- {
287
- mode: "multiple",
288
- style: { width: "100%" },
289
- placeholder: "select one country",
290
- defaultValue: ["china"],
291
- onChange: handleChange,
292
- options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
293
- }
294
- );
295
297
 
296
298
  // src/Components/Button.tsx
297
299
  import React11 from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.8-Beta7",
3
+ "version": "0.0.8-Beta9",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",