logitude-dashboard-library 3.2.56 → 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.
@@ -1274,4 +1274,139 @@ $dark-grey: #717585;
1274
1274
  display: block;
1275
1275
  overflow: hidden;
1276
1276
  text-overflow: ellipsis;
1277
+ }
1278
+
1279
+ // Widget Copy Dropdown (Duplicate / Copy)
1280
+ .widget-copy-dropdown-container {
1281
+ &-content {
1282
+ padding: 0 !important;
1283
+ border-radius: 4px !important;
1284
+ box-shadow: 0px 8px 16px 0px #0000001A !important;
1285
+ border: 1px solid #F3F4F5 !important;
1286
+ }
1287
+ }
1288
+
1289
+ .widget-copy-dropdown-menu {
1290
+ background: #FFFFFF;
1291
+ border-radius: 4px;
1292
+ width: 168px;
1293
+ height: 72px;
1294
+ padding: 8px;
1295
+ display: flex;
1296
+ flex-direction: column;
1297
+ justify-content: center;
1298
+
1299
+ .widget-copy-dropdown-item {
1300
+ padding: 6px 10px;
1301
+ font-family: "Manrope", sans-serif;
1302
+ font-weight: 500;
1303
+ font-size: 12px;
1304
+ line-height: 16px;
1305
+ color: #404040;
1306
+ cursor: pointer;
1307
+ white-space: nowrap;
1308
+
1309
+ &:hover {
1310
+ background-color: #F3F4F5;
1311
+ border-radius: 4px;
1312
+ }
1313
+ }
1314
+ }
1315
+
1316
+ // Widget Copied Notification
1317
+ .widget-copied-notification {
1318
+ position: absolute;
1319
+ top: 32px;
1320
+ left: 8px;
1321
+ background: #19395C;
1322
+ color: #FFFFFF;
1323
+ padding: 6px;
1324
+ border-radius: 4px;
1325
+ display: flex;
1326
+ align-items: center;
1327
+ gap: 4px;
1328
+ z-index: 1000;
1329
+ white-space: nowrap;
1330
+ width: calc(100% - 16px);
1331
+ max-width: calc(100% - 16px);
1332
+ animation: widgetCopiedFadeIn 0.2s ease;
1333
+
1334
+ .widget-copied-notification-check {
1335
+ font-size: 12px;
1336
+ line-height: 16px;
1337
+ }
1338
+
1339
+ .widget-copied-notification-title {
1340
+ font-family: "Manrope", sans-serif;
1341
+ font-weight: 600;
1342
+ font-size: 12px;
1343
+ line-height: 16px;
1344
+ max-width: calc(100% - 50px);
1345
+ overflow: hidden;
1346
+ text-overflow: ellipsis;
1347
+ }
1348
+
1349
+ .widget-copied-notification-text {
1350
+ font-family: "Manrope", sans-serif;
1351
+ font-weight: 500;
1352
+ font-size: 12px;
1353
+ line-height: 16px;
1354
+ }
1355
+ }
1356
+
1357
+ @keyframes widgetCopiedFadeIn {
1358
+ from {
1359
+ opacity: 0;
1360
+ transform: translateY(-4px);
1361
+ }
1362
+ to {
1363
+ opacity: 1;
1364
+ transform: translateY(0);
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;
1277
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;
@@ -19,6 +19,7 @@ declare type DashboardDesignerProps = {
19
19
  onLayoutChange: (layouts: Layouts) => void;
20
20
  onWidgetDelete: (deleteProps: DeleteWidgetProps) => void;
21
21
  onCopyWidget?: (id: string) => void;
22
+ onCopyWidgetToClipboard?: (key: string, widget: ReactWidgetPM) => void;
22
23
  dataBinding: DashboardDataBinding;
23
24
  onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
24
25
  };
@@ -5,6 +5,8 @@ import { DashboardDataBinding } from '../../types/DashboardDataBinding';
5
5
  declare type WidgetCardProps = {
6
6
  editBtnClicked(widget: any): any;
7
7
  copyBtnClicked?(id: any): any;
8
+ duplicateBtnClicked?(id: any): any;
9
+ copyToClipboardBtnClicked?(key: any, widget: ReactWidgetPM): any;
8
10
  deleteBtnClicked(i: any): any;
9
11
  widget: ReactWidgetPM | undefined;
10
12
  widgetRef: ReactWidgetPM | undefined;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ declare type DashboardProps = {
19
19
  }) => void;
20
20
  openEditWidget: (Widget: ReactWidgetPM) => void;
21
21
  onCopyWidget?: (key: string) => void;
22
+ onCopyWidgetToClipboard?: (key: string, widget: ReactWidgetPM) => void;
22
23
  openDeleteWidgetConfirmWindow: (deleteProps: DeleteWidgetProps) => void;
23
24
  onSelectDataPoint: (dataPointSelection: DataPointSelection) => void;
24
25
  };
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
 
@@ -2602,12 +2669,10 @@ function getMaxMeasureValue(seriesMeasures, widget) {
2602
2669
  var _seriesMeasure$Values;
2603
2670
 
2604
2671
  seriesMeasure === null || seriesMeasure === void 0 ? void 0 : (_seriesMeasure$Values = seriesMeasure.Values) === null || _seriesMeasure$Values === void 0 ? void 0 : _seriesMeasure$Values.forEach(function (valueItem) {
2605
- var _stackedTotalsByGroup;
2606
-
2607
2672
  var numericValue = toNumericValue(valueItem === null || valueItem === void 0 ? void 0 : valueItem.Value);
2608
2673
  if (numericValue === null) return;
2609
2674
  var groupId = valueItem === null || valueItem === void 0 ? void 0 : valueItem.GroupById;
2610
- var currentTotal = (_stackedTotalsByGroup = stackedTotalsByGroupId.get(groupId)) != null ? _stackedTotalsByGroup : 0;
2675
+ var currentTotal = stackedTotalsByGroupId.get(groupId) || 0;
2611
2676
  stackedTotalsByGroupId.set(groupId, currentTotal + numericValue);
2612
2677
  });
2613
2678
  });
@@ -4096,7 +4161,7 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
4096
4161
  });
4097
4162
 
4098
4163
  var WidgetCard = React.forwardRef(function (props, comRef) {
4099
- var _widget$current13, _widget$current14, _widget$current15;
4164
+ var _widget$current16, _widget$current17, _widget$current18, _widget$current19;
4100
4165
 
4101
4166
  var widget = React.useRef();
4102
4167
 
@@ -4118,15 +4183,39 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4118
4183
  headerErrorMessages = _useState4[0],
4119
4184
  setHeaderErrorMessages = _useState4[1];
4120
4185
 
4186
+ var _useState5 = React.useState(false),
4187
+ showCopiedNotification = _useState5[0],
4188
+ setShowCopiedNotification = _useState5[1];
4189
+
4190
+ var copyPopupRef = React.useRef(null);
4191
+ var copiedNotificationTimer = React.useRef(null);
4192
+
4121
4193
  var editWidget = function editWidget() {
4122
4194
  props.editBtnClicked(widget.current);
4123
4195
  };
4124
4196
 
4125
- var copyWidget = function copyWidget() {
4126
- if (props && props.copyBtnClicked) {
4197
+ var duplicateWidget = function duplicateWidget() {
4198
+ if (props && props.duplicateBtnClicked) {
4127
4199
  var _widget$current;
4128
4200
 
4129
- props.copyBtnClicked((_widget$current = widget.current) === null || _widget$current === void 0 ? void 0 : _widget$current.key);
4201
+ props.duplicateBtnClicked((_widget$current = widget.current) === null || _widget$current === void 0 ? void 0 : _widget$current.key);
4202
+ } else if (props && props.copyBtnClicked) {
4203
+ var _widget$current2;
4204
+
4205
+ props.copyBtnClicked((_widget$current2 = widget.current) === null || _widget$current2 === void 0 ? void 0 : _widget$current2.key);
4206
+ }
4207
+ };
4208
+
4209
+ var copyWidgetToClipboard = function copyWidgetToClipboard() {
4210
+ if (props && props.copyToClipboardBtnClicked && widget.current) {
4211
+ var _widget$current3;
4212
+
4213
+ props.copyToClipboardBtnClicked((_widget$current3 = widget.current) === null || _widget$current3 === void 0 ? void 0 : _widget$current3.key, widget.current);
4214
+ setShowCopiedNotification(true);
4215
+ if (copiedNotificationTimer.current) clearTimeout(copiedNotificationTimer.current);
4216
+ copiedNotificationTimer.current = setTimeout(function () {
4217
+ setShowCopiedNotification(false);
4218
+ }, 700);
4130
4219
  }
4131
4220
  };
4132
4221
 
@@ -4135,20 +4224,23 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4135
4224
 
4136
4225
  widget.current = props.widget;
4137
4226
  (_props$dataBinding = props.dataBinding) === null || _props$dataBinding === void 0 ? void 0 : _props$dataBinding.onEditWidget.subscribe(function (e) {
4138
- var _widget$current2;
4227
+ var _widget$current4;
4139
4228
 
4140
- if ((e === null || e === void 0 ? void 0 : e.key) != ((_widget$current2 = widget.current) === null || _widget$current2 === void 0 ? void 0 : _widget$current2.key)) return;
4229
+ if ((e === null || e === void 0 ? void 0 : e.key) != ((_widget$current4 = widget.current) === null || _widget$current4 === void 0 ? void 0 : _widget$current4.key)) return;
4141
4230
  setIsLoading(true);
4142
4231
  widget.current = _extends({}, e);
4143
4232
  setIsLoading(false);
4144
4233
  });
4145
4234
  (_props$dataBinding2 = props.dataBinding) === null || _props$dataBinding2 === void 0 ? void 0 : _props$dataBinding2.widgetUpdated.subscribe(function (updatedWidget) {
4146
- var _widget$current3;
4235
+ var _widget$current5;
4147
4236
 
4148
- if ((updatedWidget === null || updatedWidget === void 0 ? void 0 : updatedWidget.key) != ((_widget$current3 = widget.current) === null || _widget$current3 === void 0 ? void 0 : _widget$current3.key)) return;
4237
+ if ((updatedWidget === null || updatedWidget === void 0 ? void 0 : updatedWidget.key) != ((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.key)) return;
4149
4238
  widget.current = _extends({}, updatedWidget);
4150
4239
  setTriggerId(uuid.v4());
4151
4240
  });
4241
+ return function () {
4242
+ if (copiedNotificationTimer.current) clearTimeout(copiedNotificationTimer.current);
4243
+ };
4152
4244
  }, []);
4153
4245
  React.useImperativeHandle(comRef, function () {
4154
4246
  return {
@@ -4173,10 +4265,10 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4173
4265
  };
4174
4266
 
4175
4267
  var GetChartComponent = function GetChartComponent() {
4176
- var _widget$current4, _widget$current5, _widget$current6, _widget$current7, _widget$current8;
4268
+ var _widget$current6, _widget$current7, _widget$current8, _widget$current9, _widget$current10, _widget$current11;
4177
4269
 
4178
- if (isLoading || !((_widget$current4 = widget.current) !== null && _widget$current4 !== void 0 && _widget$current4.TypeCode)) return "";
4179
- if (((_widget$current5 = widget.current) === null || _widget$current5 === void 0 ? void 0 : _widget$current5.TypeCode) == "kpi") return React__default.createElement(CustomChart, {
4270
+ if (isLoading || !((_widget$current6 = widget.current) !== null && _widget$current6 !== void 0 && _widget$current6.TypeCode)) return "";
4271
+ if (((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == "kpi") return React__default.createElement(CustomChart, {
4180
4272
  isInEditMode: props.isInEditMode,
4181
4273
  isPreviewModeActive: props.isPreviewModeActive,
4182
4274
  dataBinding: props.dataBinding,
@@ -4187,7 +4279,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4187
4279
  return showErrorMsg(errorMsg);
4188
4280
  }
4189
4281
  });
4190
- if (((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.TypeCode) == "table" || ((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.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, {
4191
4283
  isInEditMode: props.isInEditMode,
4192
4284
  isPreviewModeActive: props.isPreviewModeActive,
4193
4285
  dataBinding: props.dataBinding,
@@ -4195,7 +4287,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4195
4287
  widgetRef: props.widgetRef,
4196
4288
  onSelectDataPoint: props.onSelectDataPoint
4197
4289
  });
4198
- if (((_widget$current8 = widget.current) === null || _widget$current8 === void 0 ? void 0 : _widget$current8.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, {
4199
4291
  ref: fusionChartRef,
4200
4292
  dataBinding: props.dataBinding,
4201
4293
  widget: widget.current,
@@ -4254,15 +4346,15 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4254
4346
  };
4255
4347
 
4256
4348
  var isThereTitle = function isThereTitle() {
4257
- var _widget$current9, _widget$current10;
4349
+ var _widget$current12, _widget$current13;
4258
4350
 
4259
- return ((_widget$current9 = widget.current) === null || _widget$current9 === void 0 ? void 0 : _widget$current9.Title) && ((_widget$current10 = widget.current) === null || _widget$current10 === void 0 ? void 0 : _widget$current10.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;
4260
4352
  };
4261
4353
 
4262
4354
  var isThereSubtitle = function isThereSubtitle() {
4263
- var _widget$current11, _widget$current12;
4355
+ var _widget$current14, _widget$current15;
4264
4356
 
4265
- return ((_widget$current11 = widget.current) === null || _widget$current11 === void 0 ? void 0 : _widget$current11.Subtitle) && ((_widget$current12 = widget.current) === null || _widget$current12 === void 0 ? void 0 : _widget$current12.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;
4266
4358
  };
4267
4359
 
4268
4360
  var tableHintMessage = function tableHintMessage() {
@@ -4311,7 +4403,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4311
4403
  color: getCSSPropertyValue(widget.current, 'TitleFontColor', ''),
4312
4404
  textAlign: getCSSPropertyValue(widget === null || widget === void 0 ? void 0 : widget.current, 'TitleAlignment', '', undefined)
4313
4405
  }
4314
- }, (_widget$current13 = widget.current) === null || _widget$current13 === void 0 ? void 0 : _widget$current13.Title),
4406
+ }, (_widget$current16 = widget.current) === null || _widget$current16 === void 0 ? void 0 : _widget$current16.Title),
4315
4407
  position: ['top center'],
4316
4408
  arrowStyle: {
4317
4409
  color: '#19395C'
@@ -4320,7 +4412,7 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4320
4412
  on: ['hover', 'focus']
4321
4413
  }, React__default.createElement("span", {
4322
4414
  className: "widget-title-tooltip-text"
4323
- }, (_widget$current14 = widget.current) === null || _widget$current14 === void 0 ? void 0 : _widget$current14.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", {
4324
4416
  className: "titles-vertical-seeparator"
4325
4417
  }), React__default.createElement("div", {
4326
4418
  className: isThereSubtitle() ? "subtitle" : "subtitle margin-top-4",
@@ -4330,25 +4422,57 @@ var WidgetCard = React.forwardRef(function (props, comRef) {
4330
4422
  color: getCSSPropertyValue(widget.current, 'SubtitleFontColor', ''),
4331
4423
  minWidth: isThereSubtitle() && isTableOrPivotWidget() ? '5%' : undefined
4332
4424
  }
4333
- }, (_widget$current15 = widget.current) === null || _widget$current15 === void 0 ? void 0 : _widget$current15.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", {
4334
4426
  className: isThereTitle() ? "widget-options-container" : "widget-options-container margin-top-6"
4335
4427
  }, React__default.createElement("div", null, " ", React__default.createElement(SvgEditIcon, {
4336
4428
  className: "widget-card-edit-icon",
4337
4429
  onClick: function onClick() {
4338
4430
  return editWidget();
4339
4431
  }
4340
- }), " "), React__default.createElement("div", null, " ", React__default.createElement(SvgCopyIcon, {
4341
- className: "widget-card-copy-icon",
4432
+ }), " "), React__default.createElement(Popup, {
4433
+ ref: copyPopupRef,
4434
+ className: "widget-copy-dropdown-container",
4435
+ trigger: React__default.createElement("div", null, React__default.createElement(SvgCopyIcon, {
4436
+ className: "widget-card-copy-icon"
4437
+ })),
4438
+ position: ['bottom left', 'bottom center'],
4439
+ closeOnDocumentClick: true,
4440
+ closeOnEscape: true,
4441
+ arrow: false,
4442
+ offsetY: 2
4443
+ }, React__default.createElement("div", {
4444
+ className: "widget-copy-dropdown-menu"
4445
+ }, React__default.createElement("div", {
4446
+ className: "widget-copy-dropdown-item",
4342
4447
  onClick: function onClick() {
4343
- return copyWidget();
4448
+ var _copyPopupRef$current;
4449
+
4450
+ (_copyPopupRef$current = copyPopupRef.current) === null || _copyPopupRef$current === void 0 ? void 0 : _copyPopupRef$current.close();
4451
+ duplicateWidget();
4452
+ }
4453
+ }, "Duplicate"), React__default.createElement("div", {
4454
+ className: "widget-copy-dropdown-item",
4455
+ onClick: function onClick() {
4456
+ var _copyPopupRef$current2;
4457
+
4458
+ (_copyPopupRef$current2 = copyPopupRef.current) === null || _copyPopupRef$current2 === void 0 ? void 0 : _copyPopupRef$current2.close();
4459
+ copyWidgetToClipboard();
4344
4460
  }
4345
- }), " "), React__default.createElement("div", null, " ", React__default.createElement(SvgDeleteIcon, {
4461
+ }, "Copy"))), React__default.createElement("div", null, " ", React__default.createElement(SvgDeleteIcon, {
4346
4462
  onClick: function onClick() {
4347
4463
  var _props$widget;
4348
4464
 
4349
4465
  return props.deleteBtnClicked((_props$widget = props.widget) === null || _props$widget === void 0 ? void 0 : _props$widget.key);
4350
4466
  }
4351
- }), " ")), !props.isInEditMode && showHeaderErrorMessages && React__default.createElement("div", {
4467
+ }), " ")), showCopiedNotification && React__default.createElement("div", {
4468
+ className: "widget-copied-notification"
4469
+ }, React__default.createElement("span", {
4470
+ className: "widget-copied-notification-check"
4471
+ }, "\u2713"), React__default.createElement("span", {
4472
+ className: "widget-copied-notification-title"
4473
+ }, (_widget$current19 = widget.current) === null || _widget$current19 === void 0 ? void 0 : _widget$current19.Title), React__default.createElement("span", {
4474
+ className: "widget-copied-notification-text"
4475
+ }, "widget copied")), !props.isInEditMode && showHeaderErrorMessages && React__default.createElement("div", {
4352
4476
  className: "header-message-error"
4353
4477
  }, React__default.createElement(Popup, {
4354
4478
  className: "header-message-error-tooltip-container",
@@ -4524,6 +4648,12 @@ var DashboardDesigner = function DashboardDesigner(props) {
4524
4648
  }
4525
4649
  }
4526
4650
 
4651
+ function copyWidgetToClipboard(key, widget) {
4652
+ if (props && props.onCopyWidgetToClipboard) {
4653
+ props.onCopyWidgetToClipboard(key, widget);
4654
+ }
4655
+ }
4656
+
4527
4657
  function UpdatePlaceholderDimensions(layouts) {
4528
4658
  if (!layouts) return;
4529
4659
  var max = minimumPlaceholderRowsCount;
@@ -4596,7 +4726,8 @@ var DashboardDesigner = function DashboardDesigner(props) {
4596
4726
  editBtnClicked: editWidget,
4597
4727
  deleteBtnClicked: confirmDeleteWidget,
4598
4728
  onSelectDataPoint: props.onSelectDataPoint,
4599
- copyBtnClicked: copyWidget,
4729
+ duplicateBtnClicked: copyWidget,
4730
+ copyToClipboardBtnClicked: copyWidgetToClipboard,
4600
4731
  ref: function ref(el) {
4601
4732
  var _widget$Layout3;
4602
4733
 
@@ -4678,6 +4809,12 @@ var Dashboard = function Dashboard(props) {
4678
4809
  }
4679
4810
  };
4680
4811
 
4812
+ var copyWidgetToClipboard = function copyWidgetToClipboard(key, widget) {
4813
+ if (props && props.onCopyWidgetToClipboard) {
4814
+ props.onCopyWidgetToClipboard(key, widget);
4815
+ }
4816
+ };
4817
+
4681
4818
  var updateWidgets = function updateWidgets(layouts) {
4682
4819
  var layoutsDic = {};
4683
4820
  Object.keys(layouts).forEach(function (sizeType) {
@@ -4745,6 +4882,7 @@ var Dashboard = function Dashboard(props) {
4745
4882
  return props.openDeleteWidgetConfirmWindow(deleteProps);
4746
4883
  },
4747
4884
  onCopyWidget: copyWidget,
4885
+ onCopyWidgetToClipboard: copyWidgetToClipboard,
4748
4886
  openEditWidget: function openEditWidget(widget) {
4749
4887
  return props.openEditWidget(widget);
4750
4888
  }