@apexcura/core 0.0.16-Beta3 → 0.0.16-Beta300

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
@@ -38,25 +38,32 @@ type FormExecutorProps = {
38
38
  secondTextClassName?: string;
39
39
  iconsClassName?: string;
40
40
  labelClassName?: string;
41
+ view?: boolean;
42
+ isSVGStylesOverride?: boolean;
43
+ rowSelection?: boolean;
44
+ length?: number;
45
+ loading?: boolean;
46
+ fillText1?: string;
47
+ fillText2?: string;
48
+ labels?: any[];
49
+ data?: any[];
50
+ pagination?: boolean;
51
+ is_detail?: boolean;
52
+ dateTime?: string;
41
53
  modalContent?: {
54
+ name?: string;
42
55
  className?: string;
43
- fields?: {
44
- _id?: string;
45
- name?: string;
46
- label?: string;
47
- source?: string;
48
- initial_message?: boolean;
49
- element: string;
50
- className?: string;
51
- position?: string;
52
- }[];
56
+ fields?: any[];
53
57
  };
54
58
  items?: {
55
- icon?: React.JSX.Element;
59
+ icon?: React.JSX.Element | string;
56
60
  label?: string;
57
61
  active?: boolean;
58
62
  text?: string;
59
63
  time?: string;
64
+ name?: string;
65
+ y?: number;
66
+ color?: string;
60
67
  }[];
61
68
  fields?: {
62
69
  name?: string;
@@ -70,6 +77,16 @@ type FormExecutorProps = {
70
77
  label: string;
71
78
  value: string;
72
79
  }[];
80
+ firstOptions?: {
81
+ key?: number;
82
+ label: string;
83
+ value: string;
84
+ }[];
85
+ secondOptions?: {
86
+ key?: number;
87
+ label: string;
88
+ value: string;
89
+ }[];
73
90
  selectBefore?: {
74
91
  label: string;
75
92
  value: string;
@@ -99,6 +116,7 @@ type FormExecutorProps = {
99
116
  required?: boolean;
100
117
  key?: string;
101
118
  render?: () => void;
119
+ ellipsis: boolean;
102
120
  }[];
103
121
  tbody?: {
104
122
  id?: number;
package/dist/index.d.ts CHANGED
@@ -38,25 +38,32 @@ type FormExecutorProps = {
38
38
  secondTextClassName?: string;
39
39
  iconsClassName?: string;
40
40
  labelClassName?: string;
41
+ view?: boolean;
42
+ isSVGStylesOverride?: boolean;
43
+ rowSelection?: boolean;
44
+ length?: number;
45
+ loading?: boolean;
46
+ fillText1?: string;
47
+ fillText2?: string;
48
+ labels?: any[];
49
+ data?: any[];
50
+ pagination?: boolean;
51
+ is_detail?: boolean;
52
+ dateTime?: string;
41
53
  modalContent?: {
54
+ name?: string;
42
55
  className?: string;
43
- fields?: {
44
- _id?: string;
45
- name?: string;
46
- label?: string;
47
- source?: string;
48
- initial_message?: boolean;
49
- element: string;
50
- className?: string;
51
- position?: string;
52
- }[];
56
+ fields?: any[];
53
57
  };
54
58
  items?: {
55
- icon?: React.JSX.Element;
59
+ icon?: React.JSX.Element | string;
56
60
  label?: string;
57
61
  active?: boolean;
58
62
  text?: string;
59
63
  time?: string;
64
+ name?: string;
65
+ y?: number;
66
+ color?: string;
60
67
  }[];
61
68
  fields?: {
62
69
  name?: string;
@@ -70,6 +77,16 @@ type FormExecutorProps = {
70
77
  label: string;
71
78
  value: string;
72
79
  }[];
80
+ firstOptions?: {
81
+ key?: number;
82
+ label: string;
83
+ value: string;
84
+ }[];
85
+ secondOptions?: {
86
+ key?: number;
87
+ label: string;
88
+ value: string;
89
+ }[];
73
90
  selectBefore?: {
74
91
  label: string;
75
92
  value: string;
@@ -99,6 +116,7 @@ type FormExecutorProps = {
99
116
  required?: boolean;
100
117
  key?: string;
101
118
  render?: () => void;
119
+ ellipsis: boolean;
102
120
  }[];
103
121
  tbody?: {
104
122
  id?: number;
package/dist/index.js CHANGED
@@ -37,6 +37,7 @@ module.exports = __toCommonJS(src_exports);
37
37
  // src/libraries/element-executor.tsx
38
38
  var import_react = __toESM(require("react"));
39
39
  var import_ui_components = require("@apexcura/ui-components");
40
+ var import_moment = __toESM(require("moment"));
40
41
 
41
42
  // src/services/http-service.tsx
42
43
  var import_axios = __toESM(require("axios"));
@@ -100,8 +101,6 @@ var ElementExecutor = (props) => {
100
101
  const [data, setData] = (0, import_react.useState)([]);
101
102
  const [schema, setSchema] = (0, import_react.useState)(props.data.schema);
102
103
  const onHandleChange = (name, value) => {
103
- console.log("name", name);
104
- console.log("value", value);
105
104
  const updateSchema = (schema2) => {
106
105
  return schema2.map((field) => {
107
106
  if (field.name === name) {
@@ -114,7 +113,6 @@ var ElementExecutor = (props) => {
114
113
  return field;
115
114
  });
116
115
  };
117
- console.log("schema--------------", schema);
118
116
  const updatedSchema = updateSchema(schema);
119
117
  setSchema(updatedSchema);
120
118
  props.setData({ ...props.data, schema: updatedSchema });
@@ -218,7 +216,13 @@ var ElementExecutor = (props) => {
218
216
  case "add-more":
219
217
  return /* @__PURE__ */ import_react.default.createElement(import_ui_components.AddMoreTable, { ...elementProps });
220
218
  case "div":
221
- return /* @__PURE__ */ import_react.default.createElement("div", { className: elementProps.className }, elementProps.label);
219
+ return /* @__PURE__ */ import_react.default.createElement(
220
+ import_ui_components.DivContainer,
221
+ {
222
+ ...elementProps,
223
+ onClick: () => props.selectedRecord(elementProps)
224
+ }
225
+ );
222
226
  case "button":
223
227
  return /* @__PURE__ */ import_react.default.createElement(
224
228
  import_ui_components.ButtonElement,
@@ -269,6 +273,14 @@ var ElementExecutor = (props) => {
269
273
  onChange: (value) => onHandleChange(elementProps.name || "", value)
270
274
  }
271
275
  );
276
+ case "upload-manually":
277
+ return /* @__PURE__ */ import_react.default.createElement(
278
+ import_ui_components.Upload,
279
+ {
280
+ ...elementProps,
281
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
282
+ }
283
+ );
272
284
  case "image":
273
285
  return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Image, { ...elementProps });
274
286
  case "input-password":
@@ -303,6 +315,62 @@ var ElementExecutor = (props) => {
303
315
  onChange: (value) => onHandleChange(elementProps.name || "", value)
304
316
  }
305
317
  );
318
+ case "otp":
319
+ return /* @__PURE__ */ import_react.default.createElement(
320
+ import_ui_components.OtpElement,
321
+ {
322
+ ...elementProps,
323
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
324
+ }
325
+ );
326
+ case "circle-donut":
327
+ return /* @__PURE__ */ import_react.default.createElement(
328
+ import_ui_components.CircleDonut,
329
+ {
330
+ ...elementProps,
331
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
332
+ }
333
+ );
334
+ case "semicircle-donut":
335
+ return /* @__PURE__ */ import_react.default.createElement(
336
+ import_ui_components.SemiCircleDonut,
337
+ {
338
+ ...elementProps,
339
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
340
+ }
341
+ );
342
+ case "horizontal-barchart":
343
+ return /* @__PURE__ */ import_react.default.createElement(
344
+ import_ui_components.HorizontalBarChart,
345
+ {
346
+ ...elementProps,
347
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
348
+ }
349
+ );
350
+ case "linechart":
351
+ return /* @__PURE__ */ import_react.default.createElement(
352
+ import_ui_components.LineChart,
353
+ {
354
+ ...elementProps,
355
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
356
+ }
357
+ );
358
+ case "double-barchart":
359
+ return /* @__PURE__ */ import_react.default.createElement(
360
+ import_ui_components.DoubleBarChart,
361
+ {
362
+ ...elementProps,
363
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
364
+ }
365
+ );
366
+ case "barchart":
367
+ return /* @__PURE__ */ import_react.default.createElement(
368
+ import_ui_components.BarChart,
369
+ {
370
+ ...elementProps,
371
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
372
+ }
373
+ );
306
374
  default:
307
375
  return null;
308
376
  }
@@ -310,7 +378,25 @@ var ElementExecutor = (props) => {
310
378
  const renderFields = (schema2) => {
311
379
  return schema2 && schema2.map((eachSection) => {
312
380
  if (eachSection.visible !== false) {
313
- 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 }, renderFields(eachSection.fields))) : renderElement(eachSection));
381
+ 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)), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
382
+ "p",
383
+ {
384
+ style: {
385
+ fontSize: "10px",
386
+ textAlign: eachSection.source === "bot" ? "left" : "right"
387
+ }
388
+ },
389
+ (0, import_moment.default)(eachSection.dateTime).format("LT")
390
+ ) : "") : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
391
+ "p",
392
+ {
393
+ style: {
394
+ fontSize: "10px",
395
+ textAlign: eachSection.source === "bot" ? "left" : "right"
396
+ }
397
+ },
398
+ (0, import_moment.default)(eachSection.dateTime).format("LT")
399
+ ) : ""));
314
400
  }
315
401
  return null;
316
402
  });
package/dist/index.mjs CHANGED
@@ -22,8 +22,18 @@ import {
22
22
  SingleCheckbox,
23
23
  DropDownGroup,
24
24
  FileUpload,
25
- TabsElement
25
+ TabsElement,
26
+ Upload,
27
+ OtpElement,
28
+ CircleDonut,
29
+ SemiCircleDonut,
30
+ HorizontalBarChart,
31
+ DoubleBarChart,
32
+ LineChart,
33
+ BarChart,
34
+ DivContainer
26
35
  } from "@apexcura/ui-components";
36
+ import moment from "moment";
27
37
 
28
38
  // src/services/http-service.tsx
29
39
  import axios from "axios";
@@ -87,8 +97,6 @@ var ElementExecutor = (props) => {
87
97
  const [data, setData] = useState([]);
88
98
  const [schema, setSchema] = useState(props.data.schema);
89
99
  const onHandleChange = (name, value) => {
90
- console.log("name", name);
91
- console.log("value", value);
92
100
  const updateSchema = (schema2) => {
93
101
  return schema2.map((field) => {
94
102
  if (field.name === name) {
@@ -101,7 +109,6 @@ var ElementExecutor = (props) => {
101
109
  return field;
102
110
  });
103
111
  };
104
- console.log("schema--------------", schema);
105
112
  const updatedSchema = updateSchema(schema);
106
113
  setSchema(updatedSchema);
107
114
  props.setData({ ...props.data, schema: updatedSchema });
@@ -205,7 +212,13 @@ var ElementExecutor = (props) => {
205
212
  case "add-more":
206
213
  return /* @__PURE__ */ React.createElement(AddMoreTable, { ...elementProps });
207
214
  case "div":
208
- return /* @__PURE__ */ React.createElement("div", { className: elementProps.className }, elementProps.label);
215
+ return /* @__PURE__ */ React.createElement(
216
+ DivContainer,
217
+ {
218
+ ...elementProps,
219
+ onClick: () => props.selectedRecord(elementProps)
220
+ }
221
+ );
209
222
  case "button":
210
223
  return /* @__PURE__ */ React.createElement(
211
224
  ButtonElement,
@@ -256,6 +269,14 @@ var ElementExecutor = (props) => {
256
269
  onChange: (value) => onHandleChange(elementProps.name || "", value)
257
270
  }
258
271
  );
272
+ case "upload-manually":
273
+ return /* @__PURE__ */ React.createElement(
274
+ Upload,
275
+ {
276
+ ...elementProps,
277
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
278
+ }
279
+ );
259
280
  case "image":
260
281
  return /* @__PURE__ */ React.createElement(Image, { ...elementProps });
261
282
  case "input-password":
@@ -290,6 +311,62 @@ var ElementExecutor = (props) => {
290
311
  onChange: (value) => onHandleChange(elementProps.name || "", value)
291
312
  }
292
313
  );
314
+ case "otp":
315
+ return /* @__PURE__ */ React.createElement(
316
+ OtpElement,
317
+ {
318
+ ...elementProps,
319
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
320
+ }
321
+ );
322
+ case "circle-donut":
323
+ return /* @__PURE__ */ React.createElement(
324
+ CircleDonut,
325
+ {
326
+ ...elementProps,
327
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
328
+ }
329
+ );
330
+ case "semicircle-donut":
331
+ return /* @__PURE__ */ React.createElement(
332
+ SemiCircleDonut,
333
+ {
334
+ ...elementProps,
335
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
336
+ }
337
+ );
338
+ case "horizontal-barchart":
339
+ return /* @__PURE__ */ React.createElement(
340
+ HorizontalBarChart,
341
+ {
342
+ ...elementProps,
343
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
344
+ }
345
+ );
346
+ case "linechart":
347
+ return /* @__PURE__ */ React.createElement(
348
+ LineChart,
349
+ {
350
+ ...elementProps,
351
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
352
+ }
353
+ );
354
+ case "double-barchart":
355
+ return /* @__PURE__ */ React.createElement(
356
+ DoubleBarChart,
357
+ {
358
+ ...elementProps,
359
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
360
+ }
361
+ );
362
+ case "barchart":
363
+ return /* @__PURE__ */ React.createElement(
364
+ BarChart,
365
+ {
366
+ ...elementProps,
367
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
368
+ }
369
+ );
293
370
  default:
294
371
  return null;
295
372
  }
@@ -297,7 +374,25 @@ var ElementExecutor = (props) => {
297
374
  const renderFields = (schema2) => {
298
375
  return schema2 && schema2.map((eachSection) => {
299
376
  if (eachSection.visible !== false) {
300
- 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 }, renderFields(eachSection.fields))) : renderElement(eachSection));
377
+ 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)), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
378
+ "p",
379
+ {
380
+ style: {
381
+ fontSize: "10px",
382
+ textAlign: eachSection.source === "bot" ? "left" : "right"
383
+ }
384
+ },
385
+ moment(eachSection.dateTime).format("LT")
386
+ ) : "") : /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
387
+ "p",
388
+ {
389
+ style: {
390
+ fontSize: "10px",
391
+ textAlign: eachSection.source === "bot" ? "left" : "right"
392
+ }
393
+ },
394
+ moment(eachSection.dateTime).format("LT")
395
+ ) : ""));
301
396
  }
302
397
  return null;
303
398
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/core",
3
- "version": "0.0.16-Beta3",
3
+ "version": "0.0.16-Beta300",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
@@ -28,12 +28,13 @@
28
28
  "build": "tsup"
29
29
  },
30
30
  "dependencies": {
31
- "@apexcura/ui-components": "^0.0.14-Beta3",
31
+ "@apexcura/ui-components": "^0.0.14-Beta268",
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",
35
35
  "antd": "^5.16.5",
36
36
  "axios": "^1.6.8",
37
+ "moment": "^2.30.1",
37
38
  "react": "^18.3.1",
38
39
  "react-dom": "^18.3.1",
39
40
  "tsup": "^8.0.2"