@apexcura/core 0.0.16-Beta205 → 0.0.16-Beta207

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
@@ -47,6 +47,9 @@ type FormExecutorProps = {
47
47
  fillText2?: string;
48
48
  labels?: any[];
49
49
  data?: any[];
50
+ pagination?: boolean;
51
+ is_detail?: boolean;
52
+ dateTime?: string;
50
53
  modalContent?: {
51
54
  className?: string;
52
55
  fields?: {
package/dist/index.d.ts CHANGED
@@ -47,6 +47,9 @@ type FormExecutorProps = {
47
47
  fillText2?: string;
48
48
  labels?: any[];
49
49
  data?: any[];
50
+ pagination?: boolean;
51
+ is_detail?: boolean;
52
+ dateTime?: string;
50
53
  modalContent?: {
51
54
  className?: string;
52
55
  fields?: {
package/dist/index.js CHANGED
@@ -36,9 +36,8 @@ 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"));
41
39
  var import_ui_components = require("@apexcura/ui-components");
40
+ var import_moment = __toESM(require("moment"));
42
41
 
43
42
  // src/services/http-service.tsx
44
43
  var import_axios = __toESM(require("axios"));
@@ -342,141 +341,13 @@ var ElementExecutor = (props) => {
342
341
  onChange: (value) => onHandleChange(elementProps.name || "", value)
343
342
  }
344
343
  );
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
- }]
344
+ case "linechart":
345
+ return /* @__PURE__ */ import_react.default.createElement(
346
+ import_ui_components.LineChart,
347
+ {
348
+ ...elementProps,
349
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
470
350
  }
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 })
480
351
  );
481
352
  case "double-barchart":
482
353
  return /* @__PURE__ */ import_react.default.createElement(
@@ -501,7 +372,25 @@ var ElementExecutor = (props) => {
501
372
  const renderFields = (schema2) => {
502
373
  return schema2 && schema2.map((eachSection) => {
503
374
  if (eachSection.visible !== false) {
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));
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)), eachSection.dateTime ? /* @__PURE__ */ import_react.default.createElement(
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
+ ) : ""));
505
394
  }
506
395
  return null;
507
396
  });
package/dist/index.mjs CHANGED
@@ -1,7 +1,5 @@
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";
5
3
  import {
6
4
  TextElement,
7
5
  NumberElement,
@@ -31,8 +29,10 @@ import {
31
29
  SemiCircleDonut,
32
30
  HorizontalBarChart,
33
31
  DoubleBarChart,
32
+ LineChart,
34
33
  BarChart
35
34
  } 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,141 +336,13 @@ var ElementExecutor = (props) => {
336
336
  onChange: (value) => onHandleChange(elementProps.name || "", value)
337
337
  }
338
338
  );
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
- }]
339
+ case "linechart":
340
+ return /* @__PURE__ */ React.createElement(
341
+ LineChart,
342
+ {
343
+ ...elementProps,
344
+ onChange: (value) => onHandleChange(elementProps.name || "", value)
464
345
  }
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 })
474
346
  );
475
347
  case "double-barchart":
476
348
  return /* @__PURE__ */ React.createElement(
@@ -495,7 +367,25 @@ var ElementExecutor = (props) => {
495
367
  const renderFields = (schema2) => {
496
368
  return schema2 && schema2.map((eachSection) => {
497
369
  if (eachSection.visible !== false) {
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));
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)), eachSection.dateTime ? /* @__PURE__ */ React.createElement(
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
+ ) : ""));
499
389
  }
500
390
  return null;
501
391
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/core",
3
- "version": "0.0.16-Beta205",
3
+ "version": "0.0.16-Beta207",
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-Beta188",
31
+ "@apexcura/ui-components": "^0.0.14-Beta193",
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"