@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
|
@@ -181,7 +181,9 @@ class ButtonGroup {
|
|
|
181
181
|
subscribers: {},
|
|
182
182
|
activeItem: -1,
|
|
183
183
|
tag: 'div',
|
|
184
|
-
allowNone: false
|
|
184
|
+
allowNone: false,
|
|
185
|
+
onActivate: () => {},
|
|
186
|
+
onDeactivate: () => {}
|
|
185
187
|
}
|
|
186
188
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
187
189
|
const el = document.getElementById(this.elementId)
|
|
@@ -193,7 +195,19 @@ class ButtonGroup {
|
|
|
193
195
|
handleClick (event) {
|
|
194
196
|
if (event.target.classList.contains('websy-button-group-item')) {
|
|
195
197
|
const index = +event.target.getAttribute('data-index')
|
|
196
|
-
if (this.options.
|
|
198
|
+
if (this.options.multiSelect === true) {
|
|
199
|
+
if (event.target.classList.contains('active')) {
|
|
200
|
+
this.options.onDeactivate(this.options.items[index], index, event)
|
|
201
|
+
event.target.classList.remove('active')
|
|
202
|
+
event.target.classList.add('inactive')
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
this.options.onActivate(this.options.items[index], index, event)
|
|
206
|
+
event.target.classList.add('active')
|
|
207
|
+
event.target.classList.remove('inactive')
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else if (this.options.activeItem !== index) {
|
|
197
211
|
const el = document.getElementById(this.elementId)
|
|
198
212
|
let buttons = Array.from(el.querySelectorAll('.websy-button-group-item'))
|
|
199
213
|
buttons.forEach(el => {
|
|
@@ -2520,7 +2534,7 @@ class WebsyForm {
|
|
|
2520
2534
|
let componentsToProcess = []
|
|
2521
2535
|
if (el) {
|
|
2522
2536
|
let html = `
|
|
2523
|
-
<form id="${this.elementId}Form" class="websy-form ${this.options.classes || ''}">
|
|
2537
|
+
<form id="${this.elementId}Form" class="websy-form ${(this.options.classes || []).join(' ')}">
|
|
2524
2538
|
`
|
|
2525
2539
|
this.options.fields.forEach((f, i) => {
|
|
2526
2540
|
this.fieldMap[f.field] = f
|
|
@@ -3039,6 +3053,7 @@ class WebsyNavigationMenu {
|
|
|
3039
3053
|
activeSymbol: 'none',
|
|
3040
3054
|
enableSearch: false,
|
|
3041
3055
|
searchProp: 'text',
|
|
3056
|
+
indent: 'padding',
|
|
3042
3057
|
menuIcon: `<svg viewbox="0 0 40 40" width="30" height="40">
|
|
3043
3058
|
<rect x="0" y="0" width="30" height="4" rx="2"></rect>
|
|
3044
3059
|
<rect x="0" y="12" width="30" height="4" rx="2"></rect>
|
|
@@ -3283,7 +3298,7 @@ class WebsyNavigationMenu {
|
|
|
3283
3298
|
data-menu-id='${this.elementId}_${currentBlock}_list'
|
|
3284
3299
|
data-popout-id='${level > 1 ? block : currentBlock}'
|
|
3285
3300
|
data-text='${items[i].isLink !== true ? items[i].text : ''}'
|
|
3286
|
-
style='
|
|
3301
|
+
style='${this.options.indent}-left: ${level * this.options.childIndentation}px'
|
|
3287
3302
|
${(items[i].attributes && items[i].attributes.join(' ')) || ''}
|
|
3288
3303
|
>
|
|
3289
3304
|
`
|
|
@@ -5446,7 +5461,7 @@ const WebsyUtils = {
|
|
|
5446
5461
|
if (numOut % 1 > 0) {
|
|
5447
5462
|
decimals = 1
|
|
5448
5463
|
}
|
|
5449
|
-
if (numOut < 1) {
|
|
5464
|
+
if (numOut < 1 && decimals === 0) {
|
|
5450
5465
|
decimals = getZeroDecimals(numOut)
|
|
5451
5466
|
}
|
|
5452
5467
|
numOut = (+numOut).toFixed(decimals)
|
|
@@ -7347,6 +7362,13 @@ class WebsyTable3 {
|
|
|
7347
7362
|
// bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
|
|
7348
7363
|
// }
|
|
7349
7364
|
bodyEl.style.height = `${this.sizes.bodyHeight}px`
|
|
7365
|
+
if (this.isTouchDevice === true) {
|
|
7366
|
+
let touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
7367
|
+
if (touchScrollEl) {
|
|
7368
|
+
touchScrollEl.style.top = `${this.sizes.header.height}px`
|
|
7369
|
+
touchScrollEl.style.height = `calc(100% - ${this.sizes.header.height + 30}px)`
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7350
7372
|
if (this.options.virtualScroll === true) {
|
|
7351
7373
|
// set the scroll element positions
|
|
7352
7374
|
let vScrollEl = document.getElementById(`${this.elementId}_vScrollContainer`)
|
|
@@ -7354,6 +7376,9 @@ class WebsyTable3 {
|
|
|
7354
7376
|
if (this.vScrollRequired === true) {
|
|
7355
7377
|
vScrollEl.style.top = `${this.sizes.header.height + this.sizes.total.height}px`
|
|
7356
7378
|
vScrollEl.style.height = `${this.sizes.bodyHeight}px`
|
|
7379
|
+
if (this.isTouchDevice === true) {
|
|
7380
|
+
vScrollEl.style.visibility = `unset`
|
|
7381
|
+
}
|
|
7357
7382
|
vHandleEl.style.height = Math.max(this.options.minHandleSize, this.sizes.bodyHeight * (this.sizes.rowsToRenderPrecise / this.totalRowCount)) + 'px'
|
|
7358
7383
|
const scrollableSpace = vScrollEl.getBoundingClientRect().height - vHandleEl.getBoundingClientRect().height
|
|
7359
7384
|
vHandleEl.style.top = Math.round(this.startRow / (this.totalRowCount - this.sizes.rowsToRender) * (scrollableSpace)) + 'px'
|
|
@@ -7367,6 +7392,9 @@ class WebsyTable3 {
|
|
|
7367
7392
|
hScrollEl.style.left = `${this.sizes.table.width - this.sizes.scrollableWidth}px`
|
|
7368
7393
|
hScrollEl.style.width = `${this.sizes.scrollableWidth - (this.isTouchDevice ? 30 : 20)}px`
|
|
7369
7394
|
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px'
|
|
7395
|
+
if (this.isTouchDevice === true) {
|
|
7396
|
+
hScrollEl.style.visibility = `unset`
|
|
7397
|
+
}
|
|
7370
7398
|
}
|
|
7371
7399
|
else {
|
|
7372
7400
|
hHandleEl.style.width = '0px'
|
|
@@ -7824,6 +7852,9 @@ else {
|
|
|
7824
7852
|
.select('.tracking-line')
|
|
7825
7853
|
.attr('stroke-opacity', 0)
|
|
7826
7854
|
this.tooltip.hide()
|
|
7855
|
+
if (this.options.onMouseOut) {
|
|
7856
|
+
this.options.onMouseOut()
|
|
7857
|
+
}
|
|
7827
7858
|
}
|
|
7828
7859
|
handleEventMouseMove (event, d) {
|
|
7829
7860
|
let bisectDate = d3.bisector(d => {
|
|
@@ -7850,6 +7881,9 @@ else {
|
|
|
7850
7881
|
let xDiff
|
|
7851
7882
|
if (typeof x0 === 'undefined') {
|
|
7852
7883
|
this.tooltip.hide()
|
|
7884
|
+
if (this.options.onMouseOut) {
|
|
7885
|
+
this.options.onMouseOut()
|
|
7886
|
+
}
|
|
7853
7887
|
return
|
|
7854
7888
|
}
|
|
7855
7889
|
let xLabel = this[xAxis].domain()[x0]
|
|
@@ -7872,7 +7906,7 @@ else {
|
|
|
7872
7906
|
if (!d.y.color) {
|
|
7873
7907
|
d.y.color = s.color
|
|
7874
7908
|
}
|
|
7875
|
-
tooltipData.push(d
|
|
7909
|
+
tooltipData.push(d)
|
|
7876
7910
|
}
|
|
7877
7911
|
})
|
|
7878
7912
|
}
|
|
@@ -7890,7 +7924,7 @@ else {
|
|
|
7890
7924
|
if (!pointA.y.color) {
|
|
7891
7925
|
pointA.y.color = s.color
|
|
7892
7926
|
}
|
|
7893
|
-
tooltipData.push(pointA
|
|
7927
|
+
tooltipData.push(pointA)
|
|
7894
7928
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7895
7929
|
tooltipTitle = d3.timeFormat(this.options.dateFormat || this.options.calculatedTimeFormatPattern)(pointA.x.value)
|
|
7896
7930
|
}
|
|
@@ -7901,7 +7935,7 @@ else {
|
|
|
7901
7935
|
if (!pointB.y.color) {
|
|
7902
7936
|
pointB.y.color = s.color
|
|
7903
7937
|
}
|
|
7904
|
-
tooltipData.push(pointB
|
|
7938
|
+
tooltipData.push(pointB)
|
|
7905
7939
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7906
7940
|
tooltipTitle = d3.timeFormat(this.options.dateFormat || this.options.calculatedTimeFormatPattern)(pointB.x.value)
|
|
7907
7941
|
}
|
|
@@ -7919,7 +7953,7 @@ else {
|
|
|
7919
7953
|
if (!pointB.y.color) {
|
|
7920
7954
|
pointB.y.color = s.color
|
|
7921
7955
|
}
|
|
7922
|
-
tooltipData.push(pointB
|
|
7956
|
+
tooltipData.push(pointB)
|
|
7923
7957
|
}
|
|
7924
7958
|
else {
|
|
7925
7959
|
xPoint = d0
|
|
@@ -7930,7 +7964,7 @@ else {
|
|
|
7930
7964
|
if (!pointA.y.color) {
|
|
7931
7965
|
pointA.y.color = s.color
|
|
7932
7966
|
}
|
|
7933
|
-
tooltipData.push(pointA
|
|
7967
|
+
tooltipData.push(pointA)
|
|
7934
7968
|
}
|
|
7935
7969
|
}
|
|
7936
7970
|
}
|
|
@@ -7940,10 +7974,13 @@ else {
|
|
|
7940
7974
|
`
|
|
7941
7975
|
tooltipHTML += tooltipData.map(d => `
|
|
7942
7976
|
<li>
|
|
7943
|
-
<i style='background-color: ${d.color};'></i>
|
|
7944
|
-
${d.tooltipLabel || ''}<span>: ${d.tooltipValue || d.value}</span>
|
|
7977
|
+
<i style='background-color: ${d.y.color};'></i>
|
|
7978
|
+
${d.y.tooltipLabel || ''}<span>: ${d.y.tooltipValue || d.value}</span>
|
|
7945
7979
|
</li>
|
|
7946
7980
|
`).join('')
|
|
7981
|
+
if (this.options.onMouseOver) {
|
|
7982
|
+
this.options.onMouseOver(tooltipData)
|
|
7983
|
+
}
|
|
7947
7984
|
tooltipHTML += `</ul>`
|
|
7948
7985
|
let posOptions = {
|
|
7949
7986
|
width: this.options.tooltipWidth,
|
|
@@ -7987,6 +8024,9 @@ else {
|
|
|
7987
8024
|
this.tooltip.setHeight(this.plotHeight)
|
|
7988
8025
|
if (isNaN(posOptions.left)) {
|
|
7989
8026
|
this.tooltip.hide()
|
|
8027
|
+
if (this.options.onMouseOut) {
|
|
8028
|
+
this.options.onMouseOut()
|
|
8029
|
+
}
|
|
7990
8030
|
return
|
|
7991
8031
|
}
|
|
7992
8032
|
this.options.showTooltip && this.tooltip.show(tooltipTitle, tooltipHTML, posOptions)
|
|
@@ -8033,9 +8073,9 @@ this.leftAxisLabel = this.svg.append('g').attr('class', 'left-axis-label-layer')
|
|
|
8033
8073
|
this.rightAxisLabel = this.svg.append('g').attr('class', 'right-axis-label-layer')
|
|
8034
8074
|
this.bottomAxisLabel = this.svg.append('g').attr('class', 'bottom-axis-label-layer')
|
|
8035
8075
|
this.plotArea = this.svg.append('g').attr('class', 'plot-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8076
|
+
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8036
8077
|
this.areaLayer = this.svg.append('g').attr('class', 'area-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8037
8078
|
this.lineLayer = this.svg.append('g').attr('class', 'line-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8038
|
-
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8039
8079
|
// this.barLayer.attr('clip-path', `url(#${this.elementId}_clip)`)
|
|
8040
8080
|
this.labelLayer = this.svg.append('g').attr('class', 'label-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
8041
8081
|
this.symbolLayer = this.svg.append('g').attr('class', 'symbol-layer').attr('clip-path', `url(#${this.elementId}_clip)`).append('g')
|
|
@@ -8220,9 +8260,9 @@ else {
|
|
|
8220
8260
|
this.options.data.right.max = d3.max(this.options.data.right.data)
|
|
8221
8261
|
}
|
|
8222
8262
|
if (this.options.data.right && typeof this.options.data.right.max !== 'undefined') {
|
|
8223
|
-
this.longestRight = this.options.data.right.max.toString()
|
|
8263
|
+
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()
|
|
8224
8264
|
if (this.options.data.right.formatter) {
|
|
8225
|
-
this.longestRight = this.options.data.right.formatter(this.
|
|
8265
|
+
this.longestRight = this.options.data.right.formatter(this.longestRight).toString()
|
|
8226
8266
|
}
|
|
8227
8267
|
}
|
|
8228
8268
|
// Check to see if we need to balance the min and max values
|
|
@@ -8234,10 +8274,10 @@ else {
|
|
|
8234
8274
|
}
|
|
8235
8275
|
else {
|
|
8236
8276
|
let biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max)
|
|
8237
|
-
this.options.data.left.min =
|
|
8277
|
+
this.options.data.left.min = biggestLeft * -1
|
|
8238
8278
|
this.options.data.left.max = biggestLeft
|
|
8239
8279
|
let biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max)
|
|
8240
|
-
this.options.data.right.min =
|
|
8280
|
+
this.options.data.right.min = biggestRight * -1
|
|
8241
8281
|
this.options.data.right.max = biggestRight
|
|
8242
8282
|
}
|
|
8243
8283
|
}
|
|
@@ -8262,7 +8302,7 @@ else {
|
|
|
8262
8302
|
}
|
|
8263
8303
|
}
|
|
8264
8304
|
this.options.margin.axisLeft = Math.max(longestLeftBounds.width, firstBottomWidth) + 5 // + 5 to accommodate for space between text and axis line
|
|
8265
|
-
this.options.margin.axisRight = longestRightBounds.width
|
|
8305
|
+
this.options.margin.axisRight = longestRightBounds.width + 10
|
|
8266
8306
|
this.options.margin.axisBottom = longestBottomBounds.height + 10
|
|
8267
8307
|
this.options.margin.axisTop = 0
|
|
8268
8308
|
// adjust axis margins based on title options
|
|
@@ -8327,7 +8367,8 @@ else {
|
|
|
8327
8367
|
this.totalBrushBandPadding = 0
|
|
8328
8368
|
let noOfPoints = 0
|
|
8329
8369
|
let noOfGroups = 0
|
|
8330
|
-
let plotable = 0
|
|
8370
|
+
let plotable = 0
|
|
8371
|
+
|
|
8331
8372
|
if (this.options.maxBandWidth) {
|
|
8332
8373
|
if (this.options.orientation === 'horizontal') {
|
|
8333
8374
|
this.options.data.left.totalValueCount = this.options.data.left.data.reduce((a, b) => {
|
|
@@ -8421,7 +8462,8 @@ else {
|
|
|
8421
8462
|
// }
|
|
8422
8463
|
// }
|
|
8423
8464
|
// Translate the layers
|
|
8424
|
-
const leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8465
|
+
const leftBrushAdjustment = this.options.orientation === 'horizontal' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8466
|
+
// const bottomBrushAdjustment = this.options.orientation === 'vertical' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8425
8467
|
this.leftAxisLayer
|
|
8426
8468
|
.attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8427
8469
|
.style('font-size', (this.options.data.left && this.options.data.left.fontSize) || this.options.fontSize)
|
|
@@ -8461,12 +8503,12 @@ else {
|
|
|
8461
8503
|
this.brushLayer
|
|
8462
8504
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8463
8505
|
this.yAxisClip
|
|
8464
|
-
.attr('transform', `translate(${leftBrushAdjustment
|
|
8506
|
+
.attr('transform', `translate(${leftBrushAdjustment}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
8465
8507
|
.attr('width', this.options.margin.axisLeft + 10)
|
|
8466
8508
|
.attr('height', this.plotHeight)
|
|
8467
8509
|
this.xAxisClip
|
|
8468
8510
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
|
|
8469
|
-
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
|
|
8511
|
+
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right)
|
|
8470
8512
|
.attr('height', longestBottomBounds.height + 10)
|
|
8471
8513
|
this.brushClip
|
|
8472
8514
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop})`)
|
|
@@ -8477,12 +8519,12 @@ else {
|
|
|
8477
8519
|
this.brushLayer
|
|
8478
8520
|
.attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
|
|
8479
8521
|
this.yAxisClip
|
|
8480
|
-
.attr('transform', `translate(
|
|
8522
|
+
.attr('transform', `translate(0, ${this.options.margin.top + this.options.margin.axisTop - 10})`)
|
|
8481
8523
|
.attr('width', this.options.margin.axisLeft + 10)
|
|
8482
8524
|
.attr('height', this.plotHeight + 20)
|
|
8483
8525
|
this.xAxisClip
|
|
8484
8526
|
.attr('transform', `translate(${this.options.margin.left}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
|
|
8485
|
-
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight)
|
|
8527
|
+
.attr('width', this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight + this.options.margin.right)
|
|
8486
8528
|
.attr('height', longestBottomBounds.height + 10)
|
|
8487
8529
|
this.brushClip
|
|
8488
8530
|
.attr('transform', `translate(${this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight + longestBottomBounds.height})`)
|
package/dist/websy-designs.js
CHANGED
|
@@ -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) {
|
|
@@ -2528,7 +2540,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2528
2540
|
var el = document.getElementById(this.elementId);
|
|
2529
2541
|
var componentsToProcess = [];
|
|
2530
2542
|
if (el) {
|
|
2531
|
-
var html = "\n <form id=\"".concat(this.elementId, "Form\" class=\"websy-form ").concat(this.options.classes || '', "\">\n ");
|
|
2543
|
+
var html = "\n <form id=\"".concat(this.elementId, "Form\" class=\"websy-form ").concat((this.options.classes || []).join(' '), "\">\n ");
|
|
2532
2544
|
this.options.fields.forEach(function (f, i) {
|
|
2533
2545
|
_this19.fieldMap[f.field] = f;
|
|
2534
2546
|
if (f.component) {
|
|
@@ -2850,6 +2862,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2850
2862
|
activeSymbol: 'none',
|
|
2851
2863
|
enableSearch: false,
|
|
2852
2864
|
searchProp: 'text',
|
|
2865
|
+
indent: 'padding',
|
|
2853
2866
|
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>",
|
|
2854
2867
|
searchOptions: {}
|
|
2855
2868
|
}, options);
|
|
@@ -3089,7 +3102,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
3089
3102
|
if (Array.isArray(items[i].classes)) {
|
|
3090
3103
|
items[i].classes = items[i].classes.join(' ');
|
|
3091
3104
|
}
|
|
3092
|
-
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='
|
|
3105
|
+
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 ");
|
|
3093
3106
|
if (this.options.orientation === 'horizontal') {
|
|
3094
3107
|
html += items[i].text;
|
|
3095
3108
|
}
|
|
@@ -5281,7 +5294,7 @@ var WebsyUtils = {
|
|
|
5281
5294
|
if (numOut % 1 > 0) {
|
|
5282
5295
|
decimals = 1;
|
|
5283
5296
|
}
|
|
5284
|
-
if (numOut < 1) {
|
|
5297
|
+
if (numOut < 1 && decimals === 0) {
|
|
5285
5298
|
decimals = getZeroDecimals(numOut);
|
|
5286
5299
|
}
|
|
5287
5300
|
numOut = (+numOut).toFixed(decimals);
|
|
@@ -7028,6 +7041,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7028
7041
|
// bodyEl.style.height = `calc(100% - ${this.sizes.header.height}px - ${this.sizes.total.height}px)`
|
|
7029
7042
|
// }
|
|
7030
7043
|
bodyEl.style.height = "".concat(this.sizes.bodyHeight, "px");
|
|
7044
|
+
if (this.isTouchDevice === true) {
|
|
7045
|
+
var touchScrollEl = document.getElementById("".concat(this.elementId, "_touchScroller"));
|
|
7046
|
+
if (touchScrollEl) {
|
|
7047
|
+
touchScrollEl.style.top = "".concat(this.sizes.header.height, "px");
|
|
7048
|
+
touchScrollEl.style.height = "calc(100% - ".concat(this.sizes.header.height + 30, "px)");
|
|
7049
|
+
}
|
|
7050
|
+
}
|
|
7031
7051
|
if (this.options.virtualScroll === true) {
|
|
7032
7052
|
// set the scroll element positions
|
|
7033
7053
|
var vScrollEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
|
|
@@ -7035,6 +7055,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7035
7055
|
if (this.vScrollRequired === true) {
|
|
7036
7056
|
vScrollEl.style.top = "".concat(this.sizes.header.height + this.sizes.total.height, "px");
|
|
7037
7057
|
vScrollEl.style.height = "".concat(this.sizes.bodyHeight, "px");
|
|
7058
|
+
if (this.isTouchDevice === true) {
|
|
7059
|
+
vScrollEl.style.visibility = "unset";
|
|
7060
|
+
}
|
|
7038
7061
|
vHandleEl.style.height = Math.max(this.options.minHandleSize, this.sizes.bodyHeight * (this.sizes.rowsToRenderPrecise / this.totalRowCount)) + 'px';
|
|
7039
7062
|
var scrollableSpace = vScrollEl.getBoundingClientRect().height - vHandleEl.getBoundingClientRect().height;
|
|
7040
7063
|
vHandleEl.style.top = Math.round(this.startRow / (this.totalRowCount - this.sizes.rowsToRender) * scrollableSpace) + 'px';
|
|
@@ -7047,6 +7070,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7047
7070
|
hScrollEl.style.left = "".concat(this.sizes.table.width - this.sizes.scrollableWidth, "px");
|
|
7048
7071
|
hScrollEl.style.width = "".concat(this.sizes.scrollableWidth - (this.isTouchDevice ? 30 : 20), "px");
|
|
7049
7072
|
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px';
|
|
7073
|
+
if (this.isTouchDevice === true) {
|
|
7074
|
+
hScrollEl.style.visibility = "unset";
|
|
7075
|
+
}
|
|
7050
7076
|
} else {
|
|
7051
7077
|
hHandleEl.style.width = '0px';
|
|
7052
7078
|
}
|
|
@@ -7511,6 +7537,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7511
7537
|
value: function handleEventMouseOut(event, d) {
|
|
7512
7538
|
this.trackingLineLayer.select('.tracking-line').attr('stroke-opacity', 0);
|
|
7513
7539
|
this.tooltip.hide();
|
|
7540
|
+
if (this.options.onMouseOut) {
|
|
7541
|
+
this.options.onMouseOut();
|
|
7542
|
+
}
|
|
7514
7543
|
}
|
|
7515
7544
|
}, {
|
|
7516
7545
|
key: "handleEventMouseMove",
|
|
@@ -7540,6 +7569,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7540
7569
|
var xDiff;
|
|
7541
7570
|
if (typeof x0 === 'undefined') {
|
|
7542
7571
|
this.tooltip.hide();
|
|
7572
|
+
if (this.options.onMouseOut) {
|
|
7573
|
+
this.options.onMouseOut();
|
|
7574
|
+
}
|
|
7543
7575
|
return;
|
|
7544
7576
|
}
|
|
7545
7577
|
var xLabel = this[xAxis].domain()[x0];
|
|
@@ -7562,7 +7594,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7562
7594
|
if (!d.y.color) {
|
|
7563
7595
|
d.y.color = s.color;
|
|
7564
7596
|
}
|
|
7565
|
-
tooltipData.push(d
|
|
7597
|
+
tooltipData.push(d);
|
|
7566
7598
|
}
|
|
7567
7599
|
});
|
|
7568
7600
|
} else {
|
|
@@ -7579,7 +7611,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7579
7611
|
if (!pointA.y.color) {
|
|
7580
7612
|
pointA.y.color = s.color;
|
|
7581
7613
|
}
|
|
7582
|
-
tooltipData.push(pointA
|
|
7614
|
+
tooltipData.push(pointA);
|
|
7583
7615
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7584
7616
|
tooltipTitle = d3.timeFormat(_this49.options.dateFormat || _this49.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7585
7617
|
}
|
|
@@ -7590,7 +7622,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7590
7622
|
if (!pointB.y.color) {
|
|
7591
7623
|
pointB.y.color = s.color;
|
|
7592
7624
|
}
|
|
7593
|
-
tooltipData.push(pointB
|
|
7625
|
+
tooltipData.push(pointB);
|
|
7594
7626
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7595
7627
|
tooltipTitle = d3.timeFormat(_this49.options.dateFormat || _this49.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7596
7628
|
}
|
|
@@ -7608,7 +7640,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7608
7640
|
if (!pointB.y.color) {
|
|
7609
7641
|
pointB.y.color = s.color;
|
|
7610
7642
|
}
|
|
7611
|
-
tooltipData.push(pointB
|
|
7643
|
+
tooltipData.push(pointB);
|
|
7612
7644
|
} else {
|
|
7613
7645
|
xPoint = d0;
|
|
7614
7646
|
tooltipTitle = pointA.x.value;
|
|
@@ -7618,15 +7650,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7618
7650
|
if (!pointA.y.color) {
|
|
7619
7651
|
pointA.y.color = s.color;
|
|
7620
7652
|
}
|
|
7621
|
-
tooltipData.push(pointA
|
|
7653
|
+
tooltipData.push(pointA);
|
|
7622
7654
|
}
|
|
7623
7655
|
}
|
|
7624
7656
|
}
|
|
7625
7657
|
});
|
|
7626
7658
|
tooltipHTML = " \n <ul>\n ";
|
|
7627
7659
|
tooltipHTML += tooltipData.map(function (d) {
|
|
7628
|
-
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 ");
|
|
7660
|
+
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 ");
|
|
7629
7661
|
}).join('');
|
|
7662
|
+
if (this.options.onMouseOver) {
|
|
7663
|
+
this.options.onMouseOver(tooltipData);
|
|
7664
|
+
}
|
|
7630
7665
|
tooltipHTML += "</ul>";
|
|
7631
7666
|
var posOptions = {
|
|
7632
7667
|
width: this.options.tooltipWidth,
|
|
@@ -7669,6 +7704,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7669
7704
|
this.tooltip.setHeight(this.plotHeight);
|
|
7670
7705
|
if (isNaN(posOptions.left)) {
|
|
7671
7706
|
this.tooltip.hide();
|
|
7707
|
+
if (this.options.onMouseOut) {
|
|
7708
|
+
this.options.onMouseOut();
|
|
7709
|
+
}
|
|
7672
7710
|
return;
|
|
7673
7711
|
}
|
|
7674
7712
|
this.options.showTooltip && this.tooltip.show(tooltipTitle, tooltipHTML, posOptions);
|
|
@@ -7709,9 +7747,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7709
7747
|
this.rightAxisLabel = this.svg.append('g').attr('class', 'right-axis-label-layer');
|
|
7710
7748
|
this.bottomAxisLabel = this.svg.append('g').attr('class', 'bottom-axis-label-layer');
|
|
7711
7749
|
this.plotArea = this.svg.append('g').attr('class', 'plot-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7750
|
+
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7712
7751
|
this.areaLayer = this.svg.append('g').attr('class', 'area-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7713
7752
|
this.lineLayer = this.svg.append('g').attr('class', 'line-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7714
|
-
this.barLayer = this.svg.append('g').attr('class', 'bar-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7715
7753
|
// this.barLayer.attr('clip-path', `url(#${this.elementId}_clip)`)
|
|
7716
7754
|
this.labelLayer = this.svg.append('g').attr('class', 'label-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
7717
7755
|
this.symbolLayer = this.svg.append('g').attr('class', 'symbol-layer').attr('clip-path', "url(#".concat(this.elementId, "_clip)")).append('g');
|
|
@@ -7904,9 +7942,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7904
7942
|
this.options.data.right.max = d3.max(this.options.data.right.data);
|
|
7905
7943
|
}
|
|
7906
7944
|
if (this.options.data.right && typeof this.options.data.right.max !== 'undefined') {
|
|
7907
|
-
this.longestRight = this.options.data.right.max.toString();
|
|
7945
|
+
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();
|
|
7908
7946
|
if (this.options.data.right.formatter) {
|
|
7909
|
-
this.longestRight = this.options.data.right.formatter(this.
|
|
7947
|
+
this.longestRight = this.options.data.right.formatter(this.longestRight).toString();
|
|
7910
7948
|
}
|
|
7911
7949
|
}
|
|
7912
7950
|
// Check to see if we need to balance the min and max values
|
|
@@ -7917,10 +7955,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7917
7955
|
this.options.data.bottom.max = biggestBottom;
|
|
7918
7956
|
} else {
|
|
7919
7957
|
var biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max);
|
|
7920
|
-
this.options.data.left.min =
|
|
7958
|
+
this.options.data.left.min = biggestLeft * -1;
|
|
7921
7959
|
this.options.data.left.max = biggestLeft;
|
|
7922
7960
|
var biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max);
|
|
7923
|
-
this.options.data.right.min =
|
|
7961
|
+
this.options.data.right.min = biggestRight * -1;
|
|
7924
7962
|
this.options.data.right.max = biggestRight;
|
|
7925
7963
|
}
|
|
7926
7964
|
}
|
|
@@ -7944,7 +7982,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7944
7982
|
}
|
|
7945
7983
|
}
|
|
7946
7984
|
this.options.margin.axisLeft = Math.max(longestLeftBounds.width, firstBottomWidth) + 5; // + 5 to accommodate for space between text and axis line
|
|
7947
|
-
this.options.margin.axisRight = longestRightBounds.width;
|
|
7985
|
+
this.options.margin.axisRight = longestRightBounds.width + 10;
|
|
7948
7986
|
this.options.margin.axisBottom = longestBottomBounds.height + 10;
|
|
7949
7987
|
this.options.margin.axisTop = 0;
|
|
7950
7988
|
// adjust axis margins based on title options
|
|
@@ -8096,7 +8134,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8096
8134
|
// }
|
|
8097
8135
|
// }
|
|
8098
8136
|
// Translate the layers
|
|
8099
|
-
var leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0;
|
|
8137
|
+
var leftBrushAdjustment = this.options.orientation === 'horizontal' && this.brushNeeded === true ? this.options.brushHeight : 0;
|
|
8138
|
+
// const bottomBrushAdjustment = this.options.orientation === 'vertical' && this.brushNeeded === true ? this.options.brushHeight : 0
|
|
8100
8139
|
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);
|
|
8101
8140
|
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);
|
|
8102
8141
|
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);
|
|
@@ -8114,13 +8153,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8114
8153
|
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);
|
|
8115
8154
|
if (this.options.orientation === 'horizontal') {
|
|
8116
8155
|
this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
|
|
8117
|
-
this.yAxisClip.attr('transform', "translate(".concat(leftBrushAdjustment
|
|
8118
|
-
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);
|
|
8156
|
+
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);
|
|
8157
|
+
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);
|
|
8119
8158
|
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);
|
|
8120
8159
|
} else {
|
|
8121
8160
|
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, ")"));
|
|
8122
|
-
this.yAxisClip.attr('transform', "translate(
|
|
8123
|
-
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);
|
|
8161
|
+
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);
|
|
8162
|
+
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);
|
|
8124
8163
|
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);
|
|
8125
8164
|
}
|
|
8126
8165
|
this.eventLayer.attr('transform', "translate(".concat(this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
|