@apexcura/core 0.0.17-Beta8 → 0.0.18-Beta
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 +16 -12
- package/dist/index.d.ts +16 -12
- package/dist/index.js +86 -7
- package/dist/index.mjs +94 -8
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -27,6 +27,8 @@ type FormExecutorProps = {
|
|
|
27
27
|
placement?: string;
|
|
28
28
|
profileImageClassName?: string;
|
|
29
29
|
value?: string | number | boolean | any[] | null | object;
|
|
30
|
+
picker?: "date" | "week" | "month" | "quarter" | "year";
|
|
31
|
+
weekrange?: boolean;
|
|
30
32
|
img?: string;
|
|
31
33
|
primaryText?: string;
|
|
32
34
|
secondaryText?: string;
|
|
@@ -43,18 +45,20 @@ type FormExecutorProps = {
|
|
|
43
45
|
rowSelection?: boolean;
|
|
44
46
|
length?: number;
|
|
45
47
|
loading?: boolean;
|
|
48
|
+
fillText1?: string;
|
|
49
|
+
fillText2?: string;
|
|
50
|
+
labels?: any[];
|
|
51
|
+
data?: any[];
|
|
52
|
+
pagination?: boolean;
|
|
53
|
+
is_detail?: boolean;
|
|
54
|
+
dateTime?: string;
|
|
55
|
+
minRows?: number;
|
|
56
|
+
maxRows?: number;
|
|
57
|
+
mode?: "multiple" | "tags" | undefined;
|
|
46
58
|
modalContent?: {
|
|
59
|
+
name?: string;
|
|
47
60
|
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
|
-
}[];
|
|
61
|
+
fields?: any[];
|
|
58
62
|
};
|
|
59
63
|
items?: {
|
|
60
64
|
icon?: React.JSX.Element | string;
|
|
@@ -171,8 +175,8 @@ type FormExecutorProps = {
|
|
|
171
175
|
}[];
|
|
172
176
|
}[];
|
|
173
177
|
};
|
|
174
|
-
setData
|
|
175
|
-
selectedRecord
|
|
178
|
+
setData?: Function;
|
|
179
|
+
selectedRecord?: Function;
|
|
176
180
|
};
|
|
177
181
|
type ElementExecutorProps = FormExecutorProps & styling;
|
|
178
182
|
declare const ElementExecutor: (props: ElementExecutorProps) => React.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ type FormExecutorProps = {
|
|
|
27
27
|
placement?: string;
|
|
28
28
|
profileImageClassName?: string;
|
|
29
29
|
value?: string | number | boolean | any[] | null | object;
|
|
30
|
+
picker?: "date" | "week" | "month" | "quarter" | "year";
|
|
31
|
+
weekrange?: boolean;
|
|
30
32
|
img?: string;
|
|
31
33
|
primaryText?: string;
|
|
32
34
|
secondaryText?: string;
|
|
@@ -43,18 +45,20 @@ type FormExecutorProps = {
|
|
|
43
45
|
rowSelection?: boolean;
|
|
44
46
|
length?: number;
|
|
45
47
|
loading?: boolean;
|
|
48
|
+
fillText1?: string;
|
|
49
|
+
fillText2?: string;
|
|
50
|
+
labels?: any[];
|
|
51
|
+
data?: any[];
|
|
52
|
+
pagination?: boolean;
|
|
53
|
+
is_detail?: boolean;
|
|
54
|
+
dateTime?: string;
|
|
55
|
+
minRows?: number;
|
|
56
|
+
maxRows?: number;
|
|
57
|
+
mode?: "multiple" | "tags" | undefined;
|
|
46
58
|
modalContent?: {
|
|
59
|
+
name?: string;
|
|
47
60
|
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
|
-
}[];
|
|
61
|
+
fields?: any[];
|
|
58
62
|
};
|
|
59
63
|
items?: {
|
|
60
64
|
icon?: React.JSX.Element | string;
|
|
@@ -171,8 +175,8 @@ type FormExecutorProps = {
|
|
|
171
175
|
}[];
|
|
172
176
|
}[];
|
|
173
177
|
};
|
|
174
|
-
setData
|
|
175
|
-
selectedRecord
|
|
178
|
+
setData?: Function;
|
|
179
|
+
selectedRecord?: Function;
|
|
176
180
|
};
|
|
177
181
|
type ElementExecutorProps = FormExecutorProps & styling;
|
|
178
182
|
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(
|
|
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":
|
|
@@ -316,8 +323,62 @@ var ElementExecutor = (props) => {
|
|
|
316
323
|
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
317
324
|
}
|
|
318
325
|
);
|
|
319
|
-
case "donut":
|
|
320
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
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
|
+
);
|
|
374
|
+
case "color-picker":
|
|
375
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
376
|
+
import_ui_components.ColorPickerElement,
|
|
377
|
+
{
|
|
378
|
+
...elementProps,
|
|
379
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
380
|
+
}
|
|
381
|
+
);
|
|
321
382
|
default:
|
|
322
383
|
return null;
|
|
323
384
|
}
|
|
@@ -325,7 +386,25 @@ var ElementExecutor = (props) => {
|
|
|
325
386
|
const renderFields = (schema2) => {
|
|
326
387
|
return schema2 && schema2.map((eachSection) => {
|
|
327
388
|
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))
|
|
389
|
+
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(
|
|
390
|
+
"p",
|
|
391
|
+
{
|
|
392
|
+
style: {
|
|
393
|
+
fontSize: "10px",
|
|
394
|
+
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
(0, import_moment.default)(eachSection.dateTime).format("LT")
|
|
398
|
+
) : "") : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
|
|
399
|
+
"p",
|
|
400
|
+
{
|
|
401
|
+
style: {
|
|
402
|
+
fontSize: "10px",
|
|
403
|
+
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
(0, import_moment.default)(eachSection.dateTime).format("LT")
|
|
407
|
+
) : ""));
|
|
329
408
|
}
|
|
330
409
|
return null;
|
|
331
410
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -25,8 +25,16 @@ import {
|
|
|
25
25
|
TabsElement,
|
|
26
26
|
Upload,
|
|
27
27
|
OtpElement,
|
|
28
|
-
|
|
28
|
+
CircleDonut,
|
|
29
|
+
SemiCircleDonut,
|
|
30
|
+
HorizontalBarChart,
|
|
31
|
+
DoubleBarChart,
|
|
32
|
+
LineChart,
|
|
33
|
+
BarChart,
|
|
34
|
+
DivContainer,
|
|
35
|
+
ColorPickerElement
|
|
29
36
|
} from "@apexcura/ui-components";
|
|
37
|
+
import moment from "moment";
|
|
30
38
|
|
|
31
39
|
// src/services/http-service.tsx
|
|
32
40
|
import axios from "axios";
|
|
@@ -94,7 +102,7 @@ var ElementExecutor = (props) => {
|
|
|
94
102
|
return schema2.map((field) => {
|
|
95
103
|
if (field.name === name) {
|
|
96
104
|
field["value"] = value;
|
|
97
|
-
props.selectedRecord(field);
|
|
105
|
+
props.selectedRecord && props.selectedRecord(field);
|
|
98
106
|
}
|
|
99
107
|
if (field.fields && field.fields.length) {
|
|
100
108
|
field.fields = updateSchema(field.fields);
|
|
@@ -104,7 +112,7 @@ var ElementExecutor = (props) => {
|
|
|
104
112
|
};
|
|
105
113
|
const updatedSchema = updateSchema(schema);
|
|
106
114
|
setSchema(updatedSchema);
|
|
107
|
-
props.setData({ ...props.data, schema: updatedSchema });
|
|
115
|
+
props.setData && props.setData({ ...props.data, schema: updatedSchema });
|
|
108
116
|
};
|
|
109
117
|
const handleSelectData = async () => {
|
|
110
118
|
try {
|
|
@@ -205,13 +213,19 @@ var ElementExecutor = (props) => {
|
|
|
205
213
|
case "add-more":
|
|
206
214
|
return /* @__PURE__ */ React.createElement(AddMoreTable, { ...elementProps });
|
|
207
215
|
case "div":
|
|
208
|
-
return /* @__PURE__ */ React.createElement(
|
|
216
|
+
return /* @__PURE__ */ React.createElement(
|
|
217
|
+
DivContainer,
|
|
218
|
+
{
|
|
219
|
+
...elementProps,
|
|
220
|
+
onClick: () => props.selectedRecord && props.selectedRecord(elementProps)
|
|
221
|
+
}
|
|
222
|
+
);
|
|
209
223
|
case "button":
|
|
210
224
|
return /* @__PURE__ */ React.createElement(
|
|
211
225
|
ButtonElement,
|
|
212
226
|
{
|
|
213
227
|
...elementProps,
|
|
214
|
-
onClick: () => props.selectedRecord(elementProps)
|
|
228
|
+
onClick: () => props.selectedRecord && props.selectedRecord(elementProps)
|
|
215
229
|
}
|
|
216
230
|
);
|
|
217
231
|
case "sidebar":
|
|
@@ -306,8 +320,62 @@ var ElementExecutor = (props) => {
|
|
|
306
320
|
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
307
321
|
}
|
|
308
322
|
);
|
|
309
|
-
case "donut":
|
|
310
|
-
return /* @__PURE__ */ React.createElement(
|
|
323
|
+
case "circle-donut":
|
|
324
|
+
return /* @__PURE__ */ React.createElement(
|
|
325
|
+
CircleDonut,
|
|
326
|
+
{
|
|
327
|
+
...elementProps,
|
|
328
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
case "semicircle-donut":
|
|
332
|
+
return /* @__PURE__ */ React.createElement(
|
|
333
|
+
SemiCircleDonut,
|
|
334
|
+
{
|
|
335
|
+
...elementProps,
|
|
336
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
case "horizontal-barchart":
|
|
340
|
+
return /* @__PURE__ */ React.createElement(
|
|
341
|
+
HorizontalBarChart,
|
|
342
|
+
{
|
|
343
|
+
...elementProps,
|
|
344
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
345
|
+
}
|
|
346
|
+
);
|
|
347
|
+
case "linechart":
|
|
348
|
+
return /* @__PURE__ */ React.createElement(
|
|
349
|
+
LineChart,
|
|
350
|
+
{
|
|
351
|
+
...elementProps,
|
|
352
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
case "double-barchart":
|
|
356
|
+
return /* @__PURE__ */ React.createElement(
|
|
357
|
+
DoubleBarChart,
|
|
358
|
+
{
|
|
359
|
+
...elementProps,
|
|
360
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
case "barchart":
|
|
364
|
+
return /* @__PURE__ */ React.createElement(
|
|
365
|
+
BarChart,
|
|
366
|
+
{
|
|
367
|
+
...elementProps,
|
|
368
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
369
|
+
}
|
|
370
|
+
);
|
|
371
|
+
case "color-picker":
|
|
372
|
+
return /* @__PURE__ */ React.createElement(
|
|
373
|
+
ColorPickerElement,
|
|
374
|
+
{
|
|
375
|
+
...elementProps,
|
|
376
|
+
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
377
|
+
}
|
|
378
|
+
);
|
|
311
379
|
default:
|
|
312
380
|
return null;
|
|
313
381
|
}
|
|
@@ -315,7 +383,25 @@ var ElementExecutor = (props) => {
|
|
|
315
383
|
const renderFields = (schema2) => {
|
|
316
384
|
return schema2 && schema2.map((eachSection) => {
|
|
317
385
|
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))
|
|
386
|
+
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(
|
|
387
|
+
"p",
|
|
388
|
+
{
|
|
389
|
+
style: {
|
|
390
|
+
fontSize: "10px",
|
|
391
|
+
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
moment(eachSection.dateTime).format("LT")
|
|
395
|
+
) : "") : /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
|
|
396
|
+
"p",
|
|
397
|
+
{
|
|
398
|
+
style: {
|
|
399
|
+
fontSize: "10px",
|
|
400
|
+
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
moment(eachSection.dateTime).format("LT")
|
|
404
|
+
) : ""));
|
|
319
405
|
}
|
|
320
406
|
return null;
|
|
321
407
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18-Beta",
|
|
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.
|
|
31
|
+
"@apexcura/ui-components": "^0.0.16-Beta",
|
|
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"
|