logitude-dashboard-library 3.2.57 → 3.2.58

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.
@@ -1363,4 +1363,50 @@ $dark-grey: #717585;
1363
1363
  opacity: 1;
1364
1364
  transform: translateY(0);
1365
1365
  }
1366
+ }
1367
+
1368
+ .dl-views-chart-container {
1369
+ overflow: auto;
1370
+ position: absolute;
1371
+ top: 0;
1372
+ right: 0;
1373
+ left: 0;
1374
+ bottom: 0;
1375
+ height: 100%;
1376
+ width: 100%;
1377
+ padding: 8px 12px 12px;
1378
+ }
1379
+
1380
+ .dl-views-widget-list {
1381
+ display: flex;
1382
+ flex-direction: column;
1383
+ gap: 4px;
1384
+ }
1385
+
1386
+ .dl-views-widget-row {
1387
+ text-align: left;
1388
+ }
1389
+
1390
+ .dl-views-widget-link {
1391
+ background: none;
1392
+ border: none;
1393
+ padding: 0;
1394
+ margin: 0;
1395
+ cursor: pointer;
1396
+ color: #0c64c0;
1397
+ font-size: 13px;
1398
+ line-height: 18px;
1399
+ text-align: left;
1400
+ font-family: "Manrope", sans-serif;
1401
+ }
1402
+
1403
+ .dl-views-widget-link:hover {
1404
+ text-decoration: underline;
1405
+ }
1406
+
1407
+ .dl-views-widget-empty {
1408
+ padding: 12px;
1409
+ color: #6e7072;
1410
+ font-size: 13px;
1411
+ font-family: "Manrope", sans-serif;
1366
1412
  }
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { CustomChartProps } from "./CustomChart";
3
+ declare const ViewsChart: (props: {
4
+ customChartProps: CustomChartProps;
5
+ }) => React.JSX.Element;
6
+ export default ViewsChart;
package/dist/index.js CHANGED
@@ -1845,7 +1845,7 @@ var TableChart = function TableChart(props) {
1845
1845
  rowDate = null;
1846
1846
  }
1847
1847
 
1848
- return fieldCode == "ShipmentNumber" && objectTableName == "Shipment" || IsShipmentMasterFieldClickable(fieldCode, rowDate) || fieldCode == "InvoiceNumber" && objectTableName == "APInvoice" || fieldCode == "InvoiceNumber" && objectTableName == "ARInvoice" || fieldCode == "ContainerNumber" && objectTableName == "Container" || fieldCode == "QuoteNumber" && objectTableName == "Quote" || fieldCode == "Subject" && objectTableName == "Opportunity" || fieldCode == "EnglishName" && objectTableName == "Customer" || fieldCode == "TaskNumber" && objectTableName == "Task" || fieldCode == "Subject" && objectTableName == "Activity" || fieldCode == "TicketNumber" && objectTableName == "Ticket";
1848
+ return fieldCode == "ShipmentNumber" && objectTableName == "Shipment" || IsShipmentMasterFieldClickable(fieldCode, rowDate) || fieldCode == "InvoiceNumber" && objectTableName == "APInvoice" || fieldCode == "InvoiceNumber" && objectTableName == "ARInvoice" || fieldCode == "ContainerNumber" && objectTableName == "Container" || fieldCode == "QuoteNumber" && objectTableName == "Quote" || fieldCode == "Subject" && objectTableName == "Opportunity" || fieldCode == "EnglishName" && objectTableName == "Customer" || fieldCode == "TaskNumber" && objectTableName == "Task" || fieldCode == "Subject" && objectTableName == "Activity" || fieldCode == "TicketNumber" && objectTableName == "Ticket" || fieldCode == "ReleaseNumber" && objectTableName == "WarehouseRelease";
1849
1849
  };
1850
1850
 
1851
1851
  var IsShipmentMasterFieldClickable = function IsShipmentMasterFieldClickable(fieldCode, rowData) {
@@ -2348,8 +2348,70 @@ var PivotTable = React.forwardRef(function (props, comRef) {
2348
2348
  })));
2349
2349
  });
2350
2350
 
2351
+ var parseSelectedQueries = function parseSelectedQueries(widgetJson) {
2352
+ if (!widgetJson) {
2353
+ return [];
2354
+ }
2355
+
2356
+ try {
2357
+ var parsed = JSON.parse(widgetJson);
2358
+
2359
+ if (parsed && Array.isArray(parsed.SelectedQueries)) {
2360
+ return parsed.SelectedQueries;
2361
+ }
2362
+ } catch (_unused) {}
2363
+
2364
+ return [];
2365
+ };
2366
+
2367
+ var ViewsChart = function ViewsChart(props) {
2368
+ var widget = props.customChartProps.widget;
2369
+ var objectTableName = widget === null || widget === void 0 ? void 0 : widget.ViewsWidgetObjectTableName;
2370
+ var entries = React.useMemo(function () {
2371
+ return parseSelectedQueries(widget === null || widget === void 0 ? void 0 : widget.WidgetJson);
2372
+ }, [widget]);
2373
+
2374
+ var handleClick = function handleClick(uniqueCode) {
2375
+ if (!objectTableName || !uniqueCode) {
2376
+ return;
2377
+ }
2378
+
2379
+ var selection = {
2380
+ Widget: widget,
2381
+ ViewsNavigation: {
2382
+ ObjectTableName: objectTableName,
2383
+ QueryUniqueCode: uniqueCode
2384
+ }
2385
+ };
2386
+ props.customChartProps.onSelectDataPoint(selection);
2387
+ };
2388
+
2389
+ if (!entries.length) {
2390
+ return React__default.createElement("div", {
2391
+ className: "dl-views-widget-empty"
2392
+ }, React__default.createElement("span", {
2393
+ className: "dl-views-widget-empty-text"
2394
+ }, "No views configured"));
2395
+ }
2396
+
2397
+ return React__default.createElement("div", {
2398
+ className: "dl-views-widget-list"
2399
+ }, entries.map(function (row) {
2400
+ return React__default.createElement("div", {
2401
+ key: row.UniqueCode,
2402
+ className: "dl-views-widget-row"
2403
+ }, React__default.createElement("button", {
2404
+ type: "button",
2405
+ className: "dl-views-widget-link",
2406
+ onClick: function onClick() {
2407
+ return handleClick(row.UniqueCode);
2408
+ }
2409
+ }, row.DisplayLabel || row.UniqueCode));
2410
+ }));
2411
+ };
2412
+
2351
2413
  var CustomChart = function CustomChart(props) {
2352
- var _props$widget2, _props$widget3;
2414
+ var _props$widget2, _props$widget3, _props$widget4;
2353
2415
 
2354
2416
  var project = function project() {
2355
2417
  var _props$widget;
@@ -2370,13 +2432,18 @@ var CustomChart = function CustomChart(props) {
2370
2432
  customChartProps: props
2371
2433
  });
2372
2434
 
2435
+ case "views":
2436
+ return React__default.createElement(ViewsChart, {
2437
+ customChartProps: props
2438
+ });
2439
+
2373
2440
  default:
2374
2441
  return React__default.createElement("div", null, "Invalid Type");
2375
2442
  }
2376
2443
  };
2377
2444
 
2378
2445
  return React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
2379
- className: "dl-custom-chart-container " + (props.widget && ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) == 'table' ? 'dl-table-chart-container' : '') + " " + (props.widget && ((_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.TypeCode) == 'pivot' ? 'dl-pivot-chart-container' : '')
2446
+ className: "dl-custom-chart-container " + (props.widget && ((_props$widget2 = props.widget) === null || _props$widget2 === void 0 ? void 0 : _props$widget2.TypeCode) == 'table' ? 'dl-table-chart-container' : '') + " " + (props.widget && ((_props$widget3 = props.widget) === null || _props$widget3 === void 0 ? void 0 : _props$widget3.TypeCode) == 'pivot' ? 'dl-pivot-chart-container' : '') + " " + (props.widget && ((_props$widget4 = props.widget) === null || _props$widget4 === void 0 ? void 0 : _props$widget4.TypeCode) == 'views' ? 'dl-views-chart-container' : '')
2380
2447
  }, project()));
2381
2448
  };
2382
2449
 
@@ -4094,7 +4161,7 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
4094
4161
  });
4095
4162
 
4096
4163
  var WidgetCard = React.forwardRef(function (props, comRef) {
4097
- var _widget$current15, _widget$current16, _widget$current17, _widget$current18;
4164
+ var _widget$current16, _widget$current17, _widget$current18, _widget$current19;
4098
4165
 
4099
4166
  var widget = React.useRef();
4100
4167
 
@@ -4198,7 +4265,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4198
4265
  };
4199
4266
 
4200
4267
  var GetChartComponent = function GetChartComponent() {
4201
- var _widget$current6, _widget$current7, _widget$current8, _widget$current9, _widget$current10;
4268
+ var _widget$current6, _widget$current7, _widget$current8, _widget$current9, _widget$current10, _widget$current11;
4202
4269
 
4203
4270
  if (isLoading || !((_widget$current6 = widget.current) !== null && _widget$current6 !== void 0 && _widget$current6.TypeCode)) return "";
4204
4271
  if (((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == "kpi") return React__default.createElement(CustomChart, {
@@ -4212,7 +4279,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4212
4279
  return showErrorMsg(errorMsg);
4213
4280
  }
4214
4281
  });
4215
- if (((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.TypeCode) == "table" || ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.TypeCode) == "pivot") return React__default.createElement(CustomChart, {
4282
+ if (((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.TypeCode) == "table" || ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.TypeCode) == "pivot" || ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.TypeCode) == "views") return React__default.createElement(CustomChart, {
4216
4283
  isInEditMode: props.isInEditMode,
4217
4284
  isPreviewModeActive: props.isPreviewModeActive,
4218
4285
  dataBinding: props.dataBinding,
@@ -4220,7 +4287,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4220
4287
  widgetRef: props.widgetRef,
4221
4288
  onSelectDataPoint: props.onSelectDataPoint
4222
4289
  });
4223
- if (((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.TypeCode) == "gauge") return React__default.createElement(FusionChart$1, {
4290
+ if (((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.TypeCode) == "gauge") return React__default.createElement(FusionChart$1, {
4224
4291
  ref: fusionChartRef,
4225
4292
  dataBinding: props.dataBinding,
4226
4293
  widget: widget.current,
@@ -4279,15 +4346,15 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4279
4346
  };
4280
4347
 
4281
4348
  var isThereTitle = function isThereTitle() {
4282
- var _widget$current11, _widget$current12;
4349
+ var _widget$current12, _widget$current13;
4283
4350
 
4284
- return ((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Title) && ((_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.Title.length) > 0;
4351
+ return ((_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.Title) && ((_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title.length) > 0;
4285
4352
  };
4286
4353
 
4287
4354
  var isThereSubtitle = function isThereSubtitle() {
4288
- var _widget$current13, _widget$current14;
4355
+ var _widget$current14, _widget$current15;
4289
4356
 
4290
- return ((_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Subtitle) && ((_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Subtitle.length) > 0;
4357
+ return ((_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.Subtitle) && ((_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Subtitle.length) > 0;
4291
4358
  };
4292
4359
 
4293
4360
  var tableHintMessage = function tableHintMessage() {
@@ -4336,7 +4403,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4336
4403
  color: getCSSPropertyValue(widget.current, 'TitleFontColor', ''),
4337
4404
  textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
4338
4405
  }
4339
- }, (_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.Title),
4406
+ }, (_widget$current16 = widget.current) === null || _widget$current16 === void 0 ? void 0 : _widget$current16.Title),
4340
4407
  position: ['top center'],
4341
4408
  arrowStyle: {
4342
4409
  color: '#19395C'
@@ -4345,7 +4412,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4345
4412
  on: ['hover', 'focus']
4346
4413
  }, React__default.createElement("span", {
4347
4414
  className: "widget-title-tooltip-text"
4348
- }, (_widget$current16 = widget.current) === null || _widget$current16 === void 0 ? void 0 : _widget$current16.Title))), isTableOrPivotWidget() && isThereTitle() && isThereSubtitle() && React__default.createElement("div", {
4415
+ }, (_widget$current17 = widget.current) === null || _widget$current17 === void 0 ? void 0 : _widget$current17.Title))), isTableOrPivotWidget() && isThereTitle() && isThereSubtitle() && React__default.createElement("div", {
4349
4416
  className: "titles-vertical-seeparator"
4350
4417
  }), React__default.createElement("div", {
4351
4418
  className: isThereSubtitle() ? "subtitle" : "subtitle margin-top-4",
@@ -4355,7 +4422,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4355
4422
  color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', ''),
4356
4423
  minWidth: isThereSubtitle() && isTableOrPivotWidget() ? '5%' : undefined
4357
4424
  }
4358
- }, (_widget$current17 = widget.current) === null || _widget$current17 === void 0 ? void 0 : _widget$current17.Subtitle)), !isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), props.isInEditMode && React__default.createElement("div", {
4425
+ }, (_widget$current18 = widget.current) === null || _widget$current18 === void 0 ? void 0 : _widget$current18.Subtitle)), !isTitleAligmentRight() && isTableOrPivotWidget() && tableHintMessage(), props.isInEditMode && React__default.createElement("div", {
4359
4426
  className: isThereTitle() ? "widget-options-container" : "widget-options-container margin-top-6"
4360
4427
  }, React__default.createElement("div", null, " ", React__default.createElement(SvgEditIcon, {
4361
4428
  className: "widget-card-edit-icon",
@@ -4403,7 +4470,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4403
4470
  className: "widget-copied-notification-check"
4404
4471
  }, "\u2713"), React__default.createElement("span", {
4405
4472
  className: "widget-copied-notification-title"
4406
- }, (_widget$current18 = widget.current) === null || _widget$current18 === void 0 ? void 0 : _widget$current18.Title), React__default.createElement("span", {
4473
+ }, (_widget$current19 = widget.current) === null || _widget$current19 === void 0 ? void 0 : _widget$current19.Title), React__default.createElement("span", {
4407
4474
  className: "widget-copied-notification-text"
4408
4475
  }, "widget copied")), !props.isInEditMode && showHeaderErrorMessages && React__default.createElement("div", {
4409
4476
  className: "header-message-error"