@luzmo/lucero 1.0.1-alpha.14 → 1.0.1-alpha.16
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/components/accordion/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +156 -109
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/package.json +1 -1
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-DQcRdcUa.js +0 -53
- package/components/clear-button-OFUFFe7G.cjs +0 -18
- package/components/close-button-Cbnb7XXj.cjs +0 -18
- package/components/close-button-CqHYZhum.js +0 -51
- package/components/color-controller-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cl54m8Yh.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/index-Wq3qZJGh.cjs +0 -113
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-4nDFv1Lq.js +0 -229
- package/components/luzmo-icons-D4IvHgVd.cjs +0 -29
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-CaH1si5b.cjs +0 -26
- package/components/picker-BfBP7XJN.js +0 -461
- package/components/picker-xIphqE6d.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-CeG75PPO.cjs +0 -85
- package/components/text-field-DCl-AFM-.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs}
RENAMED
|
@@ -15,17 +15,19 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
"use strict";
|
|
19
|
+
class SlottableRequestEvent extends Event {
|
|
20
|
+
constructor(name, data, key) {
|
|
21
|
+
super("slottable-request", {
|
|
22
|
+
bubbles: false,
|
|
23
|
+
cancelable: true,
|
|
24
|
+
composed: false
|
|
25
|
+
});
|
|
26
|
+
this.name = name;
|
|
27
|
+
this.data = data;
|
|
28
|
+
this.slotName = key === void 0 ? name : `${name}.${key}`;
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} : (n.push(...e), t.setAttribute(s, n.join(" ")), () => c(t, s, e));
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
c as a,
|
|
30
|
-
u as c
|
|
31
|
-
};
|
|
31
|
+
const removeSlottableRequest = Symbol("remove-slottable-request");
|
|
32
|
+
exports.SlottableRequestEvent = SlottableRequestEvent;
|
|
33
|
+
exports.removeSlottableRequest = removeSlottableRequest;
|
package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js}
RENAMED
|
@@ -15,17 +15,20 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
class
|
|
19
|
-
constructor(
|
|
18
|
+
class SlottableRequestEvent extends Event {
|
|
19
|
+
constructor(name, data, key) {
|
|
20
20
|
super("slottable-request", {
|
|
21
|
-
bubbles:
|
|
22
|
-
cancelable:
|
|
23
|
-
composed:
|
|
24
|
-
})
|
|
21
|
+
bubbles: false,
|
|
22
|
+
cancelable: true,
|
|
23
|
+
composed: false
|
|
24
|
+
});
|
|
25
|
+
this.name = name;
|
|
26
|
+
this.data = data;
|
|
27
|
+
this.slotName = key === void 0 ? name : `${name}.${key}`;
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
|
-
const
|
|
30
|
+
const removeSlottableRequest = Symbol("remove-slottable-request");
|
|
28
31
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
SlottableRequestEvent as S,
|
|
33
|
+
removeSlottableRequest as r
|
|
31
34
|
};
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
"use strict";
|
|
19
|
+
const platform = require("./platform-CxDar3Dn.cjs");
|
|
20
|
+
const IS_MOBILE = "(max-width: 743px) and (hover: none) and (pointer: coarse)";
|
|
21
|
+
class MatchMediaController {
|
|
22
|
+
constructor(host, query) {
|
|
23
|
+
this.key = Symbol("match-media-key");
|
|
24
|
+
this.matches = false;
|
|
25
|
+
this.host = host;
|
|
26
|
+
this.host.addController(this);
|
|
27
|
+
if (typeof window === "undefined") {
|
|
28
|
+
this.matches = false;
|
|
29
|
+
} else {
|
|
30
|
+
this.media = window.matchMedia(query);
|
|
31
|
+
this.matches = this.media.matches;
|
|
32
|
+
}
|
|
33
|
+
this.onChange = this.onChange.bind(this);
|
|
34
|
+
host.addController(this);
|
|
35
|
+
}
|
|
36
|
+
hostConnected() {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = this.media) == null ? void 0 : _a.addEventListener("change", this.onChange);
|
|
39
|
+
}
|
|
40
|
+
hostDisconnected() {
|
|
41
|
+
var _a;
|
|
42
|
+
(_a = this.media) == null ? void 0 : _a.removeEventListener("change", this.onChange);
|
|
43
|
+
}
|
|
44
|
+
onChange(event) {
|
|
45
|
+
if (this.matches === event.matches) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.matches = event.matches;
|
|
49
|
+
this.host.requestUpdate(this.key, !this.matches);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var InteractionTypes = /* @__PURE__ */ ((InteractionTypes2) => {
|
|
53
|
+
InteractionTypes2[InteractionTypes2["desktop"] = 0] = "desktop";
|
|
54
|
+
InteractionTypes2[InteractionTypes2["mobile"] = 1] = "mobile";
|
|
55
|
+
return InteractionTypes2;
|
|
56
|
+
})(InteractionTypes || {});
|
|
57
|
+
const SAFARI_FOCUS_RING_CLASS = "remove-focus-ring-safari-hack";
|
|
58
|
+
class InteractionController {
|
|
59
|
+
constructor(target, host) {
|
|
60
|
+
this.target = target;
|
|
61
|
+
this.host = host;
|
|
62
|
+
this.preventNextToggle = "no";
|
|
63
|
+
this.pointerdownState = false;
|
|
64
|
+
this.enterKeydownOn = null;
|
|
65
|
+
this._open = false;
|
|
66
|
+
this.target = target;
|
|
67
|
+
this.host = host;
|
|
68
|
+
this.host.addController(this);
|
|
69
|
+
this.init();
|
|
70
|
+
}
|
|
71
|
+
get activelyOpening() {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
get open() {
|
|
75
|
+
return this._open;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Set `open`
|
|
79
|
+
*/
|
|
80
|
+
set open(open) {
|
|
81
|
+
if (this._open === open) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this._open = open;
|
|
85
|
+
if (this.overlay) {
|
|
86
|
+
this.host.open = open;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
customElements.whenDefined("luzmo-overlay").then(async () => {
|
|
90
|
+
const { LuzmoOverlay: LuzmoOverlay2 } = await Promise.resolve().then(() => require("./overlay/index.cjs"));
|
|
91
|
+
this.overlay = new LuzmoOverlay2();
|
|
92
|
+
this.host.open = true;
|
|
93
|
+
this.host.requestUpdate();
|
|
94
|
+
});
|
|
95
|
+
Promise.resolve().then(() => require("./overlay/index.cjs"));
|
|
96
|
+
}
|
|
97
|
+
get overlay() {
|
|
98
|
+
return this._overlay;
|
|
99
|
+
}
|
|
100
|
+
set overlay(overlay) {
|
|
101
|
+
if (!overlay) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (this.overlay === overlay) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this._overlay = overlay;
|
|
108
|
+
this.initOverlay();
|
|
109
|
+
}
|
|
110
|
+
releaseDescription() {
|
|
111
|
+
}
|
|
112
|
+
handleBeforetoggle(event) {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
if (event.composedPath()[0] !== event.target) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (event.newState === "closed") {
|
|
118
|
+
if (this.preventNextToggle === "no") {
|
|
119
|
+
this.open = false;
|
|
120
|
+
} else if (!this.pointerdownState) {
|
|
121
|
+
(_a = this.overlay) == null ? void 0 : _a.manuallyKeepOpen();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!this.open) {
|
|
125
|
+
this.host.optionsMenu.updateSelectedItemIndex();
|
|
126
|
+
if (
|
|
127
|
+
// pickers can have submenus, selects can not
|
|
128
|
+
typeof ((_b = this.host.optionsMenu) == null ? void 0 : _b.closeDescendentOverlays) === "function"
|
|
129
|
+
) {
|
|
130
|
+
this.host.optionsMenu.closeDescendentOverlays();
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
initOverlay() {
|
|
135
|
+
if (this.overlay) {
|
|
136
|
+
this.overlay.addEventListener("beforetoggle", (event) => {
|
|
137
|
+
this.handleBeforetoggle(
|
|
138
|
+
event
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
this.overlay.type = this.host.isMobile.matches ? "modal" : "auto";
|
|
142
|
+
this.overlay.triggerElement = this.host;
|
|
143
|
+
this.overlay.placement = this.host.isMobile.matches ? void 0 : this.host.placement;
|
|
144
|
+
this.overlay.receivesFocus = "true";
|
|
145
|
+
this.overlay.willPreventClose = this.preventNextToggle !== "no" && this.open;
|
|
146
|
+
this.overlay.addEventListener(
|
|
147
|
+
"slottable-request",
|
|
148
|
+
this.host.handleSlottableRequest
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
handlePointerdown(_event) {
|
|
153
|
+
}
|
|
154
|
+
handleButtonFocus(event) {
|
|
155
|
+
if (this.preventNextToggle === "maybe" && event.relatedTarget === this.host.optionsMenu) {
|
|
156
|
+
this.preventNextToggle = "yes";
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
handleActivate(_event) {
|
|
160
|
+
}
|
|
161
|
+
/* c8 ignore next 3 */
|
|
162
|
+
init() {
|
|
163
|
+
}
|
|
164
|
+
abort() {
|
|
165
|
+
var _a;
|
|
166
|
+
this.releaseDescription();
|
|
167
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
168
|
+
}
|
|
169
|
+
hostConnected() {
|
|
170
|
+
this.init();
|
|
171
|
+
}
|
|
172
|
+
hostDisconnected() {
|
|
173
|
+
var _a;
|
|
174
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
175
|
+
}
|
|
176
|
+
hostUpdated() {
|
|
177
|
+
if (this.overlay && this.host.dependencyManager.loaded && this.host.open !== this.overlay.open) {
|
|
178
|
+
this.overlay.willPreventClose = this.preventNextToggle !== "no";
|
|
179
|
+
this.overlay.open = this.host.open;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
class DesktopController extends InteractionController {
|
|
184
|
+
constructor() {
|
|
185
|
+
super(...arguments);
|
|
186
|
+
this.type = InteractionTypes.desktop;
|
|
187
|
+
}
|
|
188
|
+
handlePointerdown(event) {
|
|
189
|
+
const target = event.target;
|
|
190
|
+
const clearButton = target.closest(".clear-icon");
|
|
191
|
+
if (clearButton) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (event.button !== 0 || event.pointerType === "touch") {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
this.pointerdownState = this.open;
|
|
198
|
+
this.preventNextToggle = "maybe";
|
|
199
|
+
let cleanupAction = 0;
|
|
200
|
+
const cleanup = () => {
|
|
201
|
+
cancelAnimationFrame(cleanupAction);
|
|
202
|
+
cleanupAction = requestAnimationFrame(() => {
|
|
203
|
+
document.removeEventListener("pointerup", cleanup);
|
|
204
|
+
document.removeEventListener("pointercancel", cleanup);
|
|
205
|
+
this.target.removeEventListener("click", cleanup);
|
|
206
|
+
requestAnimationFrame(() => {
|
|
207
|
+
this.preventNextToggle = "no";
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
document.addEventListener("pointerup", cleanup);
|
|
212
|
+
document.addEventListener("pointercancel", cleanup);
|
|
213
|
+
this.target.addEventListener("click", cleanup);
|
|
214
|
+
this.handleActivate();
|
|
215
|
+
}
|
|
216
|
+
handleActivate(event) {
|
|
217
|
+
if (this.enterKeydownOn && this.enterKeydownOn !== this.target) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (this.preventNextToggle === "yes") {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if ((event == null ? void 0 : event.type) === "click" && this.open !== this.pointerdownState) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
this.host.toggle();
|
|
227
|
+
}
|
|
228
|
+
init() {
|
|
229
|
+
var _a;
|
|
230
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
231
|
+
this.abortController = new AbortController();
|
|
232
|
+
const { signal } = this.abortController;
|
|
233
|
+
this.target.addEventListener(
|
|
234
|
+
"click",
|
|
235
|
+
(event) => this.handleActivate(event),
|
|
236
|
+
{
|
|
237
|
+
signal
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
this.target.addEventListener(
|
|
241
|
+
"pointerdown",
|
|
242
|
+
(event) => this.handlePointerdown(event),
|
|
243
|
+
{ signal }
|
|
244
|
+
);
|
|
245
|
+
this.target.addEventListener(
|
|
246
|
+
"focus",
|
|
247
|
+
(event) => this.handleButtonFocus(event),
|
|
248
|
+
{
|
|
249
|
+
signal
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
class MobileController extends InteractionController {
|
|
255
|
+
constructor() {
|
|
256
|
+
super(...arguments);
|
|
257
|
+
this.type = InteractionTypes.mobile;
|
|
258
|
+
}
|
|
259
|
+
handleClick(event) {
|
|
260
|
+
const target = event.target;
|
|
261
|
+
const clearButton = target.closest(".clear-button");
|
|
262
|
+
if (!clearButton) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (this.preventNextToggle === "no") {
|
|
266
|
+
this.open = !this.open;
|
|
267
|
+
}
|
|
268
|
+
this.preventNextToggle = "no";
|
|
269
|
+
}
|
|
270
|
+
handlePointerdown(event) {
|
|
271
|
+
const target = event.target;
|
|
272
|
+
const clearButton = target.closest(".clear-button");
|
|
273
|
+
if (!clearButton) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
this.preventNextToggle = this.open ? "yes" : "no";
|
|
277
|
+
if (platform.isWebKit()) {
|
|
278
|
+
this.target.classList.add(SAFARI_FOCUS_RING_CLASS);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
handleFocusOut() {
|
|
282
|
+
if (this.host.open) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (platform.isWebKit() && this.target.classList.contains(SAFARI_FOCUS_RING_CLASS)) {
|
|
286
|
+
this.target.classList.remove(SAFARI_FOCUS_RING_CLASS);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
init() {
|
|
290
|
+
var _a;
|
|
291
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
292
|
+
this.abortController = new AbortController();
|
|
293
|
+
const { signal } = this.abortController;
|
|
294
|
+
this.target.addEventListener(
|
|
295
|
+
"click",
|
|
296
|
+
(event) => this.handleClick(event),
|
|
297
|
+
{
|
|
298
|
+
signal
|
|
299
|
+
}
|
|
300
|
+
);
|
|
301
|
+
this.target.addEventListener(
|
|
302
|
+
"pointerdown",
|
|
303
|
+
(event) => this.handlePointerdown(event),
|
|
304
|
+
{ signal }
|
|
305
|
+
);
|
|
306
|
+
this.target.addEventListener("focusout", () => this.handleFocusOut(), {
|
|
307
|
+
signal
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const strategies = {
|
|
312
|
+
desktop: DesktopController,
|
|
313
|
+
mobile: MobileController
|
|
314
|
+
};
|
|
315
|
+
exports.IS_MOBILE = IS_MOBILE;
|
|
316
|
+
exports.MatchMediaController = MatchMediaController;
|
|
317
|
+
exports.strategies = strategies;
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { f as isWebKit } from "./platform-Cxn0WbyT.js";
|
|
19
|
+
const IS_MOBILE = "(max-width: 743px) and (hover: none) and (pointer: coarse)";
|
|
20
|
+
class MatchMediaController {
|
|
21
|
+
constructor(host, query) {
|
|
22
|
+
this.key = Symbol("match-media-key");
|
|
23
|
+
this.matches = false;
|
|
24
|
+
this.host = host;
|
|
25
|
+
this.host.addController(this);
|
|
26
|
+
if (typeof window === "undefined") {
|
|
27
|
+
this.matches = false;
|
|
28
|
+
} else {
|
|
29
|
+
this.media = window.matchMedia(query);
|
|
30
|
+
this.matches = this.media.matches;
|
|
31
|
+
}
|
|
32
|
+
this.onChange = this.onChange.bind(this);
|
|
33
|
+
host.addController(this);
|
|
34
|
+
}
|
|
35
|
+
hostConnected() {
|
|
36
|
+
var _a;
|
|
37
|
+
(_a = this.media) == null ? void 0 : _a.addEventListener("change", this.onChange);
|
|
38
|
+
}
|
|
39
|
+
hostDisconnected() {
|
|
40
|
+
var _a;
|
|
41
|
+
(_a = this.media) == null ? void 0 : _a.removeEventListener("change", this.onChange);
|
|
42
|
+
}
|
|
43
|
+
onChange(event) {
|
|
44
|
+
if (this.matches === event.matches) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this.matches = event.matches;
|
|
48
|
+
this.host.requestUpdate(this.key, !this.matches);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
var InteractionTypes = /* @__PURE__ */ ((InteractionTypes2) => {
|
|
52
|
+
InteractionTypes2[InteractionTypes2["desktop"] = 0] = "desktop";
|
|
53
|
+
InteractionTypes2[InteractionTypes2["mobile"] = 1] = "mobile";
|
|
54
|
+
return InteractionTypes2;
|
|
55
|
+
})(InteractionTypes || {});
|
|
56
|
+
const SAFARI_FOCUS_RING_CLASS = "remove-focus-ring-safari-hack";
|
|
57
|
+
class InteractionController {
|
|
58
|
+
constructor(target, host) {
|
|
59
|
+
this.target = target;
|
|
60
|
+
this.host = host;
|
|
61
|
+
this.preventNextToggle = "no";
|
|
62
|
+
this.pointerdownState = false;
|
|
63
|
+
this.enterKeydownOn = null;
|
|
64
|
+
this._open = false;
|
|
65
|
+
this.target = target;
|
|
66
|
+
this.host = host;
|
|
67
|
+
this.host.addController(this);
|
|
68
|
+
this.init();
|
|
69
|
+
}
|
|
70
|
+
get activelyOpening() {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
get open() {
|
|
74
|
+
return this._open;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Set `open`
|
|
78
|
+
*/
|
|
79
|
+
set open(open) {
|
|
80
|
+
if (this._open === open) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this._open = open;
|
|
84
|
+
if (this.overlay) {
|
|
85
|
+
this.host.open = open;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
customElements.whenDefined("luzmo-overlay").then(async () => {
|
|
89
|
+
const { LuzmoOverlay: LuzmoOverlay2 } = await import("./overlay/index.js");
|
|
90
|
+
this.overlay = new LuzmoOverlay2();
|
|
91
|
+
this.host.open = true;
|
|
92
|
+
this.host.requestUpdate();
|
|
93
|
+
});
|
|
94
|
+
import("./overlay/index.js");
|
|
95
|
+
}
|
|
96
|
+
get overlay() {
|
|
97
|
+
return this._overlay;
|
|
98
|
+
}
|
|
99
|
+
set overlay(overlay) {
|
|
100
|
+
if (!overlay) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (this.overlay === overlay) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
this._overlay = overlay;
|
|
107
|
+
this.initOverlay();
|
|
108
|
+
}
|
|
109
|
+
releaseDescription() {
|
|
110
|
+
}
|
|
111
|
+
handleBeforetoggle(event) {
|
|
112
|
+
var _a, _b;
|
|
113
|
+
if (event.composedPath()[0] !== event.target) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (event.newState === "closed") {
|
|
117
|
+
if (this.preventNextToggle === "no") {
|
|
118
|
+
this.open = false;
|
|
119
|
+
} else if (!this.pointerdownState) {
|
|
120
|
+
(_a = this.overlay) == null ? void 0 : _a.manuallyKeepOpen();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (!this.open) {
|
|
124
|
+
this.host.optionsMenu.updateSelectedItemIndex();
|
|
125
|
+
if (
|
|
126
|
+
// pickers can have submenus, selects can not
|
|
127
|
+
typeof ((_b = this.host.optionsMenu) == null ? void 0 : _b.closeDescendentOverlays) === "function"
|
|
128
|
+
) {
|
|
129
|
+
this.host.optionsMenu.closeDescendentOverlays();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
initOverlay() {
|
|
134
|
+
if (this.overlay) {
|
|
135
|
+
this.overlay.addEventListener("beforetoggle", (event) => {
|
|
136
|
+
this.handleBeforetoggle(
|
|
137
|
+
event
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
this.overlay.type = this.host.isMobile.matches ? "modal" : "auto";
|
|
141
|
+
this.overlay.triggerElement = this.host;
|
|
142
|
+
this.overlay.placement = this.host.isMobile.matches ? void 0 : this.host.placement;
|
|
143
|
+
this.overlay.receivesFocus = "true";
|
|
144
|
+
this.overlay.willPreventClose = this.preventNextToggle !== "no" && this.open;
|
|
145
|
+
this.overlay.addEventListener(
|
|
146
|
+
"slottable-request",
|
|
147
|
+
this.host.handleSlottableRequest
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
handlePointerdown(_event) {
|
|
152
|
+
}
|
|
153
|
+
handleButtonFocus(event) {
|
|
154
|
+
if (this.preventNextToggle === "maybe" && event.relatedTarget === this.host.optionsMenu) {
|
|
155
|
+
this.preventNextToggle = "yes";
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
handleActivate(_event) {
|
|
159
|
+
}
|
|
160
|
+
/* c8 ignore next 3 */
|
|
161
|
+
init() {
|
|
162
|
+
}
|
|
163
|
+
abort() {
|
|
164
|
+
var _a;
|
|
165
|
+
this.releaseDescription();
|
|
166
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
167
|
+
}
|
|
168
|
+
hostConnected() {
|
|
169
|
+
this.init();
|
|
170
|
+
}
|
|
171
|
+
hostDisconnected() {
|
|
172
|
+
var _a;
|
|
173
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
174
|
+
}
|
|
175
|
+
hostUpdated() {
|
|
176
|
+
if (this.overlay && this.host.dependencyManager.loaded && this.host.open !== this.overlay.open) {
|
|
177
|
+
this.overlay.willPreventClose = this.preventNextToggle !== "no";
|
|
178
|
+
this.overlay.open = this.host.open;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
class DesktopController extends InteractionController {
|
|
183
|
+
constructor() {
|
|
184
|
+
super(...arguments);
|
|
185
|
+
this.type = InteractionTypes.desktop;
|
|
186
|
+
}
|
|
187
|
+
handlePointerdown(event) {
|
|
188
|
+
const target = event.target;
|
|
189
|
+
const clearButton = target.closest(".clear-icon");
|
|
190
|
+
if (clearButton) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (event.button !== 0 || event.pointerType === "touch") {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
this.pointerdownState = this.open;
|
|
197
|
+
this.preventNextToggle = "maybe";
|
|
198
|
+
let cleanupAction = 0;
|
|
199
|
+
const cleanup = () => {
|
|
200
|
+
cancelAnimationFrame(cleanupAction);
|
|
201
|
+
cleanupAction = requestAnimationFrame(() => {
|
|
202
|
+
document.removeEventListener("pointerup", cleanup);
|
|
203
|
+
document.removeEventListener("pointercancel", cleanup);
|
|
204
|
+
this.target.removeEventListener("click", cleanup);
|
|
205
|
+
requestAnimationFrame(() => {
|
|
206
|
+
this.preventNextToggle = "no";
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
document.addEventListener("pointerup", cleanup);
|
|
211
|
+
document.addEventListener("pointercancel", cleanup);
|
|
212
|
+
this.target.addEventListener("click", cleanup);
|
|
213
|
+
this.handleActivate();
|
|
214
|
+
}
|
|
215
|
+
handleActivate(event) {
|
|
216
|
+
if (this.enterKeydownOn && this.enterKeydownOn !== this.target) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (this.preventNextToggle === "yes") {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if ((event == null ? void 0 : event.type) === "click" && this.open !== this.pointerdownState) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
this.host.toggle();
|
|
226
|
+
}
|
|
227
|
+
init() {
|
|
228
|
+
var _a;
|
|
229
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
230
|
+
this.abortController = new AbortController();
|
|
231
|
+
const { signal } = this.abortController;
|
|
232
|
+
this.target.addEventListener(
|
|
233
|
+
"click",
|
|
234
|
+
(event) => this.handleActivate(event),
|
|
235
|
+
{
|
|
236
|
+
signal
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
this.target.addEventListener(
|
|
240
|
+
"pointerdown",
|
|
241
|
+
(event) => this.handlePointerdown(event),
|
|
242
|
+
{ signal }
|
|
243
|
+
);
|
|
244
|
+
this.target.addEventListener(
|
|
245
|
+
"focus",
|
|
246
|
+
(event) => this.handleButtonFocus(event),
|
|
247
|
+
{
|
|
248
|
+
signal
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
class MobileController extends InteractionController {
|
|
254
|
+
constructor() {
|
|
255
|
+
super(...arguments);
|
|
256
|
+
this.type = InteractionTypes.mobile;
|
|
257
|
+
}
|
|
258
|
+
handleClick(event) {
|
|
259
|
+
const target = event.target;
|
|
260
|
+
const clearButton = target.closest(".clear-button");
|
|
261
|
+
if (!clearButton) {
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
if (this.preventNextToggle === "no") {
|
|
265
|
+
this.open = !this.open;
|
|
266
|
+
}
|
|
267
|
+
this.preventNextToggle = "no";
|
|
268
|
+
}
|
|
269
|
+
handlePointerdown(event) {
|
|
270
|
+
const target = event.target;
|
|
271
|
+
const clearButton = target.closest(".clear-button");
|
|
272
|
+
if (!clearButton) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
this.preventNextToggle = this.open ? "yes" : "no";
|
|
276
|
+
if (isWebKit()) {
|
|
277
|
+
this.target.classList.add(SAFARI_FOCUS_RING_CLASS);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
handleFocusOut() {
|
|
281
|
+
if (this.host.open) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (isWebKit() && this.target.classList.contains(SAFARI_FOCUS_RING_CLASS)) {
|
|
285
|
+
this.target.classList.remove(SAFARI_FOCUS_RING_CLASS);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
init() {
|
|
289
|
+
var _a;
|
|
290
|
+
(_a = this.abortController) == null ? void 0 : _a.abort();
|
|
291
|
+
this.abortController = new AbortController();
|
|
292
|
+
const { signal } = this.abortController;
|
|
293
|
+
this.target.addEventListener(
|
|
294
|
+
"click",
|
|
295
|
+
(event) => this.handleClick(event),
|
|
296
|
+
{
|
|
297
|
+
signal
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
this.target.addEventListener(
|
|
301
|
+
"pointerdown",
|
|
302
|
+
(event) => this.handlePointerdown(event),
|
|
303
|
+
{ signal }
|
|
304
|
+
);
|
|
305
|
+
this.target.addEventListener("focusout", () => this.handleFocusOut(), {
|
|
306
|
+
signal
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
const strategies = {
|
|
311
|
+
desktop: DesktopController,
|
|
312
|
+
mobile: MobileController
|
|
313
|
+
};
|
|
314
|
+
export {
|
|
315
|
+
IS_MOBILE as I,
|
|
316
|
+
MatchMediaController as M,
|
|
317
|
+
strategies as s
|
|
318
|
+
};
|