@apexcura/core 0.0.15-Beta12 → 0.0.15-Beta120

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
@@ -16,7 +16,7 @@ type FormExecutorProps = {
16
16
  className?: string;
17
17
  action?: string;
18
18
  order?: number;
19
- sie?: string;
19
+ size?: string;
20
20
  colCount?: number;
21
21
  disabled?: boolean;
22
22
  activeClassName?: string;
@@ -26,17 +26,23 @@ type FormExecutorProps = {
26
26
  icon?: string;
27
27
  placement?: string;
28
28
  profileImageClassName?: string;
29
- value?: string | number | boolean | any[] | object[] | null;
29
+ value?: string | number | boolean | any[] | null | object;
30
30
  img?: string;
31
31
  primaryText?: string;
32
32
  secondaryText?: string;
33
33
  count?: number;
34
34
  profileImage?: string;
35
35
  profileSubClassName?: string;
36
+ containerClassName?: string;
36
37
  subContainerClassName?: string;
37
38
  secondTextClassName?: string;
38
39
  iconsClassName?: string;
39
40
  labelClassName?: string;
41
+ view?: boolean;
42
+ isSVGStylesOverride?: boolean;
43
+ rowSelection?: boolean;
44
+ length?: number;
45
+ loading?: boolean;
40
46
  modalContent?: {
41
47
  className?: string;
42
48
  fields?: {
@@ -51,11 +57,14 @@ type FormExecutorProps = {
51
57
  }[];
52
58
  };
53
59
  items?: {
54
- icon?: React.JSX.Element;
60
+ icon?: React.JSX.Element | string;
55
61
  label?: string;
56
62
  active?: boolean;
57
63
  text?: string;
58
64
  time?: string;
65
+ name?: string;
66
+ y?: number;
67
+ color?: string;
59
68
  }[];
60
69
  fields?: {
61
70
  name?: string;
@@ -63,14 +72,29 @@ type FormExecutorProps = {
63
72
  placeholder?: string;
64
73
  element?: string;
65
74
  type?: string;
66
- value?: string | number | boolean | any[] | object[] | null;
67
- fieldNames?: any[];
68
- optionType?: string;
75
+ value?: string | number | boolean | any[] | null | object;
69
76
  options?: {
77
+ key?: number;
78
+ label: string;
79
+ value: string;
80
+ }[];
81
+ firstOptions?: {
82
+ key?: number;
83
+ label: string;
84
+ value: string;
85
+ }[];
86
+ secondOptions?: {
87
+ key?: number;
88
+ label: string;
89
+ value: string;
90
+ }[];
91
+ selectBefore?: {
92
+ label: string;
93
+ value: string;
94
+ }[];
95
+ selectAfter?: {
70
96
  label: string;
71
97
  value: string;
72
- className?: string;
73
- selectedClassName?: string;
74
98
  }[];
75
99
  dropDownOptions?: any[];
76
100
  visible?: boolean;
@@ -84,7 +108,7 @@ type FormExecutorProps = {
84
108
  styles?: React.CSSProperties;
85
109
  fieldClassName?: string;
86
110
  elementClassName?: string;
87
- variant?: "outlined" | "borderless" | "filled";
111
+ variant?: string;
88
112
  thead?: {
89
113
  id: number;
90
114
  name?: string;
@@ -92,6 +116,8 @@ type FormExecutorProps = {
92
116
  visible?: boolean;
93
117
  required?: boolean;
94
118
  key?: string;
119
+ render?: () => void;
120
+ ellipsis: boolean;
95
121
  }[];
96
122
  tbody?: {
97
123
  id?: number;
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ type FormExecutorProps = {
16
16
  className?: string;
17
17
  action?: string;
18
18
  order?: number;
19
- sie?: string;
19
+ size?: string;
20
20
  colCount?: number;
21
21
  disabled?: boolean;
22
22
  activeClassName?: string;
@@ -26,17 +26,23 @@ type FormExecutorProps = {
26
26
  icon?: string;
27
27
  placement?: string;
28
28
  profileImageClassName?: string;
29
- value?: string | number | boolean | any[] | object[] | null;
29
+ value?: string | number | boolean | any[] | null | object;
30
30
  img?: string;
31
31
  primaryText?: string;
32
32
  secondaryText?: string;
33
33
  count?: number;
34
34
  profileImage?: string;
35
35
  profileSubClassName?: string;
36
+ containerClassName?: string;
36
37
  subContainerClassName?: string;
37
38
  secondTextClassName?: string;
38
39
  iconsClassName?: string;
39
40
  labelClassName?: string;
41
+ view?: boolean;
42
+ isSVGStylesOverride?: boolean;
43
+ rowSelection?: boolean;
44
+ length?: number;
45
+ loading?: boolean;
40
46
  modalContent?: {
41
47
  className?: string;
42
48
  fields?: {
@@ -51,11 +57,14 @@ type FormExecutorProps = {
51
57
  }[];
52
58
  };
53
59
  items?: {
54
- icon?: React.JSX.Element;
60
+ icon?: React.JSX.Element | string;
55
61
  label?: string;
56
62
  active?: boolean;
57
63
  text?: string;
58
64
  time?: string;
65
+ name?: string;
66
+ y?: number;
67
+ color?: string;
59
68
  }[];
60
69
  fields?: {
61
70
  name?: string;
@@ -63,14 +72,29 @@ type FormExecutorProps = {
63
72
  placeholder?: string;
64
73
  element?: string;
65
74
  type?: string;
66
- value?: string | number | boolean | any[] | object[] | null;
67
- fieldNames?: any[];
68
- optionType?: string;
75
+ value?: string | number | boolean | any[] | null | object;
69
76
  options?: {
77
+ key?: number;
78
+ label: string;
79
+ value: string;
80
+ }[];
81
+ firstOptions?: {
82
+ key?: number;
83
+ label: string;
84
+ value: string;
85
+ }[];
86
+ secondOptions?: {
87
+ key?: number;
88
+ label: string;
89
+ value: string;
90
+ }[];
91
+ selectBefore?: {
92
+ label: string;
93
+ value: string;
94
+ }[];
95
+ selectAfter?: {
70
96
  label: string;
71
97
  value: string;
72
- className?: string;
73
- selectedClassName?: string;
74
98
  }[];
75
99
  dropDownOptions?: any[];
76
100
  visible?: boolean;
@@ -84,7 +108,7 @@ type FormExecutorProps = {
84
108
  styles?: React.CSSProperties;
85
109
  fieldClassName?: string;
86
110
  elementClassName?: string;
87
- variant?: "outlined" | "borderless" | "filled";
111
+ variant?: string;
88
112
  thead?: {
89
113
  id: number;
90
114
  name?: string;
@@ -92,6 +116,8 @@ type FormExecutorProps = {
92
116
  visible?: boolean;
93
117
  required?: boolean;
94
118
  key?: string;
119
+ render?: () => void;
120
+ ellipsis: boolean;
95
121
  }[];
96
122
  tbody?: {
97
123
  id?: number;
package/dist/index.js CHANGED
@@ -99,26 +99,22 @@ function postService(url, method, data) {
99
99
  var ElementExecutor = (props) => {
100
100
  const [data, setData] = (0, import_react.useState)([]);
101
101
  const [schema, setSchema] = (0, import_react.useState)(props.data.schema);
102
- const onHandleChange = (name, option) => {
103
- let prev = schema;
104
- prev?.map((fie) => {
105
- if (fie.name === name) {
106
- fie["value"] = option;
107
- props.selectedRecord(option);
108
- }
109
- if (fie.fields && fie.fields.length) {
110
- fie.fields.map((sub) => {
111
- if (sub.name === name) {
112
- sub["value"] = option;
113
- props.selectedRecord(option);
114
- }
115
- return sub;
116
- });
117
- }
118
- return fie;
119
- });
120
- setSchema([...prev]);
121
- props.setData({ ...props.data, schema: prev });
102
+ const onHandleChange = (name, value) => {
103
+ const updateSchema = (schema2) => {
104
+ return schema2.map((field) => {
105
+ if (field.name === name) {
106
+ field["value"] = value;
107
+ props.selectedRecord(field);
108
+ }
109
+ if (field.fields && field.fields.length) {
110
+ field.fields = updateSchema(field.fields);
111
+ }
112
+ return field;
113
+ });
114
+ };
115
+ const updatedSchema = updateSchema(schema);
116
+ setSchema(updatedSchema);
117
+ props.setData({ ...props.data, schema: updatedSchema });
122
118
  };
123
119
  const handleSelectData = async () => {
124
120
  try {
@@ -156,7 +152,7 @@ var ElementExecutor = (props) => {
156
152
  onChange: (value) => onHandleChange(elementProps.name || "", value)
157
153
  }
158
154
  );
159
- case "input-gender":
155
+ case "single-select":
160
156
  return /* @__PURE__ */ import_react.default.createElement(
161
157
  import_ui_components.SelectElement,
162
158
  {
@@ -221,19 +217,107 @@ var ElementExecutor = (props) => {
221
217
  case "div":
222
218
  return /* @__PURE__ */ import_react.default.createElement("div", { className: elementProps.className }, elementProps.label);
223
219
  case "button":
224
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.ButtonElement, { ...elementProps, onClick: () => props.selectedRecord(elementProps) });
220
+ return /* @__PURE__ */ import_react.default.createElement(
221
+ import_ui_components.ButtonElement,
222
+ {
223
+ ...elementProps,
224
+ onClick: () => props.selectedRecord(elementProps)
225
+ }
226
+ );
225
227
  case "sidebar":
226
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
228
+ return /* @__PURE__ */ import_react.default.createElement(
229
+ import_ui_components.Sidebar,
230
+ {
231
+ ...elementProps,
232
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
233
+ }
234
+ );
227
235
  case "navbar":
228
236
  return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Navbar, { ...elementProps });
229
237
  case "table":
230
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.TableElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
238
+ return /* @__PURE__ */ import_react.default.createElement(
239
+ import_ui_components.TableElement,
240
+ {
241
+ ...elementProps,
242
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
243
+ }
244
+ );
231
245
  case "daterangepicker":
232
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.DateRangePickerElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
246
+ return /* @__PURE__ */ import_react.default.createElement(
247
+ import_ui_components.DateRangePickerElement,
248
+ {
249
+ ...elementProps,
250
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
251
+ }
252
+ );
233
253
  case "datepicker":
234
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.DatePickerElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
254
+ return /* @__PURE__ */ import_react.default.createElement(
255
+ import_ui_components.DatePickerElement,
256
+ {
257
+ ...elementProps,
258
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
259
+ }
260
+ );
235
261
  case "upload":
236
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.UploadElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
262
+ return /* @__PURE__ */ import_react.default.createElement(
263
+ import_ui_components.FileUpload,
264
+ {
265
+ ...elementProps,
266
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
267
+ }
268
+ );
269
+ case "upload-manually":
270
+ return /* @__PURE__ */ import_react.default.createElement(
271
+ import_ui_components.Upload,
272
+ {
273
+ ...elementProps,
274
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
275
+ }
276
+ );
277
+ case "image":
278
+ return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Image, { ...elementProps });
279
+ case "input-password":
280
+ return /* @__PURE__ */ import_react.default.createElement(
281
+ import_ui_components.PasswordElement,
282
+ {
283
+ ...elementProps,
284
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
285
+ }
286
+ );
287
+ case "single-checkbox":
288
+ return /* @__PURE__ */ import_react.default.createElement(
289
+ import_ui_components.SingleCheckbox,
290
+ {
291
+ ...elementProps,
292
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
293
+ }
294
+ );
295
+ case "dropdown-group":
296
+ return /* @__PURE__ */ import_react.default.createElement(
297
+ import_ui_components.DropDownGroup,
298
+ {
299
+ ...elementProps,
300
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
301
+ }
302
+ );
303
+ case "tabs":
304
+ return /* @__PURE__ */ import_react.default.createElement(
305
+ import_ui_components.TabsElement,
306
+ {
307
+ ...elementProps,
308
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
309
+ }
310
+ );
311
+ case "otp":
312
+ return /* @__PURE__ */ import_react.default.createElement(
313
+ import_ui_components.OtpElement,
314
+ {
315
+ ...elementProps,
316
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
317
+ }
318
+ );
319
+ case "donut":
320
+ return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Donut, { ...elementProps });
237
321
  default:
238
322
  return null;
239
323
  }
@@ -241,7 +325,7 @@ var ElementExecutor = (props) => {
241
325
  const renderFields = (schema2) => {
242
326
  return schema2 && schema2.map((eachSection) => {
243
327
  if (eachSection.visible !== false) {
244
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, eachSection.fields && eachSection.fields.length > 0 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), /* @__PURE__ */ import_react.default.createElement("div", { className: eachSection.className, key: eachSection.name }, eachSection.label && /* @__PURE__ */ import_react.default.createElement("p", { className: eachSection.labelClassName }, eachSection.label), renderFields(eachSection.fields))) : renderElement(eachSection));
328
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, { key: eachSection.name }, eachSection.fields && eachSection.fields.length > 0 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), /* @__PURE__ */ import_react.default.createElement("div", { className: eachSection.className, key: eachSection.name }, renderFields(eachSection.fields))) : renderElement(eachSection));
245
329
  }
246
330
  return null;
247
331
  });
package/dist/index.mjs CHANGED
@@ -17,7 +17,15 @@ import {
17
17
  TableElement,
18
18
  DateRangePickerElement,
19
19
  DatePickerElement,
20
- UploadElement
20
+ Image,
21
+ PasswordElement,
22
+ SingleCheckbox,
23
+ DropDownGroup,
24
+ FileUpload,
25
+ TabsElement,
26
+ Upload,
27
+ OtpElement,
28
+ Donut
21
29
  } from "@apexcura/ui-components";
22
30
 
23
31
  // src/services/http-service.tsx
@@ -81,26 +89,22 @@ function postService(url, method, data) {
81
89
  var ElementExecutor = (props) => {
82
90
  const [data, setData] = useState([]);
83
91
  const [schema, setSchema] = useState(props.data.schema);
84
- const onHandleChange = (name, option) => {
85
- let prev = schema;
86
- prev?.map((fie) => {
87
- if (fie.name === name) {
88
- fie["value"] = option;
89
- props.selectedRecord(option);
90
- }
91
- if (fie.fields && fie.fields.length) {
92
- fie.fields.map((sub) => {
93
- if (sub.name === name) {
94
- sub["value"] = option;
95
- props.selectedRecord(option);
96
- }
97
- return sub;
98
- });
99
- }
100
- return fie;
101
- });
102
- setSchema([...prev]);
103
- props.setData({ ...props.data, schema: prev });
92
+ const onHandleChange = (name, value) => {
93
+ const updateSchema = (schema2) => {
94
+ return schema2.map((field) => {
95
+ if (field.name === name) {
96
+ field["value"] = value;
97
+ props.selectedRecord(field);
98
+ }
99
+ if (field.fields && field.fields.length) {
100
+ field.fields = updateSchema(field.fields);
101
+ }
102
+ return field;
103
+ });
104
+ };
105
+ const updatedSchema = updateSchema(schema);
106
+ setSchema(updatedSchema);
107
+ props.setData({ ...props.data, schema: updatedSchema });
104
108
  };
105
109
  const handleSelectData = async () => {
106
110
  try {
@@ -138,7 +142,7 @@ var ElementExecutor = (props) => {
138
142
  onChange: (value) => onHandleChange(elementProps.name || "", value)
139
143
  }
140
144
  );
141
- case "input-gender":
145
+ case "single-select":
142
146
  return /* @__PURE__ */ React.createElement(
143
147
  SelectElement,
144
148
  {
@@ -203,19 +207,107 @@ var ElementExecutor = (props) => {
203
207
  case "div":
204
208
  return /* @__PURE__ */ React.createElement("div", { className: elementProps.className }, elementProps.label);
205
209
  case "button":
206
- return /* @__PURE__ */ React.createElement(ButtonElement, { ...elementProps, onClick: () => props.selectedRecord(elementProps) });
210
+ return /* @__PURE__ */ React.createElement(
211
+ ButtonElement,
212
+ {
213
+ ...elementProps,
214
+ onClick: () => props.selectedRecord(elementProps)
215
+ }
216
+ );
207
217
  case "sidebar":
208
- return /* @__PURE__ */ React.createElement(Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
218
+ return /* @__PURE__ */ React.createElement(
219
+ Sidebar,
220
+ {
221
+ ...elementProps,
222
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
223
+ }
224
+ );
209
225
  case "navbar":
210
226
  return /* @__PURE__ */ React.createElement(Navbar, { ...elementProps });
211
227
  case "table":
212
- return /* @__PURE__ */ React.createElement(TableElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
228
+ return /* @__PURE__ */ React.createElement(
229
+ TableElement,
230
+ {
231
+ ...elementProps,
232
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
233
+ }
234
+ );
213
235
  case "daterangepicker":
214
- return /* @__PURE__ */ React.createElement(DateRangePickerElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
236
+ return /* @__PURE__ */ React.createElement(
237
+ DateRangePickerElement,
238
+ {
239
+ ...elementProps,
240
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
241
+ }
242
+ );
215
243
  case "datepicker":
216
- return /* @__PURE__ */ React.createElement(DatePickerElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
244
+ return /* @__PURE__ */ React.createElement(
245
+ DatePickerElement,
246
+ {
247
+ ...elementProps,
248
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
249
+ }
250
+ );
217
251
  case "upload":
218
- return /* @__PURE__ */ React.createElement(UploadElement, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
252
+ return /* @__PURE__ */ React.createElement(
253
+ FileUpload,
254
+ {
255
+ ...elementProps,
256
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
257
+ }
258
+ );
259
+ case "upload-manually":
260
+ return /* @__PURE__ */ React.createElement(
261
+ Upload,
262
+ {
263
+ ...elementProps,
264
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
265
+ }
266
+ );
267
+ case "image":
268
+ return /* @__PURE__ */ React.createElement(Image, { ...elementProps });
269
+ case "input-password":
270
+ return /* @__PURE__ */ React.createElement(
271
+ PasswordElement,
272
+ {
273
+ ...elementProps,
274
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
275
+ }
276
+ );
277
+ case "single-checkbox":
278
+ return /* @__PURE__ */ React.createElement(
279
+ SingleCheckbox,
280
+ {
281
+ ...elementProps,
282
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
283
+ }
284
+ );
285
+ case "dropdown-group":
286
+ return /* @__PURE__ */ React.createElement(
287
+ DropDownGroup,
288
+ {
289
+ ...elementProps,
290
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
291
+ }
292
+ );
293
+ case "tabs":
294
+ return /* @__PURE__ */ React.createElement(
295
+ TabsElement,
296
+ {
297
+ ...elementProps,
298
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
299
+ }
300
+ );
301
+ case "otp":
302
+ return /* @__PURE__ */ React.createElement(
303
+ OtpElement,
304
+ {
305
+ ...elementProps,
306
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
307
+ }
308
+ );
309
+ case "donut":
310
+ return /* @__PURE__ */ React.createElement(Donut, { ...elementProps });
219
311
  default:
220
312
  return null;
221
313
  }
@@ -223,7 +315,7 @@ var ElementExecutor = (props) => {
223
315
  const renderFields = (schema2) => {
224
316
  return schema2 && schema2.map((eachSection) => {
225
317
  if (eachSection.visible !== false) {
226
- return /* @__PURE__ */ React.createElement(React.Fragment, null, eachSection.fields && eachSection.fields.length > 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), /* @__PURE__ */ React.createElement("div", { className: eachSection.className, key: eachSection.name }, eachSection.label && /* @__PURE__ */ React.createElement("p", { className: eachSection.labelClassName }, eachSection.label), renderFields(eachSection.fields))) : renderElement(eachSection));
318
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: eachSection.name }, eachSection.fields && eachSection.fields.length > 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), /* @__PURE__ */ React.createElement("div", { className: eachSection.className, key: eachSection.name }, renderFields(eachSection.fields))) : renderElement(eachSection));
227
319
  }
228
320
  return null;
229
321
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/core",
3
- "version": "0.0.15-Beta12",
3
+ "version": "0.0.15-Beta120",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
@@ -28,7 +28,7 @@
28
28
  "build": "tsup"
29
29
  },
30
30
  "dependencies": {
31
- "@apexcura/ui-components": "^0.0.13-Beta8",
31
+ "@apexcura/ui-components": "^0.0.14-Beta102",
32
32
  "@testing-library/jest-dom": "^6.4.2",
33
33
  "@testing-library/react": "^15.0.6",
34
34
  "@types/react-global-configuration": "^1.3.3",