@luzmo/analytics-components-kit 1.0.1-alpha.3 → 1.0.1-alpha.4
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/LICENSE +18 -0
- package/custom-elements.json +1550 -0
- package/lib/area-chart-slots.config-BLxiYX05.cjs +20 -0
- package/lib/area-chart-slots.config-C0c2ZzBh.js +52 -0
- package/lib/async-directive-CPjMHOPu.cjs +24 -0
- package/lib/async-directive-SCUUQ3Mh.js +114 -0
- package/lib/bar-chart-slots.config-GSSL7XVA.js +47 -0
- package/lib/bar-chart-slots.config-Jx1PveTM.cjs +20 -0
- package/lib/bar-chart.config-B57geUzJ.cjs +20 -0
- package/lib/bar-chart.config-CQ6HAvs2.js +153 -0
- package/lib/bar-chart.en-BqYbiHO3.cjs +20 -0
- package/lib/bar-chart.en-FwT00qdU.js +69 -0
- package/lib/bar-chart.fr-DGx9smEh.cjs +20 -0
- package/lib/bar-chart.fr-DbxKiM0j.js +44 -0
- package/lib/bar-chart.nl-BYzVExsz.cjs +20 -0
- package/lib/bar-chart.nl-ahX1ARpH.js +44 -0
- package/lib/button-base-B4PdJFVe.cjs +27 -0
- package/lib/button-base-CtfPWS-P.js +142 -0
- package/lib/column-chart.config-B57geUzJ.cjs +20 -0
- package/lib/column-chart.config-C9hP0kX7.js +153 -0
- package/lib/cs-DVZ0Tapy.js +89 -0
- package/lib/cs-I9E81keK.cjs +20 -0
- package/lib/da-DHy05oSR.js +97 -0
- package/lib/da-QkdvupDg.cjs +20 -0
- package/lib/de-Dn5mUzha.cjs +20 -0
- package/lib/de-iM39JlAt.js +109 -0
- package/lib/decompose-numeric-format-B3rVVHpO.cjs +20 -0
- package/lib/decompose-numeric-format-BuZcjH2k.js +39 -0
- package/lib/directive-helpers-BSB0tfc9.cjs +32 -0
- package/lib/directive-helpers-eY1rHtyn.js +154 -0
- package/lib/divider.module-BW8qaMVq.js +211 -0
- package/lib/divider.module-DEy88Ieh.cjs +20 -0
- package/lib/donut-chart-slots.config-BEwhfq27.js +39 -0
- package/lib/donut-chart-slots.config-DIp-24lO.cjs +20 -0
- package/lib/donut-chart.config-3DhKiSSM.js +177 -0
- package/lib/donut-chart.config-DLWJUlHx.cjs +20 -0
- package/lib/donut-chart.en-Blb9oSdU.cjs +20 -0
- package/lib/donut-chart.en-CzjT4-XN.js +85 -0
- package/lib/donut-chart.fr-BeTVa2wh.cjs +20 -0
- package/lib/donut-chart.fr-DftPrKbG.js +39 -0
- package/lib/donut-chart.nl-D9YGbOce.cjs +20 -0
- package/lib/donut-chart.nl-NMatXfhK.js +39 -0
- package/lib/draggable-data-item/index.cjs +20 -0
- package/lib/draggable-data-item/index.js +30 -0
- package/lib/droppable-slot/index.cjs +20 -0
- package/lib/droppable-slot/index.js +30 -0
- package/lib/en-BDBzmAXX.cjs +202 -0
- package/lib/en-CIeY2T5K.js +1980 -0
- package/lib/en-GB-BqYHIX1v.cjs +20 -0
- package/lib/en-GB-CYx--4nh.js +28 -0
- package/lib/es-CwyPlN5d.cjs +20 -0
- package/lib/es-KhTq4jX8.js +305 -0
- package/lib/fi-Dh_ebgpe.js +97 -0
- package/lib/fi-rijeZE5V.cjs +20 -0
- package/lib/fr-BcgE-6S_.cjs +20 -0
- package/lib/fr-CU727YF1.js +305 -0
- package/lib/get-css-variable-BHHQ0SnL.js +1444 -0
- package/lib/get-css-variable-D439CdH9.cjs +24 -0
- package/lib/he-Au3xg6lR.js +89 -0
- package/lib/he-O6Ih8Bqh.cjs +20 -0
- package/lib/hu-BnZ8y3xQ.cjs +20 -0
- package/lib/hu-DNJ-P_MW.js +97 -0
- package/lib/if-defined-BbzmSG-O.js +757 -0
- package/lib/if-defined-V7yEJWI3.cjs +54 -0
- package/lib/imageobject.config-B7ld9bj3.cjs +20 -0
- package/lib/imageobject.config-DZLp9Elq.js +127 -0
- package/lib/index-0314DjEl.cjs +20 -0
- package/lib/index-B9h2L_hV.js +3048 -0
- package/lib/index-BDXFsKUM.cjs +146 -0
- package/lib/index-Bd4cKS9O.js +155 -0
- package/lib/index-BmAD29P2.js +106 -0
- package/lib/index-Bo1DpZ-1.cjs +58 -0
- package/lib/index-C4ePDYEC.cjs +41 -0
- package/lib/index-C9xEN5Ji.js +82 -0
- package/lib/index-CBCm4_7S.js +869 -0
- package/lib/index-CM80_HQw.js +442 -0
- package/lib/index-CcF-9wyF.cjs +71 -0
- package/lib/index-CfEm5P0J.cjs +196 -0
- package/lib/index-CrWoFMZ3.cjs +22 -0
- package/lib/index-CtEJZdT0.js +1627 -0
- package/lib/index-CvX-HLY1.cjs +322 -0
- package/lib/index-D37RwuEH.js +1584 -0
- package/lib/index-D5puKlcm.cjs +96 -0
- package/lib/index-DGz6jCKo.cjs +26 -0
- package/lib/index-DJp_9h0l.js +327 -0
- package/lib/index-DSbgZduE.js +501 -0
- package/lib/index-D_KYpfBM.js +24 -0
- package/lib/index-DdtjeKYI.js +928 -0
- package/lib/index-Dj7PF4Q9.cjs +63 -0
- package/lib/index-Dq3HAOaM.js +127 -0
- package/lib/index-DrIA0eFE.js +392 -0
- package/lib/index-jt6FL_uE.cjs +20 -0
- package/lib/index-kJR406YZ.cjs +112 -0
- package/lib/index-v8ZTprPO.cjs +51 -0
- package/lib/index.cjs +875 -0
- package/lib/index.js +6367 -302
- package/lib/it-Bh5U73z6.js +305 -0
- package/lib/it-PshtLMkq.cjs +20 -0
- package/lib/ja-CCcHUL61.js +89 -0
- package/lib/ja-KIS2HdaG.cjs +20 -0
- package/lib/ko--l4qmjLV.cjs +20 -0
- package/lib/ko-DhapsZMM.js +89 -0
- package/lib/line-chart.config-BZcvfO2c.cjs +20 -0
- package/lib/line-chart.config-CIVN6uLI.js +115 -0
- package/lib/mk-B9HPSuKa.js +97 -0
- package/lib/mk-DZlj-edb.cjs +20 -0
- package/lib/nl-BKlDqOXb.cjs +20 -0
- package/lib/nl-BwSt5Bf4.js +109 -0
- package/lib/no-D-DofYnx.js +109 -0
- package/lib/no-D_SzxhTu.cjs +20 -0
- package/lib/observe-slot-text-DOYmGOZe.js +181 -0
- package/lib/observe-slot-text-oJ0a2KY9.cjs +42 -0
- package/lib/picker/index.cjs +20 -0
- package/lib/picker/index.js +32 -0
- package/lib/pl-D_L_0Boq.js +97 -0
- package/lib/pl-PIK23rK_.cjs +20 -0
- package/lib/popover-Bwnkg-5-.js +67 -0
- package/lib/popover-CQGN8nbX.cjs +32 -0
- package/lib/progress-circle/index.cjs +35 -0
- package/lib/progress-circle/index.js +104 -0
- package/lib/pt-B0BBS5VB.js +89 -0
- package/lib/pt-Dqlu4MS5.cjs +20 -0
- package/lib/ru-Vo-m3O_2.js +108 -0
- package/lib/ru-zyNDTB04.cjs +20 -0
- package/lib/sv-1DPTltNQ.cjs +20 -0
- package/lib/sv-CiozMaev.js +89 -0
- package/lib/textobject.config-C8opcGG4.js +52 -0
- package/lib/textobject.config-DbAajFz8.cjs +20 -0
- package/lib/tr-BkmWvOG2.cjs +20 -0
- package/lib/tr-D_D4i5iv.js +109 -0
- package/lib/zh-CN-DTZ4OmdP.cjs +20 -0
- package/lib/zh-CN-wsl7eFSd.js +89 -0
- package/lib/zh-TW-DTZ4OmdP.cjs +20 -0
- package/lib/zh-TW-wsl7eFSd.js +89 -0
- package/package.json +16 -12
- package/lib/37.js +0 -1
- package/lib/729.js +0 -1
- package/lib/common-31743c5a.js +0 -13
- package/lib/common-b02547a0.js +0 -1
- package/lib/common-b49d9a9d.js +0 -1
- package/lib/common-b5232813.js +0 -56
- package/lib/common-cefd4f4c.js +0 -1
- package/lib/common-d6cb565f.js +0 -1
- package/lib/common-fd868059.js +0 -1
- package/lib/common-fedaf338.js +0 -32
- package/lib/edit-option-picker/index.js +0 -314
- package/lib/edit-option-slider/index.js +0 -102
- package/lib/edit-option-toggle/index.js +0 -114
- package/lib/vendors-93cc3efa.js +0 -1
- package/lib/vendors-bb3d84b5.js +0 -1
@@ -0,0 +1,501 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2024 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
import { S as v, L as f, r as x, x as z, n as l, e as I } from "./if-defined-BbzmSG-O.js";
|
21
|
+
import { s as E } from "./observe-slot-text-DOYmGOZe.js";
|
22
|
+
function p(c, t, e) {
|
23
|
+
return typeof c === t ? () => c : typeof c == "function" ? c : e;
|
24
|
+
}
|
25
|
+
class C {
|
26
|
+
constructor(t, {
|
27
|
+
direction: e,
|
28
|
+
elementEnterAction: r,
|
29
|
+
elements: i,
|
30
|
+
focusInIndex: s,
|
31
|
+
isFocusableElement: o,
|
32
|
+
listenerScope: g
|
33
|
+
} = { elements: () => [] }) {
|
34
|
+
this._currentIndex = -1, this.prevIndex = -1, this._direction = () => "both", this.directionLength = 5, this.elementEnterAction = (a) => {
|
35
|
+
}, this._focused = !1, this._focusInIndex = (a) => 0, this.isFocusableElement = (a) => !0, this._listenerScope = () => this.host, this.offset = 0, this.recentlyConnected = !1, this.handleFocusin = (a) => {
|
36
|
+
if (!this.isEventWithinListenerScope(a))
|
37
|
+
return;
|
38
|
+
const n = a.composedPath();
|
39
|
+
let h = -1;
|
40
|
+
n.find((b) => (h = this.elements.indexOf(b), h !== -1)), this.prevIndex = this.currentIndex, this.currentIndex = h > -1 ? h : this.currentIndex, this.isRelatedTargetOrContainAnElement(a) && this.hostContainsFocus();
|
41
|
+
}, this.handleClick = () => {
|
42
|
+
var h;
|
43
|
+
const a = this.elements;
|
44
|
+
if (a.length === 0)
|
45
|
+
return;
|
46
|
+
let n = a[this.currentIndex];
|
47
|
+
this.currentIndex < 0 || ((!n || !this.isFocusableElement(n)) && (this.setCurrentIndexCircularly(1), n = a[this.currentIndex]), n && this.isFocusableElement(n) && ((h = a[this.prevIndex]) == null || h.setAttribute("tabindex", "-1"), n.setAttribute("tabindex", "0")));
|
48
|
+
}, this.handleFocusout = (a) => {
|
49
|
+
this.isRelatedTargetOrContainAnElement(a) && this.hostNoLongerContainsFocus();
|
50
|
+
}, this.handleKeydown = (a) => {
|
51
|
+
if (!this.acceptsEventCode(a.code) || a.defaultPrevented)
|
52
|
+
return;
|
53
|
+
let n = 0;
|
54
|
+
switch (this.prevIndex = this.currentIndex, a.code) {
|
55
|
+
case "ArrowRight": {
|
56
|
+
n += 1;
|
57
|
+
break;
|
58
|
+
}
|
59
|
+
case "ArrowDown": {
|
60
|
+
n += this.direction === "grid" ? this.directionLength : 1;
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
case "ArrowLeft": {
|
64
|
+
n -= 1;
|
65
|
+
break;
|
66
|
+
}
|
67
|
+
case "ArrowUp": {
|
68
|
+
n -= this.direction === "grid" ? this.directionLength : 1;
|
69
|
+
break;
|
70
|
+
}
|
71
|
+
case "End": {
|
72
|
+
this.currentIndex = 0, n -= 1;
|
73
|
+
break;
|
74
|
+
}
|
75
|
+
case "Home": {
|
76
|
+
this.currentIndex = this.elements.length - 1, n += 1;
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
a.preventDefault(), this.direction === "grid" && this.currentIndex + n < 0 ? this.currentIndex = 0 : this.direction === "grid" && this.currentIndex + n > this.elements.length - 1 ? this.currentIndex = this.elements.length - 1 : this.setCurrentIndexCircularly(n), this.elementEnterAction(this.elements[this.currentIndex]), this.focus();
|
81
|
+
}, this.mutationObserver = new MutationObserver(() => {
|
82
|
+
this.handleItemMutation();
|
83
|
+
}), this.host = t, this.host.addController(this), this._elements = i, this.isFocusableElement = o || this.isFocusableElement, this._direction = p(
|
84
|
+
e,
|
85
|
+
"string",
|
86
|
+
this._direction
|
87
|
+
), this.elementEnterAction = r || this.elementEnterAction, this._focusInIndex = p(
|
88
|
+
s,
|
89
|
+
"number",
|
90
|
+
this._focusInIndex
|
91
|
+
), this._listenerScope = p(
|
92
|
+
g,
|
93
|
+
"object",
|
94
|
+
this._listenerScope
|
95
|
+
);
|
96
|
+
}
|
97
|
+
get currentIndex() {
|
98
|
+
return this._currentIndex === -1 && (this._currentIndex = this.focusInIndex), this._currentIndex - this.offset;
|
99
|
+
}
|
100
|
+
set currentIndex(t) {
|
101
|
+
this._currentIndex = t + this.offset;
|
102
|
+
}
|
103
|
+
get direction() {
|
104
|
+
return this._direction();
|
105
|
+
}
|
106
|
+
get elements() {
|
107
|
+
return this.cachedElements || (this.cachedElements = this._elements()), this.cachedElements;
|
108
|
+
}
|
109
|
+
set focused(t) {
|
110
|
+
t !== this.focused && (this._focused = t);
|
111
|
+
}
|
112
|
+
get focused() {
|
113
|
+
return this._focused;
|
114
|
+
}
|
115
|
+
get focusInElement() {
|
116
|
+
return this.elements[this.focusInIndex];
|
117
|
+
}
|
118
|
+
get focusInIndex() {
|
119
|
+
return this._focusInIndex(this.elements);
|
120
|
+
}
|
121
|
+
isEventWithinListenerScope(t) {
|
122
|
+
return this._listenerScope() === this.host ? !0 : t.composedPath().includes(this._listenerScope());
|
123
|
+
}
|
124
|
+
/* In handleItemMutation() method the first if condition is checking if the element is not focused or if the element's children's length is not decreasing then it means no element has been deleted and we must return.
|
125
|
+
Then we are checking if the deleted element was the focused one before the deletion if so then we need to proceed else we casn return;
|
126
|
+
*/
|
127
|
+
handleItemMutation() {
|
128
|
+
if (this._currentIndex === -1 || this.elements.length <= this._elements().length)
|
129
|
+
return;
|
130
|
+
const t = this.elements[this.currentIndex];
|
131
|
+
if (this.clearElementCache(), this.elements.includes(t))
|
132
|
+
return;
|
133
|
+
const e = this.currentIndex !== this.elements.length, r = e ? 1 : -1;
|
134
|
+
e && this.setCurrentIndexCircularly(-1), this.setCurrentIndexCircularly(r), this.focus();
|
135
|
+
}
|
136
|
+
update({ elements: t } = { elements: () => [] }) {
|
137
|
+
this.unmanage(), this._elements = t, this.clearElementCache(), this.manage();
|
138
|
+
}
|
139
|
+
focus(t) {
|
140
|
+
var i;
|
141
|
+
const e = this.elements;
|
142
|
+
if (e.length === 0)
|
143
|
+
return;
|
144
|
+
let r = e[this.currentIndex];
|
145
|
+
(!r || !this.isFocusableElement(r)) && (this.setCurrentIndexCircularly(1), r = e[this.currentIndex]), r && this.isFocusableElement(r) && ((i = e[this.prevIndex]) == null || i.setAttribute("tabindex", "-1"), r.tabIndex = 0, r.focus(t));
|
146
|
+
}
|
147
|
+
clearElementCache(t = 0) {
|
148
|
+
this.mutationObserver.disconnect(), delete this.cachedElements, this.offset = t, requestAnimationFrame(() => {
|
149
|
+
this.elements.forEach((e) => {
|
150
|
+
this.mutationObserver.observe(e, {
|
151
|
+
attributes: !0
|
152
|
+
});
|
153
|
+
});
|
154
|
+
});
|
155
|
+
}
|
156
|
+
setCurrentIndexCircularly(t) {
|
157
|
+
const { length: e } = this.elements;
|
158
|
+
let r = e;
|
159
|
+
this.prevIndex = this.currentIndex;
|
160
|
+
let i = (e + this.currentIndex + t) % e;
|
161
|
+
for (
|
162
|
+
;
|
163
|
+
// don't cycle the elements more than once
|
164
|
+
r && this.elements[i] && !this.isFocusableElement(this.elements[i]);
|
165
|
+
)
|
166
|
+
i = (e + i + t) % e, r -= 1;
|
167
|
+
this.currentIndex = i;
|
168
|
+
}
|
169
|
+
hostContainsFocus() {
|
170
|
+
this.host.addEventListener("focusout", this.handleFocusout), this.host.addEventListener("keydown", this.handleKeydown), this.focused = !0;
|
171
|
+
}
|
172
|
+
hostNoLongerContainsFocus() {
|
173
|
+
this.host.addEventListener("focusin", this.handleFocusin), this.host.removeEventListener("focusout", this.handleFocusout), this.host.removeEventListener("keydown", this.handleKeydown), this.focused = !1;
|
174
|
+
}
|
175
|
+
isRelatedTargetOrContainAnElement(t) {
|
176
|
+
const e = t.relatedTarget, r = this.elements.includes(e), i = this.elements.some(
|
177
|
+
(s) => s.contains(e)
|
178
|
+
);
|
179
|
+
return !(r || i);
|
180
|
+
}
|
181
|
+
acceptsEventCode(t) {
|
182
|
+
if (t === "End" || t === "Home")
|
183
|
+
return !0;
|
184
|
+
switch (this.direction) {
|
185
|
+
case "horizontal":
|
186
|
+
return t === "ArrowLeft" || t === "ArrowRight";
|
187
|
+
case "vertical":
|
188
|
+
return t === "ArrowUp" || t === "ArrowDown";
|
189
|
+
case "both":
|
190
|
+
case "grid":
|
191
|
+
return t.startsWith("Arrow");
|
192
|
+
}
|
193
|
+
}
|
194
|
+
manage() {
|
195
|
+
this.addEventListeners();
|
196
|
+
}
|
197
|
+
unmanage() {
|
198
|
+
this.removeEventListeners();
|
199
|
+
}
|
200
|
+
addEventListeners() {
|
201
|
+
this.host.addEventListener("focusin", this.handleFocusin), this.host.addEventListener("click", this.handleClick);
|
202
|
+
}
|
203
|
+
removeEventListeners() {
|
204
|
+
this.host.removeEventListener("focusin", this.handleFocusin), this.host.removeEventListener("focusout", this.handleFocusout), this.host.removeEventListener("keydown", this.handleKeydown), this.host.removeEventListener("click", this.handleClick);
|
205
|
+
}
|
206
|
+
hostConnected() {
|
207
|
+
this.recentlyConnected = !0, this.addEventListeners();
|
208
|
+
}
|
209
|
+
hostDisconnected() {
|
210
|
+
this.mutationObserver.disconnect(), this.removeEventListeners();
|
211
|
+
}
|
212
|
+
hostUpdated() {
|
213
|
+
this.recentlyConnected && (this.recentlyConnected = !1, this.elements.forEach((t) => {
|
214
|
+
this.mutationObserver.observe(t, {
|
215
|
+
attributes: !0
|
216
|
+
});
|
217
|
+
}));
|
218
|
+
}
|
219
|
+
}
|
220
|
+
class y extends C {
|
221
|
+
constructor() {
|
222
|
+
super(...arguments), this.managed = !0, this.manageIndexesAnimationFrame = 0;
|
223
|
+
}
|
224
|
+
set focused(t) {
|
225
|
+
t !== this.focused && (super.focused = t, this.manageTabindexes());
|
226
|
+
}
|
227
|
+
get focused() {
|
228
|
+
return super.focused;
|
229
|
+
}
|
230
|
+
clearElementCache(t = 0) {
|
231
|
+
cancelAnimationFrame(this.manageIndexesAnimationFrame), super.clearElementCache(t), this.managed && (this.manageIndexesAnimationFrame = requestAnimationFrame(
|
232
|
+
() => this.manageTabindexes()
|
233
|
+
));
|
234
|
+
}
|
235
|
+
manageTabindexes() {
|
236
|
+
this.focused ? this.updateTabindexes(() => ({ tabIndex: -1 })) : this.updateTabindexes((t) => ({
|
237
|
+
removeTabIndex: t.contains(this.focusInElement) && t !== this.focusInElement,
|
238
|
+
tabIndex: t === this.focusInElement ? 0 : -1
|
239
|
+
}));
|
240
|
+
}
|
241
|
+
updateTabindexes(t) {
|
242
|
+
this.elements.forEach((e) => {
|
243
|
+
const { tabIndex: r, removeTabIndex: i } = t(e);
|
244
|
+
if (!i) {
|
245
|
+
this.focused ? e !== this.elements[this.currentIndex] && (e.tabIndex = r) : e.tabIndex = r;
|
246
|
+
return;
|
247
|
+
}
|
248
|
+
e.removeAttribute("tabindex");
|
249
|
+
const s = e;
|
250
|
+
s.requestUpdate && s.requestUpdate();
|
251
|
+
});
|
252
|
+
}
|
253
|
+
manage() {
|
254
|
+
this.managed = !0, this.manageTabindexes(), super.manage();
|
255
|
+
}
|
256
|
+
unmanage() {
|
257
|
+
this.managed = !1, this.updateTabindexes(() => ({ tabIndex: 0 })), super.unmanage();
|
258
|
+
}
|
259
|
+
hostUpdated() {
|
260
|
+
super.hostUpdated(), this.host.hasUpdated || this.manageTabindexes();
|
261
|
+
}
|
262
|
+
}
|
263
|
+
const A = ":host{gap:var(--luzmo-action-group-horizontal-spacing-regular, var(--action-group-horizontal-spacing-regular));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:3}:host(:not([vertical]):not([compact])) ::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--luzmo-action-group-vertical-spacing-regular, var(--action-group-vertical-spacing-regular));flex-direction:column;display:inline-flex}:host([compact]){gap:var(--luzmo-action-group-gap-size-compact, var(--action-group-gap-size-compact))}:host([compact]:not([quiet])){flex-wrap:nowrap}:host([compact]:not([quiet])) ::slotted(*){border-radius:var(--luzmo-action-group-border-radius-reset, var(--action-group-border-radius-reset));z-index:0;position:relative}:host([compact]:not([quiet])) ::slotted(:first-child){--luzmo-actionbutton-focus-indicator-border-radius: var( --luzmo-action-group-border-radius, var(--action-group-border-radius) ) 0px 0px var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-start-start-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-end-start-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));margin-inline-start:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset))}:host([compact]:not([quiet])) ::slotted(:not(:first-child)){--luzmo-actionbutton-focus-indicator-border-radius: 0px;margin-inline-start:var(--luzmo-action-group-horizontal-spacing-compact, var(--action-group-horizontal-spacing-compact));margin-inline-end:var(--luzmo-action-group-horizontal-spacing-compact, var(--action-group-horizontal-spacing-compact))}:host([compact]:not([quiet])) ::slotted(:last-child){--luzmo-actionbutton-focus-indicator-border-radius: 0px var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0px;border-start-end-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-end-end-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));margin-inline-start:var(--luzmo-action-group-horizontal-spacing-compact, var(--action-group-horizontal-spacing-compact));margin-inline-end:var(--luzmo-action-group-border-radius-reset, var(--action-group-border-radius-reset))}:host([compact]:not([quiet])) ::slotted([selected]){z-index:1}@media (hover: hover){:host([compact]:not([quiet])) ::slotted(:hover){z-index:2}}:host([compact]:not([quiet])) ::slotted(:focus-visible){z-index:3}:host([compact]:not([quiet])[vertical]){gap:var(--luzmo-action-group-gap-size-compact, var(--action-group-gap-size-compact))}:host([compact][vertical]:not([quiet])) ::slotted(*){border-radius:var(--luzmo-action-group-border-radius-reset, var(--action-group-border-radius-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--luzmo-actionbutton-focus-indicator-border-radius: var( --luzmo-action-group-border-radius, var(--action-group-border-radius) ) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0px 0px;border-start-start-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-start-end-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));margin-block-start:var(--luzmo-action-group-vertical-spacing-compact, var(--action-group-vertical-spacing-compact));margin-block-end:var(--luzmo-action-group-vertical-spacing-compact, var(--action-group-vertical-spacing-compact));margin-inline-end:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:not(:first-child)){margin-block-start:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset));margin-block-end:var(--luzmo-action-group-vertical-spacing-compact, var(--action-group-vertical-spacing-compact));margin-inline-start:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset));margin-inline-end:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset))}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--luzmo-actionbutton-focus-indicator-border-radius: 0px 0px var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-end-end-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));border-end-start-radius:var(--luzmo-action-group-border-radius, var(--action-group-border-radius));margin-block-start:var(--luzmo-action-group-vertical-spacing-compact, var(--action-group-vertical-spacing-compact));margin-block-end:var(--luzmo-action-group-button-spacing-reset, var(--action-group-button-spacing-reset))}:host([justified]) ::slotted(*){flex:1}:host{--action-group-gap-size-compact: 0px;--action-group-horizontal-spacing-compact: -1px;--action-group-vertical-spacing-compact: -1px;--action-group-button-spacing-reset: 0px;--action-group-border-radius-reset: 0px;--action-group-border-radius: var(--luzmo-border-radius);--action-group-horizontal-spacing-regular: var(--luzmo-spacing-3);--action-group-vertical-spacing-regular: var(--luzmo-spacing-3)}:host([size=xs]),:host([size=s]){--action-group-horizontal-spacing-regular: var(--luzmo-spacing-2);--action-group-vertical-spacing-regular: var(--luzmo-spacing-2)}:host,:host([size=l]),:host([size=xl]){--action-group-horizontal-spacing-regular: var(--luzmo-spacing-3);--action-group-vertical-spacing-regular: var(--luzmo-spacing-3)}:host([dir][compact][vertical]) ::slotted(:nth-child(n)){margin-right:0;margin-left:0}:host([justified]) ::slotted(:not([role])),:host([vertical]) ::slotted(:not([role])){display:flex;flex-direction:column;align-items:stretch}:host([compact]:not([quiet])) ::slotted(:not([role])){--overriden-border-radius: 0;--luzmo-action-button-border-radius: var(--overriden-border-radius)}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):first-child){--overriden-border-radius: var( --luzmo-action-group-border-radius, var(--action-group-border-radius) ) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0 0}:host([compact][vertical]:not([quiet])) ::slotted(:not([role]):last-child){--overriden-border-radius: 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius: var( --luzmo-action-group-border-radius, var(--action-group-border-radius) ) 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):first-child){--overriden-border-radius: 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius: 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:not([role]):last-child){--overriden-border-radius: var( --luzmo-action-group-border-radius, var(--action-group-border-radius) ) 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}:host([compact]:not([quiet])) ::slotted(*){--luzmo-action-button-focus-ring-border-radius: 0}:host([compact][vertical]:not([quiet])) ::slotted(:first-child){--luzmo-action-button-focus-ring-border-radius: var(--luzmo-border-radius) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0 0}:host([compact][vertical]:not([quiet])) ::slotted(:last-child){--luzmo-action-button-focus-ring-border-radius: 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:first-child){--luzmo-action-button-focus-ring-border-radius: var(--luzmo-border-radius) 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:first-child){--luzmo-action-button-focus-ring-border-radius: 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0}:host([dir=ltr][compact]:not([quiet],[vertical])) ::slotted(:last-child){--luzmo-action-button-focus-ring-border-radius: 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) var(--luzmo-action-group-border-radius, var(--action-group-border-radius)) 0}:host([dir=rtl][compact]:not([quiet],[vertical])) ::slotted(:last-child){--luzmo-action-button-focus-ring-border-radius: var(--luzmo-border-radius) 0 0 var(--luzmo-action-group-border-radius, var(--action-group-border-radius))}";
|
264
|
+
var _ = Object.defineProperty, q = Object.getOwnPropertyDescriptor, d = (c, t, e, r) => {
|
265
|
+
for (var i = r > 1 ? void 0 : r ? q(t, e) : t, s = c.length - 1, o; s >= 0; s--)
|
266
|
+
(o = c[s]) && (i = (r ? o(t, e, i) : o(i)) || i);
|
267
|
+
return r && i && _(t, e, i), i;
|
268
|
+
};
|
269
|
+
const m = [];
|
270
|
+
class u extends v(f, {
|
271
|
+
validSizes: ["xs", "s", "m", "l", "xl"],
|
272
|
+
noDefaultSize: !0
|
273
|
+
}) {
|
274
|
+
constructor() {
|
275
|
+
super(), this._buttons = [], this._buttonSelector = "luzmo-action-button, luzmo-action-menu", this.rovingTabindexController = new y(
|
276
|
+
this,
|
277
|
+
{
|
278
|
+
focusInIndex: (t) => {
|
279
|
+
let e = -1;
|
280
|
+
const r = t.findIndex((i, s) => (!t[e] && !i.disabled && (e = s), i.selected && !i.disabled));
|
281
|
+
return t[r] ? r : e;
|
282
|
+
},
|
283
|
+
elements: () => this.buttons,
|
284
|
+
isFocusableElement: (t) => !t.disabled
|
285
|
+
}
|
286
|
+
), this.compact = !1, this.emphasized = !1, this.justified = !1, this.label = "", this.quiet = !1, this.vertical = !1, this._selected = m, this.hasManaged = !1, this.manageButtons = () => {
|
287
|
+
if (!this.slotElement)
|
288
|
+
return;
|
289
|
+
const e = this.slotElement.assignedElements({
|
290
|
+
flatten: !0
|
291
|
+
}).reduce((r, i) => {
|
292
|
+
if (i.matches(this._buttonSelector))
|
293
|
+
r.push(i);
|
294
|
+
else {
|
295
|
+
const s = [
|
296
|
+
...i.querySelectorAll(`:scope > ${this._buttonSelector}`)
|
297
|
+
];
|
298
|
+
r.push(...s);
|
299
|
+
}
|
300
|
+
return r;
|
301
|
+
}, []);
|
302
|
+
if (this.buttons = e, this.selects || !this.hasManaged) {
|
303
|
+
const r = [];
|
304
|
+
this.buttons.forEach((i) => {
|
305
|
+
i.selected && r.push(i.value);
|
306
|
+
}), this.setSelected([...this.selected, ...r]);
|
307
|
+
}
|
308
|
+
this.manageChildren(), this.manageSelects(), this.hasManaged = !0;
|
309
|
+
}, new E(this, {
|
310
|
+
config: {
|
311
|
+
childList: !0,
|
312
|
+
subtree: !0
|
313
|
+
},
|
314
|
+
callback: () => {
|
315
|
+
this.manageButtons();
|
316
|
+
},
|
317
|
+
skipInitial: !0
|
318
|
+
});
|
319
|
+
}
|
320
|
+
static get styles() {
|
321
|
+
return [x(A)];
|
322
|
+
}
|
323
|
+
set buttons(t) {
|
324
|
+
t !== this.buttons && (this._buttons = t, this.rovingTabindexController.clearElementCache());
|
325
|
+
}
|
326
|
+
get buttons() {
|
327
|
+
return this._buttons;
|
328
|
+
}
|
329
|
+
set selected(t) {
|
330
|
+
this.requestUpdate("selected", this._selected), this._selected = t, this.updateComplete.then(() => {
|
331
|
+
this.applySelects(), this.manageChildren();
|
332
|
+
});
|
333
|
+
}
|
334
|
+
get selected() {
|
335
|
+
return this._selected;
|
336
|
+
}
|
337
|
+
dispatchChange(t) {
|
338
|
+
this.dispatchEvent(
|
339
|
+
new Event("change", {
|
340
|
+
bubbles: !0,
|
341
|
+
composed: !0,
|
342
|
+
cancelable: !0
|
343
|
+
})
|
344
|
+
) || (this.setSelected(t), this.buttons.map((r) => {
|
345
|
+
r.selected = this.selected.includes(r.value);
|
346
|
+
}));
|
347
|
+
}
|
348
|
+
setSelected(t, e) {
|
349
|
+
if (t === this.selected)
|
350
|
+
return;
|
351
|
+
const r = this.selected;
|
352
|
+
this.requestUpdate("selected", r), this._selected = t, e && this.dispatchChange(r);
|
353
|
+
}
|
354
|
+
focus(t) {
|
355
|
+
this.rovingTabindexController.focus(t);
|
356
|
+
}
|
357
|
+
deselectSelectedButtons() {
|
358
|
+
this.buttons.forEach((t) => {
|
359
|
+
t.selected && (t.selected = !1, t.tabIndex = -1, t.setAttribute(
|
360
|
+
this.selects ? "aria-checked" : (
|
361
|
+
/* c8 ignore */
|
362
|
+
"aria-pressed"
|
363
|
+
),
|
364
|
+
"false"
|
365
|
+
));
|
366
|
+
});
|
367
|
+
}
|
368
|
+
handleActionButtonChange(t) {
|
369
|
+
t.stopPropagation(), t.preventDefault();
|
370
|
+
}
|
371
|
+
handleClick(t) {
|
372
|
+
const e = t.target;
|
373
|
+
if (e.value !== void 0)
|
374
|
+
switch (this.selects) {
|
375
|
+
case "single": {
|
376
|
+
this.deselectSelectedButtons(), e.selected = !0, e.tabIndex = 0, e.setAttribute("aria-checked", "true"), this.setSelected([e.value], !0);
|
377
|
+
break;
|
378
|
+
}
|
379
|
+
case "multiple": {
|
380
|
+
const r = [...this.selected];
|
381
|
+
e.selected = !e.selected, e.setAttribute("aria-checked", e.selected ? "true" : "false"), e.selected ? r.push(e.value) : r.splice(this.selected.indexOf(e.value), 1), this.setSelected(r, !0), this.buttons.forEach((i) => {
|
382
|
+
i.tabIndex = -1;
|
383
|
+
}), e.tabIndex = 0;
|
384
|
+
break;
|
385
|
+
}
|
386
|
+
}
|
387
|
+
}
|
388
|
+
async applySelects() {
|
389
|
+
await this.manageSelects(!0);
|
390
|
+
}
|
391
|
+
async manageSelects(t) {
|
392
|
+
if (this.buttons.length === 0)
|
393
|
+
return;
|
394
|
+
const e = this.buttons;
|
395
|
+
switch (this.selects) {
|
396
|
+
case "single": {
|
397
|
+
this.setAttribute("role", "radiogroup");
|
398
|
+
const r = [], i = e.map(async (o) => {
|
399
|
+
await o.updateComplete, o.setAttribute("role", "radio"), o.setAttribute(
|
400
|
+
"aria-checked",
|
401
|
+
o.selected ? "true" : "false"
|
402
|
+
), o.selected && r.push(o);
|
403
|
+
});
|
404
|
+
if (t)
|
405
|
+
break;
|
406
|
+
await Promise.all(i);
|
407
|
+
const s = r.map((o) => o.value);
|
408
|
+
this.setSelected(s || m);
|
409
|
+
break;
|
410
|
+
}
|
411
|
+
case "multiple": {
|
412
|
+
this.getAttribute("role") === "radiogroup" && this.removeAttribute("role");
|
413
|
+
const r = [], i = e.map(async (o) => {
|
414
|
+
await o.updateComplete, o.setAttribute("role", "checkbox"), o.setAttribute(
|
415
|
+
"aria-checked",
|
416
|
+
o.selected ? "true" : "false"
|
417
|
+
), o.selected && r.push(o.value);
|
418
|
+
});
|
419
|
+
if (t)
|
420
|
+
break;
|
421
|
+
await Promise.all(i);
|
422
|
+
const s = r.length > 0 ? r : m;
|
423
|
+
this.setSelected(s);
|
424
|
+
break;
|
425
|
+
}
|
426
|
+
default:
|
427
|
+
if (this.selected.length > 0) {
|
428
|
+
const r = [], i = e.map(async (s) => {
|
429
|
+
await s.updateComplete, s.setAttribute("role", "button"), s.selected ? (s.setAttribute("aria-pressed", "true"), r.push(s)) : s.removeAttribute("aria-pressed");
|
430
|
+
});
|
431
|
+
if (t)
|
432
|
+
break;
|
433
|
+
await Promise.all(i), this.setSelected(r.map((s) => s.value));
|
434
|
+
} else {
|
435
|
+
this.buttons.forEach((r) => {
|
436
|
+
r.setAttribute("role", "button");
|
437
|
+
});
|
438
|
+
break;
|
439
|
+
}
|
440
|
+
}
|
441
|
+
this.hasAttribute("role") || this.setAttribute("role", "toolbar");
|
442
|
+
}
|
443
|
+
render() {
|
444
|
+
return z`
|
445
|
+
<slot role="presentation" @slotchange=${this.manageButtons}></slot>
|
446
|
+
`;
|
447
|
+
}
|
448
|
+
firstUpdated(t) {
|
449
|
+
super.firstUpdated(t), this.addEventListener("click", this.handleClick);
|
450
|
+
}
|
451
|
+
updated(t) {
|
452
|
+
super.updated(t), t.has("selects") && (this.manageSelects(), this.manageChildren(), this.selects ? this.renderRoot.addEventListener(
|
453
|
+
"change",
|
454
|
+
this.handleActionButtonChange
|
455
|
+
) : this.renderRoot.removeEventListener(
|
456
|
+
"change",
|
457
|
+
this.handleActionButtonChange
|
458
|
+
)), (t.has("quiet") || t.has("emphasized") || t.has("size") || t.has("staticColor")) && this.manageChildren(t), t.has("label") && (this.label || t.get("label") !== void 0) && (this.label.length > 0 ? this.setAttribute("aria-label", this.label) : this.removeAttribute("aria-label"));
|
459
|
+
}
|
460
|
+
manageChildren(t) {
|
461
|
+
this.buttons.forEach((e) => {
|
462
|
+
(this.quiet || t != null && t.get("quiet")) && (e.quiet = this.quiet), (this.emphasized || t != null && t.get("emphasized")) && (e.emphasized = this.emphasized), (this.staticColor || t != null && t.get("staticColor")) && (e.staticColor = this.staticColor), (this.selects || !this.hasManaged) && (e.selected = this.selected.includes(e.value)), this.size && (this.size !== "m" || (t == null ? void 0 : t.get("size")) !== void 0) && (e.size = this.size);
|
463
|
+
});
|
464
|
+
}
|
465
|
+
}
|
466
|
+
d([
|
467
|
+
l({ type: Boolean, reflect: !0 })
|
468
|
+
], u.prototype, "compact", 2);
|
469
|
+
d([
|
470
|
+
l({ type: Boolean, reflect: !0 })
|
471
|
+
], u.prototype, "emphasized", 2);
|
472
|
+
d([
|
473
|
+
l({ type: Boolean, reflect: !0 })
|
474
|
+
], u.prototype, "justified", 2);
|
475
|
+
d([
|
476
|
+
l({ type: String })
|
477
|
+
], u.prototype, "label", 2);
|
478
|
+
d([
|
479
|
+
l({ type: Boolean, reflect: !0 })
|
480
|
+
], u.prototype, "quiet", 2);
|
481
|
+
d([
|
482
|
+
l({ type: String })
|
483
|
+
], u.prototype, "selects", 2);
|
484
|
+
d([
|
485
|
+
l({ reflect: !0, attribute: "static-color" })
|
486
|
+
], u.prototype, "staticColor", 2);
|
487
|
+
d([
|
488
|
+
l({ type: Boolean, reflect: !0 })
|
489
|
+
], u.prototype, "vertical", 2);
|
490
|
+
d([
|
491
|
+
l({ type: Array })
|
492
|
+
], u.prototype, "selected", 1);
|
493
|
+
d([
|
494
|
+
I("slot")
|
495
|
+
], u.prototype, "slotElement", 2);
|
496
|
+
customElements.get("luzmo-action-group") || customElements.define("luzmo-action-group", u);
|
497
|
+
export {
|
498
|
+
C as F,
|
499
|
+
u as L,
|
500
|
+
y as R
|
501
|
+
};
|
@@ -0,0 +1,24 @@
|
|
1
|
+
/*! * A kit of modern Luzmo Web Components for analytics in your web application.
|
2
|
+
*
|
3
|
+
* Copyright © 2024 Luzmo
|
4
|
+
* All rights reserved.
|
5
|
+
* Luzmo web components (“Luzmo Web Components”)
|
6
|
+
* must be used according to the Luzmo Terms of Service.
|
7
|
+
* This license allows users with a current active Luzmo account
|
8
|
+
* to use the Luzmo Web Components. This license terminates
|
9
|
+
* automatically if a user no longer has an active Luzmo account.
|
10
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
11
|
+
*
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
13
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
14
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
15
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
16
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
17
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
|
+
* SOFTWARE.
|
19
|
+
* */
|
20
|
+
import { Popover as o } from "./popover-Bwnkg-5-.js";
|
21
|
+
customElements.get("luzmo-popover") || customElements.define("luzmo-popover", o);
|
22
|
+
export {
|
23
|
+
o as Popover
|
24
|
+
};
|