@watermarkinsights/ripple 5.23.0-alpha.0 → 5.23.0-alpha.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/cjs/{app-globals-d75466f5.js → app-globals-d5560aa2.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-chart-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-chart-bar.cjs.entry.js +7 -7
- package/dist/cjs/wm-option_2.cjs.entry.js +50 -31
- package/dist/collection/components/charts/priv-chart-popover/priv-chart-popover.js +2 -2
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.css +5 -3
- package/dist/collection/components/charts/wm-chart-bar/wm-chart-bar.js +7 -7
- package/dist/collection/components/charts/wm-chart-legend/wm-chart-legend.js +2 -2
- package/dist/collection/components/selects/wm-select/wm-select.js +50 -31
- package/dist/collection/dev/chart-bar.js +8 -8
- package/dist/esm/{app-globals-be942f12.js → app-globals-2d0df1cb.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-chart-popover_2.entry.js +2 -2
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-chart-bar.entry.js +7 -7
- package/dist/esm/wm-option_2.entry.js +50 -31
- package/dist/esm-es5/{app-globals-be942f12.js → app-globals-2d0df1cb.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-chart-popover_2.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-chart-bar.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/ripple/{p-5a5456e8.js → p-0d03f838.js} +1 -1
- package/dist/ripple/p-1eae5841.entry.js +1 -0
- package/dist/ripple/{p-efe93044.entry.js → p-21480984.entry.js} +1 -1
- package/dist/ripple/{p-77de2d9e.system.entry.js → p-2f925b25.system.entry.js} +1 -1
- package/dist/ripple/{p-6ea645ee.system.entry.js → p-60aa6bec.system.entry.js} +1 -1
- package/dist/ripple/{p-bd4a3dd8.system.entry.js → p-62cdc8c6.system.entry.js} +1 -1
- package/dist/ripple/{p-dcb1935c.entry.js → p-6646191c.entry.js} +1 -1
- package/dist/ripple/{p-4c727f0f.system.js → p-874cc540.system.js} +1 -1
- package/dist/ripple/{p-1806bab8.system.js → p-8aee3856.system.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/selects/wm-select/wm-select.d.ts +4 -2
- package/dist/types/global/interfaces.d.ts +2 -3
- package/package.json +3 -3
- package/dist/ripple/p-a68d6bed.entry.js +0 -1
|
@@ -455,55 +455,74 @@ const Select = class {
|
|
|
455
455
|
}
|
|
456
456
|
this.announcement = message;
|
|
457
457
|
}
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
458
|
+
handleOverflow() {
|
|
459
|
+
// handle overflow + counter for multiselect
|
|
460
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
461
|
+
const overflowCounterWidth = 38;
|
|
462
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
463
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
464
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
465
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
466
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
467
|
+
this.overflowCount = 0;
|
|
468
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
469
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
470
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
471
|
+
this.overflowCount++;
|
|
472
|
+
this.displayedOptions.pop();
|
|
473
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
474
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
462
475
|
}
|
|
463
|
-
|
|
464
|
-
|
|
476
|
+
}
|
|
477
|
+
setButtonText() {
|
|
478
|
+
if (!this.multiple) {
|
|
479
|
+
const selEl = this.childOptions.filter((x) => x.selected)[0];
|
|
480
|
+
return selEl ? selEl.textContent : "";
|
|
465
481
|
}
|
|
466
482
|
else {
|
|
467
|
-
|
|
468
|
-
// only bother if things have changed
|
|
483
|
+
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
469
484
|
const hasChanged = this.displayedOptions !== this.previousDisplayedOptions;
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
this.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
this.
|
|
484
|
-
this.
|
|
485
|
-
|
|
485
|
+
const noDisplayedOptions = this.displayedOptions.length < 1;
|
|
486
|
+
if (noDisplayedOptions) {
|
|
487
|
+
return this.placeholder;
|
|
488
|
+
}
|
|
489
|
+
else if (!this.buttonEl) {
|
|
490
|
+
index.forceUpdate(this.el);
|
|
491
|
+
return "";
|
|
492
|
+
}
|
|
493
|
+
else if (hasChanged) {
|
|
494
|
+
this.handleOverflow();
|
|
495
|
+
// we need to calc overflowcount as we only want to display allSelected message if there is an overflow...
|
|
496
|
+
if (this.overflowCount > 0 && this.allSelected) {
|
|
497
|
+
// ...but it should be reset so it isn't displayed in that case
|
|
498
|
+
this.overflowCount = 0;
|
|
499
|
+
this.buttonText = this.allSelectedMessage;
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
this.buttonText = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
486
503
|
}
|
|
487
|
-
this.previousDisplayedOptions = this.displayedOptions;
|
|
488
504
|
}
|
|
489
|
-
|
|
505
|
+
this.previousDisplayedOptions = this.displayedOptions;
|
|
506
|
+
// the reason for setting a global variable and returning it
|
|
507
|
+
// is that we need the stored value when displayedOptions haven't changed.
|
|
508
|
+
return this.buttonText; // multiselect value
|
|
490
509
|
}
|
|
491
510
|
}
|
|
492
511
|
renderOverflowCount() {
|
|
493
|
-
if (this.overflowCount > 0
|
|
512
|
+
if (this.overflowCount > 0) {
|
|
494
513
|
return (index.h("span", null, index.h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
495
514
|
}
|
|
496
515
|
}
|
|
497
516
|
render() {
|
|
498
517
|
const showSubinfo = !this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo;
|
|
499
|
-
return (index.h(index.Host, { key: '
|
|
518
|
+
return (index.h(index.Host, { key: '9a0a5c13f988c06c380ed732da86365c28446e77', onBlur: (ev) => this.handleComponentBlur(ev) }, index.h("div", { key: '3aa70cdc8f541d6f93ff99cbe44d6192bcba364b', class: `wrapper ${functions.getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, index.h("div", { key: '899522611760999dca554ab63bfa0f5c831d0542', class: "label-wrapper" }, index.h("label", { key: '0730c044f78edc158ac6a2de09ea05a09ddecd23', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => functions.hideTooltip() }, this.label),
|
|
500
519
|
// we can't use aria-required because the listbox is in a sub-component and it is not announced
|
|
501
|
-
this.requiredField && (index.h("span", { key: '
|
|
520
|
+
this.requiredField && (index.h("span", { key: 'b453a4c0fbd8973d62a7cfdc4e37537ab94dfed8', class: "required" }, index.h("span", { key: '53699fcc342d68b1fb24180cb13a524ab58038c4', class: "sr-only" }, intl.globalMessages.requiredField), index.h("span", { key: 'b7489dbe7ee74b6c46d30002762f10624f26cad7', "aria-hidden": "true" }, "*")))), index.h("div", { key: 'b44b002b4a5b34cf0958a8ddfc9efcb6934873f0', class: "button-wrapper" }, index.h("button", { key: 'b6f5d59e8399d894c2bb7cbfd4c9b5e57a7bfc4a', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, index.h("span", { key: 'c4d37441c2e76ecf5c03b6a22cabbec2d16c77bc', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, index.h("span", { key: 'baa91ff63a3d7d33be866337237408f38f46cc60', class: "button-text" }, this.setButtonText()), showSubinfo && index.h("span", { key: '5ed44f71ef8184df2bfee442fa94e496f9305b54', class: "subinfo" }, this.selectedOptions[0].subinfo)), index.h("div", { key: 'd0e3a1bade399be089b1f38e33281ca5f1e6cc03', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), index.h("div", { key: '2a43776bb5a5cccc79796939ca9be7b7b8ee569a', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), index.h("div", { key: 'eac706ae0781e210c89aed74dded805472a01996',
|
|
502
521
|
// is-open is for the CSS transition in modern browsers
|
|
503
522
|
// hidden is to wait for position calculations in Firefox
|
|
504
523
|
class: `dropdown ${this.isExpanded ? "is-open" : ""} ${this.isHidden ? "hidden" : ""} ${this.openUp ? "upward" : ""}`, id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el),
|
|
505
524
|
// @ts-ignore -- don't tell typescript but we're in the future
|
|
506
|
-
onToggle: (ev) => this.handleToggle(ev) }, index.h("priv-option-list", { key: '
|
|
525
|
+
onToggle: (ev) => this.handleToggle(ev) }, index.h("priv-option-list", { key: '3ba4da015a18e38b1a6fddd6788886d4dc551cd1', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
|
|
507
526
|
this.dropdownEl.hidePopover();
|
|
508
527
|
}, onOptionListAllSelected: () => {
|
|
509
528
|
this.returnFocus = true;
|
|
@@ -511,7 +530,7 @@ const Select = class {
|
|
|
511
530
|
}, onOptionListAllDeselected: () => {
|
|
512
531
|
this.returnFocus = true;
|
|
513
532
|
this.wmSelectAllDeselected.emit();
|
|
514
|
-
} }, index.h("slot", { key: '
|
|
533
|
+
} }, index.h("slot", { key: '87030837dc77fa939c06ccaf0f69e5b4d067c628' }))), index.h("div", { key: '36ccfeb061afde76690cf17a27aef19cfdf01071', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), index.h("div", { key: '63a34701d7a0822dca9c7970be7bce7c74dcfa72', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
515
534
|
}
|
|
516
535
|
static get delegatesFocus() { return true; }
|
|
517
536
|
get el() { return index.getElement(this); }
|
|
@@ -128,7 +128,7 @@ export class ChartPopover {
|
|
|
128
128
|
"mutable": false,
|
|
129
129
|
"complexType": {
|
|
130
130
|
"original": "ChartData",
|
|
131
|
-
"resolved": "undefined | { [key: string]: any;
|
|
131
|
+
"resolved": "undefined | { [key: string]: any; barLegend: string; amount: number; color?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
132
132
|
"references": {
|
|
133
133
|
"ChartData": {
|
|
134
134
|
"location": "import",
|
|
@@ -253,7 +253,7 @@ export class ChartPopover {
|
|
|
253
253
|
},
|
|
254
254
|
"complexType": {
|
|
255
255
|
"original": "ChartData",
|
|
256
|
-
"resolved": "{ [key: string]: any;
|
|
256
|
+
"resolved": "{ [key: string]: any; barLegend: string; amount: number; color?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
257
257
|
"references": {
|
|
258
258
|
"ChartData": {
|
|
259
259
|
"location": "import",
|
|
@@ -886,6 +886,7 @@
|
|
|
886
886
|
.chart-wrapper {
|
|
887
887
|
display: flex;
|
|
888
888
|
container: chart-measure/inline-size;
|
|
889
|
+
gap: 0.75rem;
|
|
889
890
|
}
|
|
890
891
|
|
|
891
892
|
.legend.--top {
|
|
@@ -935,19 +936,22 @@
|
|
|
935
936
|
grid-template-columns: minmax(0, max-content) auto 1fr;
|
|
936
937
|
grid-template-rows: 1fr;
|
|
937
938
|
margin-right: 3rem;
|
|
939
|
+
row-gap: 0.75rem;
|
|
938
940
|
}
|
|
939
941
|
|
|
940
942
|
.chart-right-side {
|
|
941
943
|
grid-column: 4;
|
|
942
944
|
grid-row: 1/-1;
|
|
943
945
|
}
|
|
946
|
+
.chart-right-side:empty {
|
|
947
|
+
display: none;
|
|
948
|
+
}
|
|
944
949
|
|
|
945
950
|
.category-axis-label {
|
|
946
951
|
max-width: 9.375rem;
|
|
947
952
|
display: flex;
|
|
948
953
|
align-items: center;
|
|
949
954
|
justify-content: center;
|
|
950
|
-
margin-inline-end: 0.75rem;
|
|
951
955
|
}
|
|
952
956
|
@container chart-measure (max-width: 414px) {
|
|
953
957
|
.category-axis-label {
|
|
@@ -976,7 +980,6 @@
|
|
|
976
980
|
grid-column: 2/-1;
|
|
977
981
|
row-gap: 0.75rem;
|
|
978
982
|
align-items: center;
|
|
979
|
-
margin-block-end: 0.75rem;
|
|
980
983
|
grid-template-rows: repeat(var(--row-count), minmax(1.5rem, 1fr)) 0;
|
|
981
984
|
}
|
|
982
985
|
|
|
@@ -1062,7 +1065,6 @@
|
|
|
1062
1065
|
display: flex;
|
|
1063
1066
|
justify-content: space-between;
|
|
1064
1067
|
font-size: 0.75rem;
|
|
1065
|
-
margin-block-end: 0.75rem;
|
|
1066
1068
|
}
|
|
1067
1069
|
@container chart-measure (max-width: 414px) {
|
|
1068
1070
|
.x-axis .tick:not(:first-of-type):not(:last-of-type) {
|
|
@@ -88,7 +88,7 @@ export class ChartBar {
|
|
|
88
88
|
var _a;
|
|
89
89
|
const barColor = item.color || (isUniformConfigColor ? this.colorPalette[0] : (_a = this.colorPalette[index]) !== null && _a !== void 0 ? _a : defaultColor);
|
|
90
90
|
return {
|
|
91
|
-
|
|
91
|
+
barLegend: item.barLegend,
|
|
92
92
|
amount: item.amount,
|
|
93
93
|
gridPercent: (item.amount / this.gridMax) * 100,
|
|
94
94
|
displayValue: formatDisplayValue(item.amount, itemTotal, valueFormat),
|
|
@@ -223,7 +223,7 @@ export class ChartBar {
|
|
|
223
223
|
setTimeout(() => {
|
|
224
224
|
// allow time for the popover to reopen if the click that closed it was on a bar, to prevent flash
|
|
225
225
|
if (this.popoverEl.open) {
|
|
226
|
-
this.highlightBar(this.processedData.findIndex((item) => { var _a; return item.
|
|
226
|
+
this.highlightBar(this.processedData.findIndex((item) => { var _a; return item.barLegend === ((_a = this.popoverEl.chartData) === null || _a === void 0 ? void 0 : _a.barLegend); }));
|
|
227
227
|
}
|
|
228
228
|
else {
|
|
229
229
|
this.clearHighlights();
|
|
@@ -231,7 +231,7 @@ export class ChartBar {
|
|
|
231
231
|
}, 30);
|
|
232
232
|
}
|
|
233
233
|
openPopover(clickedProcessedData, coords) {
|
|
234
|
-
let matchingChartData = this.data.find((item) => item.
|
|
234
|
+
let matchingChartData = this.data.find((item) => item.barLegend === clickedProcessedData.barLegend);
|
|
235
235
|
if (matchingChartData) {
|
|
236
236
|
this.popoverEl.chartData = matchingChartData;
|
|
237
237
|
this.popoverEl.header = matchingChartData.popoverTitle || this.config.popoverTitle || "";
|
|
@@ -271,14 +271,14 @@ export class ChartBar {
|
|
|
271
271
|
// #region Rendering
|
|
272
272
|
////////////////////////////////////////////////////////////
|
|
273
273
|
renderBarLegends() {
|
|
274
|
-
return this.processedData.map((item) => (h("div", { key: `legend-${item.
|
|
274
|
+
return this.processedData.map((item) => (h("div", { key: `legend-${item.barLegend}`, class: "bar-legend" }, item.barLegend)));
|
|
275
275
|
}
|
|
276
276
|
renderBars() {
|
|
277
277
|
// Use effective grid max (numTicks * interval) for accurate bar sizing
|
|
278
278
|
const effectiveGridMax = this.gridInfo.numTicks * this.gridInfo.interval;
|
|
279
279
|
return this.processedData.map((item, idx) => {
|
|
280
280
|
const barPercent = effectiveGridMax > 0 ? (item.amount / effectiveGridMax) * 100 : 0;
|
|
281
|
-
return (h("div", { key: `bar-${item.
|
|
281
|
+
return (h("div", { key: `bar-${item.barLegend}`, class: "bar-wrapper" }, h("div", { class: "bar", style: { width: `${barPercent}%`, backgroundColor: `var(--${item.color})` }, onClick: (ev) => this.handleBarClick(ev, idx), onKeyDown: (ev) => this.handleBarKeyDown(ev, idx), tabindex: "-1", "aria-label": `${item.barLegend} ${item.displayValue}` }), h("span", { class: "value", style: { insetInlineStart: `${barPercent}%` } }, item.displayValue)));
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
renderXAxis() {
|
|
@@ -297,7 +297,7 @@ export class ChartBar {
|
|
|
297
297
|
render() {
|
|
298
298
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
299
299
|
const rowCount = this.processedData.length || 1;
|
|
300
|
-
return (h(Host, { key: '
|
|
300
|
+
return (h(Host, { key: '2fe75003c819b49d5de618eea92bbd2fcfc10723' }, h("div", { key: '48f496b705d9571f9386dfddaaaddbd414836252', class: "component-wrapper", tabindex: "0", role: "application", onKeyDown: (ev) => this.handleChartKeyDown(ev), onBlur: (ev) => this.handleComponentBlur(ev), "aria-roledescription": chartMessages.interactiveChart, "aria-describedby": "chart-instructions", "aria-label": (_a = this.config) === null || _a === void 0 ? void 0 : _a.label }, h("div", { key: '9f78d67d37c8048554127adbd40ee94409dcc575', class: "popover-wrapper" }, h("priv-chart-popover", { key: '9d1f5bf3bb3d1af0a36b2c0e7d53a7e56f23ce9d', ref: (el) => (this.popoverEl = el), onIntChartPopoverOpenChanged: (ev) => this.handlePopoverOpenChanged(ev) })), h("label", { key: 'c111aecf07f21b19422804a21ffeba9632258309', id: "label", class: `label --${(_b = this.config) === null || _b === void 0 ? void 0 : _b.labelPosition}` }, h("span", { key: 'bb866688ed8f54ded76bfdff8ca54437322dc73d', class: "label-text" }, (_c = this.config) === null || _c === void 0 ? void 0 : _c.label), this.subinfoText ? h("span", { class: "subinfo" }, this.subinfoText) : ""), this.showLegend === "top" && this.renderLegend("horizontal"), h("div", { key: '58a8f0c8932fa214311ef73fac64925d2eb1cb74', class: "chart-wrapper" }, h("div", { key: '1ad4c29e26a7d5fb3e23b54d25ce639adbceedd9', class: "chart-left-side" }, this.showLegend === "left" && this.renderLegend("vertical"), h("div", { key: '5f7aeb14ab9101f1fd38c811d9ac17660c5055d5', class: "category-axis-label" }, h("span", { key: 'bc99815352064b5b62efc9634d0f623b29e56c19', class: "axis-label-text" }, (_d = this.config) === null || _d === void 0 ? void 0 : _d.categoryAxisLabel))), h("div", { key: '1b968d3f687215a65ddd3bc6e39bc96dd908c68c', class: "chart-center" }, h("div", { key: '6da38ae08882fed85387427d8c36984160ac805a', class: "chart-area", style: { "--row-count": rowCount.toString() } }, this.processedData && this.renderBarLegends(), h("div", { key: '1413e4f4a62e10cf7236d87b38b96932f3bd713a', class: `bar-area ${this.isKeying ? "user-is-keying" : ""}`, ref: (el) => (this.barAreaEl = el) }, this.gridInfo && ((_e = this.config) === null || _e === void 0 ? void 0 : _e.gridMax) != undefined && this.renderGrid(), this.gridInfo && this.processedData && this.renderBars())), h("div", { key: '5021bad3a65b05b5280a63320dacfab6b560ab88', class: "value-axis-label" }, h("span", { key: 'c2b06b622ef28a16423eaa277c31e7c298ed431d', class: "axis-label-text" }, (_f = this.config) === null || _f === void 0 ? void 0 : _f.valueAxisLabel)), this.gridInfo && ((_g = this.config) === null || _g === void 0 ? void 0 : _g.gridMax) != undefined && this.renderXAxis()), h("div", { key: '49ae3d55b3172a5d98cb26b6bbdd59c277b38b57', class: "chart-right-side" }, this.showLegend === "right" && this.renderLegend("vertical"))), this.showLegend === "bottom" && this.renderLegend("horizontal"), renderInstructionsText())));
|
|
301
301
|
}
|
|
302
302
|
static get is() { return "wm-chart-bar"; }
|
|
303
303
|
static get encapsulation() { return "shadow"; }
|
|
@@ -318,7 +318,7 @@ export class ChartBar {
|
|
|
318
318
|
"mutable": false,
|
|
319
319
|
"complexType": {
|
|
320
320
|
"original": "ChartConfig",
|
|
321
|
-
"resolved": "undefined | { label: string; labelPosition: \"top\" | \"none\";
|
|
321
|
+
"resolved": "undefined | { label: string; labelPosition: \"top\" | \"none\"; valueAxisLabel: string; categoryAxisLabel: string; printMode: boolean; printModeFormat: \"amount\" | \"percentage\"; gridMax?: number | \"auto\" | undefined; sort?: \"none\" | \"ascending\" | \"descending\" | undefined; showLegend?: \"top\" | \"bottom\" | \"left\" | \"right\" | \"none\" | undefined; subinfo?: string | undefined; completionMessage?: string | undefined; valueFormat?: \"none\" | \"amount\" | \"percentage\" | undefined; colors?: string | undefined; popoverTitle?: string | undefined; popoverText?: string | undefined; popoverButtonText?: string | undefined; }",
|
|
322
322
|
"references": {
|
|
323
323
|
"ChartConfig": {
|
|
324
324
|
"location": "import",
|
|
@@ -26,10 +26,10 @@ export class ChartLegend {
|
|
|
26
26
|
this.wmLegendItemClick.emit({ idx: idx });
|
|
27
27
|
}
|
|
28
28
|
renderLegendItems() {
|
|
29
|
-
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.
|
|
29
|
+
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.barLegend, onClick: () => this.handleLegendItemClick(idx) }, h("div", { class: "color", style: { "--color": `var(--${item.color})` } }), h("div", { class: "label" }, item.barLegend), h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` }, "(", item.printValue, ")"))));
|
|
30
30
|
}
|
|
31
31
|
render() {
|
|
32
|
-
return (h(Host, { key: '
|
|
32
|
+
return (h(Host, { key: 'be2793da927897a4c0e62345ffe502967fd7f12c' }, h("div", { key: '382567c522ff081fbd02e96563b11f1831a56c32', class: `legend-container --${this.orientation}` }, this.renderLegendItems())));
|
|
33
33
|
}
|
|
34
34
|
static get is() { return "wm-chart-legend"; }
|
|
35
35
|
static get encapsulation() { return "shadow"; }
|
|
@@ -273,55 +273,74 @@ export class Select {
|
|
|
273
273
|
}
|
|
274
274
|
this.announcement = message;
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
276
|
+
handleOverflow() {
|
|
277
|
+
// handle overflow + counter for multiselect
|
|
278
|
+
// this is a fixed measurement accounting for the max width of a 3 character overflow counter
|
|
279
|
+
const overflowCounterWidth = 38;
|
|
280
|
+
const computedStyle = window.getComputedStyle(this.buttonEl);
|
|
281
|
+
// there seems to be no quick way to get an elements width without padding, except for subtracting padding manually
|
|
282
|
+
const paddingLeft = parseInt(computedStyle.getPropertyValue("padding-left").slice(0, -2));
|
|
283
|
+
const paddingRight = parseInt(computedStyle.getPropertyValue("padding-right").slice(0, -2));
|
|
284
|
+
const availableSpace = this.buttonEl.clientWidth - paddingLeft - paddingRight - overflowCounterWidth;
|
|
285
|
+
this.overflowCount = 0;
|
|
286
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
287
|
+
let optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
288
|
+
while (optionsTotalWidth > availableSpace && this.displayedOptions.length > 1) {
|
|
289
|
+
this.overflowCount++;
|
|
290
|
+
this.displayedOptions.pop();
|
|
291
|
+
this.measurementAreaEl.textContent = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
292
|
+
optionsTotalWidth = this.measurementAreaEl.clientWidth;
|
|
280
293
|
}
|
|
281
|
-
|
|
282
|
-
|
|
294
|
+
}
|
|
295
|
+
setButtonText() {
|
|
296
|
+
if (!this.multiple) {
|
|
297
|
+
const selEl = this.childOptions.filter((x) => x.selected)[0];
|
|
298
|
+
return selEl ? selEl.textContent : "";
|
|
283
299
|
}
|
|
284
300
|
else {
|
|
285
|
-
|
|
286
|
-
// only bother if things have changed
|
|
301
|
+
this.displayedOptions = this.childOptions.filter((x) => x.selected);
|
|
287
302
|
const hasChanged = this.displayedOptions !== this.previousDisplayedOptions;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
this.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
this.
|
|
302
|
-
this.
|
|
303
|
-
|
|
303
|
+
const noDisplayedOptions = this.displayedOptions.length < 1;
|
|
304
|
+
if (noDisplayedOptions) {
|
|
305
|
+
return this.placeholder;
|
|
306
|
+
}
|
|
307
|
+
else if (!this.buttonEl) {
|
|
308
|
+
forceUpdate(this.el);
|
|
309
|
+
return "";
|
|
310
|
+
}
|
|
311
|
+
else if (hasChanged) {
|
|
312
|
+
this.handleOverflow();
|
|
313
|
+
// we need to calc overflowcount as we only want to display allSelected message if there is an overflow...
|
|
314
|
+
if (this.overflowCount > 0 && this.allSelected) {
|
|
315
|
+
// ...but it should be reset so it isn't displayed in that case
|
|
316
|
+
this.overflowCount = 0;
|
|
317
|
+
this.buttonText = this.allSelectedMessage;
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
this.buttonText = this.displayedOptions.map((x) => x.textContent).join(", ");
|
|
304
321
|
}
|
|
305
|
-
this.previousDisplayedOptions = this.displayedOptions;
|
|
306
322
|
}
|
|
307
|
-
|
|
323
|
+
this.previousDisplayedOptions = this.displayedOptions;
|
|
324
|
+
// the reason for setting a global variable and returning it
|
|
325
|
+
// is that we need the stored value when displayedOptions haven't changed.
|
|
326
|
+
return this.buttonText; // multiselect value
|
|
308
327
|
}
|
|
309
328
|
}
|
|
310
329
|
renderOverflowCount() {
|
|
311
|
-
if (this.overflowCount > 0
|
|
330
|
+
if (this.overflowCount > 0) {
|
|
312
331
|
return (h("span", null, h("span", { class: "overflow-counter" }, "+", this.overflowCount)));
|
|
313
332
|
}
|
|
314
333
|
}
|
|
315
334
|
render() {
|
|
316
335
|
const showSubinfo = !this.multiple && this.selectedOptions.length > 0 && this.selectedOptions[0].subinfo;
|
|
317
|
-
return (h(Host, { key: '
|
|
336
|
+
return (h(Host, { key: '9a0a5c13f988c06c380ed732da86365c28446e77', onBlur: (ev) => this.handleComponentBlur(ev) }, h("div", { key: '3aa70cdc8f541d6f93ff99cbe44d6192bcba364b', class: `wrapper ${getTextDir()} label-${this.labelPosition} ${this.errorMessage ? "invalid" : ""}` }, h("div", { key: '899522611760999dca554ab63bfa0f5c831d0542', class: "label-wrapper" }, h("label", { key: '0730c044f78edc158ac6a2de09ea05a09ddecd23', class: "label", id: "label", htmlFor: "selectbtn", onMouseEnter: (ev) => this.handleLabelMouseEnter(ev), onMouseLeave: () => hideTooltip() }, this.label),
|
|
318
337
|
// we can't use aria-required because the listbox is in a sub-component and it is not announced
|
|
319
|
-
this.requiredField && (h("span", { key: '
|
|
338
|
+
this.requiredField && (h("span", { key: 'b453a4c0fbd8973d62a7cfdc4e37537ab94dfed8', class: "required" }, h("span", { key: '53699fcc342d68b1fb24180cb13a524ab58038c4', class: "sr-only" }, globalMessages.requiredField), h("span", { key: 'b7489dbe7ee74b6c46d30002762f10624f26cad7', "aria-hidden": "true" }, "*")))), h("div", { key: 'b44b002b4a5b34cf0958a8ddfc9efcb6934873f0', class: "button-wrapper" }, h("button", { key: 'b6f5d59e8399d894c2bb7cbfd4c9b5e57a7bfc4a', id: "selectbtn", disabled: this.isDisabled, "aria-labelledby": "label selectbtn", "aria-describedby": "error", popoverTarget: "dropdown", popoverTargetAction: "toggle", class: "displayedoption", ref: (el) => (this.buttonEl = el) }, h("span", { key: 'c4d37441c2e76ecf5c03b6a22cabbec2d16c77bc', class: `overflowcontrol ${showSubinfo ? "hassubinfo" : ""}` }, h("span", { key: 'baa91ff63a3d7d33be866337237408f38f46cc60', class: "button-text" }, this.setButtonText()), showSubinfo && h("span", { key: '5ed44f71ef8184df2bfee442fa94e496f9305b54', class: "subinfo" }, this.selectedOptions[0].subinfo)), h("div", { key: 'd0e3a1bade399be089b1f38e33281ca5f1e6cc03', class: `expand-icon svg-icon ${this.isExpanded ? "svg-expand-less" : "svg-expand-more"}` }), this.renderOverflowCount(), h("div", { key: '2a43776bb5a5cccc79796939ca9be7b7b8ee569a', ref: (el) => (this.measurementAreaEl = el), class: "measurement-area", "aria-hidden": "true" })), h("div", { key: 'eac706ae0781e210c89aed74dded805472a01996',
|
|
320
339
|
// is-open is for the CSS transition in modern browsers
|
|
321
340
|
// hidden is to wait for position calculations in Firefox
|
|
322
341
|
class: `dropdown ${this.isExpanded ? "is-open" : ""} ${this.isHidden ? "hidden" : ""} ${this.openUp ? "upward" : ""}`, id: "dropdown", popover: "auto", ref: (el) => (this.dropdownEl = el),
|
|
323
342
|
// @ts-ignore -- don't tell typescript but we're in the future
|
|
324
|
-
onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: '
|
|
343
|
+
onToggle: (ev) => this.handleToggle(ev) }, h("priv-option-list", { key: '3ba4da015a18e38b1a6fddd6788886d4dc551cd1', ref: (el) => (this.optionListEl = el), multiple: this.multiple, search: this.search, selectAll: this.selectAll, maxHeight: this.maxHeight, searchPlaceholder: this.searchPlaceholder, onOptionListCloseRequested: () => {
|
|
325
344
|
this.dropdownEl.hidePopover();
|
|
326
345
|
}, onOptionListAllSelected: () => {
|
|
327
346
|
this.returnFocus = true;
|
|
@@ -329,7 +348,7 @@ export class Select {
|
|
|
329
348
|
}, onOptionListAllDeselected: () => {
|
|
330
349
|
this.returnFocus = true;
|
|
331
350
|
this.wmSelectAllDeselected.emit();
|
|
332
|
-
} }, h("slot", { key: '
|
|
351
|
+
} }, h("slot", { key: '87030837dc77fa939c06ccaf0f69e5b4d067c628' }))), h("div", { key: '36ccfeb061afde76690cf17a27aef19cfdf01071', id: "error", class: this.errorMessage ? "error-message" : "" }, this.errorMessage), h("div", { key: '63a34701d7a0822dca9c7970be7bce7c74dcfa72', id: "announcement", "aria-live": "polite", "aria-atomic": "true", class: "sr-only", ref: (el) => (this.liveRegionEl = el) }, this.announcement)))));
|
|
333
352
|
}
|
|
334
353
|
static get is() { return "wm-select"; }
|
|
335
354
|
static get encapsulation() { return "shadow"; }
|
|
@@ -25,14 +25,14 @@ setTimeout(() => {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
barChart1.data = [
|
|
28
|
-
{
|
|
29
|
-
{
|
|
30
|
-
{
|
|
31
|
-
{
|
|
32
|
-
{
|
|
33
|
-
{
|
|
34
|
-
{
|
|
35
|
-
{
|
|
28
|
+
{ barLegend: "Marine Biology", amount: 250, whatever: "whatever", color: "wmcolor-border" },
|
|
29
|
+
{ barLegend: "Organic Chemistry", amount: 500 },
|
|
30
|
+
{ barLegend: "Aeronautical Engineering", amount: 982 },
|
|
31
|
+
{ barLegend: "Pure Mathematics", amount: 100 },
|
|
32
|
+
{ barLegend: "Astrophysics", amount: 500, popoverTitle: "Astrophysics", popoverText: "Astrophysics description set by the data", popoverButtonText: "View Astrophysics Details" },
|
|
33
|
+
{ barLegend: "Social Psychology", amount: 900 },
|
|
34
|
+
{ barLegend: "Urban Sociology", amount: 500 },
|
|
35
|
+
{ barLegend: "Behavioral Economics & Economy Sciences", amount: 250 },
|
|
36
36
|
];
|
|
37
37
|
}, 1000);
|
|
38
38
|
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as bootstrapLazy } from './index-130e07bb.js';
|
|
2
2
|
export { s as setNonce } from './index-130e07bb.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-2d0df1cb.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -157,10 +157,10 @@ const ChartLegend = class {
|
|
|
157
157
|
this.wmLegendItemClick.emit({ idx: idx });
|
|
158
158
|
}
|
|
159
159
|
renderLegendItems() {
|
|
160
|
-
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.
|
|
160
|
+
return this.processedData.map((item, idx) => (h("div", { class: "legend-item", key: item.barLegend, onClick: () => this.handleLegendItemClick(idx) }, h("div", { class: "color", style: { "--color": `var(--${item.color})` } }), h("div", { class: "label" }, item.barLegend), h("span", { class: `print-value ${this.printMode ? "force-visible" : ""}` }, "(", item.printValue, ")"))));
|
|
161
161
|
}
|
|
162
162
|
render() {
|
|
163
|
-
return (h(Host, { key: '
|
|
163
|
+
return (h(Host, { key: 'be2793da927897a4c0e62345ffe502967fd7f12c' }, h("div", { key: '382567c522ff081fbd02e96563b11f1831a56c32', class: `legend-container --${this.orientation}` }, this.renderLegendItems())));
|
|
164
164
|
}
|
|
165
165
|
static get delegatesFocus() { return true; }
|
|
166
166
|
get el() { return getElement(this); }
|
package/dist/esm/ripple.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p as promiseResolve, b as bootstrapLazy } from './index-130e07bb.js';
|
|
2
2
|
export { s as setNonce } from './index-130e07bb.js';
|
|
3
|
-
import { g as globalScripts } from './app-globals-
|
|
3
|
+
import { g as globalScripts } from './app-globals-2d0df1cb.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v4.21.0 | MIT Licensed | https://stenciljs.com
|