@apexcura/ui-components 0.0.8-Beta12 → 0.0.8-Beta2

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,8 @@ type ElementType = {
18
18
  maxLength?: number;
19
19
  fieldNames?: any[];
20
20
  onChange?: (value: string | number | boolean | any[]) => void;
21
- dropDownOptions?: any[];
21
+ options: any[];
22
+ onFocusHandler: () => void;
22
23
  };
23
24
 
24
25
  interface ElementExecuterProps$3 extends ElementType {
@@ -61,7 +62,7 @@ declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
61
62
 
62
63
  declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
63
64
 
64
- declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
65
+ declare const MultipleSelectElement: () => React$1.JSX.Element;
65
66
 
66
67
  declare const ButtonElement: () => React$1.JSX.Element;
67
68
 
package/dist/index.d.ts CHANGED
@@ -18,7 +18,8 @@ type ElementType = {
18
18
  maxLength?: number;
19
19
  fieldNames?: any[];
20
20
  onChange?: (value: string | number | boolean | any[]) => void;
21
- dropDownOptions?: any[];
21
+ options: any[];
22
+ onFocusHandler: () => void;
22
23
  };
23
24
 
24
25
  interface ElementExecuterProps$3 extends ElementType {
@@ -61,7 +62,7 @@ declare const CkEditor: (props: ElementExecuterProps) => React$1.JSX.Element;
61
62
 
62
63
  declare const SingleSelectElement: (props: ElementType) => React$1.JSX.Element;
63
64
 
64
- declare const MultipleSelectElement: (props: ElementType) => React$1.JSX.Element;
65
+ declare const MultipleSelectElement: () => React$1.JSX.Element;
65
66
 
66
67
  declare const ButtonElement: () => React$1.JSX.Element;
67
68
 
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 handleChange = (value) => {
162
+ const handleChange3 = (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: handleChange
181
+ onChange: handleChange3
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 handleChange = (e) => {
190
+ const handleChange3 = (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: 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"));
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"));
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 handleChange = (list) => {
207
+ const handleChange3 = (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: handleChange
239
+ onChange: handleChange3
240
240
  }
241
241
  ));
242
242
  };
@@ -301,13 +301,10 @@ 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
+ };
304
306
  var SingleSelectElement = (props) => {
305
- console.log("dropdownoptions....................", props.dropDownOptions);
306
- const handleChange = (value) => {
307
- if (props.onChange) {
308
- props.onChange(value);
309
- }
310
- };
307
+ console.log(props.options);
311
308
  return /* @__PURE__ */ import_react10.default.createElement(
312
309
  import_antd8.Select,
313
310
  {
@@ -317,6 +314,7 @@ var SingleSelectElement = (props) => {
317
314
  onChange: handleChange,
318
315
  onSearch,
319
316
  filterOption,
317
+ onFocus: props.onFocusHandler,
320
318
  options: []
321
319
  }
322
320
  );
@@ -325,18 +323,46 @@ var SingleSelectElement = (props) => {
325
323
  // src/Components/Select/MultipleSelectElement.tsx
326
324
  var import_react11 = __toESM(require("react"));
327
325
  var import_antd9 = require("antd");
328
- var MultipleSelectElement = (props) => {
329
- const handleChange = (value) => {
330
- if (props.onChange) {
331
- props.onChange(value);
332
- }
333
- };
326
+ var handleChange2 = (value) => {
327
+ console.log(`selected ${value}`);
328
+ };
329
+ var options = [
330
+ {
331
+ label: "China",
332
+ value: "china",
333
+ emoji: "\u{1F1E8}\u{1F1F3}",
334
+ desc: "China (\u4E2D\u56FD)"
335
+ },
336
+ {
337
+ label: "USA",
338
+ value: "usa",
339
+ emoji: "\u{1F1FA}\u{1F1F8}",
340
+ desc: "USA (\u7F8E\u56FD)"
341
+ },
342
+ {
343
+ label: "Japan",
344
+ value: "japan",
345
+ emoji: "\u{1F1EF}\u{1F1F5}",
346
+ desc: "Japan (\u65E5\u672C)"
347
+ },
348
+ {
349
+ label: "Korea",
350
+ value: "korea",
351
+ emoji: "\u{1F1F0}\u{1F1F7}",
352
+ desc: "Korea (\u97E9\u56FD)"
353
+ }
354
+ ];
355
+ var MultipleSelectElement = () => {
334
356
  return /* @__PURE__ */ import_react11.default.createElement(
335
357
  import_antd9.Select,
336
358
  {
337
359
  mode: "multiple",
338
- placeholder: props.placeholder,
339
- onChange: handleChange
360
+ style: { width: "100%" },
361
+ placeholder: "select one country",
362
+ defaultValue: ["china"],
363
+ onChange: handleChange2,
364
+ options,
365
+ 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)
340
366
  }
341
367
  );
342
368
  };
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 handleChange = (value) => {
116
+ const handleChange3 = (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: handleChange
135
+ onChange: handleChange3
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 handleChange = (e) => {
144
+ const handleChange3 = (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: 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"));
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"));
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 handleChange = (list) => {
161
+ const handleChange3 = (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: handleChange
193
+ onChange: handleChange3
194
194
  }
195
195
  ));
196
196
  };
@@ -255,13 +255,10 @@ 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
+ };
258
260
  var SingleSelectElement = (props) => {
259
- console.log("dropdownoptions....................", props.dropDownOptions);
260
- const handleChange = (value) => {
261
- if (props.onChange) {
262
- props.onChange(value);
263
- }
264
- };
261
+ console.log(props.options);
265
262
  return /* @__PURE__ */ React9.createElement(
266
263
  Select2,
267
264
  {
@@ -271,6 +268,7 @@ var SingleSelectElement = (props) => {
271
268
  onChange: handleChange,
272
269
  onSearch,
273
270
  filterOption,
271
+ onFocus: props.onFocusHandler,
274
272
  options: []
275
273
  }
276
274
  );
@@ -278,19 +276,47 @@ var SingleSelectElement = (props) => {
278
276
 
279
277
  // src/Components/Select/MultipleSelectElement.tsx
280
278
  import React10 from "react";
281
- import { Select as Select3 } from "antd";
282
- var MultipleSelectElement = (props) => {
283
- const handleChange = (value) => {
284
- if (props.onChange) {
285
- props.onChange(value);
286
- }
287
- };
279
+ import { Select as Select3, Space as Space2 } from "antd";
280
+ var handleChange2 = (value) => {
281
+ console.log(`selected ${value}`);
282
+ };
283
+ var options = [
284
+ {
285
+ label: "China",
286
+ value: "china",
287
+ emoji: "\u{1F1E8}\u{1F1F3}",
288
+ desc: "China (\u4E2D\u56FD)"
289
+ },
290
+ {
291
+ label: "USA",
292
+ value: "usa",
293
+ emoji: "\u{1F1FA}\u{1F1F8}",
294
+ desc: "USA (\u7F8E\u56FD)"
295
+ },
296
+ {
297
+ label: "Japan",
298
+ value: "japan",
299
+ emoji: "\u{1F1EF}\u{1F1F5}",
300
+ desc: "Japan (\u65E5\u672C)"
301
+ },
302
+ {
303
+ label: "Korea",
304
+ value: "korea",
305
+ emoji: "\u{1F1F0}\u{1F1F7}",
306
+ desc: "Korea (\u97E9\u56FD)"
307
+ }
308
+ ];
309
+ var MultipleSelectElement = () => {
288
310
  return /* @__PURE__ */ React10.createElement(
289
311
  Select3,
290
312
  {
291
313
  mode: "multiple",
292
- placeholder: props.placeholder,
293
- onChange: handleChange
314
+ style: { width: "100%" },
315
+ placeholder: "select one country",
316
+ defaultValue: ["china"],
317
+ onChange: handleChange2,
318
+ options,
319
+ optionRender: (option) => /* @__PURE__ */ React10.createElement(Space2, null, /* @__PURE__ */ React10.createElement("span", { role: "img", "aria-label": option.data.label }, option.data.emoji), option.data.desc)
294
320
  }
295
321
  );
296
322
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.8-Beta12",
3
+ "version": "0.0.8-Beta2",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 ApexCura
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.