@apexcura/core 0.0.17-Beta6 → 0.0.17-Beta60

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
@@ -25,8 +25,19 @@ type FormExecutorProps = {
25
25
  buttonClassName?: string;
26
26
  icon?: string;
27
27
  placement?: string;
28
+ firstValue?: string;
29
+ secondValue?: string;
30
+ firstPlaceholder?: string;
31
+ secondPlaceholder?: string;
32
+ enabled_dates?: string;
28
33
  profileImageClassName?: string;
29
34
  value?: string | number | boolean | any[] | null | object;
35
+ message?: string;
36
+ description?: string;
37
+ notificationType?: string;
38
+ showProgress?: boolean;
39
+ picker?: "date" | "week" | "month" | "quarter" | "year";
40
+ weekrange?: boolean;
30
41
  img?: string;
31
42
  primaryText?: string;
32
43
  secondaryText?: string;
@@ -43,18 +54,20 @@ type FormExecutorProps = {
43
54
  rowSelection?: boolean;
44
55
  length?: number;
45
56
  loading?: boolean;
57
+ fillText1?: string;
58
+ fillText2?: string;
59
+ labels?: any[];
60
+ data?: any[];
61
+ pagination?: boolean;
62
+ is_detail?: boolean;
63
+ dateTime?: string;
64
+ minRows?: number;
65
+ maxRows?: number;
66
+ mode?: "multiple" | "tags" | undefined;
46
67
  modalContent?: {
68
+ name?: string;
47
69
  className?: string;
48
- fields?: {
49
- _id?: string;
50
- name?: string;
51
- label?: string;
52
- source?: string;
53
- initial_message?: boolean;
54
- element: string;
55
- className?: string;
56
- position?: string;
57
- }[];
70
+ fields?: any[];
58
71
  };
59
72
  items?: {
60
73
  icon?: React.JSX.Element | string;
@@ -171,8 +184,8 @@ type FormExecutorProps = {
171
184
  }[];
172
185
  }[];
173
186
  };
174
- setData: Function;
175
- selectedRecord: Function;
187
+ setData?: Function;
188
+ selectedRecord?: Function;
176
189
  };
177
190
  type ElementExecutorProps = FormExecutorProps & styling;
178
191
  declare const ElementExecutor: (props: ElementExecutorProps) => React.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -25,8 +25,19 @@ type FormExecutorProps = {
25
25
  buttonClassName?: string;
26
26
  icon?: string;
27
27
  placement?: string;
28
+ firstValue?: string;
29
+ secondValue?: string;
30
+ firstPlaceholder?: string;
31
+ secondPlaceholder?: string;
32
+ enabled_dates?: string;
28
33
  profileImageClassName?: string;
29
34
  value?: string | number | boolean | any[] | null | object;
35
+ message?: string;
36
+ description?: string;
37
+ notificationType?: string;
38
+ showProgress?: boolean;
39
+ picker?: "date" | "week" | "month" | "quarter" | "year";
40
+ weekrange?: boolean;
30
41
  img?: string;
31
42
  primaryText?: string;
32
43
  secondaryText?: string;
@@ -43,18 +54,20 @@ type FormExecutorProps = {
43
54
  rowSelection?: boolean;
44
55
  length?: number;
45
56
  loading?: boolean;
57
+ fillText1?: string;
58
+ fillText2?: string;
59
+ labels?: any[];
60
+ data?: any[];
61
+ pagination?: boolean;
62
+ is_detail?: boolean;
63
+ dateTime?: string;
64
+ minRows?: number;
65
+ maxRows?: number;
66
+ mode?: "multiple" | "tags" | undefined;
46
67
  modalContent?: {
68
+ name?: string;
47
69
  className?: string;
48
- fields?: {
49
- _id?: string;
50
- name?: string;
51
- label?: string;
52
- source?: string;
53
- initial_message?: boolean;
54
- element: string;
55
- className?: string;
56
- position?: string;
57
- }[];
70
+ fields?: any[];
58
71
  };
59
72
  items?: {
60
73
  icon?: React.JSX.Element | string;
@@ -171,8 +184,8 @@ type FormExecutorProps = {
171
184
  }[];
172
185
  }[];
173
186
  };
174
- setData: Function;
175
- selectedRecord: Function;
187
+ setData?: Function;
188
+ selectedRecord?: Function;
176
189
  };
177
190
  type ElementExecutorProps = FormExecutorProps & styling;
178
191
  declare const ElementExecutor: (props: ElementExecutorProps) => React.JSX.Element;
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"));
@@ -104,7 +105,7 @@ var ElementExecutor = (props) => {
104
105
  return schema2.map((field) => {
105
106
  if (field.name === name) {
106
107
  field["value"] = value;
107
- props.selectedRecord(field);
108
+ props.selectedRecord && props.selectedRecord(field);
108
109
  }
109
110
  if (field.fields && field.fields.length) {
110
111
  field.fields = updateSchema(field.fields);
@@ -114,7 +115,7 @@ var ElementExecutor = (props) => {
114
115
  };
115
116
  const updatedSchema = updateSchema(schema);
116
117
  setSchema(updatedSchema);
117
- props.setData({ ...props.data, schema: updatedSchema });
118
+ props.setData && props.setData({ ...props.data, schema: updatedSchema });
118
119
  };
119
120
  const handleSelectData = async () => {
120
121
  try {
@@ -215,13 +216,19 @@ var ElementExecutor = (props) => {
215
216
  case "add-more":
216
217
  return /* @__PURE__ */ import_react.default.createElement(import_ui_components.AddMoreTable, { ...elementProps });
217
218
  case "div":
218
- 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 && props.selectedRecord(elementProps)
224
+ }
225
+ );
219
226
  case "button":
220
227
  return /* @__PURE__ */ import_react.default.createElement(
221
228
  import_ui_components.ButtonElement,
222
229
  {
223
230
  ...elementProps,
224
- onClick: () => props.selectedRecord(elementProps)
231
+ onClick: () => props.selectedRecord && props.selectedRecord(elementProps)
225
232
  }
226
233
  );
227
234
  case "sidebar":
@@ -258,6 +265,14 @@ var ElementExecutor = (props) => {
258
265
  onChange: (value) => onHandleChange(elementProps.name || "", value)
259
266
  }
260
267
  );
268
+ case "datetimepicker":
269
+ return /* @__PURE__ */ import_react.default.createElement(
270
+ import_ui_components.DatePickerElement,
271
+ {
272
+ ...elementProps,
273
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
274
+ }
275
+ );
261
276
  case "upload":
262
277
  return /* @__PURE__ */ import_react.default.createElement(
263
278
  import_ui_components.FileUpload,
@@ -316,16 +331,96 @@ var ElementExecutor = (props) => {
316
331
  onChange: (value) => onHandleChange(elementProps.name || "", value)
317
332
  }
318
333
  );
319
- case "donut":
320
- return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Donut, { ...elementProps });
334
+ case "circle-donut":
335
+ return /* @__PURE__ */ import_react.default.createElement(
336
+ import_ui_components.CircleDonut,
337
+ {
338
+ ...elementProps,
339
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
340
+ }
341
+ );
342
+ case "semicircle-donut":
343
+ return /* @__PURE__ */ import_react.default.createElement(
344
+ import_ui_components.SemiCircleDonut,
345
+ {
346
+ ...elementProps,
347
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
348
+ }
349
+ );
350
+ case "horizontal-barchart":
351
+ return /* @__PURE__ */ import_react.default.createElement(
352
+ import_ui_components.HorizontalBarChart,
353
+ {
354
+ ...elementProps,
355
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
356
+ }
357
+ );
358
+ case "linechart":
359
+ return /* @__PURE__ */ import_react.default.createElement(
360
+ import_ui_components.LineChart,
361
+ {
362
+ ...elementProps,
363
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
364
+ }
365
+ );
366
+ case "double-barchart":
367
+ return /* @__PURE__ */ import_react.default.createElement(
368
+ import_ui_components.DoubleBarChart,
369
+ {
370
+ ...elementProps,
371
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
372
+ }
373
+ );
374
+ case "barchart":
375
+ return /* @__PURE__ */ import_react.default.createElement(
376
+ import_ui_components.BarChart,
377
+ {
378
+ ...elementProps,
379
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
380
+ }
381
+ );
382
+ case "color-picker":
383
+ return /* @__PURE__ */ import_react.default.createElement(
384
+ import_ui_components.ColorPickerElement,
385
+ {
386
+ ...elementProps,
387
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
388
+ }
389
+ );
390
+ case "alert":
391
+ return /* @__PURE__ */ import_react.default.createElement(
392
+ import_ui_components.NotificationAlert,
393
+ {
394
+ ...elementProps,
395
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
396
+ }
397
+ );
321
398
  default:
322
399
  return null;
323
400
  }
324
401
  };
325
402
  const renderFields = (schema2) => {
326
- return schema2 && schema2.map((eachSection) => {
403
+ return schema2 && schema2.map((eachSection, index) => {
327
404
  if (eachSection.visible !== false) {
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));
405
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, { key: index }, 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: index }, renderFields(eachSection.fields)), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
406
+ "p",
407
+ {
408
+ style: {
409
+ fontSize: "10px",
410
+ textAlign: eachSection.source === "bot" ? "left" : "right"
411
+ }
412
+ },
413
+ (0, import_moment.default)(eachSection.dateTime).format("LT")
414
+ ) : "") : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
415
+ "p",
416
+ {
417
+ style: {
418
+ fontSize: "10px",
419
+ textAlign: eachSection.source === "bot" ? "left" : "right"
420
+ }
421
+ },
422
+ (0, import_moment.default)(eachSection.dateTime).format("LT")
423
+ ) : ""));
329
424
  }
330
425
  return null;
331
426
  });
package/dist/index.mjs CHANGED
@@ -25,8 +25,17 @@ import {
25
25
  TabsElement,
26
26
  Upload,
27
27
  OtpElement,
28
- Donut
28
+ CircleDonut,
29
+ SemiCircleDonut,
30
+ HorizontalBarChart,
31
+ DoubleBarChart,
32
+ LineChart,
33
+ BarChart,
34
+ DivContainer,
35
+ ColorPickerElement,
36
+ NotificationAlert
29
37
  } from "@apexcura/ui-components";
38
+ import moment from "moment";
30
39
 
31
40
  // src/services/http-service.tsx
32
41
  import axios from "axios";
@@ -94,7 +103,7 @@ var ElementExecutor = (props) => {
94
103
  return schema2.map((field) => {
95
104
  if (field.name === name) {
96
105
  field["value"] = value;
97
- props.selectedRecord(field);
106
+ props.selectedRecord && props.selectedRecord(field);
98
107
  }
99
108
  if (field.fields && field.fields.length) {
100
109
  field.fields = updateSchema(field.fields);
@@ -104,7 +113,7 @@ var ElementExecutor = (props) => {
104
113
  };
105
114
  const updatedSchema = updateSchema(schema);
106
115
  setSchema(updatedSchema);
107
- props.setData({ ...props.data, schema: updatedSchema });
116
+ props.setData && props.setData({ ...props.data, schema: updatedSchema });
108
117
  };
109
118
  const handleSelectData = async () => {
110
119
  try {
@@ -205,13 +214,19 @@ var ElementExecutor = (props) => {
205
214
  case "add-more":
206
215
  return /* @__PURE__ */ React.createElement(AddMoreTable, { ...elementProps });
207
216
  case "div":
208
- return /* @__PURE__ */ React.createElement("div", { className: elementProps.className }, elementProps.label);
217
+ return /* @__PURE__ */ React.createElement(
218
+ DivContainer,
219
+ {
220
+ ...elementProps,
221
+ onClick: () => props.selectedRecord && props.selectedRecord(elementProps)
222
+ }
223
+ );
209
224
  case "button":
210
225
  return /* @__PURE__ */ React.createElement(
211
226
  ButtonElement,
212
227
  {
213
228
  ...elementProps,
214
- onClick: () => props.selectedRecord(elementProps)
229
+ onClick: () => props.selectedRecord && props.selectedRecord(elementProps)
215
230
  }
216
231
  );
217
232
  case "sidebar":
@@ -248,6 +263,14 @@ var ElementExecutor = (props) => {
248
263
  onChange: (value) => onHandleChange(elementProps.name || "", value)
249
264
  }
250
265
  );
266
+ case "datetimepicker":
267
+ return /* @__PURE__ */ React.createElement(
268
+ DatePickerElement,
269
+ {
270
+ ...elementProps,
271
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
272
+ }
273
+ );
251
274
  case "upload":
252
275
  return /* @__PURE__ */ React.createElement(
253
276
  FileUpload,
@@ -306,16 +329,96 @@ var ElementExecutor = (props) => {
306
329
  onChange: (value) => onHandleChange(elementProps.name || "", value)
307
330
  }
308
331
  );
309
- case "donut":
310
- return /* @__PURE__ */ React.createElement(Donut, { ...elementProps });
332
+ case "circle-donut":
333
+ return /* @__PURE__ */ React.createElement(
334
+ CircleDonut,
335
+ {
336
+ ...elementProps,
337
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
338
+ }
339
+ );
340
+ case "semicircle-donut":
341
+ return /* @__PURE__ */ React.createElement(
342
+ SemiCircleDonut,
343
+ {
344
+ ...elementProps,
345
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
346
+ }
347
+ );
348
+ case "horizontal-barchart":
349
+ return /* @__PURE__ */ React.createElement(
350
+ HorizontalBarChart,
351
+ {
352
+ ...elementProps,
353
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
354
+ }
355
+ );
356
+ case "linechart":
357
+ return /* @__PURE__ */ React.createElement(
358
+ LineChart,
359
+ {
360
+ ...elementProps,
361
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
362
+ }
363
+ );
364
+ case "double-barchart":
365
+ return /* @__PURE__ */ React.createElement(
366
+ DoubleBarChart,
367
+ {
368
+ ...elementProps,
369
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
370
+ }
371
+ );
372
+ case "barchart":
373
+ return /* @__PURE__ */ React.createElement(
374
+ BarChart,
375
+ {
376
+ ...elementProps,
377
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
378
+ }
379
+ );
380
+ case "color-picker":
381
+ return /* @__PURE__ */ React.createElement(
382
+ ColorPickerElement,
383
+ {
384
+ ...elementProps,
385
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
386
+ }
387
+ );
388
+ case "alert":
389
+ return /* @__PURE__ */ React.createElement(
390
+ NotificationAlert,
391
+ {
392
+ ...elementProps,
393
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
394
+ }
395
+ );
311
396
  default:
312
397
  return null;
313
398
  }
314
399
  };
315
400
  const renderFields = (schema2) => {
316
- return schema2 && schema2.map((eachSection) => {
401
+ return schema2 && schema2.map((eachSection, index) => {
317
402
  if (eachSection.visible !== false) {
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));
403
+ return /* @__PURE__ */ React.createElement(React.Fragment, { key: index }, eachSection.fields && eachSection.fields.length > 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), /* @__PURE__ */ React.createElement("div", { className: eachSection.className, key: index }, renderFields(eachSection.fields)), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
404
+ "p",
405
+ {
406
+ style: {
407
+ fontSize: "10px",
408
+ textAlign: eachSection.source === "bot" ? "left" : "right"
409
+ }
410
+ },
411
+ moment(eachSection.dateTime).format("LT")
412
+ ) : "") : /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
413
+ "p",
414
+ {
415
+ style: {
416
+ fontSize: "10px",
417
+ textAlign: eachSection.source === "bot" ? "left" : "right"
418
+ }
419
+ },
420
+ moment(eachSection.dateTime).format("LT")
421
+ ) : ""));
319
422
  }
320
423
  return null;
321
424
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/core",
3
- "version": "0.0.17-Beta6",
3
+ "version": "0.0.17-Beta60",
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.15-Beta8",
31
+ "@apexcura/ui-components": "^0.0.15-Beta50",
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"