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

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
@@ -61,7 +61,7 @@ declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
61
61
 
62
62
  declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
63
63
 
64
- declare const MultipleSelectElement: () => React$1.JSX.Element;
64
+ declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
65
65
 
66
66
  declare const ButtonElement: () => React$1.JSX.Element;
67
67
 
package/dist/index.d.ts CHANGED
@@ -61,7 +61,7 @@ declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
61
61
 
62
62
  declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
63
63
 
64
- declare const MultipleSelectElement: () => React$1.JSX.Element;
64
+ declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
65
65
 
66
66
  declare const ButtonElement: () => React$1.JSX.Element;
67
67
 
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,16 +301,19 @@ 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) => {
305
+ const handleChange2 = (value) => {
306
+ if (props.onChange) {
307
+ props.onChange(value);
308
+ }
309
+ };
307
310
  return /* @__PURE__ */ import_react10.default.createElement(
308
311
  import_antd8.Select,
309
312
  {
310
313
  showSearch: true,
311
314
  placeholder: props.placeholder,
312
315
  optionFilterProp: "children",
313
- onChange: handleChange,
316
+ onChange: handleChange2,
314
317
  onSearch,
315
318
  filterOption,
316
319
  options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
@@ -321,49 +324,20 @@ var SingleSelectElement = (props) => {
321
324
  // src/Components/Select/MultipleSelectElement.tsx
322
325
  var import_react11 = __toESM(require("react"));
323
326
  var import_antd9 = require("antd");
324
- var handleChange2 = (value) => {
327
+ var handleChange = (value) => {
325
328
  console.log(`selected ${value}`);
326
329
  };
327
- var options = [
328
- {
329
- label: "China",
330
- value: "china",
331
- emoji: "\u{1F1E8}\u{1F1F3}",
332
- desc: "China (\u4E2D\u56FD)"
333
- },
330
+ var MultipleSelectElement = (props) => /* @__PURE__ */ import_react11.default.createElement(
331
+ import_antd9.Select,
334
332
  {
335
- label: "USA",
336
- value: "usa",
337
- emoji: "\u{1F1FA}\u{1F1F8}",
338
- desc: "USA (\u7F8E\u56FD)"
339
- },
340
- {
341
- label: "Japan",
342
- value: "japan",
343
- emoji: "\u{1F1EF}\u{1F1F5}",
344
- desc: "Japan (\u65E5\u672C)"
345
- },
346
- {
347
- label: "Korea",
348
- value: "korea",
349
- emoji: "\u{1F1F0}\u{1F1F7}",
350
- desc: "Korea (\u97E9\u56FD)"
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) }))
351
339
  }
352
- ];
353
- var MultipleSelectElement = () => {
354
- return /* @__PURE__ */ import_react11.default.createElement(
355
- import_antd9.Select,
356
- {
357
- mode: "multiple",
358
- style: { width: "100%" },
359
- placeholder: "select one country",
360
- defaultValue: ["china"],
361
- onChange: handleChange2,
362
- options,
363
- 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)
364
- }
365
- );
366
- };
340
+ );
367
341
 
368
342
  // src/Components/Button.tsx
369
343
  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 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,16 +255,19 @@ 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) => {
259
+ const handleChange2 = (value) => {
260
+ if (props.onChange) {
261
+ props.onChange(value);
262
+ }
263
+ };
261
264
  return /* @__PURE__ */ React9.createElement(
262
265
  Select2,
263
266
  {
264
267
  showSearch: true,
265
268
  placeholder: props.placeholder,
266
269
  optionFilterProp: "children",
267
- onChange: handleChange,
270
+ onChange: handleChange2,
268
271
  onSearch,
269
272
  filterOption,
270
273
  options: props.options.map((eachOption) => ({ label: String(eachOption.title), value: String(eachOption.title) }))
@@ -274,50 +277,21 @@ var SingleSelectElement = (props) => {
274
277
 
275
278
  // src/Components/Select/MultipleSelectElement.tsx
276
279
  import React10 from "react";
277
- import { Select as Select3, Space as Space2 } from "antd";
278
- var handleChange2 = (value) => {
280
+ import { Select as Select3 } from "antd";
281
+ var handleChange = (value) => {
279
282
  console.log(`selected ${value}`);
280
283
  };
281
- var options = [
282
- {
283
- label: "China",
284
- value: "china",
285
- emoji: "\u{1F1E8}\u{1F1F3}",
286
- desc: "China (\u4E2D\u56FD)"
287
- },
284
+ var MultipleSelectElement = (props) => /* @__PURE__ */ React10.createElement(
285
+ Select3,
288
286
  {
289
- label: "USA",
290
- value: "usa",
291
- emoji: "\u{1F1FA}\u{1F1F8}",
292
- desc: "USA (\u7F8E\u56FD)"
293
- },
294
- {
295
- label: "Japan",
296
- value: "japan",
297
- emoji: "\u{1F1EF}\u{1F1F5}",
298
- desc: "Japan (\u65E5\u672C)"
299
- },
300
- {
301
- label: "Korea",
302
- value: "korea",
303
- emoji: "\u{1F1F0}\u{1F1F7}",
304
- desc: "Korea (\u97E9\u56FD)"
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) }))
305
293
  }
306
- ];
307
- var MultipleSelectElement = () => {
308
- return /* @__PURE__ */ React10.createElement(
309
- Select3,
310
- {
311
- mode: "multiple",
312
- style: { width: "100%" },
313
- placeholder: "select one country",
314
- defaultValue: ["china"],
315
- onChange: handleChange2,
316
- options,
317
- optionRender: (option) => /* @__PURE__ */ React10.createElement(Space2, null, /* @__PURE__ */ React10.createElement("span", { role: "img", "aria-label": option.data.label }, option.data.emoji), option.data.desc)
318
- }
319
- );
320
- };
294
+ );
321
295
 
322
296
  // src/Components/Button.tsx
323
297
  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-Beta5",
3
+ "version": "0.0.8-Beta7",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",