@websy/websy-designs 1.9.1 → 1.9.3
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/websy-designs-es6.debug.js +66 -24
- package/dist/websy-designs-es6.js +61 -22
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +66 -24
- package/dist/websy-designs.js +61 -22
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -176,7 +176,9 @@ class ButtonGroup {
|
|
|
176
176
|
subscribers: {},
|
|
177
177
|
activeItem: -1,
|
|
178
178
|
tag: 'div',
|
|
179
|
-
allowNone: false
|
|
179
|
+
allowNone: false,
|
|
180
|
+
onActivate: () => {},
|
|
181
|
+
onDeactivate: () => {}
|
|
180
182
|
}
|
|
181
183
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
182
184
|
const el = document.getElementById(this.elementId)
|
|
@@ -188,7 +190,19 @@ class ButtonGroup {
|
|
|
188
190
|
handleClick (event) {
|
|
189
191
|
if (event.target.classList.contains('websy-button-group-item')) {
|
|
190
192
|
const index = +event.target.getAttribute('data-index')
|
|
191
|
-
if (this.options.
|
|
193
|
+
if (this.options.multiSelect === true) {
|
|
194
|
+
if (event.target.classList.contains('active')) {
|
|
195
|
+
this.options.onDeactivate(this.options.items[index], index, event)
|
|
196
|
+
event.target.classList.remove('active')
|
|
197
|
+
event.target.classList.add('inactive')
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this.options.onActivate(this.options.items[index], index, event)
|
|
201
|
+
event.target.classList.add('active')
|
|
202
|
+
event.target.classList.remove('inactive')
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else if (this.options.activeItem !== index) {
|
|
192
206
|
const el = document.getElementById(this.elementId)
|
|
193
207
|
let buttons = Array.from(el.querySelectorAll('.websy-button-group-item'))
|
|
194
208
|
buttons.forEach(el => {
|
|
@@ -2321,7 +2335,7 @@ class WebsyForm {
|
|
|
2321
2335
|
let componentsToProcess = []
|
|
2322
2336
|
if (el) {
|
|
2323
2337
|
let html = `
|
|
2324
|
-
<form id="${this.elementId}Form" class="websy-form ${this.options.classes || ''}">
|
|
2338
|
+
<form id="${this.elementId}Form" class="websy-form ${(this.options.classes || []).join(' ')}">
|
|
2325
2339
|
`
|
|
2326
2340
|
this.options.fields.forEach((f, i) => {
|
|
2327
2341
|
this.fieldMap[f.field] = f
|
|
@@ -2776,6 +2790,7 @@ class WebsyNavigationMenu {
|
|
|
2776
2790
|
activeSymbol: 'none',
|
|
2777
2791
|
enableSearch: false,
|
|
2778
2792
|
searchProp: 'text',
|
|
2793
|
+
indent: 'padding',
|
|
2779
2794
|
menuIcon: `<svg viewbox="0 0 40 40" width="30" height="40">
|
|
2780
2795
|
<rect x="0" y="0" width="30" height="4" rx="2"></rect>
|
|
2781
2796
|
<rect x="0" y="12" width="30" height="4" rx="2"></rect>
|
|
@@ -3020,7 +3035,7 @@ class WebsyNavigationMenu {
|
|
|
3020
3035
|
data-menu-id='${this.elementId}_${currentBlock}_list'
|
|
3021
3036
|
data-popout-id='${level > 1 ? block : currentBlock}'
|
|
3022
3037
|
data-text='${items[i].isLink !== true ? items[i].text : ''}'
|
|
3023
|
-
style='
|
|
3038
|
+
style='${this.options.indent}-left: ${level * this.options.childIndentation}px'
|
|
3024
3039
|
${(items[i].attributes && items[i].attributes.join(' ')) || ''}
|
|
3025
3040
|
>
|
|
3026
3041
|
`
|
|
@@ -5030,7 +5045,7 @@ const WebsyUtils = {
|
|
|
5030
5045
|
if (numOut % 1 > 0) {
|
|
5031
5046
|
decimals = 1
|
|
5032
5047
|
}
|
|
5033
|
-
if (numOut < 1) {
|
|
5048
|
+
if (numOut < 1 && decimals === 0) {
|
|
5034
5049
|
decimals = getZeroDecimals(numOut)
|
|
5035
5050
|
}
|
|
5036
5051
|
numOut = (+numOut).toFixed(decimals)
|
|
@@ -6931,6 +6946,13 @@ class WebsyTable3 {
|
|
|
6931
6946
|
// bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
|
|
6932
6947
|
// }
|
|
6933
6948
|
bodyEl.style.height = `${this.sizes.bodyHeight}px`
|
|
6949
|
+
if (this.isTouchDevice === true) {
|
|
6950
|
+
let touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6951
|
+
if (touchScrollEl) {
|
|
6952
|
+
touchScrollEl.style.top = `${this.sizes.header.height}px`
|
|
6953
|
+
touchScrollEl.style.height = `calc(100% - ${this.sizes.header.height + 30}px)`
|
|
6954
|
+
}
|
|
6955
|
+
}
|
|
6934
6956
|
if (this.options.virtualScroll === true) {
|
|
6935
6957
|
// set the scroll element positions
|
|
6936
6958
|
let vScrollEl = document.getElementById(`${this.elementId}_vScrollContainer`)
|
|
@@ -6938,6 +6960,9 @@ class WebsyTable3 {
|
|
|
6938
6960
|
if (this.vScrollRequired === true) {
|
|
6939
6961
|
vScrollEl.style.top = `${this.sizes.header.height + this.sizes.total.height}px`
|
|
6940
6962
|
vScrollEl.style.height = `${this.sizes.bodyHeight}px`
|
|
6963
|
+
if (this.isTouchDevice === true) {
|
|
6964
|
+
vScrollEl.style.visibility = `unset`
|
|
6965
|
+
}
|
|
6941
6966
|
vHandleEl.style.height = Math.max(this.options.minHandleSize, this.sizes.bodyHeight * (this.sizes.rowsToRenderPrecise / this.totalRowCount)) + 'px'
|
|
6942
6967
|
const scrollableSpace = vScrollEl.getBoundingClientRect().height - vHandleEl.getBoundingClientRect().height
|
|
6943
6968
|
vHandleEl.style.top = Math.round(this.startRow / (this.totalRowCount - this.sizes.rowsToRender) * (scrollableSpace)) + 'px'
|
|
@@ -6951,6 +6976,9 @@ class WebsyTable3 {
|
|
|
6951
6976
|
hScrollEl.style.left = `${this.sizes.table.width - this.sizes.scrollableWidth}px`
|
|
6952
6977
|
hScrollEl.style.width = `${this.sizes.scrollableWidth - (this.isTouchDevice ? 30 : 20)}px`
|
|
6953
6978
|
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px'
|
|
6979
|
+
if (this.isTouchDevice === true) {
|
|
6980
|
+
hScrollEl.style.visibility = `unset`
|
|
6981
|
+
}
|
|
6954
6982
|
}
|
|
6955
6983
|
else {
|
|
6956
6984
|
hHandleEl.style.width = '0px'
|
|
@@ -7408,6 +7436,9 @@ else {
|
|
|
7408
7436
|
.select('.tracking-line')
|
|
7409
7437
|
.attr('stroke-opacity', 0)
|
|
7410
7438
|
this.tooltip.hide()
|
|
7439
|
+
if (this.options.onMouseOut) {
|
|
7440
|
+
this.options.onMouseOut()
|
|
7441
|
+
}
|
|
7411
7442
|
}
|
|
7412
7443
|
handleEventMouseMove (event, d) {
|
|
7413
7444
|
let bisectDate = d3.bisector(d => {
|
|
@@ -7434,6 +7465,9 @@ else {
|
|
|
7434
7465
|
let xDiff
|
|
7435
7466
|
if (typeof x0 === 'undefined') {
|
|
7436
7467
|
this.tooltip.hide()
|
|
7468
|
+
if (this.options.onMouseOut) {
|
|
7469
|
+
this.options.onMouseOut()
|
|
7470
|
+
}
|
|
7437
7471
|
return
|
|
7438
7472
|
}
|
|
7439
7473
|
let xLabel = this[xAxis].domain()[x0]
|
|
@@ -7456,7 +7490,7 @@ else {
|
|
|
7456
7490
|
if (!d.y.color) {
|
|
7457
7491
|
d.y.color = s.color
|
|
7458
7492
|
}
|
|
7459
|
-
tooltipData.push(d
|
|
7493
|
+
tooltipData.push(d)
|
|
7460
7494
|
}
|
|
7461
7495
|
})
|
|
7462
7496
|
}
|
|
@@ -7474,7 +7508,7 @@ else {
|
|
|
7474
7508
|
if (!pointA.y.color) {
|
|
7475
7509
|
pointA.y.color = s.color
|
|
7476
7510
|
}
|
|
7477
|
-
tooltipData.push(pointA
|
|
7511
|
+
tooltipData.push(pointA)
|
|
7478
7512
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7479
7513
|
tooltipTitle = d3.timeFormat(this.options.dateFormat || this.options.calculatedTimeFormatPattern)(pointA.x.value)
|
|
7480
7514
|
}
|
|
@@ -7485,7 +7519,7 @@ else {
|
|
|
7485
7519
|
if (!pointB.y.color) {
|
|
7486
7520
|
pointB.y.color = s.color
|
|
7487
7521
|
}
|
|
7488
|
-
tooltipData.push(pointB
|
|
7522
|
+
tooltipData.push(pointB)
|
|
7489
7523
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7490
7524
|
tooltipTitle = d3.timeFormat(this.options.dateFormat || this.options.calculatedTimeFormatPattern)(pointB.x.value)
|
|
7491
7525
|
}
|
|
@@ -7503,7 +7537,7 @@ else {
|
|
|
7503
7537
|
if (!pointB.y.color) {
|
|
7504
7538
|
pointB.y.color = s.color
|
|
7505
7539
|
}
|
|
7506
|
-
tooltipData.push(pointB
|
|
7540
|
+
tooltipData.push(pointB)
|
|
7507
7541
|
}
|
|
7508
7542
|
else {
|
|
7509
7543
|
xPoint = d0
|
|
@@ -7514,7 +7548,7 @@ else {
|
|
|
7514
7548
|
if (!pointA.y.color) {
|
|
7515
7549
|
pointA.y.color = s.color
|
|
7516
7550
|
}
|
|
7517
|
-
tooltipData.push(pointA
|
|
7551
|
+
tooltipData.push(pointA)
|
|
7518
7552
|
}
|
|
7519
7553
|
}
|
|
7520
7554
|
}
|
|
@@ -7524,10 +7558,13 @@ else {
|
|
|
7524
7558
|
`
|
|
7525
7559
|
tooltipHTML += tooltipData.map(d => `
|
|
7526
7560
|
<li>
|
|
7527
|
-
<i style='background-color: ${d.color};'></i>
|
|
7528
|
-
${d.tooltipLabel || ''}<span>: ${d.tooltipValue || d.value}</span>
|
|
7561
|
+
<i style='background-color: ${d.y.color};'></i>
|
|
7562
|
+
${d.y.tooltipLabel || ''}<span>: ${d.y.tooltipValue || d.value}</span>
|
|
7529
7563
|
</li>
|
|
7530
7564
|
`).join('')
|
|
7565
|
+
if (this.options.onMouseOver) {
|
|
7566
|
+
this.options.onMouseOver(tooltipData)
|
|
7567
|
+
}
|
|
7531
7568
|
tooltipHTML += `</ul>`
|
|
7532
7569
|
let posOptions = {
|
|
7533
7570
|
width: this.options.tooltipWidth,
|
|
@@ -7571,6 +7608,9 @@ else {
|
|
|
7571
7608
|
this.tooltip.setHeight(this.plotHeight)
|
|
7572
7609
|
if (isNaN(posOptions.left)) {
|
|
7573
7610
|
this.tooltip.hide()
|
|
7611
|
+
if (this.options.onMouseOut) {
|
|
7612
|
+
this.options.onMouseOut()
|
|
7613
|
+
}
|
|
7574
7614
|
return
|
|
7575
7615
|
}
|
|
7576
7616
|
this.options.showTooltip && this.tooltip.show(tooltipTitle, tooltipHTML, posOptions)
|
|
@@ -7617,9 +7657,9 @@ this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer')
|
|
|
7617
7657
|
this.rightAxisLabel = this.svg.append('g').attr('class', 'right-axis-label-layer')
|
|
7618
7658
|
this.bottomAxisLabel = this.svg.append('g').attr('class', 'bottom-axis-label-layer')
|
|
7619
7659
|
this.plotArea = this.svg.append('g').attr('class', 'plot-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7660
|
+
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7620
7661
|
this.areaLayer = this.svg.append('g').attr('class', 'area-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7621
7662
|
this.lineLayer = this.svg.append('g').attr('class', 'line-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7622
|
-
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7623
7663
|
// this.barLayer.attr('clip-path', `url(#${this.elementId}_clip)`)
|
|
7624
7664
|
this.labelLayer = this.svg.append('g').attr('class', 'label-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
7625
7665
|
this.symbolLayer = this.svg.append('g').attr('class', 'symbol-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
@@ -7804,9 +7844,9 @@ else {
|
|
|
7804
7844
|
this.options.data.right.max = d3.max(this.options.data.right.data)
|
|
7805
7845
|
}
|
|
7806
7846
|
if (this.options.data.right && typeof this.options.data.right.max !== 'undefined') {
|
|
7807
|
-
this.longestRight = this.options.data.right.max.toString()
|
|
7847
|
+
this.longestRight = this.options.data.right.max.length > this.options.data.right.min.length ? this.options.data.right.max.toString() : this.options.data.right.min.toString()
|
|
7808
7848
|
if (this.options.data.right.formatter) {
|
|
7809
|
-
this.longestRight = this.options.data.right.formatter(this.
|
|
7849
|
+
this.longestRight = this.options.data.right.formatter(this.longestRight).toString()
|
|
7810
7850
|
}
|
|
7811
7851
|
}
|
|
7812
7852
|
// Check to see if we need to balance the min and max values
|
|
@@ -7818,10 +7858,10 @@ else {
|
|
|
7818
7858
|
}
|
|
7819
7859
|
else {
|
|
7820
7860
|
let biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max)
|
|
7821
|
-
this.options.data.left.min =
|
|
7861
|
+
this.options.data.left.min = biggestLeft * -1
|
|
7822
7862
|
this.options.data.left.max = biggestLeft
|
|
7823
7863
|
let biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max)
|
|
7824
|
-
this.options.data.right.min =
|
|
7864
|
+
this.options.data.right.min = biggestRight * -1
|
|
7825
7865
|
this.options.data.right.max = biggestRight
|
|
7826
7866
|
}
|
|
7827
7867
|
}
|
|
@@ -7846,7 +7886,7 @@ else {
|
|
|
7846
7886
|
}
|
|
7847
7887
|
}
|
|
7848
7888
|
this.options.margin.axisLeft = Math.max(longestLeftBounds.width, firstBottomWidth) + 5 // + 5 to accommodate for space between text and axis line
|
|
7849
|
-
this.options.margin.axisRight = longestRightBounds.width
|
|
7889
|
+
this.options.margin.axisRight = longestRightBounds.width + 10
|
|
7850
7890
|
this.options.margin.axisBottom = longestBottomBounds.height + 10
|
|
7851
7891
|
this.options.margin.axisTop = 0
|
|
7852
7892
|
// adjust axis margins based on title options
|
|
@@ -7911,7 +7951,8 @@ else {
|
|
|
7911
7951
|
this.totalBrushBandPadding = 0
|
|
7912
7952
|
let noOfPoints = 0
|
|
7913
7953
|
let noOfGroups = 0
|
|
7914
|
-
let plotable = 0
|
|
7954
|
+
let plotable = 0
|
|
7955
|
+
|
|
7915
7956
|
if (this.options.maxBandWidth) {
|
|
7916
7957
|
if (this.options.orientation === 'horizontal') {
|
|
7917
7958
|
this.options.data.left.totalValueCount = this.options.data.left.data.reduce((a, b) => {
|
|
@@ -8005,7 +8046,8 @@ else {
|
|
|
8005
8046
|
// }
|
|
8006
8047
|
// }
|
|
8007
8048
|
// Translate the layers
|
|
8008
|
-
const leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8049
|
+
const leftBrushAdjustment = this.options.orientation === 'horizontal' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8050
|
+
// const bottomBrushAdjustment = this.options.orientation === 'vertical' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8009
8051
|
this.leftAxisLayer
|
|
8010
8052
|
.attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8011
8053
|
.style('font-size', (this.options.data.left && this.options.data.left.fontSize) || this.options.fontSize)
|
|
@@ -8045,12 +8087,12 @@ else {
|
|
|
8045
8087
|
this.brushLayer
|
|
8046
8088
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8047
8089
|
this.yAxisClip
|
|
8048
|
-
.attr('transform', `translate(${leftBrushAdjustment
|
|
8090
|
+
.attr('transform', `translate(${leftBrushAdjustment}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8049
8091
|
.attr('width', this.options.margin.axisLeft + 10)
|
|
8050
8092
|
.attr('height', this.plotHeight)
|
|
8051
8093
|
this.xAxisClip
|
|
8052
8094
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
|
|
8053
|
-
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
|
|
8095
|
+
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right)
|
|
8054
8096
|
.attr('height', longestBottomBounds.height + 10)
|
|
8055
8097
|
this.brushClip
|
|
8056
8098
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
@@ -8061,12 +8103,12 @@ else {
|
|
|
8061
8103
|
this.brushLayer
|
|
8062
8104
|
.attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
|
|
8063
8105
|
this.yAxisClip
|
|
8064
|
-
.attr('transform', `translate(
|
|
8106
|
+
.attr('transform', `translate(0, ${this.options.margin.top + this.options.margin.axisTop - 10})`)
|
|
8065
8107
|
.attr('width', this.options.margin.axisLeft + 10)
|
|
8066
8108
|
.attr('height', this.plotHeight + 20)
|
|
8067
8109
|
this.xAxisClip
|
|
8068
8110
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
|
|
8069
|
-
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
|
|
8111
|
+
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right)
|
|
8070
8112
|
.attr('height', longestBottomBounds.height + 10)
|
|
8071
8113
|
this.brushClip
|
|
8072
8114
|
.attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
|
|
@@ -219,7 +219,9 @@ var ButtonGroup = /*#__PURE__*/function () {
|
|
|
219
219
|
subscribers: {},
|
|
220
220
|
activeItem: -1,
|
|
221
221
|
tag: 'div',
|
|
222
|
-
allowNone: false
|
|
222
|
+
allowNone: false,
|
|
223
|
+
onActivate: function onActivate() {},
|
|
224
|
+
onDeactivate: function onDeactivate() {}
|
|
223
225
|
};
|
|
224
226
|
this.options = _extends({}, DEFAULTS, options);
|
|
225
227
|
var el = document.getElementById(this.elementId);
|
|
@@ -233,7 +235,17 @@ var ButtonGroup = /*#__PURE__*/function () {
|
|
|
233
235
|
value: function handleClick(event) {
|
|
234
236
|
if (event.target.classList.contains('websy-button-group-item')) {
|
|
235
237
|
var index = +event.target.getAttribute('data-index');
|
|
236
|
-
if (this.options.
|
|
238
|
+
if (this.options.multiSelect === true) {
|
|
239
|
+
if (event.target.classList.contains('active')) {
|
|
240
|
+
this.options.onDeactivate(this.options.items[index], index, event);
|
|
241
|
+
event.target.classList.remove('active');
|
|
242
|
+
event.target.classList.add('inactive');
|
|
243
|
+
} else {
|
|
244
|
+
this.options.onActivate(this.options.items[index], index, event);
|
|
245
|
+
event.target.classList.add('active');
|
|
246
|
+
event.target.classList.remove('inactive');
|
|
247
|
+
}
|
|
248
|
+
} else if (this.options.activeItem !== index) {
|
|
237
249
|
var el = document.getElementById(this.elementId);
|
|
238
250
|
var buttons = Array.from(el.querySelectorAll('.websy-button-group-item'));
|
|
239
251
|
buttons.forEach(function (el) {
|
|
@@ -2351,7 +2363,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2351
2363
|
var el = document.getElementById(this.elementId);
|
|
2352
2364
|
var componentsToProcess = [];
|
|
2353
2365
|
if (el) {
|
|
2354
|
-
var html = "\n <form id=\"".concat(this.elementId, "Form\" class=\"websy-form ").concat(this.options.classes || '', "\">\n ");
|
|
2366
|
+
var html = "\n <form id=\"".concat(this.elementId, "Form\" class=\"websy-form ").concat((this.options.classes || []).join(' '), "\">\n ");
|
|
2355
2367
|
this.options.fields.forEach(function (f, i) {
|
|
2356
2368
|
_this17.fieldMap[f.field] = f;
|
|
2357
2369
|
if (f.component) {
|
|
@@ -2610,6 +2622,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2610
2622
|
activeSymbol: 'none',
|
|
2611
2623
|
enableSearch: false,
|
|
2612
2624
|
searchProp: 'text',
|
|
2625
|
+
indent: 'padding',
|
|
2613
2626
|
menuIcon: "<svg viewbox=\"0 0 40 40\" width=\"30\" height=\"40\"> \n <rect x=\"0\" y=\"0\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"12\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"24\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n </svg>",
|
|
2614
2627
|
searchOptions: {}
|
|
2615
2628
|
}, options);
|
|
@@ -2849,7 +2862,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2849
2862
|
if (Array.isArray(items[i].classes)) {
|
|
2850
2863
|
items[i].classes = items[i].classes.join(' ');
|
|
2851
2864
|
}
|
|
2852
|
-
html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='
|
|
2865
|
+
html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='").concat(this.options.indent, "-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
|
|
2853
2866
|
if (this.options.orientation === 'horizontal') {
|
|
2854
2867
|
html += items[i].text;
|
|
2855
2868
|
}
|
|
@@ -4888,7 +4901,7 @@ var WebsyUtils = {
|
|
|
4888
4901
|
if (numOut % 1 > 0) {
|
|
4889
4902
|
decimals = 1;
|
|
4890
4903
|
}
|
|
4891
|
-
if (numOut < 1) {
|
|
4904
|
+
if (numOut < 1 && decimals === 0) {
|
|
4892
4905
|
decimals = getZeroDecimals(numOut);
|
|
4893
4906
|
}
|
|
4894
4907
|
numOut = (+numOut).toFixed(decimals);
|
|
@@ -6635,6 +6648,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6635
6648
|
// bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
|
|
6636
6649
|
// }
|
|
6637
6650
|
bodyEl.style.height = "".concat(this.sizes.bodyHeight, "px");
|
|
6651
|
+
if (this.isTouchDevice === true) {
|
|
6652
|
+
var touchScrollEl = document.getElementById("".concat(this.elementId, "_touchScroller"));
|
|
6653
|
+
if (touchScrollEl) {
|
|
6654
|
+
touchScrollEl.style.top = "".concat(this.sizes.header.height, "px");
|
|
6655
|
+
touchScrollEl.style.height = "calc(100% - ".concat(this.sizes.header.height + 30, "px)");
|
|
6656
|
+
}
|
|
6657
|
+
}
|
|
6638
6658
|
if (this.options.virtualScroll === true) {
|
|
6639
6659
|
// set the scroll element positions
|
|
6640
6660
|
var vScrollEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
|
|
@@ -6642,6 +6662,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6642
6662
|
if (this.vScrollRequired === true) {
|
|
6643
6663
|
vScrollEl.style.top = "".concat(this.sizes.header.height + this.sizes.total.height, "px");
|
|
6644
6664
|
vScrollEl.style.height = "".concat(this.sizes.bodyHeight, "px");
|
|
6665
|
+
if (this.isTouchDevice === true) {
|
|
6666
|
+
vScrollEl.style.visibility = "unset";
|
|
6667
|
+
}
|
|
6645
6668
|
vHandleEl.style.height = Math.max(this.options.minHandleSize, this.sizes.bodyHeight * (this.sizes.rowsToRenderPrecise / this.totalRowCount)) + 'px';
|
|
6646
6669
|
var scrollableSpace = vScrollEl.getBoundingClientRect().height - vHandleEl.getBoundingClientRect().height;
|
|
6647
6670
|
vHandleEl.style.top = Math.round(this.startRow / (this.totalRowCount - this.sizes.rowsToRender) * scrollableSpace) + 'px';
|
|
@@ -6654,6 +6677,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6654
6677
|
hScrollEl.style.left = "".concat(this.sizes.table.width - this.sizes.scrollableWidth, "px");
|
|
6655
6678
|
hScrollEl.style.width = "".concat(this.sizes.scrollableWidth - (this.isTouchDevice ? 30 : 20), "px");
|
|
6656
6679
|
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px';
|
|
6680
|
+
if (this.isTouchDevice === true) {
|
|
6681
|
+
hScrollEl.style.visibility = "unset";
|
|
6682
|
+
}
|
|
6657
6683
|
} else {
|
|
6658
6684
|
hHandleEl.style.width = '0px';
|
|
6659
6685
|
}
|
|
@@ -7118,6 +7144,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7118
7144
|
value: function handleEventMouseOut(event, d) {
|
|
7119
7145
|
this.trackingLineLayer.select('.tracking-line').attr('stroke-opacity', 0);
|
|
7120
7146
|
this.tooltip.hide();
|
|
7147
|
+
if (this.options.onMouseOut) {
|
|
7148
|
+
this.options.onMouseOut();
|
|
7149
|
+
}
|
|
7121
7150
|
}
|
|
7122
7151
|
}, {
|
|
7123
7152
|
key: "handleEventMouseMove",
|
|
@@ -7147,6 +7176,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7147
7176
|
var xDiff;
|
|
7148
7177
|
if (typeof x0 === 'undefined') {
|
|
7149
7178
|
this.tooltip.hide();
|
|
7179
|
+
if (this.options.onMouseOut) {
|
|
7180
|
+
this.options.onMouseOut();
|
|
7181
|
+
}
|
|
7150
7182
|
return;
|
|
7151
7183
|
}
|
|
7152
7184
|
var xLabel = this[xAxis].domain()[x0];
|
|
@@ -7169,7 +7201,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7169
7201
|
if (!d.y.color) {
|
|
7170
7202
|
d.y.color = s.color;
|
|
7171
7203
|
}
|
|
7172
|
-
tooltipData.push(d
|
|
7204
|
+
tooltipData.push(d);
|
|
7173
7205
|
}
|
|
7174
7206
|
});
|
|
7175
7207
|
} else {
|
|
@@ -7186,7 +7218,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7186
7218
|
if (!pointA.y.color) {
|
|
7187
7219
|
pointA.y.color = s.color;
|
|
7188
7220
|
}
|
|
7189
|
-
tooltipData.push(pointA
|
|
7221
|
+
tooltipData.push(pointA);
|
|
7190
7222
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7191
7223
|
tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7192
7224
|
}
|
|
@@ -7197,7 +7229,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7197
7229
|
if (!pointB.y.color) {
|
|
7198
7230
|
pointB.y.color = s.color;
|
|
7199
7231
|
}
|
|
7200
|
-
tooltipData.push(pointB
|
|
7232
|
+
tooltipData.push(pointB);
|
|
7201
7233
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7202
7234
|
tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7203
7235
|
}
|
|
@@ -7215,7 +7247,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7215
7247
|
if (!pointB.y.color) {
|
|
7216
7248
|
pointB.y.color = s.color;
|
|
7217
7249
|
}
|
|
7218
|
-
tooltipData.push(pointB
|
|
7250
|
+
tooltipData.push(pointB);
|
|
7219
7251
|
} else {
|
|
7220
7252
|
xPoint = d0;
|
|
7221
7253
|
tooltipTitle = pointA.x.value;
|
|
@@ -7225,15 +7257,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7225
7257
|
if (!pointA.y.color) {
|
|
7226
7258
|
pointA.y.color = s.color;
|
|
7227
7259
|
}
|
|
7228
|
-
tooltipData.push(pointA
|
|
7260
|
+
tooltipData.push(pointA);
|
|
7229
7261
|
}
|
|
7230
7262
|
}
|
|
7231
7263
|
}
|
|
7232
7264
|
});
|
|
7233
7265
|
tooltipHTML = " \n <ul>\n ";
|
|
7234
7266
|
tooltipHTML += tooltipData.map(function (d) {
|
|
7235
|
-
return "\n <li>\n <i style='background-color: ".concat(d.color, ";'></i>\n ").concat(d.tooltipLabel || '', "<span>: ").concat(d.tooltipValue || d.value, "</span>\n </li>\n ");
|
|
7267
|
+
return "\n <li>\n <i style='background-color: ".concat(d.y.color, ";'></i>\n ").concat(d.y.tooltipLabel || '', "<span>: ").concat(d.y.tooltipValue || d.value, "</span>\n </li>\n ");
|
|
7236
7268
|
}).join('');
|
|
7269
|
+
if (this.options.onMouseOver) {
|
|
7270
|
+
this.options.onMouseOver(tooltipData);
|
|
7271
|
+
}
|
|
7237
7272
|
tooltipHTML += "</ul>";
|
|
7238
7273
|
var posOptions = {
|
|
7239
7274
|
width: this.options.tooltipWidth,
|
|
@@ -7276,6 +7311,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7276
7311
|
this.tooltip.setHeight(this.plotHeight);
|
|
7277
7312
|
if (isNaN(posOptions.left)) {
|
|
7278
7313
|
this.tooltip.hide();
|
|
7314
|
+
if (this.options.onMouseOut) {
|
|
7315
|
+
this.options.onMouseOut();
|
|
7316
|
+
}
|
|
7279
7317
|
return;
|
|
7280
7318
|
}
|
|
7281
7319
|
this.options.showTooltip && this.tooltip.show(tooltipTitle, tooltipHTML, posOptions);
|
|
@@ -7316,9 +7354,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7316
7354
|
this.rightAxisLabel = this.svg.append('g').attr('class', 'right-axis-label-layer');
|
|
7317
7355
|
this.bottomAxisLabel = this.svg.append('g').attr('class', 'bottom-axis-label-layer');
|
|
7318
7356
|
this.plotArea = this.svg.append('g').attr('class', 'plot-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7357
|
+
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7319
7358
|
this.areaLayer = this.svg.append('g').attr('class', 'area-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7320
7359
|
this.lineLayer = this.svg.append('g').attr('class', 'line-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7321
|
-
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7322
7360
|
// this.barLayer.attr('clip-path', `url(#${this.elementId}_clip)`)
|
|
7323
7361
|
this.labelLayer = this.svg.append('g').attr('class', 'label-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7324
7362
|
this.symbolLayer = this.svg.append('g').attr('class', 'symbol-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
@@ -7511,9 +7549,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7511
7549
|
this.options.data.right.max = d3.max(this.options.data.right.data);
|
|
7512
7550
|
}
|
|
7513
7551
|
if (this.options.data.right && typeof this.options.data.right.max !== 'undefined') {
|
|
7514
|
-
this.longestRight = this.options.data.right.max.toString();
|
|
7552
|
+
this.longestRight = this.options.data.right.max.length > this.options.data.right.min.length ? this.options.data.right.max.toString() : this.options.data.right.min.toString();
|
|
7515
7553
|
if (this.options.data.right.formatter) {
|
|
7516
|
-
this.longestRight = this.options.data.right.formatter(this.
|
|
7554
|
+
this.longestRight = this.options.data.right.formatter(this.longestRight).toString();
|
|
7517
7555
|
}
|
|
7518
7556
|
}
|
|
7519
7557
|
// Check to see if we need to balance the min and max values
|
|
@@ -7524,10 +7562,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7524
7562
|
this.options.data.bottom.max = biggestBottom;
|
|
7525
7563
|
} else {
|
|
7526
7564
|
var biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max);
|
|
7527
|
-
this.options.data.left.min =
|
|
7565
|
+
this.options.data.left.min = biggestLeft * -1;
|
|
7528
7566
|
this.options.data.left.max = biggestLeft;
|
|
7529
7567
|
var biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max);
|
|
7530
|
-
this.options.data.right.min =
|
|
7568
|
+
this.options.data.right.min = biggestRight * -1;
|
|
7531
7569
|
this.options.data.right.max = biggestRight;
|
|
7532
7570
|
}
|
|
7533
7571
|
}
|
|
@@ -7551,7 +7589,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7551
7589
|
}
|
|
7552
7590
|
}
|
|
7553
7591
|
this.options.margin.axisLeft = Math.max(longestLeftBounds.width, firstBottomWidth) + 5; // + 5 to accommodate for space between text and axis line
|
|
7554
|
-
this.options.margin.axisRight = longestRightBounds.width;
|
|
7592
|
+
this.options.margin.axisRight = longestRightBounds.width + 10;
|
|
7555
7593
|
this.options.margin.axisBottom = longestBottomBounds.height + 10;
|
|
7556
7594
|
this.options.margin.axisTop = 0;
|
|
7557
7595
|
// adjust axis margins based on title options
|
|
@@ -7703,7 +7741,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7703
7741
|
// }
|
|
7704
7742
|
// }
|
|
7705
7743
|
// Translate the layers
|
|
7706
|
-
var leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0;
|
|
7744
|
+
var leftBrushAdjustment = this.options.orientation === 'horizontal' && this.brushNeeded === true ? this.options.brushHeight : 0;
|
|
7745
|
+
// const bottomBrushAdjustment = this.options.orientation === 'vertical' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
7707
7746
|
this.leftAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.left && this.options.data.left.fontSize || this.options.fontSize);
|
|
7708
7747
|
this.rightAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.plotWidth + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.right && this.options.data.right.fontSize || this.options.fontSize);
|
|
7709
7748
|
this.bottomAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).style('font-size', this.options.data.bottom && this.options.data.bottom.fontSize || this.options.fontSize);
|
|
@@ -7721,13 +7760,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7721
7760
|
this.clip.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", 0)")).attr('width', this.plotWidth).attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop);
|
|
7722
7761
|
if (this.options.orientation === 'horizontal') {
|
|
7723
7762
|
this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
|
|
7724
|
-
this.yAxisClip.attr('transform', "translate(".concat(leftBrushAdjustment
|
|
7725
|
-
this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight).attr('height', longestBottomBounds.height + 10);
|
|
7763
|
+
this.yAxisClip.attr('transform', "translate(".concat(leftBrushAdjustment, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).attr('width', this.options.margin.axisLeft + 10).attr('height', this.plotHeight);
|
|
7764
|
+
this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right).attr('height', longestBottomBounds.height + 10);
|
|
7726
7765
|
this.brushClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).attr('height', this.plotHeight).attr('width', this.options.brushHeight);
|
|
7727
7766
|
} else {
|
|
7728
7767
|
this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height, ")"));
|
|
7729
|
-
this.yAxisClip.attr('transform', "translate(
|
|
7730
|
-
this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight).attr('height', longestBottomBounds.height + 10);
|
|
7768
|
+
this.yAxisClip.attr('transform', "translate(0, ".concat(this.options.margin.top + this.options.margin.axisTop - 10, ")")).attr('width', this.options.margin.axisLeft + 10).attr('height', this.plotHeight + 20);
|
|
7769
|
+
this.xAxisClip.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right).attr('height', longestBottomBounds.height + 10);
|
|
7731
7770
|
this.brushClip.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height, ")")).attr('width', this.plotWidth).attr('height', this.options.brushHeight);
|
|
7732
7771
|
}
|
|
7733
7772
|
this.eventLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
|