@apexcura/core 0.0.16-Beta204 → 0.0.16-Beta205
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 +0 -3
- package/dist/index.d.ts +0 -3
- package/dist/index.js +137 -26
- package/dist/index.mjs +137 -27
- package/package.json +2 -3
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -36,8 +36,9 @@ module.exports = __toCommonJS(src_exports);
|
|
|
36
36
|
|
|
37
37
|
// src/libraries/element-executor.tsx
|
|
38
38
|
var import_react = __toESM(require("react"));
|
|
39
|
+
var import_highcharts = __toESM(require("highcharts"));
|
|
40
|
+
var import_highcharts_react_official = __toESM(require("highcharts-react-official"));
|
|
39
41
|
var import_ui_components = require("@apexcura/ui-components");
|
|
40
|
-
var import_moment = __toESM(require("moment"));
|
|
41
42
|
|
|
42
43
|
// src/services/http-service.tsx
|
|
43
44
|
var import_axios = __toESM(require("axios"));
|
|
@@ -341,13 +342,141 @@ var ElementExecutor = (props) => {
|
|
|
341
342
|
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
342
343
|
}
|
|
343
344
|
);
|
|
344
|
-
case "linechart":
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
345
|
+
case "highchart-linechart":
|
|
346
|
+
let data_options = {
|
|
347
|
+
chart: {
|
|
348
|
+
height: "45%"
|
|
349
|
+
},
|
|
350
|
+
title: {
|
|
351
|
+
text: "U.S Solar Employment Growth",
|
|
352
|
+
align: "left"
|
|
353
|
+
},
|
|
354
|
+
subtitle: {
|
|
355
|
+
text: 'By Job Category. Source: <a href="https://irecusa.org/programs/solar-jobs-census/" target="_blank">IREC</a>.',
|
|
356
|
+
align: "left"
|
|
357
|
+
},
|
|
358
|
+
yAxis: {
|
|
359
|
+
title: {
|
|
360
|
+
text: "Number of Employees"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
xAxis: {
|
|
364
|
+
accessibility: {
|
|
365
|
+
rangeDescription: "Range: 2010 to 2020"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
legend: {
|
|
369
|
+
layout: "vertical",
|
|
370
|
+
align: "right",
|
|
371
|
+
verticalAlign: "middle"
|
|
372
|
+
},
|
|
373
|
+
plotOptions: {
|
|
374
|
+
series: {
|
|
375
|
+
label: {
|
|
376
|
+
connectorAllowed: false
|
|
377
|
+
},
|
|
378
|
+
pointStart: 2010
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
series: [{
|
|
382
|
+
name: "Installation & Developers",
|
|
383
|
+
data: [
|
|
384
|
+
43934,
|
|
385
|
+
48656,
|
|
386
|
+
65165,
|
|
387
|
+
81827,
|
|
388
|
+
112143,
|
|
389
|
+
142383,
|
|
390
|
+
171533,
|
|
391
|
+
165174,
|
|
392
|
+
155157,
|
|
393
|
+
161454,
|
|
394
|
+
154610
|
|
395
|
+
]
|
|
396
|
+
}, {
|
|
397
|
+
name: "Manufacturing",
|
|
398
|
+
data: [
|
|
399
|
+
24916,
|
|
400
|
+
37941,
|
|
401
|
+
29742,
|
|
402
|
+
29851,
|
|
403
|
+
32490,
|
|
404
|
+
30282,
|
|
405
|
+
38121,
|
|
406
|
+
36885,
|
|
407
|
+
33726,
|
|
408
|
+
34243,
|
|
409
|
+
31050
|
|
410
|
+
]
|
|
411
|
+
}, {
|
|
412
|
+
name: "Sales & Distribution",
|
|
413
|
+
data: [
|
|
414
|
+
11744,
|
|
415
|
+
3e4,
|
|
416
|
+
16005,
|
|
417
|
+
19771,
|
|
418
|
+
20185,
|
|
419
|
+
24377,
|
|
420
|
+
32147,
|
|
421
|
+
30912,
|
|
422
|
+
29243,
|
|
423
|
+
29213,
|
|
424
|
+
25663
|
|
425
|
+
]
|
|
426
|
+
}, {
|
|
427
|
+
name: "Operations & Maintenance",
|
|
428
|
+
data: [
|
|
429
|
+
null,
|
|
430
|
+
null,
|
|
431
|
+
null,
|
|
432
|
+
null,
|
|
433
|
+
null,
|
|
434
|
+
null,
|
|
435
|
+
null,
|
|
436
|
+
null,
|
|
437
|
+
11164,
|
|
438
|
+
11218,
|
|
439
|
+
10077
|
|
440
|
+
]
|
|
441
|
+
}, {
|
|
442
|
+
name: "Other",
|
|
443
|
+
data: [
|
|
444
|
+
21908,
|
|
445
|
+
5548,
|
|
446
|
+
8105,
|
|
447
|
+
11248,
|
|
448
|
+
8989,
|
|
449
|
+
11816,
|
|
450
|
+
18274,
|
|
451
|
+
17300,
|
|
452
|
+
13053,
|
|
453
|
+
11906,
|
|
454
|
+
10073
|
|
455
|
+
]
|
|
456
|
+
}],
|
|
457
|
+
responsive: {
|
|
458
|
+
rules: [{
|
|
459
|
+
condition: {
|
|
460
|
+
maxWidth: 500
|
|
461
|
+
},
|
|
462
|
+
chartOptions: {
|
|
463
|
+
legend: {
|
|
464
|
+
layout: "horizontal",
|
|
465
|
+
align: "center",
|
|
466
|
+
verticalAlign: "bottom"
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}]
|
|
350
470
|
}
|
|
471
|
+
};
|
|
472
|
+
return (
|
|
473
|
+
// <LineChart
|
|
474
|
+
// {...elementProps}
|
|
475
|
+
// onChange={(value: any) =>
|
|
476
|
+
// onHandleChange(elementProps.name || "", value)
|
|
477
|
+
// }
|
|
478
|
+
// />
|
|
479
|
+
/* @__PURE__ */ import_react.default.createElement(import_highcharts_react_official.default, { highcharts: import_highcharts.default, options: data_options })
|
|
351
480
|
);
|
|
352
481
|
case "double-barchart":
|
|
353
482
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -372,25 +501,7 @@ var ElementExecutor = (props) => {
|
|
|
372
501
|
const renderFields = (schema2) => {
|
|
373
502
|
return schema2 && schema2.map((eachSection) => {
|
|
374
503
|
if (eachSection.visible !== false) {
|
|
375
|
-
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))
|
|
376
|
-
"p",
|
|
377
|
-
{
|
|
378
|
-
style: {
|
|
379
|
-
fontSize: "10px",
|
|
380
|
-
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
381
|
-
}
|
|
382
|
-
},
|
|
383
|
-
(0, import_moment.default)(eachSection.dateTime).format("LT")
|
|
384
|
-
) : "") : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
|
|
385
|
-
"p",
|
|
386
|
-
{
|
|
387
|
-
style: {
|
|
388
|
-
fontSize: "10px",
|
|
389
|
-
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
(0, import_moment.default)(eachSection.dateTime).format("LT")
|
|
393
|
-
) : ""));
|
|
504
|
+
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));
|
|
394
505
|
}
|
|
395
506
|
return null;
|
|
396
507
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/libraries/element-executor.tsx
|
|
2
2
|
import React, { useState } from "react";
|
|
3
|
+
import Highcharts from "highcharts";
|
|
4
|
+
import HighchartsReact from "highcharts-react-official";
|
|
3
5
|
import {
|
|
4
6
|
TextElement,
|
|
5
7
|
NumberElement,
|
|
@@ -29,10 +31,8 @@ import {
|
|
|
29
31
|
SemiCircleDonut,
|
|
30
32
|
HorizontalBarChart,
|
|
31
33
|
DoubleBarChart,
|
|
32
|
-
LineChart,
|
|
33
34
|
BarChart
|
|
34
35
|
} from "@apexcura/ui-components";
|
|
35
|
-
import moment from "moment";
|
|
36
36
|
|
|
37
37
|
// src/services/http-service.tsx
|
|
38
38
|
import axios from "axios";
|
|
@@ -336,13 +336,141 @@ var ElementExecutor = (props) => {
|
|
|
336
336
|
onChange: (value) => onHandleChange(elementProps.name || "", value)
|
|
337
337
|
}
|
|
338
338
|
);
|
|
339
|
-
case "linechart":
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
339
|
+
case "highchart-linechart":
|
|
340
|
+
let data_options = {
|
|
341
|
+
chart: {
|
|
342
|
+
height: "45%"
|
|
343
|
+
},
|
|
344
|
+
title: {
|
|
345
|
+
text: "U.S Solar Employment Growth",
|
|
346
|
+
align: "left"
|
|
347
|
+
},
|
|
348
|
+
subtitle: {
|
|
349
|
+
text: 'By Job Category. Source: <a href="https://irecusa.org/programs/solar-jobs-census/" target="_blank">IREC</a>.',
|
|
350
|
+
align: "left"
|
|
351
|
+
},
|
|
352
|
+
yAxis: {
|
|
353
|
+
title: {
|
|
354
|
+
text: "Number of Employees"
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
xAxis: {
|
|
358
|
+
accessibility: {
|
|
359
|
+
rangeDescription: "Range: 2010 to 2020"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
legend: {
|
|
363
|
+
layout: "vertical",
|
|
364
|
+
align: "right",
|
|
365
|
+
verticalAlign: "middle"
|
|
366
|
+
},
|
|
367
|
+
plotOptions: {
|
|
368
|
+
series: {
|
|
369
|
+
label: {
|
|
370
|
+
connectorAllowed: false
|
|
371
|
+
},
|
|
372
|
+
pointStart: 2010
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
series: [{
|
|
376
|
+
name: "Installation & Developers",
|
|
377
|
+
data: [
|
|
378
|
+
43934,
|
|
379
|
+
48656,
|
|
380
|
+
65165,
|
|
381
|
+
81827,
|
|
382
|
+
112143,
|
|
383
|
+
142383,
|
|
384
|
+
171533,
|
|
385
|
+
165174,
|
|
386
|
+
155157,
|
|
387
|
+
161454,
|
|
388
|
+
154610
|
|
389
|
+
]
|
|
390
|
+
}, {
|
|
391
|
+
name: "Manufacturing",
|
|
392
|
+
data: [
|
|
393
|
+
24916,
|
|
394
|
+
37941,
|
|
395
|
+
29742,
|
|
396
|
+
29851,
|
|
397
|
+
32490,
|
|
398
|
+
30282,
|
|
399
|
+
38121,
|
|
400
|
+
36885,
|
|
401
|
+
33726,
|
|
402
|
+
34243,
|
|
403
|
+
31050
|
|
404
|
+
]
|
|
405
|
+
}, {
|
|
406
|
+
name: "Sales & Distribution",
|
|
407
|
+
data: [
|
|
408
|
+
11744,
|
|
409
|
+
3e4,
|
|
410
|
+
16005,
|
|
411
|
+
19771,
|
|
412
|
+
20185,
|
|
413
|
+
24377,
|
|
414
|
+
32147,
|
|
415
|
+
30912,
|
|
416
|
+
29243,
|
|
417
|
+
29213,
|
|
418
|
+
25663
|
|
419
|
+
]
|
|
420
|
+
}, {
|
|
421
|
+
name: "Operations & Maintenance",
|
|
422
|
+
data: [
|
|
423
|
+
null,
|
|
424
|
+
null,
|
|
425
|
+
null,
|
|
426
|
+
null,
|
|
427
|
+
null,
|
|
428
|
+
null,
|
|
429
|
+
null,
|
|
430
|
+
null,
|
|
431
|
+
11164,
|
|
432
|
+
11218,
|
|
433
|
+
10077
|
|
434
|
+
]
|
|
435
|
+
}, {
|
|
436
|
+
name: "Other",
|
|
437
|
+
data: [
|
|
438
|
+
21908,
|
|
439
|
+
5548,
|
|
440
|
+
8105,
|
|
441
|
+
11248,
|
|
442
|
+
8989,
|
|
443
|
+
11816,
|
|
444
|
+
18274,
|
|
445
|
+
17300,
|
|
446
|
+
13053,
|
|
447
|
+
11906,
|
|
448
|
+
10073
|
|
449
|
+
]
|
|
450
|
+
}],
|
|
451
|
+
responsive: {
|
|
452
|
+
rules: [{
|
|
453
|
+
condition: {
|
|
454
|
+
maxWidth: 500
|
|
455
|
+
},
|
|
456
|
+
chartOptions: {
|
|
457
|
+
legend: {
|
|
458
|
+
layout: "horizontal",
|
|
459
|
+
align: "center",
|
|
460
|
+
verticalAlign: "bottom"
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}]
|
|
345
464
|
}
|
|
465
|
+
};
|
|
466
|
+
return (
|
|
467
|
+
// <LineChart
|
|
468
|
+
// {...elementProps}
|
|
469
|
+
// onChange={(value: any) =>
|
|
470
|
+
// onHandleChange(elementProps.name || "", value)
|
|
471
|
+
// }
|
|
472
|
+
// />
|
|
473
|
+
/* @__PURE__ */ React.createElement(HighchartsReact, { highcharts: Highcharts, options: data_options })
|
|
346
474
|
);
|
|
347
475
|
case "double-barchart":
|
|
348
476
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -367,25 +495,7 @@ var ElementExecutor = (props) => {
|
|
|
367
495
|
const renderFields = (schema2) => {
|
|
368
496
|
return schema2 && schema2.map((eachSection) => {
|
|
369
497
|
if (eachSection.visible !== false) {
|
|
370
|
-
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))
|
|
371
|
-
"p",
|
|
372
|
-
{
|
|
373
|
-
style: {
|
|
374
|
-
fontSize: "10px",
|
|
375
|
-
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
moment(eachSection.dateTime).format("LT")
|
|
379
|
-
) : "") : /* @__PURE__ */ React.createElement(React.Fragment, null, renderElement(eachSection), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
|
|
380
|
-
"p",
|
|
381
|
-
{
|
|
382
|
-
style: {
|
|
383
|
-
fontSize: "10px",
|
|
384
|
-
textAlign: eachSection.source === "bot" ? "left" : "right"
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
moment(eachSection.dateTime).format("LT")
|
|
388
|
-
) : ""));
|
|
498
|
+
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));
|
|
389
499
|
}
|
|
390
500
|
return null;
|
|
391
501
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/core",
|
|
3
|
-
"version": "0.0.16-
|
|
3
|
+
"version": "0.0.16-Beta205",
|
|
4
4
|
"description": "Apex cura React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex cura",
|
|
@@ -28,13 +28,12 @@
|
|
|
28
28
|
"build": "tsup"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@apexcura/ui-components": "^0.0.14-
|
|
31
|
+
"@apexcura/ui-components": "^0.0.14-Beta188",
|
|
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",
|
|
38
37
|
"react": "^18.3.1",
|
|
39
38
|
"react-dom": "^18.3.1",
|
|
40
39
|
"tsup": "^8.0.2"
|