@websy/websy-designs 1.3.0 → 1.3.1
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/server/routes/v1/shop.js +52 -15
- package/dist/websy-designs-es6.debug.js +134 -55
- package/dist/websy-designs-es6.js +146 -54
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +134 -55
- package/dist/websy-designs.js +146 -54
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
package/dist/websy-designs.js
CHANGED
|
@@ -629,6 +629,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
629
629
|
var _this4 = this;
|
|
630
630
|
|
|
631
631
|
var isRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
632
|
+
console.trace();
|
|
632
633
|
var maskEl = document.getElementById("".concat(this.elementId, "_mask"));
|
|
633
634
|
var contentEl = document.getElementById("".concat(this.elementId, "_content"));
|
|
634
635
|
var el = document.getElementById(this.elementId);
|
|
@@ -650,9 +651,9 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
650
651
|
hoursOut.push(this.options.hours[i]);
|
|
651
652
|
}
|
|
652
653
|
|
|
653
|
-
this.options.onChange(hoursOut, true);
|
|
654
|
+
this.options.onChange(hoursOut, true, this.selectedRange);
|
|
654
655
|
} else {
|
|
655
|
-
this.options.onChange(this.selectedRangeDates, true);
|
|
656
|
+
this.options.onChange(this.selectedRangeDates, true, this.selectedRange);
|
|
656
657
|
}
|
|
657
658
|
} else {
|
|
658
659
|
if (this.options.mode === 'hour') {
|
|
@@ -660,9 +661,9 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
660
661
|
return _this4.options.hours[h];
|
|
661
662
|
});
|
|
662
663
|
|
|
663
|
-
this.options.onChange(_hoursOut, true);
|
|
664
|
+
this.options.onChange(_hoursOut, true, this.selectedRange);
|
|
664
665
|
} else {
|
|
665
|
-
this.options.onChange(this.currentselection, isRange);
|
|
666
|
+
this.options.onChange(this.currentselection, isRange, this.selectedRange);
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
669
|
}
|
|
@@ -688,7 +689,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
688
689
|
} // d.setTime(d.getTime() + d.getTimezoneOffset() * 60000)
|
|
689
690
|
|
|
690
691
|
|
|
691
|
-
return new Date(d.
|
|
692
|
+
return new Date(d.setUTCHours(12, 0, 0, 0));
|
|
692
693
|
}
|
|
693
694
|
}, {
|
|
694
695
|
key: "handleClick",
|
|
@@ -829,7 +830,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
829
830
|
|
|
830
831
|
if (this.options.mode === 'date') {
|
|
831
832
|
d = this.floorDate(new Date(this.selectedRangeDates[0].getTime() + _i * this.oneDay));
|
|
832
|
-
d.
|
|
833
|
+
d.setUTCHours(12, 0, 0, 0);
|
|
833
834
|
d = d.getTime();
|
|
834
835
|
rangeStart = this.selectedRangeDates[0].getTime();
|
|
835
836
|
rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime();
|
|
@@ -885,9 +886,11 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
885
886
|
dateEl = document.getElementById("".concat(_this5.elementId, "_").concat(d, "_hour"));
|
|
886
887
|
}
|
|
887
888
|
|
|
888
|
-
dateEl
|
|
889
|
-
|
|
890
|
-
|
|
889
|
+
if (dateEl) {
|
|
890
|
+
dateEl.classList.add('selected');
|
|
891
|
+
dateEl.classList.add('first');
|
|
892
|
+
dateEl.classList.add('last');
|
|
893
|
+
}
|
|
891
894
|
});
|
|
892
895
|
}
|
|
893
896
|
}
|
|
@@ -1135,7 +1138,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1135
1138
|
|
|
1136
1139
|
html += "<div id='".concat(this.elementId, "_dateList' class='websy-dp-date-list'><ul>");
|
|
1137
1140
|
html += yearList.map(function (d) {
|
|
1138
|
-
return "<li id='".concat(_this6.elementId, "_").concat(d.id, "_year' class='websy-dp-date websy-dp-year ").concat(d.disabled === true ? 'websy-disabled-date' : '', "'>").concat(d.year, "</li>");
|
|
1141
|
+
return "<li id='".concat(_this6.elementId, "_").concat(d.id, "_year' data-id='").concat(d.id, "' class='websy-dp-date websy-dp-year ").concat(d.disabled === true ? 'websy-disabled-date' : '', "'>").concat(d.year, "</li>");
|
|
1139
1142
|
}).join('');
|
|
1140
1143
|
html += "</ul></div>";
|
|
1141
1144
|
} else if (this.options.mode === 'monthyear') {
|
|
@@ -1155,7 +1158,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1155
1158
|
}
|
|
1156
1159
|
|
|
1157
1160
|
html += this.monthYears[year].map(function (d) {
|
|
1158
|
-
return "<li id='".concat(_this6.elementId, "_").concat(d.id, "_monthyear' data-year='").concat(d.year, "' class='websy-dp-date websy-dp-monthyear'>").concat(d.month, "</li>");
|
|
1161
|
+
return "<li id='".concat(_this6.elementId, "_").concat(d.id, "_monthyear' data-id='").concat(d.id, "' data-year='").concat(d.year, "' class='websy-dp-date websy-dp-monthyear'>").concat(d.month, "</li>");
|
|
1159
1162
|
}).join('');
|
|
1160
1163
|
html += "</ul>";
|
|
1161
1164
|
}
|
|
@@ -1263,16 +1266,6 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1263
1266
|
return d.getTime();
|
|
1264
1267
|
});
|
|
1265
1268
|
this.selectedRange = +index;
|
|
1266
|
-
var el = document.getElementById("".concat(this.elementId, "_header"));
|
|
1267
|
-
|
|
1268
|
-
if (el) {
|
|
1269
|
-
if (this.selectedRange === 0) {
|
|
1270
|
-
el.classList.remove('range-selected');
|
|
1271
|
-
} else {
|
|
1272
|
-
el.classList.add('range-selected');
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
1269
|
this.highlightRange();
|
|
1277
1270
|
this.updateRange();
|
|
1278
1271
|
this.close(confirm, true);
|
|
@@ -1284,16 +1277,17 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1284
1277
|
var _this8 = this;
|
|
1285
1278
|
|
|
1286
1279
|
this.selectedRange = -1;
|
|
1287
|
-
var isContinuousRange = true;
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
}
|
|
1280
|
+
var isContinuousRange = true; // if (rangeInput.length === 1) {
|
|
1281
|
+
// this.selectedRangeDates = [...rangeInput]
|
|
1282
|
+
// this.customRangeSelected = true
|
|
1283
|
+
// }
|
|
1284
|
+
// else if (rangeInput.length === 2) {
|
|
1285
|
+
// this.selectedRangeDates = [...rangeInput]
|
|
1286
|
+
// this.customRangeSelected = true
|
|
1287
|
+
// }
|
|
1296
1288
|
|
|
1289
|
+
this.selectedRangeDates = _toConsumableArray(rangeInput);
|
|
1290
|
+
this.customRangeSelected = true;
|
|
1297
1291
|
rangeInput.forEach(function (r, i) {
|
|
1298
1292
|
if (i > 0) {
|
|
1299
1293
|
if (_this8.options.mode === 'date' || _this8.options.mode === 'monthyear') {
|
|
@@ -1447,6 +1441,16 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1447
1441
|
if (labelEl) {
|
|
1448
1442
|
labelEl.innerHTML = range.label;
|
|
1449
1443
|
}
|
|
1444
|
+
|
|
1445
|
+
var headerEl = document.getElementById("".concat(this.elementId, "_header"));
|
|
1446
|
+
|
|
1447
|
+
if (headerEl) {
|
|
1448
|
+
if (this.selectedRange === 0) {
|
|
1449
|
+
headerEl.classList.remove('range-selected');
|
|
1450
|
+
} else {
|
|
1451
|
+
headerEl.classList.add('range-selected');
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1450
1454
|
}
|
|
1451
1455
|
}]);
|
|
1452
1456
|
|
|
@@ -1981,7 +1985,8 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
1981
1985
|
var DEFAULTS = {
|
|
1982
1986
|
items: [],
|
|
1983
1987
|
orientation: 'horizontal',
|
|
1984
|
-
dropPlaceholder: 'Drop item here'
|
|
1988
|
+
dropPlaceholder: 'Drop item here',
|
|
1989
|
+
accepts: 'application/wd-item'
|
|
1985
1990
|
};
|
|
1986
1991
|
this.busy = false;
|
|
1987
1992
|
this.options = _extends({}, DEFAULTS, options);
|
|
@@ -2047,7 +2052,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2047
2052
|
item.id = WebsyDesigns.Utils.createIdentity();
|
|
2048
2053
|
}
|
|
2049
2054
|
|
|
2050
|
-
var html = "\n <div id='".concat(item.id, "_item' class='websy-dragdrop-item' draggable='true' data-id='").concat(item.id, "'> \n <div id='").concat(item.id, "_itemInner' class='websy-dragdrop-item-inner' data-id='").concat(item.id, "'>\n ");
|
|
2055
|
+
var html = "\n <div id='".concat(item.id, "_item' class='websy-dragdrop-item ").concat((item.classes || []).join(' '), "' draggable='true' data-id='").concat(item.id, "'> \n <div id='").concat(item.id, "_itemInner' class='websy-dragdrop-item-inner' data-id='").concat(item.id, "'>\n ");
|
|
2051
2056
|
|
|
2052
2057
|
if (item.component) {
|
|
2053
2058
|
html += "<div id='".concat(item.id, "_component'></div>");
|
|
@@ -2077,27 +2082,32 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2077
2082
|
value: function handleDragStart(event) {
|
|
2078
2083
|
this.draggedId = event.target.getAttribute('data-id');
|
|
2079
2084
|
event.dataTransfer.effectAllowed = 'move';
|
|
2080
|
-
event.dataTransfer.setData(
|
|
2085
|
+
event.dataTransfer.setData(this.options.accepts, JSON.stringify({
|
|
2081
2086
|
el: event.target.id,
|
|
2082
2087
|
id: this.elementId,
|
|
2083
2088
|
itemId: this.draggedId
|
|
2084
|
-
}));
|
|
2089
|
+
}));
|
|
2090
|
+
event.target.classList.add('dragging'); // event.target.style.opacity = 0.5
|
|
2085
2091
|
|
|
2086
|
-
event.target.style.opacity = 0.5;
|
|
2087
2092
|
this.dragging = true;
|
|
2088
2093
|
}
|
|
2089
2094
|
}, {
|
|
2090
2095
|
key: "handleDragOver",
|
|
2091
2096
|
value: function handleDragOver(event) {
|
|
2092
|
-
// console.log('drag over', event.target.classList)
|
|
2093
2097
|
if (event.preventDefault) {
|
|
2094
2098
|
event.preventDefault();
|
|
2095
2099
|
}
|
|
2096
2100
|
|
|
2101
|
+
console.log('drag', event.target.classList);
|
|
2102
|
+
|
|
2097
2103
|
if (!event.target.classList.contains('droppable')) {
|
|
2098
2104
|
return;
|
|
2099
2105
|
}
|
|
2100
2106
|
|
|
2107
|
+
if (event.dataTransfer.types.indexOf(this.options.accepts) === -1) {
|
|
2108
|
+
return;
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2101
2111
|
event.target.classList.add('drag-over');
|
|
2102
2112
|
}
|
|
2103
2113
|
}, {
|
|
@@ -2117,8 +2127,8 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2117
2127
|
key: "handleDrop",
|
|
2118
2128
|
value: function handleDrop(event) {
|
|
2119
2129
|
// console.log('drag drop')
|
|
2120
|
-
// console.log(event.dataTransfer.getData('application/wd-item'))
|
|
2121
|
-
var data = JSON.parse(event.dataTransfer.getData(
|
|
2130
|
+
// console.log(event.dataTransfer.getData('application/wd-item'))
|
|
2131
|
+
var data = JSON.parse(event.dataTransfer.getData(this.options.accepts));
|
|
2122
2132
|
|
|
2123
2133
|
if (event.preventDefault) {
|
|
2124
2134
|
event.preventDefault();
|
|
@@ -2128,6 +2138,10 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2128
2138
|
return;
|
|
2129
2139
|
}
|
|
2130
2140
|
|
|
2141
|
+
if (event.dataTransfer.types.indexOf(this.options.accepts) === -1) {
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2131
2145
|
var side = event.target.getAttribute('data-side');
|
|
2132
2146
|
var id = event.target.getAttribute('data-id');
|
|
2133
2147
|
var index = this.getItemIndex(id);
|
|
@@ -2185,6 +2199,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2185
2199
|
value: function handleDragEnd(event) {
|
|
2186
2200
|
// console.log('drag end')
|
|
2187
2201
|
event.target.style.opacity = 1;
|
|
2202
|
+
event.target.classList.remove('dragging');
|
|
2188
2203
|
this.draggedId = null;
|
|
2189
2204
|
this.dragging = false;
|
|
2190
2205
|
var startEl = document.getElementById("".concat(this.elementId, "start_item"));
|
|
@@ -6200,12 +6215,20 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6200
6215
|
data.forEach(function (row) {
|
|
6201
6216
|
bodyHtml += "<tr class=\"websy-table-row\">";
|
|
6202
6217
|
row.forEach(function (cell, cellIndex) {
|
|
6218
|
+
if (typeof sizingColumns[cellIndex] === 'undefined') {
|
|
6219
|
+
return; // need to revisit this logic
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6203
6222
|
var style = '';
|
|
6204
6223
|
|
|
6205
6224
|
if (cell.style) {
|
|
6206
6225
|
style += cell.style;
|
|
6207
6226
|
}
|
|
6208
6227
|
|
|
6228
|
+
if (useWidths === true) {
|
|
6229
|
+
style += "max-width: ".concat(sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth, "px!important;");
|
|
6230
|
+
}
|
|
6231
|
+
|
|
6209
6232
|
if (cell.backgroundColor) {
|
|
6210
6233
|
style += "background-color: ".concat(cell.backgroundColor, "; ");
|
|
6211
6234
|
|
|
@@ -6218,7 +6241,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6218
6241
|
style += "color: ".concat(cell.color, "; ");
|
|
6219
6242
|
}
|
|
6220
6243
|
|
|
6221
|
-
|
|
6244
|
+
console.log('rowspan', cell.rowspan);
|
|
6245
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n "); // if (useWidths === true) {
|
|
6222
6246
|
// bodyHtml += `
|
|
6223
6247
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
6224
6248
|
// width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
|
|
@@ -6377,10 +6401,16 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6377
6401
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6378
6402
|
return a + (b.width || b.actualWidth);
|
|
6379
6403
|
}, 0);
|
|
6404
|
+
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6405
|
+
return i >= _this40.pinnedColumns;
|
|
6406
|
+
}).reduce(function (a, b) {
|
|
6407
|
+
return a + (b.width || b.actualWidth);
|
|
6408
|
+
}, 0);
|
|
6380
6409
|
var outerSize = outerEl.getBoundingClientRect();
|
|
6381
6410
|
|
|
6382
6411
|
if (this.sizes.totalWidth < outerSize.width) {
|
|
6383
6412
|
this.sizes.totalWidth = 0;
|
|
6413
|
+
this.sizes.totalNonPinnedWidth = 0;
|
|
6384
6414
|
var equalWidth = outerSize.width / this.options.columns[this.options.columns.length - 1].length;
|
|
6385
6415
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6386
6416
|
if (!c.width) {
|
|
@@ -6391,6 +6421,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6391
6421
|
}
|
|
6392
6422
|
|
|
6393
6423
|
_this40.sizes.totalWidth += c.width || c.actualWidth;
|
|
6424
|
+
|
|
6425
|
+
if (i < _this40.pinnedColumns) {
|
|
6426
|
+
_this40.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6427
|
+
}
|
|
6428
|
+
|
|
6394
6429
|
equalWidth = (outerSize.width - _this40.sizes.totalWidth) / (_this40.options.columns[_this40.options.columns.length - 1].length - (i + 1));
|
|
6395
6430
|
});
|
|
6396
6431
|
} // take the height of the last cell as the official height for data cells
|
|
@@ -6412,10 +6447,14 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6412
6447
|
|
|
6413
6448
|
if (this.sizes.rowsToRender < this.totalRowCount) {
|
|
6414
6449
|
this.vScrollRequired = true;
|
|
6450
|
+
} else {
|
|
6451
|
+
this.vScrollRequired = false;
|
|
6415
6452
|
}
|
|
6416
6453
|
|
|
6417
6454
|
if (this.sizes.totalWidth > this.sizes.outer.width) {
|
|
6418
6455
|
this.hScrollRequired = true;
|
|
6456
|
+
} else {
|
|
6457
|
+
this.hScrollRequired = false;
|
|
6419
6458
|
}
|
|
6420
6459
|
|
|
6421
6460
|
this.options.allColumns = this.options.columns.map(function (c) {
|
|
@@ -6605,9 +6644,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6605
6644
|
if (this.hScrollRequired === true) {
|
|
6606
6645
|
hScrollEl.style.left = "".concat(this.sizes.table.width - this.sizes.scrollableWidth, "px");
|
|
6607
6646
|
hScrollEl.style.width = "".concat(this.sizes.scrollableWidth - 20, "px");
|
|
6608
|
-
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.
|
|
6647
|
+
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px';
|
|
6609
6648
|
} else {
|
|
6610
|
-
hHandleEl.style.
|
|
6649
|
+
hHandleEl.style.width = '0px';
|
|
6611
6650
|
}
|
|
6612
6651
|
}
|
|
6613
6652
|
}
|
|
@@ -6648,8 +6687,6 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6648
6687
|
el.classList.add('has-error');
|
|
6649
6688
|
}
|
|
6650
6689
|
|
|
6651
|
-
var tableEl = document.getElementById("".concat(this.elementId, "_tableInner"));
|
|
6652
|
-
tableEl.classList.add('hidden');
|
|
6653
6690
|
var containerEl = document.getElementById("".concat(this.elementId, "_errorContainer"));
|
|
6654
6691
|
|
|
6655
6692
|
if (containerEl) {
|
|
@@ -6675,6 +6712,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6675
6712
|
}, {
|
|
6676
6713
|
key: "scrollX",
|
|
6677
6714
|
value: function scrollX(diff) {
|
|
6715
|
+
var el = document.getElementById("".concat(this.elementId, "_tableContainer"));
|
|
6716
|
+
|
|
6717
|
+
if (!el.classList.contains('scrolling')) {
|
|
6718
|
+
el.classList.add('scrolling');
|
|
6719
|
+
}
|
|
6720
|
+
|
|
6721
|
+
if (this.scrollTimeoutFn) {
|
|
6722
|
+
clearTimeout(this.scrollTimeoutFn);
|
|
6723
|
+
}
|
|
6724
|
+
|
|
6725
|
+
this.scrollTimeoutFn = setTimeout(function () {
|
|
6726
|
+
el.classList.remove('scrolling');
|
|
6727
|
+
}, 200);
|
|
6728
|
+
|
|
6729
|
+
if (this.hScrollRequired === false) {
|
|
6730
|
+
return;
|
|
6731
|
+
}
|
|
6732
|
+
|
|
6678
6733
|
var scrollContainerEl = document.getElementById("".concat(this.elementId, "_hScrollContainer"));
|
|
6679
6734
|
var scrollHandleEl = document.getElementById("".concat(this.elementId, "_hScrollHandle"));
|
|
6680
6735
|
var handlePos;
|
|
@@ -6690,12 +6745,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6690
6745
|
scrollHandleEl.style.left = Math.min(scrollableSpace, Math.max(0, handlePos)) + 'px';
|
|
6691
6746
|
|
|
6692
6747
|
if (this.options.onScroll) {
|
|
6693
|
-
var actualLeft = (this.sizes.
|
|
6748
|
+
var actualLeft = (this.sizes.totalNonPinnedWidth - this.sizes.scrollableWidth) * (Math.min(scrollableSpace, Math.max(0, handlePos)) / scrollableSpace);
|
|
6694
6749
|
var cumulativeWidth = 0;
|
|
6695
6750
|
this.startCol = 0;
|
|
6696
6751
|
this.endCol = 0;
|
|
6697
6752
|
|
|
6698
|
-
for (var i =
|
|
6753
|
+
for (var i = this.pinnedColumns; i < this.options.allColumns[this.options.allColumns.length - 1].length; i++) {
|
|
6699
6754
|
cumulativeWidth += this.options.allColumns[this.options.allColumns.length - 1][i].actualWidth;
|
|
6700
6755
|
console.log('actualLeft', actualLeft, this.sizes.totalWidth, cumulativeWidth, cumulativeWidth + this.options.allColumns[this.options.allColumns.length - 1][i].actualWidth);
|
|
6701
6756
|
|
|
@@ -6730,6 +6785,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6730
6785
|
}, {
|
|
6731
6786
|
key: "scrollY",
|
|
6732
6787
|
value: function scrollY(diff) {
|
|
6788
|
+
var el = document.getElementById("".concat(this.elementId, "_tableContainer"));
|
|
6789
|
+
|
|
6790
|
+
if (!el.classList.contains('scrolling')) {
|
|
6791
|
+
el.classList.add('scrolling');
|
|
6792
|
+
}
|
|
6793
|
+
|
|
6794
|
+
if (this.scrollTimeoutFn) {
|
|
6795
|
+
clearTimeout(this.scrollTimeoutFn);
|
|
6796
|
+
}
|
|
6797
|
+
|
|
6798
|
+
this.scrollTimeoutFn = setTimeout(function () {
|
|
6799
|
+
el.classList.remove('scrolling');
|
|
6800
|
+
}, 200);
|
|
6801
|
+
|
|
6802
|
+
if (this.vScrollRequired === false) {
|
|
6803
|
+
return;
|
|
6804
|
+
}
|
|
6805
|
+
|
|
6733
6806
|
var scrollContainerEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
|
|
6734
6807
|
var scrollHandleEl = document.getElementById("".concat(this.elementId, "_vScrollHandle"));
|
|
6735
6808
|
var handlePos;
|
|
@@ -7716,11 +7789,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7716
7789
|
|
|
7717
7790
|
bars.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
7718
7791
|
bars.attr('width', getBarWidth.bind(this)).attr('height', getBarHeight.bind(this)).attr('x', getBarX.bind(this)).attr('y', getBarY.bind(this)).transition(this.transition).attr('fill', function (d) {
|
|
7719
|
-
return d.color || series.color;
|
|
7792
|
+
return d.y.color || d.color || series.color;
|
|
7720
7793
|
});
|
|
7721
7794
|
bars.enter().append('rect').attr('width', getBarWidth.bind(this)).attr('height', getBarHeight.bind(this)).attr('x', getBarX.bind(this)).attr('y', getBarY.bind(this)) // .transition(this.transition)
|
|
7722
7795
|
.attr('fill', function (d) {
|
|
7723
|
-
return d.color || series.color;
|
|
7796
|
+
return d.y.color || d.color || series.color;
|
|
7724
7797
|
}).attr('class', function (d) {
|
|
7725
7798
|
return "bar bar_".concat(series.key);
|
|
7726
7799
|
});
|
|
@@ -7740,20 +7813,36 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7740
7813
|
yAxis = 'bottomAxis';
|
|
7741
7814
|
}
|
|
7742
7815
|
|
|
7743
|
-
if (this.options.showLabels) {
|
|
7816
|
+
if (this.options.showLabels === true || series.showLabels === true) {
|
|
7744
7817
|
// need to add logic to handle positioning options
|
|
7745
7818
|
// e.g. Inside, Outide, Auto (this will also affect the available plot space)
|
|
7746
7819
|
// We currently only support 'Auto'
|
|
7747
7820
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
7748
7821
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
7749
|
-
labels.attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('class', "label_".concat(series.key)).
|
|
7750
|
-
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.color || series.color);
|
|
7751
|
-
}).transition(this.transition).text(function (d) {
|
|
7822
|
+
labels.attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
7823
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
7824
|
+
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
7752
7825
|
return d.y.label || d.y.value;
|
|
7826
|
+
}).each(function (d, i) {
|
|
7827
|
+
if (that.options.orientation === 'horizontal') {
|
|
7828
|
+
if (that.options.grouping === 'stacked') {
|
|
7829
|
+
this.setAttribute('text-anchor', 'middle');
|
|
7830
|
+
} else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
|
|
7831
|
+
this.setAttribute('text-anchor', 'end');
|
|
7832
|
+
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
7833
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
7834
|
+
} else {
|
|
7835
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
7836
|
+
}
|
|
7837
|
+
} else {
|
|
7838
|
+
if (that.plotheight - getLabelX.call(that, d) < (that.options.labelSize || that.options.fontSize)) {
|
|
7839
|
+
this.setAttribute('y', +this.getAttribute('y') + 8);
|
|
7840
|
+
}
|
|
7841
|
+
}
|
|
7753
7842
|
});
|
|
7754
|
-
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').
|
|
7755
|
-
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.color || series.color);
|
|
7756
|
-
}).text(function (d) {
|
|
7843
|
+
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
7844
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
7845
|
+
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
7757
7846
|
return d.y.label || d.y.value;
|
|
7758
7847
|
}).each(function (d, i) {
|
|
7759
7848
|
if (that.options.orientation === 'horizontal') {
|
|
@@ -7762,6 +7851,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7762
7851
|
} else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
|
|
7763
7852
|
this.setAttribute('text-anchor', 'end');
|
|
7764
7853
|
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
7854
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
7855
|
+
} else {
|
|
7856
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
7765
7857
|
}
|
|
7766
7858
|
} else {
|
|
7767
7859
|
if (that.plotheight - getLabelX.call(that, d) < (that.options.labelSize || that.options.fontSize)) {
|