impaktapps-ui-builder 1.0.182 → 1.0.196-test

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.
Files changed (22) hide show
  1. package/dist/impaktapps-ui-builder.es.js +81 -72
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +6 -6
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.d.ts +1 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.d.ts +22 -0
  7. package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +0 -1
  8. package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +0 -1
  9. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -2
  10. package/package.json +1 -1
  11. package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +3 -0
  12. package/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.ts +35 -0
  13. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +4 -0
  14. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +15 -0
  15. package/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.ts +13 -0
  16. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +9 -1
  17. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +1 -2
  18. package/src/impaktapps-ui-builder/builder/services/component.ts +1 -0
  19. package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +1 -81
  20. package/src/impaktapps-ui-builder/runtime/services/events.ts +3 -6
  21. package/src/impaktapps-ui-builder/runtime/services/interface.ts +0 -1
  22. package/src/impaktapps-ui-builder/runtime/services/service.ts +10 -5
@@ -6272,6 +6272,7 @@ const ComponentSchema = {
6272
6272
  { title: "Rank", const: "Rank" },
6273
6273
  { title: "Rank Card", const: "RankCard" },
6274
6274
  { title: "Metric Card", const: "MetricCard" },
6275
+ { title: "Hierarchy Chart", const: "HierarchyChart" },
6275
6276
  { title: "Runner Boy", const: "RunnerBoyProgressBar" },
6276
6277
  { title: "Table", const: "Table" },
6277
6278
  { title: "Tabs", const: "TabSection" },
@@ -6335,6 +6336,13 @@ const ComponentSchema = {
6335
6336
  { title: "Standard", const: "standard" }
6336
6337
  ]
6337
6338
  },
6339
+ linkType: {
6340
+ oneOf: [
6341
+ { title: "Step", const: "step" },
6342
+ { title: "Diagonal", const: "diagonal" },
6343
+ { title: "Line", const: "line" }
6344
+ ]
6345
+ },
6338
6346
  positionVertical: {
6339
6347
  oneOf: [
6340
6348
  { title: "Top", const: "top" },
@@ -8158,6 +8166,17 @@ const buildPropertiesSection = function(type) {
8158
8166
  emptyBox$1("cardEmpty", { xs: 0, sm: 0, md: 8, lg: 8 })
8159
8167
  ];
8160
8168
  break;
8169
+ case "HierarchyChart":
8170
+ uiSchema.elements = [
8171
+ getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
8172
+ getSelectField("linkType", "Link Type"),
8173
+ getInputField("nodeWidth", "Node Width"),
8174
+ getInputField("nodeHeight", "Node Height"),
8175
+ getInputField("chartHeight", "Chart Height"),
8176
+ getInputField("stepPercent", "Link Bend Position"),
8177
+ emptyBox$1("HierarchyChart", { xs: 0, sm: 0, md: 4, lg: 6 })
8178
+ ];
8179
+ break;
8161
8180
  case "MetricCard":
8162
8181
  uiSchema.elements = [
8163
8182
  getInputField("url", "Image Url"),
@@ -8876,6 +8895,7 @@ const sectionLabels = {
8876
8895
  ProgressBar: ["Core", "Properties", "Events", "Style"],
8877
8896
  RankCard: ["Core", "Properties", "Events", "Style"],
8878
8897
  MetricCard: ["Core", "Properties", "Events", "Style", "Validation"],
8898
+ HierarchyChart: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
8879
8899
  Slider: ["Core", "Components", "Events", "Style", "Validation"],
8880
8900
  Timer: ["Core", "Events", "Style"],
8881
8901
  Rank: ["Core", "Events", "Style"],
@@ -9504,7 +9524,8 @@ const EventSchema = {
9504
9524
  { title: "Fail", const: "Fail" },
9505
9525
  { title: "onClose", const: "onClose" },
9506
9526
  { title: "Key Down", const: "onKeyDown" },
9507
- { title: "Set Style", const: "setStyle" }
9527
+ { title: "Set Style", const: "setStyle" },
9528
+ { title: "Expand Node", const: "onNodeExpandChange" }
9508
9529
  ]
9509
9530
  },
9510
9531
  Handler: {
@@ -9521,7 +9542,6 @@ const EventSchema = {
9521
9542
  oneOf: [
9522
9543
  { title: "RankProvider", const: "RankProvider" },
9523
9544
  { title: "Download File", const: "downloadFile" },
9524
- { title: "Download File Stream", const: "downloadFileStream" },
9525
9545
  { title: "downloadFileFromUrl", const: "downloadFileFromUrl" }
9526
9546
  ]
9527
9547
  },
@@ -10490,7 +10510,7 @@ function downloadFile$1({ data, name }) {
10490
10510
  URL.revokeObjectURL(url);
10491
10511
  }
10492
10512
  const downloadFileFromUrl = (response, service2) => {
10493
- let url = `${service2.defaults.baseURL}/${response.path}`;
10513
+ let url = `${service2.defaults.baseURL}${response.path}`;
10494
10514
  if (response == null ? void 0 : response.params) {
10495
10515
  const keysArray = Object.keys(response == null ? void 0 : response.params);
10496
10516
  keysArray.map((e, i) => {
@@ -10503,66 +10523,6 @@ const downloadFileFromUrl = (response, service2) => {
10503
10523
  link.click();
10504
10524
  link.parentNode.removeChild(link);
10505
10525
  };
10506
- const downloadFileStream = async (params2) => {
10507
- try {
10508
- let response;
10509
- if (params2.method === "GET") {
10510
- response = await params2.fetchservice.getStream(
10511
- params2.url,
10512
- params2.config
10513
- );
10514
- } else if (params2.method === "POST") {
10515
- response = await params2.fetchservice.postStream(
10516
- params2.url,
10517
- params2.body,
10518
- params2.config
10519
- );
10520
- } else {
10521
- throw new Error(
10522
- `Unsupported HTTP method: ${params2.method}. Only GET and POST are supported.`
10523
- );
10524
- }
10525
- if (!response.ok) {
10526
- throw new Error("Download failed");
10527
- }
10528
- params2.store.setNotify({
10529
- SuccessMessage: "File Download Started Successfully",
10530
- Success: true
10531
- });
10532
- const fileName = response.headers.get("filename") || "downloaded_file";
10533
- const extension = fileName.includes(".") ? fileName.substring(fileName.lastIndexOf(".")) : "";
10534
- const reader = response.body.getReader();
10535
- const fileHandle = await window.showSaveFilePicker({
10536
- suggestedName: fileName,
10537
- types: extension ? [
10538
- {
10539
- description: "File",
10540
- accept: {
10541
- "application/octet-stream": [extension]
10542
- }
10543
- }
10544
- ] : void 0
10545
- });
10546
- const writable = await fileHandle.createWritable();
10547
- while (true) {
10548
- const { done, value } = await reader.read();
10549
- if (done)
10550
- break;
10551
- await writable.write(value);
10552
- }
10553
- await writable.close();
10554
- params2.store.setNotify({
10555
- SuccessMessage: `File "${fileHandle.name}" downloaded successfully.`,
10556
- Success: true
10557
- });
10558
- } catch (e) {
10559
- params2.store.setNotify({
10560
- FailMessage: "File Download Failed",
10561
- Fail: true
10562
- });
10563
- console.error(e);
10564
- }
10565
- };
10566
10526
  const executeEvents = (params2) => {
10567
10527
  var _a, _b, _c;
10568
10528
  let nextEvent = [];
@@ -10684,13 +10644,10 @@ function executeInBuiltFunctionHandler(params) {
10684
10644
  let parameter = {};
10685
10645
  if (params.config.funcParametersCode) {
10686
10646
  const makeFunc = eval(params.config.funcParametersCode);
10687
- parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.fetchservice);
10688
- params.serviceHolder[params.config.inBuiltFunctionType](
10689
- parameter,
10690
- params.service
10691
- );
10647
+ parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
10648
+ params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service);
10692
10649
  } else {
10693
- params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.fetchservice);
10650
+ params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
10694
10651
  }
10695
10652
  }
10696
10653
  function executeCustomHandler(params) {
@@ -10894,8 +10851,7 @@ var service = (funcParams) => {
10894
10851
  dynamicData: funcParams.dynamicData,
10895
10852
  userValue: funcParams.userValue,
10896
10853
  service: funcParams.service,
10897
- fetchservice: funcParams.fetchservice,
10898
- serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, downloadFileStream, ...funcParams.functionsProvider },
10854
+ serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
10899
10855
  eventGroups,
10900
10856
  functionsProvider: funcParams.functionsProvider,
10901
10857
  formDataHolder
@@ -11042,6 +10998,13 @@ var service = (funcParams) => {
11042
10998
  const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
11043
10999
  return response == null ? void 0 : response.data;
11044
11000
  },
11001
+ onNodeExpandChange: async function(param) {
11002
+ const apiBody = [
11003
+ { key: "expandedNodeId", value: param.expandedNodeId }
11004
+ ];
11005
+ const response = await this.callExecuteEvents(param, apiBody, "onNodeExpandChange");
11006
+ return response == null ? void 0 : response.data;
11007
+ },
11045
11008
  getSelectOptions: async function(param) {
11046
11009
  if (param.serachValue !== "" && param.serachValue !== void 0) {
11047
11010
  const apiBody = [
@@ -11157,7 +11120,6 @@ var service = (funcParams) => {
11157
11120
  },
11158
11121
  downloadFile: downloadFile$1,
11159
11122
  downloadFileFromUrl,
11160
- downloadFileStream,
11161
11123
  ...funcParams.functionsProvider
11162
11124
  };
11163
11125
  };
@@ -12669,6 +12631,9 @@ const buildEmptyBox = (config2, componentScope2) => {
12669
12631
  if (config2.layout) {
12670
12632
  EmptyBox.config.layout = createLayoutFormat(config2.layout);
12671
12633
  }
12634
+ if (config2.style) {
12635
+ EmptyBox.config.style = JSON.parse(config2.style);
12636
+ }
12672
12637
  return EmptyBox;
12673
12638
  };
12674
12639
  const ArrayUiSchema = {
@@ -13417,6 +13382,47 @@ const buildPdfViewer = (config2, componentScope2) => {
13417
13382
  }
13418
13383
  return PdfViewer;
13419
13384
  };
13385
+ const HierarchyChart = {
13386
+ type: "Control",
13387
+ scope: "#/properties/HierarchyChart",
13388
+ options: {
13389
+ widget: "HierarchyChart"
13390
+ },
13391
+ config: {
13392
+ layout: { xs: 12, sm: 12, md: 12, lg: 12 },
13393
+ main: {},
13394
+ style: { containerStyle: {}, labelStyle: { margin: {} } }
13395
+ }
13396
+ };
13397
+ const buildHierarchyChart = (config2, componentScope2, store2) => {
13398
+ const hierarchyChart = _.cloneDeep(HierarchyChart);
13399
+ hierarchyChart.scope = componentScope2;
13400
+ if (config2.style) {
13401
+ hierarchyChart.config.style = JSON.parse(config2.style);
13402
+ }
13403
+ if (config2.layout) {
13404
+ hierarchyChart.config.layout = createLayoutFormat(config2.layout);
13405
+ }
13406
+ if (config2.linkType) {
13407
+ hierarchyChart.config.main.linkType = config2.linkType;
13408
+ }
13409
+ if (config2.stepPercent) {
13410
+ hierarchyChart.config.main.stepPercent = config2.stepPercent;
13411
+ }
13412
+ if (config2.nodeWidth) {
13413
+ hierarchyChart.config.main.nodeWidth = config2.nodeWidth;
13414
+ }
13415
+ if (config2.nodeHeight) {
13416
+ hierarchyChart.config.main.nodeHeight = config2.nodeHeight;
13417
+ }
13418
+ if (config2.chartHeight) {
13419
+ hierarchyChart.config.main.chartHeight = config2.chartHeight;
13420
+ }
13421
+ if (config2.lazyLoading) {
13422
+ hierarchyChart.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
13423
+ }
13424
+ return hierarchyChart;
13425
+ };
13420
13426
  let schema = {
13421
13427
  type: "object",
13422
13428
  properties: {},
@@ -13580,6 +13586,9 @@ const buildUiSchema = (config2, store2) => {
13580
13586
  case "MetricCard":
13581
13587
  elements = buildMetricCard(config2, componentScope2);
13582
13588
  break;
13589
+ case "HierarchyChart":
13590
+ elements = buildHierarchyChart(config2, componentScope2);
13591
+ break;
13583
13592
  case "Graph":
13584
13593
  switch (config2.graphType) {
13585
13594
  case "BarGraph":