@ganpatiinfo/gids-core-web 9.0.0 → 10.1.0
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/css/index.css +1504 -1
- package/dist/css/index.css.map +1 -1
- package/dist/gids-action-bar.d.ts +11 -0
- package/dist/gids-action-bar.js +1 -0
- package/dist/gids-activity-gauge.d.ts +11 -0
- package/dist/gids-activity-gauge.js +1 -0
- package/dist/gids-bar-chart.d.ts +11 -0
- package/dist/gids-bar-chart.js +1 -0
- package/dist/gids-calendar-header-panel.d.ts +11 -0
- package/dist/gids-calendar-header-panel.js +1 -0
- package/dist/gids-calendar-month-list.d.ts +11 -0
- package/dist/gids-calendar-month-list.js +1 -0
- package/dist/gids-calendar-year-list.d.ts +11 -0
- package/dist/gids-calendar-year-list.js +1 -0
- package/dist/gids-calendar.d.ts +11 -0
- package/dist/gids-calendar.js +1 -0
- package/dist/gids-chart-legend-item.d.ts +11 -0
- package/dist/gids-chart-legend-item.js +1 -0
- package/dist/gids-chart-legend.d.ts +11 -0
- package/dist/gids-chart-legend.js +1 -0
- package/dist/gids-chart.d.ts +11 -0
- package/dist/gids-chart.js +1 -0
- package/dist/gids-chevron-button.d.ts +11 -0
- package/dist/gids-chevron-button.js +1 -0
- package/dist/gids-dot.d.ts +11 -0
- package/dist/gids-dot.js +1 -0
- package/dist/gids-dropdown-field.d.ts +11 -0
- package/dist/gids-dropdown-field.js +1 -0
- package/dist/gids-dropdown-picker.d.ts +11 -0
- package/dist/gids-dropdown-picker.js +1 -0
- package/dist/gids-dropdown.d.ts +11 -0
- package/dist/gids-dropdown.js +1 -0
- package/dist/gids-field.js +1 -1
- package/dist/gids-filter.d.ts +11 -0
- package/dist/gids-filter.js +1 -0
- package/dist/gids-icon.js +1 -1
- package/dist/gids-input.js +1 -1
- package/dist/gids-level-gauge.d.ts +11 -0
- package/dist/gids-level-gauge.js +1 -0
- package/dist/gids-line-chart.d.ts +11 -0
- package/dist/gids-line-chart.js +1 -0
- package/dist/gids-notification.js +1 -1
- package/dist/gids-overflow-container.js +1 -1
- package/dist/gids-overlay-provider.js +1 -1
- package/dist/gids-password-field.js +1 -1
- package/dist/gids-pie-chart.d.ts +11 -0
- package/dist/gids-pie-chart.js +1 -0
- package/dist/gids-popover.js +1 -1
- package/dist/gids-progress-circle.d.ts +11 -0
- package/dist/gids-progress-circle.js +1 -0
- package/dist/gids-scrim.js +1 -1
- package/dist/gids-snackbar.js +1 -1
- package/dist/gids-text-field.js +1 -1
- package/dist/gids-toggle-button.js +1 -1
- package/dist/gids-tooltip.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{p-DvoHLz_5.js → p-BQ-ZnlnH.js} +1 -1
- package/dist/p-BZCJlqVe.js +1 -0
- package/dist/p-Bf3p-DY2.js +1 -0
- package/dist/p-BpQB6ncp.js +1 -0
- package/dist/{p-DybsMR13.js → p-CHGTBObD.js} +1 -1
- package/dist/p-CP1wz2PI.js +1 -0
- package/dist/p-CQH7eAs3.js +1 -0
- package/dist/p-CW7tw1Fb.js +1 -0
- package/dist/p-CaauwQNd.js +1 -0
- package/dist/p-Cn3-K5eR.js +1 -0
- package/dist/p-CoS0NuDU.js +1 -0
- package/dist/{p-veoOgDXg.js → p-D4Pimu_8.js} +1 -1
- package/dist/p-D6lxqcxP.js +1 -0
- package/dist/p-DMNS1d8v.js +1 -0
- package/dist/{p-iCAclJND.js → p-DNTv2BQ5.js} +1 -1
- package/dist/p-DPIK2ayL.js +1 -0
- package/dist/p-Db62Pz3n.js +1 -0
- package/dist/p-Degg_WJz.js +1 -0
- package/dist/p-DfxTsSdZ.js +1 -0
- package/dist/p-Dg2yoUxw.js +1 -0
- package/dist/p-DmLoB2Dn.js +1 -0
- package/dist/p-DoCwI_bx.js +1 -0
- package/dist/p-H1JIMJ2t.js +1 -0
- package/dist/p-JjN8U9B5.js +1 -0
- package/dist/p-UVmSPzTd.js +1 -0
- package/dist/p-UxDcM-C5.js +1 -0
- package/dist/p-V48JyMbP.js +1 -0
- package/dist/p-mZJdpfOo.js +1 -0
- package/dist/types/components/html/GidsButtonGroup/GidsButtonGroup.d.ts +2 -2
- package/dist/types/components/html/GidsCalendarCell/GidsCalendarCell.d.ts +7 -0
- package/dist/types/components/html/GidsCalendarDayCell/GidsCalendarDayCell.d.ts +4 -0
- package/dist/types/components/html/GidsDropdownItem/GidsDropdownItem.d.ts +1 -1
- package/dist/types/components/html/GidsDropdownMenu/GidsDropdownMenu.d.ts +1 -1
- package/dist/types/components/html/GidsDropdownMenuGroup/GidsDropdownMenuGroup.d.ts +1 -1
- package/dist/types/components/html/GidsListItem/GidsListItem.d.ts +2 -2
- package/dist/types/components/html/GidsPageTitle/GidsPageTitle.d.ts +4 -0
- package/dist/types/components/webComponents/GidsActionBar/GidsActionBar.d.ts +59 -0
- package/dist/types/components/webComponents/GidsActivityGauge/GidsActivityGauge.d.ts +23 -0
- package/dist/types/components/webComponents/GidsBarChart/GidsBarChart.d.ts +27 -0
- package/dist/types/components/webComponents/GidsCalendar/GidsCalendar.d.ts +34 -0
- package/dist/types/components/webComponents/GidsCalendarHeaderPanel/GidsCalendarHeaderPanel.d.ts +67 -0
- package/dist/types/components/webComponents/GidsCalendarMonthList/GidsCalendarMonthList.d.ts +26 -0
- package/dist/types/components/webComponents/GidsCalendarYearList/GidsCalendarYearList.d.ts +31 -0
- package/dist/types/components/webComponents/GidsChart/GidsChart.d.ts +19 -0
- package/dist/types/components/webComponents/GidsChartLegend/GidsChartLegend.d.ts +7 -0
- package/dist/types/components/webComponents/GidsChartLegendItem/GidsChartLegendItem.d.ts +9 -0
- package/dist/types/components/webComponents/GidsChevronButton/GidsChevronButton.d.ts +21 -0
- package/dist/types/components/webComponents/GidsDot/GidsDot.d.ts +17 -0
- package/dist/types/components/webComponents/GidsDropdown/GidsDropdown.d.ts +78 -0
- package/dist/types/components/webComponents/GidsDropdownField/GidsDropdownField.d.ts +37 -0
- package/dist/types/components/webComponents/GidsDropdownPicker/GidsDropdownPicker.d.ts +52 -0
- package/dist/types/components/webComponents/GidsFilter/GidsFilter.d.ts +55 -0
- package/dist/types/components/webComponents/GidsLevelGauge/GidsLevelGauge.d.ts +22 -0
- package/dist/types/components/webComponents/GidsLineChart/GidsLineChart.d.ts +27 -0
- package/dist/types/components/webComponents/GidsPieChart/GidsPieChart.d.ts +23 -0
- package/dist/types/components/webComponents/GidsProgressCircle/GidsProgressCircle.d.ts +24 -0
- package/dist/types/components/webComponents/GidsToggleButton/GidsToggleButton.d.ts +5 -3
- package/dist/types/components.d.ts +1585 -49
- package/dist/types/utils/childrenValidityUtils.d.ts +1 -1
- package/dist-bundled/es/gids-action-bar.js +177 -0
- package/dist-bundled/es/gids-activity-gauge.js +6 -0
- package/dist-bundled/es/gids-bar-chart.js +6 -0
- package/dist-bundled/es/gids-calendar-header-panel.js +6 -0
- package/dist-bundled/es/gids-calendar-month-list.js +6 -0
- package/dist-bundled/es/gids-calendar-year-list.js +6 -0
- package/dist-bundled/es/gids-calendar.js +153 -0
- package/dist-bundled/es/gids-chart-legend-item.js +6 -0
- package/dist-bundled/es/gids-chart-legend.js +6 -0
- package/dist-bundled/es/gids-chart.js +108 -0
- package/dist-bundled/es/gids-chevron-button.js +56 -0
- package/dist-bundled/es/gids-dot.js +6 -0
- package/dist-bundled/es/gids-dropdown-field.js +88 -0
- package/dist-bundled/es/gids-dropdown-picker.js +6 -0
- package/dist-bundled/es/gids-dropdown.js +6 -0
- package/dist-bundled/es/gids-field.js +1 -1
- package/dist-bundled/es/gids-filter.js +6 -0
- package/dist-bundled/es/gids-icon.js +3 -29
- package/dist-bundled/es/gids-input.js +4 -4
- package/dist-bundled/es/gids-level-gauge.js +6 -0
- package/dist-bundled/es/gids-line-chart.js +6 -0
- package/dist-bundled/es/gids-notification.js +1 -1
- package/dist-bundled/es/gids-overflow-container.js +6 -6
- package/dist-bundled/es/gids-overlay-provider.js +17 -17
- package/dist-bundled/es/gids-password-field.js +39 -38
- package/dist-bundled/es/gids-pie-chart.js +6 -0
- package/dist-bundled/es/gids-popover.js +10 -10
- package/dist-bundled/es/gids-progress-circle.js +6 -0
- package/dist-bundled/es/gids-scrim.js +8 -8
- package/dist-bundled/es/gids-snackbar.js +1 -1
- package/dist-bundled/es/gids-text-field.js +15 -14
- package/dist-bundled/es/gids-toggle-button.js +4 -44
- package/dist-bundled/es/gids-tooltip.js +2 -2
- package/dist-bundled/es/index.js +3 -3
- package/dist-bundled/es/{p-DvoHLz_5-C5EvA91N.js → p-BQ-ZnlnH-CUVdDHzX.js} +5 -5
- package/dist-bundled/es/p-BZCJlqVe-BcSwze-q.js +71 -0
- package/dist-bundled/es/p-Bf3p-DY2-CPqEc-vc.js +672 -0
- package/dist-bundled/es/p-BpQB6ncp-C2AWddf-.js +180 -0
- package/dist-bundled/es/{p-DybsMR13-DpmsG3Q1.js → p-CHGTBObD-EN4cCwtX.js} +3 -3
- package/dist-bundled/es/p-CP1wz2PI-DhVAsHFS.js +115 -0
- package/dist-bundled/es/p-CQH7eAs3-BVowyVGn.js +88 -0
- package/dist-bundled/es/p-CW7tw1Fb-DtJ5TwCU.js +92 -0
- package/dist-bundled/es/p-CaauwQNd-D6_PbcRr.js +20 -0
- package/dist-bundled/es/p-Cn3-K5eR-tQ1EOnDF.js +243 -0
- package/dist-bundled/es/p-CoS0NuDU-CqmDcRWj.js +56 -0
- package/dist-bundled/es/{p-veoOgDXg-fRinub-C.js → p-D4Pimu_8-DfEGRQGf.js} +9 -9
- package/dist-bundled/es/p-D6lxqcxP-DWrZi1Xi.js +74 -0
- package/dist-bundled/es/p-DMNS1d8v-CHF62UXm.js +29 -0
- package/dist-bundled/es/{p-iCAclJND-Bmsvd-W1.js → p-DNTv2BQ5-Bwgd30mM.js} +6 -6
- package/dist-bundled/es/p-DPIK2ayL-DPEbctqo.js +71 -0
- package/dist-bundled/es/p-Db62Pz3n-DpQjwBYb.js +31 -0
- package/dist-bundled/es/p-Degg_WJz-BLua06el.js +55 -0
- package/dist-bundled/es/p-DfxTsSdZ-C2Afv1lS.js +67 -0
- package/dist-bundled/es/p-Dg2yoUxw-Cca8ROd_.js +25 -0
- package/dist-bundled/es/p-DmLoB2Dn-D-FSoCvI.js +44 -0
- package/dist-bundled/es/p-DoCwI_bx-BXHlZI7-.js +37 -0
- package/dist-bundled/es/p-H1JIMJ2t-DEXp7M4I.js +152 -0
- package/dist-bundled/es/p-JjN8U9B5-GeWjfJBY.js +135 -0
- package/dist-bundled/es/{p-CFw4_-5A-Dzvju3VE.js → p-UVmSPzTd-DiTxS9kW.js} +9 -9
- package/dist-bundled/es/p-UxDcM-C5-Dr5d_WpJ.js +15 -0
- package/dist-bundled/es/p-V48JyMbP-Bx-0od-Z.js +80 -0
- package/dist-bundled/es/p-mZJdpfOo-DicbKil0.js +47 -0
- package/dist-bundled/umd/gids-action-bar.umd.js +7 -0
- package/dist-bundled/umd/gids-activity-gauge.umd.js +5 -0
- package/dist-bundled/umd/gids-bar-chart.umd.js +13 -0
- package/dist-bundled/umd/gids-calendar-header-panel.umd.js +5 -0
- package/dist-bundled/umd/gids-calendar-month-list.umd.js +5 -0
- package/dist-bundled/umd/gids-calendar-year-list.umd.js +5 -0
- package/dist-bundled/umd/gids-calendar.umd.js +5 -0
- package/dist-bundled/umd/gids-chart-legend-item.umd.js +5 -0
- package/dist-bundled/umd/gids-chart-legend.umd.js +5 -0
- package/dist-bundled/umd/gids-chart.umd.js +13 -0
- package/dist-bundled/umd/gids-chevron-button.umd.js +5 -0
- package/dist-bundled/umd/gids-dot.umd.js +5 -0
- package/dist-bundled/umd/gids-dropdown-field.umd.js +5 -0
- package/dist-bundled/umd/gids-dropdown-picker.umd.js +5 -0
- package/dist-bundled/umd/gids-dropdown.umd.js +5 -0
- package/dist-bundled/umd/gids-field.umd.js +2 -2
- package/dist-bundled/umd/gids-filter.umd.js +7 -0
- package/dist-bundled/umd/gids-icon.umd.js +2 -2
- package/dist-bundled/umd/gids-input.umd.js +2 -2
- package/dist-bundled/umd/gids-level-gauge.umd.js +5 -0
- package/dist-bundled/umd/gids-line-chart.umd.js +5 -0
- package/dist-bundled/umd/gids-notification.umd.js +2 -2
- package/dist-bundled/umd/gids-overflow-container.umd.js +2 -2
- package/dist-bundled/umd/gids-overlay-provider.umd.js +2 -2
- package/dist-bundled/umd/gids-password-field.umd.js +2 -2
- package/dist-bundled/umd/gids-pie-chart.umd.js +5 -0
- package/dist-bundled/umd/gids-popover.umd.js +2 -2
- package/dist-bundled/umd/gids-progress-circle.umd.js +5 -0
- package/dist-bundled/umd/gids-scrim.umd.js +2 -2
- package/dist-bundled/umd/gids-snackbar.umd.js +2 -2
- package/dist-bundled/umd/gids-text-field.umd.js +2 -2
- package/dist-bundled/umd/gids-toggle-button.umd.js +3 -3
- package/dist-bundled/umd/gids-tooltip.umd.js +2 -2
- package/dist-bundled/umd/index.umd.js +2 -2
- package/dist-bundled/umd-complete/gids-core-web.umd.js +11 -3
- package/package.json +164 -4
- package/dist/p-CFw4_-5A.js +0 -1
- package/dist/p-DijVkS9b.js +0 -1
- package/dist/p-ibikYq-w.js +0 -1
- package/dist-bundled/es/p-DijVkS9b-CeV1i4T-.js +0 -35
- package/dist-bundled/es/p-ibikYq-w-BsGxk8ro.js +0 -635
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { q as g, L as p, u as d, D as e } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { r as h, e as _, d as v, F as y } from "./p-CaauwQNd-D6_PbcRr.js";
|
|
3
|
+
import { p as m } from "./p-DMNS1d8v-CHF62UXm.js";
|
|
4
|
+
import { c } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const f = ({ breakpoint: a }, t) => c("gids-level-gauge", {
|
|
6
|
+
"gids-level-gauge--breakpoint-mobile": a === "mobile"
|
|
7
|
+
}, t), u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
getGidsLevelGaugeClassNames: f
|
|
10
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsLevelGaugeClassNames: b } = u, x = p(class extends d {
|
|
11
|
+
constructor(a) {
|
|
12
|
+
super(), a !== !1 && this.__registerHost(), this.breakpoint = "desktop", this.value = 0, this.label = "Completed", this.size = "xxs", this.color = "amber", this.chartLoaderSize = "lg", this.chartLoading = !1, this.width = 0, this.height = 0;
|
|
13
|
+
}
|
|
14
|
+
valueChanged() {
|
|
15
|
+
this.updateDimensions();
|
|
16
|
+
}
|
|
17
|
+
componentDidLoad() {
|
|
18
|
+
this.updateDimensions(), this.resizeObserver = new ResizeObserver((() => this.updateDimensions())), this.hostElement.parentElement && this.resizeObserver.observe(this.hostElement.parentElement);
|
|
19
|
+
}
|
|
20
|
+
disconnectedCallback() {
|
|
21
|
+
this.resizeObserver && this.resizeObserver.disconnect();
|
|
22
|
+
}
|
|
23
|
+
updateDimensions() {
|
|
24
|
+
const a = this.hostElement.getBoundingClientRect();
|
|
25
|
+
this.width = a.width, this.height = a.height > 0 ? a.height : 240;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
if (this.chartLoading) return e("div", { class: "gids-level-gauge__no-data" }, e(m, { label: this.chartLoadingTitle, supportingText: this.chartLoadingSupportingText, size: this?.chartLoaderSize ?? "lg" }));
|
|
29
|
+
let a = 0;
|
|
30
|
+
typeof this.value == "number" && !isNaN(this.value) && (a = this.value);
|
|
31
|
+
const t = y;
|
|
32
|
+
if (!(typeof this.value == "number" && !isNaN(this.value) && this.value <= t && this.value >= 0)) return e("div", { class: "gids-level-gauge__no-data" }, e(h, { title: _, supportingText: v(100), image: e("slot", { name: "chartFeedbackBlockImage" }) }));
|
|
33
|
+
const l = Math.min(Math.max(a / t, 0), 1), r = `${Math.round(100 * l)}%`, n = b({ breakpoint: this.breakpoint }), i = 2 * Math.PI * 40, o = `${l * i} ${i}`, s = this.size === "xxs";
|
|
34
|
+
return e("div", { class: n }, e("div", { class: `gids-level-gauge__main-container gids-level-gauge__main-container--variant-${this.color}` }, e("div", { class: `gids-level-gauge__svg-wrapper gids-level-gauge__svg-wrapper--size-${this.size}` }, e("svg", { viewBox: "0 0 100 100", class: "gids-level-gauge__chart-vector" }, e("circle", { cx: "50", cy: "50", r: 40, class: "gids-level-gauge__track-background" }), e("circle", { cx: "50", cy: "50", r: 40, class: `gids-level-gauge__segment gids-level-gauge__segment--variant-${this.color}`, "stroke-dasharray": o, "stroke-dashoffset": "0", transform: "rotate(-90 50 50)" })), e("div", { class: "gids-level-gauge__center-content" }, s ? null : e("span", { class: `gids-level-gauge__label-common gids-level-gauge__label-${this.size}` }, this.label), e("span", { class: `gids-level-gauge__percentage-common gids-level-gauge__percentage-${this.size}` }, r))), s ? e("div", { class: "gids-level-gauge__bottom-content" }, e("span", { class: `gids-level-gauge__label-common gids-level-gauge__label-${this.size}` }, this.label)) : null));
|
|
35
|
+
}
|
|
36
|
+
get hostElement() {
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
static get watchers() {
|
|
40
|
+
return { value: [{ valueChanged: 0 }], max: [{ valueChanged: 0 }] };
|
|
41
|
+
}
|
|
42
|
+
static get style() {
|
|
43
|
+
return ":host{display:block;box-sizing:border-box}.gids-level-gauge{display:block;box-sizing:border-box}.gids-level-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-level-gauge__main-container{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-level-gauge__svg-wrapper--size-xxs{width:180px;height:180px}.gids-level-gauge__svg-wrapper--size-xs{width:220px;height:220px}.gids-level-gauge__svg-wrapper--size-sm{width:260px;height:260px}.gids-level-gauge__svg-wrapper--size-md{width:300px;height:300px}.gids-level-gauge__svg-wrapper--size-lg{width:340px;height:340px}.gids-level-gauge__chart-vector{display:block;width:100%;height:100%}.gids-level-gauge{}.gids-level-gauge__main-container{display:flex;flex-direction:column;gap:var(--gids-gap-050)}.gids-level-gauge__main-container--variant-amber .gids-level-gauge__track-background{stroke:rgb(248, 248, 248)}.gids-level-gauge__main-container--variant-burgundy .gids-level-gauge__track-background{stroke:rgb(246, 243, 243)}.gids-level-gauge__main-container--variant-teal .gids-level-gauge__track-background{stroke:rgb(232, 245, 250)}.gids-level-gauge__track-background{fill:none;stroke-width:6}.gids-level-gauge__segment{fill:none;stroke-width:6;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-level-gauge__segment--variant-amber{stroke:rgb(80, 82, 88)}.gids-level-gauge__segment--variant-burgundy{stroke:rgb(132, 84, 95)}.gids-level-gauge__segment--variant-teal{stroke:rgb(23, 60, 102)}.gids-level-gauge{}.gids-level-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;gap:var(--gids-gap-025)}.gids-level-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-level-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-level-gauge__percentage-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-level-gauge__percentage-common{color:var(--gids-color-text-default)}.gids-level-gauge{}.gids-level-gauge__bottom-content{display:flex;justify-content:center;text-align:center}.gids-level-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}";
|
|
44
|
+
}
|
|
45
|
+
}, [260, "gids-level-gauge", { breakpoint: [1], value: [2], label: [1], size: [1], color: [1], chartLoaderSize: [1, "chart-loader-size"], chartLoading: [4, "chart-loading"], chartLoadingTitle: [1, "chart-loading-title"], chartLoadingSupportingText: [1, "chart-loading-supporting-text"], width: [32], height: [32] }, void 0, { value: [{ valueChanged: 0 }], max: [{ valueChanged: 0 }] }]);
|
|
46
|
+
function w() {
|
|
47
|
+
typeof customElements < "u" && ["gids-level-gauge"].forEach(((a) => {
|
|
48
|
+
a === "gids-level-gauge" && (customElements.get(g(a)) || customElements.define(g(a), x));
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
w();
|
|
52
|
+
export {
|
|
53
|
+
x as d,
|
|
54
|
+
w as h
|
|
55
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { q as l, L as f, u, D as t } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { p as b } from "./p-DMNS1d8v-CHF62UXm.js";
|
|
3
|
+
import { o as x } from "./p-DoCwI_bx-BXHlZI7-.js";
|
|
4
|
+
import { d as z } from "./p-mZJdpfOo-DicbKil0.js";
|
|
5
|
+
import { c as w } from "./clsx-OuTLNxxd.js";
|
|
6
|
+
const k = ({ breakpoint: a }, g) => w("gids-activity-gauge", {
|
|
7
|
+
"gids-activity-gauge--breakpoint-mobile": a === "mobile"
|
|
8
|
+
}, g), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
|
+
__proto__: null,
|
|
10
|
+
getGidsActivityGaugeClassNames: k
|
|
11
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsActivityGaugeClassNames: L } = D, E = f(class extends u {
|
|
12
|
+
constructor(a) {
|
|
13
|
+
super(), a !== !1 && this.__registerHost(), this.breakpoint = "desktop", this.chartData = [], this.label = "", this.size = "xs", this.legend = "none", this.chartLoaderSize = "lg", this.chartLoading = !1, this.width = 0, this.height = 0;
|
|
14
|
+
}
|
|
15
|
+
chartDataChanged() {
|
|
16
|
+
this.updateDimensions();
|
|
17
|
+
}
|
|
18
|
+
legendChanged(a) {
|
|
19
|
+
this.legend = a;
|
|
20
|
+
}
|
|
21
|
+
componentDidLoad() {
|
|
22
|
+
this.updateDimensions(), this.resizeObserver = new ResizeObserver((() => this.updateDimensions())), this.hostElement.parentElement && this.resizeObserver.observe(this.hostElement.parentElement);
|
|
23
|
+
}
|
|
24
|
+
disconnectedCallback() {
|
|
25
|
+
this.resizeObserver && this.resizeObserver.disconnect();
|
|
26
|
+
}
|
|
27
|
+
updateDimensions() {
|
|
28
|
+
const a = this.hostElement.getBoundingClientRect();
|
|
29
|
+
this.width = a.width, this.height = a.height > 0 ? a.height : 240;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
if (this.chartLoading) return t("div", { class: "gids-activity-gauge__no-data" }, t(b, { label: this.chartLoadingTitle, supportingText: this.chartLoadingSupportingText, size: this?.chartLoaderSize ?? "lg" }));
|
|
33
|
+
const a = this.chartData.map(((i) => i.value || 0)), g = a.length > 0 ? Math.max(...a) : 0, r = Math.max(1e3, g), p = r.toLocaleString(), y = L({ breakpoint: this.breakpoint }), n = [{ radius: 42, strokeWidth: 5.5 }, { radius: 34, strokeWidth: 5.5 }, { radius: 26, strokeWidth: 5.5 }], o = this.size === "xxs", d = typeof this.label == "string" && this.label.trim() !== "", c = this.legend && this.legend === "right" && this.breakpoint !== "mobile", _ = this.legend && (this.legend === "bottom" || this.breakpoint === "mobile");
|
|
34
|
+
return t("div", { class: y }, t("div", { class: "gids-activity-gauge__main-container" }, t("div", { class: "gids-activity-gauge__chart-stage-container" }, t("div", { class: `gids-activity-gauge__svg-wrapper gids-activity-gauge--size-${this.size}` }, t("svg", { viewBox: "0 0 100 100", class: "gids-activity-gauge__chart-vector" }, this.chartData.slice(0, 3).map(((i, e) => {
|
|
35
|
+
const s = n[e] || n[0] || { radius: 26, strokeWidth: 5.5 }, m = r > 0 ? Math.min(Math.max((i.value || 0) / r, 0), 1) : 0, h = 2 * Math.PI * s.radius, v = `${m * h} ${h}`;
|
|
36
|
+
return t("g", { key: i.label || e }, t("circle", { cx: "50", cy: "50", r: s.radius, "stroke-width": s.strokeWidth, class: "gids-activity-gauge__track-background" }), t("circle", { cx: "50", cy: "50", r: s.radius, "stroke-width": s.strokeWidth, class: `gids-activity-gauge__segment gids-activity-gauge__segment-series-${e + 1}`, "stroke-dasharray": v, "stroke-dashoffset": "0", transform: "rotate(-90 50 50)" }));
|
|
37
|
+
}))), t("div", { class: "gids-activity-gauge__center-content" }, d && !o ? t("span", { class: `gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}` }, this.label) : null, t("span", { class: `gids-activity-gauge__value-common gids-activity-gauge__value-${this.size}` }, p)))), c ? t("div", { class: "gids-activity-gauge__sidebar" }, t("gids-chart-legend", { orientation: "vertical" }, this.chartData.slice(0, 3).map(((i, e) => t("gids-chart-legend-item", { key: i.label, seriesType: `${e + 1}`, orientation: "vertical" }, i.label))))) : null), o && d ? t("div", { class: "gids-activity-gauge__bottom-content" }, t("span", { class: `gids-activity-gauge__label-common gids-activity-gauge__label-${this.size}` }, this.label)) : null, _ ? t("div", { class: "gids-activity-gauge__legend-container gids-activity-gauge__legend-container--bottom" }, t("gids-chart-legend", { orientation: "horizontal" }, this.chartData.slice(0, 3).map(((i, e) => t("gids-chart-legend-item", { key: i.label, seriesType: `${e + 1}`, orientation: "horizontal" }, i.label))))) : null);
|
|
38
|
+
}
|
|
39
|
+
get hostElement() {
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
static get watchers() {
|
|
43
|
+
return { chartData: [{ chartDataChanged: 0 }], legend: [{ legendChanged: 0 }] };
|
|
44
|
+
}
|
|
45
|
+
static get style() {
|
|
46
|
+
return ":host{display:block;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.gids-activity-gauge--breakpoint-mobile{max-width:var(--gids-width-xs)}.gids-activity-gauge__main-container{display:inline-flex;justify-content:center;gap:var(--gids-gap-200);width:100%;height:100%}.gids-activity-gauge__svg-wrapper{position:relative;display:block;flex-shrink:0}.gids-activity-gauge--size-xxs{width:180px;height:180px}.gids-activity-gauge--size-xs{width:220px;height:220px}.gids-activity-gauge--size-sm{width:260px;height:260px}.gids-activity-gauge--size-md{width:300px;height:300px}.gids-activity-gauge--size-lg{width:340px;height:340px}.gids-activity-gauge__chart-stage-container{display:flex;justify-content:center;align-items:center}.gids-activity-gauge__chart-vector{display:block;width:100%;height:100%}.gids-activity-gauge__track-background{fill:none;stroke:var(--gids-color-background-brand-subtlest-default);stroke-linecap:round}.gids-activity-gauge__segment{fill:none;stroke-linecap:round;transition:stroke-dasharray 0.4s ease-out}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-1{stroke:var(--gids-color-icon-subtle)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-2{stroke:var(--gids-color-icon-warning)}.gids-activity-gauge__segment.gids-activity-gauge__segment-series-3{stroke:var(--gids-color-icon-danger)}.gids-activity-gauge__center-content{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none}.gids-activity-gauge__label-xxs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-xs{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-sm{font-family:var(--gids-typography-label-x-small__font-family);font-size:var(--gids-typography-label-x-small__font-size);font-weight:var(--gids-typography-label-x-small__font-weight);letter-spacing:var(--gids-typography-label-x-small__letter-spacing);line-height:var(--gids-typography-label-x-small__line-height);text-transform:var(--gids-typography-label-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-x-small__font-variant-caps, inherit)}.gids-activity-gauge__label-md{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-lg{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__label-common{color:var(--gids-color-text-subtlest)}.gids-activity-gauge__value-xxs{font-family:var(--gids-typography-label-small__font-family);font-size:var(--gids-typography-label-small__font-size);font-weight:var(--gids-typography-label-small__font-weight);letter-spacing:var(--gids-typography-label-small__letter-spacing);line-height:var(--gids-typography-label-small__line-height);text-transform:var(--gids-typography-label-small__text-transform, inherit);font-variant-caps:var(--gids-typography-label-small__font-variant-caps, inherit)}.gids-activity-gauge__value-xs{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-sm{font-family:var(--gids-typography-display-x-small__font-family);font-size:var(--gids-typography-display-x-small__font-size);font-weight:var(--gids-typography-display-x-small__font-weight);letter-spacing:var(--gids-typography-display-x-small__letter-spacing);line-height:var(--gids-typography-display-x-small__line-height);text-transform:var(--gids-typography-display-x-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-x-small__font-variant-caps, inherit)}.gids-activity-gauge__value-md{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-lg{font-family:var(--gids-typography-display-small__font-family);font-size:var(--gids-typography-display-small__font-size);font-weight:var(--gids-typography-display-small__font-weight);letter-spacing:var(--gids-typography-display-small__letter-spacing);line-height:var(--gids-typography-display-small__line-height);text-transform:var(--gids-typography-display-small__text-transform, inherit);font-variant-caps:var(--gids-typography-display-small__font-variant-caps, inherit)}.gids-activity-gauge__value-common{color:var(--gids-color-text-default)}.gids-activity-gauge__bottom-content{display:flex;justify-content:center;align-items:center;text-align:center}.gids-activity-gauge__no-data{display:flex;align-items:center;justify-content:center;padding:var(--gids-padding-vertical-edge-to-element-300) var(--gids-padding-horizontal-edge-to-element-100);width:100%;height:100%;min-height:200px;color:var(--gids-color-text-subtlest);border:var(--gids-border-width-thin) dashed var(--gids-color-border-default);border-radius:var(--gids-border-radius-md)}";
|
|
47
|
+
}
|
|
48
|
+
}, [0, "gids-activity-gauge", { breakpoint: [1], chartData: [16], label: [1], size: [1], legend: [1], chartLoaderSize: [1, "chart-loader-size"], chartLoading: [4, "chart-loading"], chartLoadingTitle: [1, "chart-loading-title"], chartLoadingSupportingText: [1, "chart-loading-supporting-text"], width: [32], height: [32] }, void 0, { chartData: [{ chartDataChanged: 0 }], legend: [{ legendChanged: 0 }] }]);
|
|
49
|
+
function $() {
|
|
50
|
+
typeof customElements < "u" && ["gids-activity-gauge", "gids-chart-legend", "gids-chart-legend-item"].forEach(((a) => {
|
|
51
|
+
switch (a) {
|
|
52
|
+
case "gids-activity-gauge":
|
|
53
|
+
customElements.get(l(a)) || customElements.define(l(a), E);
|
|
54
|
+
break;
|
|
55
|
+
case "gids-chart-legend":
|
|
56
|
+
customElements.get(l(a)) || x();
|
|
57
|
+
break;
|
|
58
|
+
case "gids-chart-legend-item":
|
|
59
|
+
customElements.get(l(a)) || z();
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
$();
|
|
64
|
+
export {
|
|
65
|
+
$ as d,
|
|
66
|
+
E as o
|
|
67
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { D as i } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { c as f } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
const m = ({ disabled: e }, t) => f("gids-label", { "gids-label--disabled": e }, t), _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
|
+
__proto__: null,
|
|
5
|
+
getGidsLabelClassNames: m
|
|
6
|
+
}, Symbol.toStringTag, { value: "Module" })), d = (e) => {
|
|
7
|
+
const t = Array.isArray(e) ? e[e.length - 1] : e;
|
|
8
|
+
return typeof t == "string" && t.trim().endsWith(".");
|
|
9
|
+
}, y = /\w/, h = (e) => e.replace(y, (t) => t.toLocaleUpperCase()), c = (e, t) => typeof e == "function" ? e(t) : t ? h(e) : e, L = ({ children: e, fieldRequirement: t, fieldRequirementOptionalText: r, fieldRequirementRequiredText: n, isLabelSentence: o }) => {
|
|
10
|
+
const s = o ? o(e) : d(e);
|
|
11
|
+
if (t === "required")
|
|
12
|
+
return c(n && n.length > 0 ? n : "(required)", s);
|
|
13
|
+
if (t === "optional")
|
|
14
|
+
return c(r && r.length > 0 ? r : "(optional)", s);
|
|
15
|
+
}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
16
|
+
__proto__: null,
|
|
17
|
+
getIndicatorText: L,
|
|
18
|
+
isSentence: d
|
|
19
|
+
}, Symbol.toStringTag, { value: "Module" })), { getIndicatorText: j } = S, { getGidsLabelClassNames: v } = _, O = ({ disabled: e, fieldRequirement: t, fieldRequirementOptionalText: r, fieldRequirementRequiredText: n, info: o, htmlFor: s, labelId: u, class: g, isLabelSentence: p, ...b }, l) => {
|
|
20
|
+
const a = j({ children: l, fieldRequirement: t, fieldRequirementOptionalText: r, fieldRequirementRequiredText: n, isLabelSentence: p });
|
|
21
|
+
return i("div", { class: v({ disabled: e }, g), ...b }, i("label", { htmlFor: s, id: u }, l, a && i("span", { class: "gids-label__field-requirement" }, a)), o);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
O as a
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { q as s, L as l, u as d, z as i, D as t, P as n } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { o } from "./p-UVmSPzTd-DiTxS9kW.js";
|
|
3
|
+
import { i as c } from "./p-B2zUuNXz-BLBgQDu7.js";
|
|
4
|
+
const a = l(class extends d {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(), e !== !1 && this.__registerHost(), this.__attachShadow(), this.select = i(this, "select"), this._toggle = this._toggle.bind(this);
|
|
7
|
+
}
|
|
8
|
+
handleSelctedChange(e) {
|
|
9
|
+
this.selected = e;
|
|
10
|
+
}
|
|
11
|
+
connectedCallback() {
|
|
12
|
+
const e = c();
|
|
13
|
+
e !== void 0 && this._el.shadowRoot?.adoptedStyleSheets.push(e);
|
|
14
|
+
}
|
|
15
|
+
_toggle() {
|
|
16
|
+
const e = !this.selected;
|
|
17
|
+
this._el.selected = this.selected, this.select?.emit(e), this.selected = this.selected;
|
|
18
|
+
}
|
|
19
|
+
render() {
|
|
20
|
+
return t(n, { key: "f7fe1215b0945a6d71c23d3644121dd73ff653cf" }, t("style", { key: "78195ef784f5f4df916d0a61e9b988233db31fef" }, `:host {
|
|
21
|
+
display: ${this.width === "full" ? "block" : "inline-block"}
|
|
22
|
+
}`), t(o, { key: "c0ae6269f93d930064073e1091cd145e453b7e7f", appearance: this.appearance, size: this.size, width: this.width, disabled: this.disabled, onClick: this._toggle, "aria-pressed": this.selected ? "true" : "false", leadingIcon: t("slot", { name: "leadingIcon" }), trailingIcon: t("slot", { name: "trailingIcon" }), forceIconOnly: this._onlyHasLeadingIcon() }, t("slot", { key: "1e8fd27fe3a99d3957b0cc4d6334cd297bc8fb21" })));
|
|
23
|
+
}
|
|
24
|
+
_onlyHasLeadingIcon() {
|
|
25
|
+
const e = this._el.childNodes;
|
|
26
|
+
return e.length === 1 && e[0] instanceof window.Element && e[0].slot === "leadingIcon";
|
|
27
|
+
}
|
|
28
|
+
get _el() {
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
static get watchers() {
|
|
32
|
+
return { selected: [{ handleSelctedChange: 0 }] };
|
|
33
|
+
}
|
|
34
|
+
}, [257, "gids-toggle-button", { disabled: [516], appearance: [513], size: [513], width: [513], defaultSelected: [516, "default-selected"], selected: [1540] }, void 0, { selected: [{ handleSelctedChange: 0 }] }]);
|
|
35
|
+
function h() {
|
|
36
|
+
typeof customElements < "u" && ["gids-toggle-button"].forEach(((e) => {
|
|
37
|
+
e === "gids-toggle-button" && (customElements.get(s(e)) || customElements.define(s(e), a));
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
h();
|
|
41
|
+
export {
|
|
42
|
+
a as l,
|
|
43
|
+
h as o
|
|
44
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { q as t, L as a, u as r, D as n } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { c as s } from "./clsx-OuTLNxxd.js";
|
|
3
|
+
const o = ({ orientation: e }, i) => s("gids-chart-legend", {
|
|
4
|
+
// 'gids-chart-legend--orientation-horizontal':
|
|
5
|
+
// orientation === 'horizontal', // not needed as by default
|
|
6
|
+
"gids-chart-legend--orientation-vertical": e === "vertical"
|
|
7
|
+
}, i), d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
getGidsChartLegendClassNames: o
|
|
10
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsChartLegendClassNames: l } = d, c = a(class extends r {
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(), e !== !1 && this.__registerHost(), this.orientation = "horizontal";
|
|
13
|
+
}
|
|
14
|
+
handleOrientationChange(e) {
|
|
15
|
+
this.orientation = e;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const e = l({ orientation: this.orientation });
|
|
19
|
+
return n("div", { key: "91b00cc799a723fe520513e41dc67df2b19c871e", class: e }, n("slot", { key: "83968874a18a0fb86706516b4083d6582a3341fb" }));
|
|
20
|
+
}
|
|
21
|
+
static get watchers() {
|
|
22
|
+
return { orientation: [{ handleOrientationChange: 0 }] };
|
|
23
|
+
}
|
|
24
|
+
static get style() {
|
|
25
|
+
return ".gids-chart-legend{display:inline-flex;align-items:flex-start;gap:var(--gids-gap-150)}.gids-chart-legend--orientation-vertical{flex-direction:column;gap:var(--gids-gap-050)}";
|
|
26
|
+
}
|
|
27
|
+
}, [260, "gids-chart-legend", { orientation: [1] }, void 0, { orientation: [{ handleOrientationChange: 0 }] }]);
|
|
28
|
+
function g() {
|
|
29
|
+
typeof customElements < "u" && ["gids-chart-legend"].forEach(((e) => {
|
|
30
|
+
e === "gids-chart-legend" && (customElements.get(t(e)) || customElements.define(t(e), c));
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
g();
|
|
34
|
+
export {
|
|
35
|
+
g as o,
|
|
36
|
+
c as r
|
|
37
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { q as h, L as g, u as m, D as o } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { d as u } from "./p-D4Pimu_8-DfEGRQGf.js";
|
|
3
|
+
import { o as p } from "./p-DmLoB2Dn-D-FSoCvI.js";
|
|
4
|
+
import { c as v } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const I = ({ expanded: e }, i) => v("gids-filter", {
|
|
6
|
+
"gids-filter--expanded": e
|
|
7
|
+
}, i), y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
getGidsFilterClassNames: I
|
|
10
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsFilterClassNames: x } = y, E = g(class extends m {
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(), e !== !1 && this.__registerHost(), this.expanded = !1, this.type = "none", this.filterItemType = "primary", this.filterSelected = !1, this.filterDefaultSelected = !1, this.disabled = !1, this.size = "sm", this.loading = !1, this.filterIndex = 0, this.hasSlottedMenu = !1, this.hasItemListener = !1, this.suppressNextMenuClickSelection = !1, this.handleFilterPickerItemSelect = (i) => {
|
|
13
|
+
const { value: s, title: t, disabled: l, id: n, selectedIndex: a, isPlaceholderItem: r, defaultSelected: d } = i.detail;
|
|
14
|
+
l || typeof s != "string" || (this.suppressNextMenuClickSelection = !0, queueMicrotask((() => {
|
|
15
|
+
this.suppressNextMenuClickSelection = !1;
|
|
16
|
+
})), this.applySelection({ id: n, filterId: this?.filterId, value: s, title: t, disabled: !1, selectedFilterMenuIndex: a, defaultSelected: d, filterType: this.type, filterItemType: this.filterItemType, filterTitle: t, filterIndex: this.filterIndex, hasFilterMenu: !0, originalEvent: i, filterSelected: !r, isPlaceholderItem: r || !1 }));
|
|
17
|
+
}, this.handleMenuClick = (i) => {
|
|
18
|
+
if (this.suppressNextMenuClickSelection) return;
|
|
19
|
+
const s = i.target;
|
|
20
|
+
if (!(s instanceof Element)) return;
|
|
21
|
+
const t = s.closest(".gids-dropdown-item");
|
|
22
|
+
if (!t || !this.hostElement.contains(t) || t.hasAttribute("disabled") || t.getAttribute("aria-disabled") === "true") return;
|
|
23
|
+
const l = t instanceof HTMLButtonElement ? t.value : t.getAttribute("value") ?? "";
|
|
24
|
+
if (typeof l != "string" || l.length === 0) return;
|
|
25
|
+
const n = t instanceof HTMLButtonElement ? t.id : t.getAttribute("id") ?? "";
|
|
26
|
+
if (typeof n != "string" || n.length === 0) return;
|
|
27
|
+
const a = t instanceof HTMLButtonElement ? t.tabIndex : t.getAttribute("tabIndex") ?? "", r = t.getAttribute("is-placeholder-item") ?? "", d = t.querySelector(".gids-dropdown-item__label") || t.querySelector("span"), c = d ? d.textContent?.trim() : t.firstChild?.textContent?.trim() || l, f = !(!r || r !== "true");
|
|
28
|
+
this.applySelection({ id: n, filterId: this.filterId, value: l, title: c, disabled: !1, selectedFilterMenuIndex: Number(a), defaultSelected: this.filterDefaultSelected, filterType: this.type, filterItemType: this.filterItemType, filterTitle: c, filterIndex: this.filterIndex, hasFilterMenu: !0, originalEvent: i, filterSelected: !f, isPlaceholderItem: f });
|
|
29
|
+
}, this.handleTriggerToggle = (i) => {
|
|
30
|
+
this.isInteractive() && this.setExpandedState(!this.expanded, i);
|
|
31
|
+
}, this.handleFilterButtonClickToggle = (i) => {
|
|
32
|
+
if (!i.defaultPrevented) if (i.stopPropagation(), this.isMenuToggler()) this.handleTriggerToggle(i);
|
|
33
|
+
else {
|
|
34
|
+
this.filterSelected = i.detail, i?.detail === !1 && this.handleFormReset(), this.applySelection({ id: "1", filterId: this.filterId, value: this.value, title: this.value, disabled: this.disabled, selectedFilterMenuIndex: void 0, filterType: this.type, filterItemType: this.filterItemType, filterTitle: this.value, filterIndex: this.filterIndex, originalEvent: i, filterSelected: i.detail, hasFilterMenu: !1, isPlaceholderItem: !1 });
|
|
35
|
+
const s = { expanded: !1, originalEvent: i };
|
|
36
|
+
this.onToggle?.(s);
|
|
37
|
+
}
|
|
38
|
+
}, this.handleFormReset = () => {
|
|
39
|
+
this.value = this.initialValue, this.selectedItemTitle = this.initialValue, this.filterSelected = !1, this.isMenuToggler() ? this.setExpandedState(!1) : this.expanded = !1;
|
|
40
|
+
}, this.setFilterDropdownPosition = () => {
|
|
41
|
+
if (!this.hostElement) return;
|
|
42
|
+
const i = this.hostElement.querySelector(".gids-filter__menu");
|
|
43
|
+
if (!i) return;
|
|
44
|
+
const s = window.innerWidth / 2, t = this.hostElement.getBoundingClientRect();
|
|
45
|
+
t.left + t.width / 2 > s ? i.classList.add("gids-filter__menu--align-right") : i.classList.remove("gids-filter__menu--align-right");
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
handleExpandedChange(e) {
|
|
49
|
+
e && !this.isInteractive() && (this.expanded = !1);
|
|
50
|
+
}
|
|
51
|
+
handleInteractivityChange() {
|
|
52
|
+
!this.isInteractive() && this.expanded && this.setExpandedState(!1);
|
|
53
|
+
}
|
|
54
|
+
handleFilterTypeChange(e) {
|
|
55
|
+
this.type = e;
|
|
56
|
+
}
|
|
57
|
+
handleFilterSelectedChange(e) {
|
|
58
|
+
this.filterSelected = e;
|
|
59
|
+
}
|
|
60
|
+
connectedCallback() {
|
|
61
|
+
this.attachItemListener(), this.attachFormListener();
|
|
62
|
+
}
|
|
63
|
+
componentDidLoad() {
|
|
64
|
+
this.initialValue = this.value, this.evaluateSlottedMenuExistence();
|
|
65
|
+
}
|
|
66
|
+
disconnectedCallback() {
|
|
67
|
+
this.detachItemListener(), this.detachFormListener();
|
|
68
|
+
}
|
|
69
|
+
getFilterButtonControl() {
|
|
70
|
+
return this.hostElement.querySelector(".gids-button");
|
|
71
|
+
}
|
|
72
|
+
getItemElements() {
|
|
73
|
+
return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"));
|
|
74
|
+
}
|
|
75
|
+
evaluateSlottedMenuExistence() {
|
|
76
|
+
const e = this.hostElement.querySelector(".gids-filter__menu");
|
|
77
|
+
if (!e) return void (this.hasSlottedMenu = !1);
|
|
78
|
+
const i = Array.from(e.childNodes).filter(((s) => s.nodeType !== Node.COMMENT_NODE && !(s.nodeType === Node.TEXT_NODE && !s.textContent?.trim())));
|
|
79
|
+
this.hasSlottedMenu = i.length > 0;
|
|
80
|
+
}
|
|
81
|
+
attachItemListener() {
|
|
82
|
+
this.hasItemListener || (this.hostElement.addEventListener("onPressDropdownItem", this.handleFilterPickerItemSelect), this.hasItemListener = !0);
|
|
83
|
+
}
|
|
84
|
+
detachItemListener() {
|
|
85
|
+
this.hasItemListener && (this.hostElement.removeEventListener("onPressDropdownItem", this.handleFilterPickerItemSelect), this.hasItemListener = !1);
|
|
86
|
+
}
|
|
87
|
+
applySelection(e) {
|
|
88
|
+
this.value = e.value, this.selectedItemTitle = typeof e.title == "string" ? e.title : void 0, this.clearActive(), this.isMenuToggler() ? this.setExpandedState(!1, this.coerceEvent(e.originalEvent)) : this.expanded = !1, this.onFilterMenuItemChange?.(e), this.hostElement.dispatchEvent(new CustomEvent("gidsFilterPickerChange", { bubbles: !0, composed: !0, detail: e }));
|
|
89
|
+
}
|
|
90
|
+
clearActive() {
|
|
91
|
+
this.getItemElements().forEach(((e) => e.classList.remove("gids-dropdown-item--active")));
|
|
92
|
+
}
|
|
93
|
+
setExpandedState(e, i) {
|
|
94
|
+
const s = !!e;
|
|
95
|
+
if (this.setFilterDropdownPosition(), s && !this.isInteractive() || this.expanded === s) return;
|
|
96
|
+
this.expanded = s, s || (this.clearActive(), this.syncFilterDisplayValue());
|
|
97
|
+
const t = { expanded: s, originalEvent: i };
|
|
98
|
+
this.onToggle?.(t);
|
|
99
|
+
}
|
|
100
|
+
syncFilterDisplayValue() {
|
|
101
|
+
const e = this.getFilterButtonControl();
|
|
102
|
+
e && e.value !== (this.selectedItemTitle ?? "") && (e.value = this.selectedItemTitle ?? "");
|
|
103
|
+
}
|
|
104
|
+
attachFormListener() {
|
|
105
|
+
const e = this.hostElement.closest("form");
|
|
106
|
+
this.patternForm !== e && (this.patternForm && this.patternForm.removeEventListener("reset", this.handleFormReset), this.patternForm = e ?? void 0, this.patternForm?.addEventListener("reset", this.handleFormReset));
|
|
107
|
+
}
|
|
108
|
+
detachFormListener() {
|
|
109
|
+
this.patternForm && (this.patternForm.removeEventListener("reset", this.handleFormReset), this.patternForm = void 0);
|
|
110
|
+
}
|
|
111
|
+
isInteractive() {
|
|
112
|
+
return !this.disabled;
|
|
113
|
+
}
|
|
114
|
+
coerceEvent(e) {
|
|
115
|
+
if (typeof Event < "u" && e !== null) return e instanceof Event ? e : void 0;
|
|
116
|
+
}
|
|
117
|
+
isMenuToggler() {
|
|
118
|
+
return (this.type === "none" || this.type === "more") && this.hasSlottedMenu;
|
|
119
|
+
}
|
|
120
|
+
handleWindowClick(e) {
|
|
121
|
+
this.expanded && (e.composedPath().includes(this.hostElement) || this.setExpandedState(!1, e));
|
|
122
|
+
}
|
|
123
|
+
render() {
|
|
124
|
+
const e = this.expanded && this.isInteractive(), i = x({ expanded: e }), s = this.isMenuToggler(), t = typeof this.filterPickerId == "string" ? this.filterPickerId : void 0, l = t ? `${t}__menu` : void 0, n = this.selectedItemTitle ?? this.value ?? "", a = this.type === "more", r = this.type === "all", d = this.type === "none";
|
|
125
|
+
return o("div", { key: "278b8b3901a5c836c7e078aeafb2c6338726d76a", class: i, "aria-control": l ?? "" }, o("gids-toggle-button", { key: "b35f6770a815537932f617318e31df74a8031b3c", id: t, name: this.name, expanded: e, value: n, disabled: this.disabled, size: this.size, loading: this.loading, tabIndex: this.filterIndex, defaultSelected: this.filterDefaultSelected, selected: this.filterSelected || this.filterDefaultSelected, onSelect: this.handleFilterButtonClickToggle }, a || r ? o(u, { name: a ? "options" : "filter", size: this.size, appearance: "regular", alt: "", slot: "leadingIcon" }) : void 0, d || r ? n : void 0, s && !a ? o(u, { name: "chevron-down", size: this.size, appearance: "regular", alt: "", slot: "trailingIcon" }) : void 0), o("div", { key: "d6b40dcae48bfb4b4f6654e2126c707afd2b0801", class: "gids-filter__menu", id: l, role: "pickerbox", onClick: this.handleMenuClick }, o("slot", { key: "32c88f98018ebad487c6acdd02cf5c1e0cc00050", onSlotchange: () => this.evaluateSlottedMenuExistence() })));
|
|
126
|
+
}
|
|
127
|
+
get hostElement() {
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
static get watchers() {
|
|
131
|
+
return { expanded: [{ handleExpandedChange: 0 }], disabled: [{ handleInteractivityChange: 0 }], type: [{ handleFilterTypeChange: 0 }], filterSelected: [{ handleFilterSelectedChange: 0 }] };
|
|
132
|
+
}
|
|
133
|
+
static get style() {
|
|
134
|
+
return ".gids-filter{position:relative}.gids-filter__menu{position:absolute;top:calc(100% + var(--gids-gap-050));z-index:3;display:none;flex-direction:column;align-self:stretch;min-width:var(--gids-width-2-xs);min-height:55px;max-height:15rem;overflow-x:hidden;overflow-y:auto;background-color:var(--gids-elevation-surface-overlay-default);box-shadow:var(--gids-elevation-shadow-overlay);border-radius:var(--gids-border-radius-lg);left:0;right:auto}.gids-filter__menu--align-right{left:auto !important;right:0 !important}.gids-filter__menu>*{flex-shrink:0}.gids-filter--expanded .gids-filter__menu{display:flex}";
|
|
135
|
+
}
|
|
136
|
+
}, [260, "gids-filter", { name: [1], filterId: [1, "filter-id"], filterPickerId: [1, "filter-picker-id"], expanded: [4], type: [1], filterItemType: [1, "filter-item-type"], value: [1], filterSelected: [1540, "filter-selected"], filterDefaultSelected: [4, "filter-default-selected"], disabled: [4], size: [1], loading: [4], filterIndex: [2, "filter-index"], onFilterMenuItemChange: [16], onToggle: [16], selectedItemTitle: [32], hasSlottedMenu: [32] }, [[8, "click", "handleWindowClick"]], { expanded: [{ handleExpandedChange: 0 }], disabled: [{ handleInteractivityChange: 0 }], type: [{ handleFilterTypeChange: 0 }], filterSelected: [{ handleFilterSelectedChange: 0 }] }]);
|
|
137
|
+
function S() {
|
|
138
|
+
typeof customElements < "u" && ["gids-filter", "gids-toggle-button"].forEach(((e) => {
|
|
139
|
+
switch (e) {
|
|
140
|
+
case "gids-filter":
|
|
141
|
+
customElements.get(h(e)) || customElements.define(h(e), E);
|
|
142
|
+
break;
|
|
143
|
+
case "gids-toggle-button":
|
|
144
|
+
customElements.get(h(e)) || p();
|
|
145
|
+
}
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
148
|
+
S();
|
|
149
|
+
export {
|
|
150
|
+
S as a,
|
|
151
|
+
E as h
|
|
152
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { q as r, L as l, u as h, D as n } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { o as c } from "./p-UVmSPzTd-DiTxS9kW.js";
|
|
3
|
+
import { d as p } from "./p-D4Pimu_8-DfEGRQGf.js";
|
|
4
|
+
import { c as u } from "./clsx-OuTLNxxd.js";
|
|
5
|
+
const m = ({ expanded: e }, t) => u("gids-dropdown-picker", {
|
|
6
|
+
"gids-dropdown-picker--expanded": e
|
|
7
|
+
}, t), g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
getGidsDropdownPickerClassNames: m
|
|
10
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsDropdownPickerClassNames: f } = g, v = l(class extends h {
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(), e !== !1 && this.__registerHost(), this.appearance = "subtle", this.size = "sm", this.idPicker = "", this.expanded = !1, this.hasLeadingIcon = !1, this.hasItemListener = !1, this.suppressNextMenuClickSelection = !1, this.hasDocumentListeners = !1, this.handleDropdownPickerItemSelect = (t) => {
|
|
13
|
+
const { value: i, title: s, disabled: o, id: a, isPlaceholderItem: d } = t.detail;
|
|
14
|
+
o || typeof i != "string" || (this.suppressNextMenuClickSelection = !0, queueMicrotask((() => {
|
|
15
|
+
this.suppressNextMenuClickSelection = !1;
|
|
16
|
+
})), this.applySelection({ id: a, value: i, title: s, disabled: !1, originalEvent: t, isPlaceholderItem: d }));
|
|
17
|
+
}, this.handleMenuClick = (t) => {
|
|
18
|
+
if (this.suppressNextMenuClickSelection) return;
|
|
19
|
+
const i = t.target;
|
|
20
|
+
if (!(i instanceof Element)) return;
|
|
21
|
+
const s = i.closest(".gids-dropdown-item");
|
|
22
|
+
if (!s || !this.hostElement.contains(s) || s.hasAttribute("disabled") || s.getAttribute("aria-disabled") === "true") return;
|
|
23
|
+
const o = s instanceof HTMLButtonElement ? s.value : s.getAttribute("value") ?? "";
|
|
24
|
+
if (typeof o != "string" || o.length === 0) return;
|
|
25
|
+
const a = s instanceof HTMLButtonElement ? s.id : s.getAttribute("id") ?? "";
|
|
26
|
+
if (typeof a != "string" || a.length === 0) return;
|
|
27
|
+
const d = s.getAttribute("is-placeholder-item") ?? "";
|
|
28
|
+
this.applySelection({ id: a, value: o, title: s.textContent?.trim() ?? "", disabled: !1, originalEvent: t, isPlaceholderItem: !(!d || d !== "true") });
|
|
29
|
+
}, this.handleTriggerToggle = (t) => {
|
|
30
|
+
this.isInteractive() && this.setExpandedState(!this.expanded, t);
|
|
31
|
+
}, this.handleDropdownButtonClickToggle = (t) => {
|
|
32
|
+
t.defaultPrevented || (t.stopPropagation(), this.handleTriggerToggle(t));
|
|
33
|
+
}, this.handleOutSpaceClickOfDropdownButtonToggle = (t) => {
|
|
34
|
+
this.expanded && (t.stopPropagation(), this.setExpandedState(!1));
|
|
35
|
+
}, this.handleDocumentPointerDown = (t) => {
|
|
36
|
+
t.button !== 2 && this.expanded && ((typeof t.composedPath == "function" ? t.composedPath() : []).includes(this.hostElement) || this.hostElement.contains(t.target) || this.setExpandedState(!1, t));
|
|
37
|
+
}, this.handleDocumentKeyDown = (t) => {
|
|
38
|
+
if (!this.expanded) return;
|
|
39
|
+
const i = t.key;
|
|
40
|
+
if (i === "Escape" || i === "Esc") return t.preventDefault(), void this.setExpandedState(!1, t);
|
|
41
|
+
i === "Tab" && this.setExpandedState(!1, t);
|
|
42
|
+
}, this.handleFormReset = () => {
|
|
43
|
+
this.value = this.initialValue, this.selectedItemTitle = void 0, this.setExpandedState(!1);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
handleExpandedChange(e) {
|
|
47
|
+
e && !this.isInteractive() && (this.expanded = !1);
|
|
48
|
+
}
|
|
49
|
+
handleInteractivityChange() {
|
|
50
|
+
!this.isInteractive() && this.expanded && this.setExpandedState(!1);
|
|
51
|
+
}
|
|
52
|
+
connectedCallback() {
|
|
53
|
+
this.initialValue = this.value, this.attachItemListener(), this.attachDocumentListeners(), this.attachFormListener();
|
|
54
|
+
}
|
|
55
|
+
disconnectedCallback() {
|
|
56
|
+
this.detachItemListener(), this.detachDocumentListeners(), this.detachFormListener();
|
|
57
|
+
}
|
|
58
|
+
componentWillLoad() {
|
|
59
|
+
this.checkSlots();
|
|
60
|
+
}
|
|
61
|
+
componentWillUpdate() {
|
|
62
|
+
this.checkSlots();
|
|
63
|
+
}
|
|
64
|
+
checkSlots() {
|
|
65
|
+
this.hasLeadingIcon = !!this.hostElement.querySelector('[slot="leadingIconDropdownPicker"]');
|
|
66
|
+
}
|
|
67
|
+
getDropdownButtonControl() {
|
|
68
|
+
return this.hostElement.querySelector(".gids-button");
|
|
69
|
+
}
|
|
70
|
+
getItemElements() {
|
|
71
|
+
return Array.from(this.hostElement.querySelectorAll(".gids-dropdown-item"));
|
|
72
|
+
}
|
|
73
|
+
attachItemListener() {
|
|
74
|
+
this.hasItemListener || (this.hostElement.addEventListener("onPressDropdownItem", this.handleDropdownPickerItemSelect), this.hasItemListener = !0);
|
|
75
|
+
}
|
|
76
|
+
detachItemListener() {
|
|
77
|
+
this.hasItemListener && (this.hostElement.removeEventListener("onPressDropdownItem", this.handleDropdownPickerItemSelect), this.hasItemListener = !1);
|
|
78
|
+
}
|
|
79
|
+
applySelection(e) {
|
|
80
|
+
this.value = e.value, this.selectedItemTitle = typeof e.title == "string" ? e.title : void 0, this.clearActive(), this.setExpandedState(!1, this.coerceEvent(e.originalEvent)), this.onSelectionChange?.(e), this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownPickerChange", { bubbles: !0, composed: !0, detail: e }));
|
|
81
|
+
}
|
|
82
|
+
clearActive() {
|
|
83
|
+
this.getItemElements().forEach(((e) => e.classList.remove("gids-dropdown-item--active")));
|
|
84
|
+
}
|
|
85
|
+
setExpandedState(e, t) {
|
|
86
|
+
const i = !!e;
|
|
87
|
+
i && !this.isInteractive() || this.expanded !== i && (this.expanded = i, i || (this.clearActive(), this.syncInputDisplayValue()), this.hostElement.dispatchEvent(new CustomEvent("gidsDropdownPickerToggle", { bubbles: !0, composed: !0, detail: { expanded: i, originalEvent: t } })));
|
|
88
|
+
}
|
|
89
|
+
syncInputDisplayValue() {
|
|
90
|
+
const e = this.getDropdownButtonControl();
|
|
91
|
+
e && e.value !== (this.selectedItemTitle ?? "") && (e.value = this.selectedItemTitle ?? "");
|
|
92
|
+
}
|
|
93
|
+
attachDocumentListeners() {
|
|
94
|
+
this.hasDocumentListeners || typeof document > "u" || (document.addEventListener("pointerdown", this.handleDocumentPointerDown), document.addEventListener("keydown", this.handleDocumentKeyDown), this.hasDocumentListeners = !0);
|
|
95
|
+
}
|
|
96
|
+
detachDocumentListeners() {
|
|
97
|
+
this.hasDocumentListeners && typeof document < "u" && (document.removeEventListener("pointerdown", this.handleDocumentPointerDown), document.removeEventListener("keydown", this.handleDocumentKeyDown), this.hasDocumentListeners = !1);
|
|
98
|
+
}
|
|
99
|
+
attachFormListener() {
|
|
100
|
+
const e = this.hostElement.closest("form");
|
|
101
|
+
this.patternForm !== e && (this.patternForm && this.patternForm.removeEventListener("reset", this.handleFormReset), this.patternForm = e ?? void 0, this.patternForm?.addEventListener("reset", this.handleFormReset));
|
|
102
|
+
}
|
|
103
|
+
detachFormListener() {
|
|
104
|
+
this.patternForm && (this.patternForm.removeEventListener("reset", this.handleFormReset), this.patternForm = void 0);
|
|
105
|
+
}
|
|
106
|
+
isInteractive() {
|
|
107
|
+
return !this.disabled;
|
|
108
|
+
}
|
|
109
|
+
coerceEvent(e) {
|
|
110
|
+
if (typeof Event < "u" && e !== null) return e instanceof Event ? e : void 0;
|
|
111
|
+
}
|
|
112
|
+
render() {
|
|
113
|
+
const e = this.expanded && this.isInteractive(), t = f({ expanded: e }), i = typeof this.idPicker == "string" ? this.idPicker : void 0, s = i ? `${i}__menu` : void 0;
|
|
114
|
+
return n("div", { key: "fd8821be1aecb1e5ba7f725d9ebec0f6222a16cd", class: t, onClick: this.handleOutSpaceClickOfDropdownButtonToggle }, n(c, { key: "63016b4e74dfeaa3f9c29139f69a2d46ca97ae76", role: "pickerbox", "aria-expanded": e ? "true" : "false", "aria-haspopup": "pickerlistbox", "aria-controls": s ?? "", onClick: this.handleDropdownButtonClickToggle, disabled: this.disabled, value: this.selectedItemTitle ?? this.value ?? "", loading: this.loading, appearance: this.appearance, size: this.size }, this.hasLeadingIcon ? n("slot", { name: "leadingIconDropdownPicker", slot: "leadingIcon" }) : n(p, { name: "chevron-down", size: this.size, appearance: "regular", alt: "", slot: "leadingIcon" })), n("div", { key: "4f463a8f04de48e3b8b6ceeab69c90cbc8ba7631", class: "gids-dropdown-picker__menu", id: s, role: "pickerbox", onClick: this.handleMenuClick }, n("slot", { key: "1fab2b1bd8cd2bcd0fd7031712d0585635620be1" })));
|
|
115
|
+
}
|
|
116
|
+
get hostElement() {
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
static get watchers() {
|
|
120
|
+
return { expanded: [{ handleExpandedChange: 0 }], disabled: [{ handleInteractivityChange: 0 }] };
|
|
121
|
+
}
|
|
122
|
+
static get style() {
|
|
123
|
+
return ".gids-dropdown-picker{position:relative}.gids-dropdown-picker__menu{position:absolute;inset-inline:0;top:calc(100% + var(--gids-gap-050));z-index:3;display:none;flex-direction:column;align-self:stretch;min-width:var(--gids-width-2-xs);min-height:55px;max-height:15rem;overflow-x:hidden;overflow-y:auto;background-color:var(--gids-elevation-surface-overlay-default);box-shadow:var(--gids-elevation-shadow-overlay);border-radius:var(--gids-border-radius-lg)}.gids-dropdown-picker__menu>*{flex-shrink:0}.gids-dropdown-picker--expanded .gids-dropdown-picker__menu{display:flex}";
|
|
124
|
+
}
|
|
125
|
+
}, [260, "gids-dropdown-picker", { appearance: [1], size: [1], idPicker: [1, "id-picker"], expanded: [1540], disabled: [516], loading: [516], value: [513], name: [1], onSelectionChange: [16], selectedItemTitle: [32], hasLeadingIcon: [32] }, void 0, { expanded: [{ handleExpandedChange: 0 }], disabled: [{ handleInteractivityChange: 0 }] }]);
|
|
126
|
+
function E() {
|
|
127
|
+
typeof customElements < "u" && ["gids-dropdown-picker"].forEach(((e) => {
|
|
128
|
+
e === "gids-dropdown-picker" && (customElements.get(r(e)) || customElements.define(r(e), v));
|
|
129
|
+
}));
|
|
130
|
+
}
|
|
131
|
+
E();
|
|
132
|
+
export {
|
|
133
|
+
E as h,
|
|
134
|
+
v as r
|
|
135
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { l as h } from "./p-
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { D as a } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { l as h } from "./p-CHGTBObD-EN4cCwtX.js";
|
|
3
|
+
import { c as v } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
const _ = ({ appearance: t, size: n, width: d, destructive: s, positive: o, loading: l }, i, e) => v("gids-button", {
|
|
5
5
|
"gids-button--primary": t === "primary",
|
|
6
6
|
"gids-button--subtle": t === "subtle",
|
|
7
7
|
"gids-button--xs": n === "xs",
|
|
@@ -13,13 +13,13 @@ const v = ({ appearance: t, size: n, width: d, destructive: s, positive: o, load
|
|
|
13
13
|
"gids-button--positive": o && !s,
|
|
14
14
|
"gids-button--icon-only": i,
|
|
15
15
|
"gids-button--loading": l
|
|
16
|
-
}, e),
|
|
16
|
+
}, e), x = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
17
17
|
__proto__: null,
|
|
18
|
-
getGidsButtonClassNames:
|
|
19
|
-
}, Symbol.toStringTag, { value: "Module" })), b = (t) => t !== void 0 && (!Array.isArray(t) || t.length > 0), { getGidsButtonClassNames:
|
|
18
|
+
getGidsButtonClassNames: _
|
|
19
|
+
}, Symbol.toStringTag, { value: "Module" })), b = (t) => t !== void 0 && (!Array.isArray(t) || t.length > 0), { getGidsButtonClassNames: w } = x, j = ({ appearance: t, size: n, destructive: d, positive: s, loading: o, width: l, leadingIcon: i, trailingIcon: e, as: c, disabled: p, class: m, forceIconOnly: y = !1, ...u }, g) => {
|
|
20
20
|
const r = c || "button", f = n === "lg" || n === void 0 ? "md" : n;
|
|
21
|
-
return r !== "button" || "type" in u || (u.type = "button"), a(r, { class:
|
|
21
|
+
return r !== "button" || "type" in u || (u.type = "button"), a(r, { class: w({ appearance: t, size: n, destructive: d, loading: o, width: l, positive: s }, y || g.length === 0 && b(i) && !b(e), m), disabled: r === "button" ? p : void 0, ...u }, a("span", { class: "gids-button__content" }, i, g), o && a(h, { size: f, indeterminate: !0 }), e);
|
|
22
22
|
};
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
j as o
|
|
25
25
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { D as t } from "./p-Bf3p-DY2-CPqEc-vc.js";
|
|
2
|
+
import { d } from "./p-D4Pimu_8-DfEGRQGf.js";
|
|
3
|
+
import { c as m } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
const n = ({ appearance: e, size: s }, i) => m("gids-dismiss-button", {
|
|
5
|
+
"gids-dismiss-button--sm": s === "sm",
|
|
6
|
+
// 'gids-dismiss-button--md': size === 'md',
|
|
7
|
+
"gids-dismiss-button--lg": s === "lg",
|
|
8
|
+
"gids-dismiss-button--bold": e === "bold"
|
|
9
|
+
}, i), b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
getGidsDismissButtonClassNames: n
|
|
12
|
+
}, Symbol.toStringTag, { value: "Module" })), { getGidsDismissButtonClassNames: c } = b, f = ({ appearance: e = "subtle", size: s = "md", disabled: i = !1, class: a, onPressDismiss: o, label: l, ...r }) => t("button", { class: c({ appearance: e, size: s }, a), onClick: o, disabled: i, "aria-label": l, ...r }, t(d, { name: "cross", appearance: "regular" }));
|
|
13
|
+
export {
|
|
14
|
+
f as r
|
|
15
|
+
};
|