@apexcura/ui-components 0.0.8-Beta4 → 0.0.8-Beta6

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.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 handleChange3 = (value) => {
162
+ const handleChange2 = (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: handleChange3
181
+ onChange: handleChange2
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 handleChange3 = (e) => {
190
+ const handleChange2 = (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: handleChange3 }, "A"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 2, onChange: handleChange3 }, "B"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 3, onChange: handleChange3 }, "C"), /* @__PURE__ */ import_react6.default.createElement(import_antd6.Radio, { value: 4, onChange: handleChange3 }, "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: 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"));
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 handleChange3 = (list) => {
207
+ const handleChange2 = (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: handleChange3
239
+ onChange: handleChange2
240
240
  }
241
241
  ));
242
242
  };
@@ -301,20 +301,22 @@ var onSearch = (value) => {
301
301
  console.log("search:", value);
302
302
  };
303
303
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
304
- var handleChange = () => {
305
- };
306
304
  var SingleSelectElement = (props) => {
307
- console.log("passedprops.................", props.options);
305
+ const handleChange2 = (value) => {
306
+ if (props.onChange) {
307
+ props.onChange(value);
308
+ }
309
+ };
308
310
  return /* @__PURE__ */ import_react10.default.createElement(
309
311
  import_antd8.Select,
310
312
  {
311
313
  showSearch: true,
312
314
  placeholder: props.placeholder,
313
315
  optionFilterProp: "children",
314
- onChange: handleChange,
316
+ onChange: handleChange2,
315
317
  onSearch,
316
318
  filterOption,
317
- options: props.options
319
+ options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
318
320
  }
319
321
  );
320
322
  };
@@ -322,7 +324,7 @@ var SingleSelectElement = (props) => {
322
324
  // src/Components/Select/MultipleSelectElement.tsx
323
325
  var import_react11 = __toESM(require("react"));
324
326
  var import_antd9 = require("antd");
325
- var handleChange2 = (value) => {
327
+ var handleChange = (value) => {
326
328
  console.log(`selected ${value}`);
327
329
  };
328
330
  var options = [
@@ -359,7 +361,7 @@ var MultipleSelectElement = () => {
359
361
  style: { width: "100%" },
360
362
  placeholder: "select one country",
361
363
  defaultValue: ["china"],
362
- onChange: handleChange2,
364
+ onChange: handleChange,
363
365
  options,
364
366
  optionRender: (option) => /* @__PURE__ */ import_react11.default.createElement(import_antd9.Space, null, /* @__PURE__ */ import_react11.default.createElement("span", { role: "img", "aria-label": option.data.label }, option.data.emoji), option.data.desc)
365
367
  }
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 handleChange3 = (value) => {
116
+ const handleChange2 = (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: handleChange3
135
+ onChange: handleChange2
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 handleChange3 = (e) => {
144
+ const handleChange2 = (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: handleChange3 }, "A"), /* @__PURE__ */ React6.createElement(Radio, { value: 2, onChange: handleChange3 }, "B"), /* @__PURE__ */ React6.createElement(Radio, { value: 3, onChange: handleChange3 }, "C"), /* @__PURE__ */ React6.createElement(Radio, { value: 4, onChange: handleChange3 }, "D"));
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"));
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 handleChange3 = (list) => {
161
+ const handleChange2 = (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: handleChange3
193
+ onChange: handleChange2
194
194
  }
195
195
  ));
196
196
  };
@@ -255,20 +255,22 @@ var onSearch = (value) => {
255
255
  console.log("search:", value);
256
256
  };
257
257
  var filterOption = (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase());
258
- var handleChange = () => {
259
- };
260
258
  var SingleSelectElement = (props) => {
261
- console.log("passedprops.................", props.options);
259
+ const handleChange2 = (value) => {
260
+ if (props.onChange) {
261
+ props.onChange(value);
262
+ }
263
+ };
262
264
  return /* @__PURE__ */ React9.createElement(
263
265
  Select2,
264
266
  {
265
267
  showSearch: true,
266
268
  placeholder: props.placeholder,
267
269
  optionFilterProp: "children",
268
- onChange: handleChange,
270
+ onChange: handleChange2,
269
271
  onSearch,
270
272
  filterOption,
271
- options: props.options
273
+ options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
272
274
  }
273
275
  );
274
276
  };
@@ -276,7 +278,7 @@ var SingleSelectElement = (props) => {
276
278
  // src/Components/Select/MultipleSelectElement.tsx
277
279
  import React10 from "react";
278
280
  import { Select as Select3, Space as Space2 } from "antd";
279
- var handleChange2 = (value) => {
281
+ var handleChange = (value) => {
280
282
  console.log(`selected ${value}`);
281
283
  };
282
284
  var options = [
@@ -313,7 +315,7 @@ var MultipleSelectElement = () => {
313
315
  style: { width: "100%" },
314
316
  placeholder: "select one country",
315
317
  defaultValue: ["china"],
316
- onChange: handleChange2,
318
+ onChange: handleChange,
317
319
  options,
318
320
  optionRender: (option) => /* @__PURE__ */ React10.createElement(Space2, null, /* @__PURE__ */ React10.createElement("span", { role: "img", "aria-label": option.data.label }, option.data.emoji), option.data.desc)
319
321
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.8-Beta4",
3
+ "version": "0.0.8-Beta6",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",