@trintel/zooy 1.0.1-beta.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/LICENSE +190 -0
- package/README.md +471 -0
- package/dist/chunks/16-30f5E9no.js +1 -0
- package/dist/chunks/16-41wFkj7S.js +1 -0
- package/dist/chunks/16-4Ffg4DOO.js +1 -0
- package/dist/chunks/16-8pr5mbIO.js +28 -0
- package/dist/chunks/16-B56B50XT.js +1 -0
- package/dist/chunks/16-BFJN6B6d.js +39 -0
- package/dist/chunks/16-BTonF5Je.js +29 -0
- package/dist/chunks/16-BiShwKPX.js +28 -0
- package/dist/chunks/16-BwDdccyH.js +33 -0
- package/dist/chunks/16-C7Xs-wKv.js +1 -0
- package/dist/chunks/16-CDRTWf-C.js +21 -0
- package/dist/chunks/16-CSWwhDUY.js +21 -0
- package/dist/chunks/16-ChlL35BX.js +62 -0
- package/dist/chunks/16-CpNRIuiB.js +1 -0
- package/dist/chunks/16-CqC9427V.js +21 -0
- package/dist/chunks/16-Cubm18Em.js +1 -0
- package/dist/chunks/16-D3Ol0pdg.js +21 -0
- package/dist/chunks/16-DH311Of_.js +1 -0
- package/dist/chunks/16-Dlq3qxDh.js +1 -0
- package/dist/chunks/16-Drl9-5Gn.js +21 -0
- package/dist/chunks/16-Dt4v0bcc.js +1 -0
- package/dist/chunks/16-DylBiJnm.js +1 -0
- package/dist/chunks/20-CZPIOG-A.js +84 -0
- package/dist/chunks/20-gmyNFvDv.js +1 -0
- package/dist/chunks/button-DdJepOoE.js +271 -0
- package/dist/chunks/button-skeleton-COf2kCDL.js +48 -0
- package/dist/chunks/button-skeleton-rf3WDPTZ.js +21 -0
- package/dist/chunks/button-zHEPxpXa.js +66 -0
- package/dist/chunks/carbon-element-CbfPUYRT.js +1 -0
- package/dist/chunks/carbon-element-DzDuXiyl.js +25 -0
- package/dist/chunks/checkbox-B5mHvx0J.js +200 -0
- package/dist/chunks/checkbox-BRPCg-DN.js +40 -0
- package/dist/chunks/class-map-BfNAkUL_.js +5 -0
- package/dist/chunks/class-map-DEHG4tmw.js +32 -0
- package/dist/chunks/collection-helpers-BwUB2CEz.js +8 -0
- package/dist/chunks/collection-helpers-CYLIiyii.js +1 -0
- package/dist/chunks/content-switcher-item-DeGjVRQY.js +350 -0
- package/dist/chunks/content-switcher-item-DucclV1b.js +27 -0
- package/dist/chunks/defs-DMmigODC.js +1077 -0
- package/dist/chunks/defs-DPD20sPK.js +1 -0
- package/dist/chunks/directive-Dp4ZTz-F.js +5 -0
- package/dist/chunks/directive-kLG6oqUu.js +27 -0
- package/dist/chunks/dropdown-item-BgLQ1VLo.js +69 -0
- package/dist/chunks/dropdown-item-DPdwOION.js +620 -0
- package/dist/chunks/focus-B9JYe97T.js +20 -0
- package/dist/chunks/focus-rQSNiwy7.js +1 -0
- package/dist/chunks/form-D6Tce4-W.js +1 -0
- package/dist/chunks/form-DpI-v6DA.js +20 -0
- package/dist/chunks/host-listener-CN245INl.js +37 -0
- package/dist/chunks/host-listener-DD3oGxvg.js +16 -0
- package/dist/chunks/host-listener-gxrTpxgv.js +1 -0
- package/dist/chunks/host-listener-rUcT_LUW.js +1 -0
- package/dist/chunks/icon-loader-Dk_AU26w.js +7 -0
- package/dist/chunks/icon-loader-o_JYDmJX.js +1 -0
- package/dist/chunks/icon-loader-utils-BBjK16O-.js +5 -0
- package/dist/chunks/icon-loader-utils-BEOGXn0q.js +117 -0
- package/dist/chunks/if-defined-BdZRLDJ6.js +5 -0
- package/dist/chunks/if-defined-C0yJsxi2.js +10 -0
- package/dist/chunks/if-non-empty-CEHK-hqx.js +1 -0
- package/dist/chunks/if-non-empty-DTGflHtA.js +5 -0
- package/dist/chunks/index-16wphaSo.js +4 -0
- package/dist/chunks/index-27oFQaOS.js +37 -0
- package/dist/chunks/index-45EApaFs.js +205 -0
- package/dist/chunks/index-5jmZyISW.js +1 -0
- package/dist/chunks/index-B1vQ44Hl.js +363 -0
- package/dist/chunks/index-B3CDjjXh.js +214 -0
- package/dist/chunks/index-B3mXrMt1.js +24 -0
- package/dist/chunks/index-B7mGUQhz.js +79 -0
- package/dist/chunks/index-BBNaYDog.js +22 -0
- package/dist/chunks/index-BBt9OmO5.js +12 -0
- package/dist/chunks/index-BIaF1Dfx.js +107 -0
- package/dist/chunks/index-BJAuRs3y.js +75 -0
- package/dist/chunks/index-BJKftWYn.js +89 -0
- package/dist/chunks/index-BLjNrhkN.js +4 -0
- package/dist/chunks/index-BOTu9u-3.js +86 -0
- package/dist/chunks/index-BPVpH8ll.js +160 -0
- package/dist/chunks/index-BRuvyoCz.js +15 -0
- package/dist/chunks/index-BSgHSOVT.js +65 -0
- package/dist/chunks/index-BSh7UYcP.js +9 -0
- package/dist/chunks/index-BUxB7aWd.js +96 -0
- package/dist/chunks/index-BXIxcS00.js +22 -0
- package/dist/chunks/index-BXczHDk-.js +187 -0
- package/dist/chunks/index-BaVyBv2V.js +25 -0
- package/dist/chunks/index-BgbqX0uv.js +234 -0
- package/dist/chunks/index-BjQlt8g2.js +451 -0
- package/dist/chunks/index-BoNLj7PW.js +44 -0
- package/dist/chunks/index-BwIoRMDI.js +24 -0
- package/dist/chunks/index-Bwix1iwB.js +38 -0
- package/dist/chunks/index-BxVW3p3I.js +258 -0
- package/dist/chunks/index-ByKyGGzb.js +3 -0
- package/dist/chunks/index-ByTSSU1x.js +1 -0
- package/dist/chunks/index-C8LyfVmf.js +428 -0
- package/dist/chunks/index-CBbsFlsv.js +290 -0
- package/dist/chunks/index-CByffhPq.js +762 -0
- package/dist/chunks/index-CIbRjtWm.js +32 -0
- package/dist/chunks/index-CIzeMGQv.js +81 -0
- package/dist/chunks/index-CLGxSjLW.js +62 -0
- package/dist/chunks/index-CMF5Cawn.js +70 -0
- package/dist/chunks/index-CO-A2KY9.js +562 -0
- package/dist/chunks/index-CONgwvp0.js +12 -0
- package/dist/chunks/index-CT43RMOu.js +20 -0
- package/dist/chunks/index-CUgiXqyk.js +4 -0
- package/dist/chunks/index-C_K070Kn.js +284 -0
- package/dist/chunks/index-C_ttE2g9.js +16 -0
- package/dist/chunks/index-CcgnA1uu.js +29 -0
- package/dist/chunks/index-Cd7aoWrX.js +336 -0
- package/dist/chunks/index-Ce-pMzBC.js +19 -0
- package/dist/chunks/index-CgYZ66P_.js +187 -0
- package/dist/chunks/index-ChcHMeAS.js +35 -0
- package/dist/chunks/index-Cixdzvwd.js +682 -0
- package/dist/chunks/index-Clq0Fl19.js +15 -0
- package/dist/chunks/index-CtxTJnIm.js +58 -0
- package/dist/chunks/index-Cv1hWa_y.js +242 -0
- package/dist/chunks/index-CzTjJ8lP.js +432 -0
- package/dist/chunks/index-D0xRAPD5.js +75 -0
- package/dist/chunks/index-D25buhRm.js +79 -0
- package/dist/chunks/index-D4DqJG5_.js +16 -0
- package/dist/chunks/index-D5GGFPcS.js +251 -0
- package/dist/chunks/index-D5kiHJpX.js +413 -0
- package/dist/chunks/index-DEjRiv5B.js +1 -0
- package/dist/chunks/index-DFA4_spk.js +160 -0
- package/dist/chunks/index-DFZsXFsx.js +19 -0
- package/dist/chunks/index-DGauWNwV.js +156 -0
- package/dist/chunks/index-DIR0jr3f.js +127 -0
- package/dist/chunks/index-DNeagy5a.js +65 -0
- package/dist/chunks/index-DO0fmDR9.js +2 -0
- package/dist/chunks/index-DSitHBEh.js +36 -0
- package/dist/chunks/index-DW7ST0tB.js +1 -0
- package/dist/chunks/index-DWfFgEXE.js +110 -0
- package/dist/chunks/index-DX6WAtmo.js +874 -0
- package/dist/chunks/index-DaPfSuLu.js +393 -0
- package/dist/chunks/index-DbKlVm7y.js +74 -0
- package/dist/chunks/index-DdNZTQw1.js +48 -0
- package/dist/chunks/index-Dgi-m1K-.js +1 -0
- package/dist/chunks/index-Dh4uigJs.js +454 -0
- package/dist/chunks/index-DnYNK1mz.js +8 -0
- package/dist/chunks/index-DnierBep.js +510 -0
- package/dist/chunks/index-DnpSGM23.js +213 -0
- package/dist/chunks/index-DntY4deR.js +41 -0
- package/dist/chunks/index-Dp4A8k6C.js +103 -0
- package/dist/chunks/index-Dphpk5r2.js +1 -0
- package/dist/chunks/index-DrBrgF-v.js +49 -0
- package/dist/chunks/index-Dr_cqQ-_.js +77 -0
- package/dist/chunks/index-Dt-nBtrQ.js +26 -0
- package/dist/chunks/index-DurPWBYc.js +24 -0
- package/dist/chunks/index-DwTj7cFr.js +57 -0
- package/dist/chunks/index-DyZVAYLv.js +52 -0
- package/dist/chunks/index-Hh597Yu6.js +121 -0
- package/dist/chunks/index-LxkAuMAA.js +1 -0
- package/dist/chunks/index-OaQhvPR1.js +46 -0
- package/dist/chunks/index-UPr2EvBX.js +149 -0
- package/dist/chunks/index-WNXgzThF.js +2340 -0
- package/dist/chunks/index-WvrCPen2.js +367 -0
- package/dist/chunks/index-cTXIVcWI.js +45 -0
- package/dist/chunks/index-caLn8cu1.js +1603 -0
- package/dist/chunks/index-hLI0Bnyb.js +77 -0
- package/dist/chunks/index-jBse-XgU.js +35 -0
- package/dist/chunks/index-oTjafsfN.js +25 -0
- package/dist/chunks/index-qNmuI3RB.js +149 -0
- package/dist/chunks/index-qiqzy9MI.js +23 -0
- package/dist/chunks/index-rwBsdvh6.js +87 -0
- package/dist/chunks/index-siqJUhKa.js +1 -0
- package/dist/chunks/index-w-G9CFId.js +1 -0
- package/dist/chunks/index-x6SeA7x7.js +405 -0
- package/dist/chunks/loading-icon-DJQIjg97.js +23 -0
- package/dist/chunks/loading-icon-DhJR6LyV.js +16 -0
- package/dist/chunks/main-DUusfqrI.js +18 -0
- package/dist/chunks/main-Dp7wHHgP.js +2882 -0
- package/dist/chunks/on-BPhwbVf3.js +10 -0
- package/dist/chunks/on-XRofyGQh.js +1 -0
- package/dist/chunks/property-DCYiZTFF.js +5 -0
- package/dist/chunks/property-pT1z5CCa.js +36 -0
- package/dist/chunks/query-CbRg6ZGy.js +23 -0
- package/dist/chunks/query-Dh8joWcT.js +9 -0
- package/dist/chunks/radio-group-manager-DBAEmhDM.js +1 -0
- package/dist/chunks/radio-group-manager-Du5wSOS1.js +102 -0
- package/dist/chunks/register-BK21_Wkj.js +11035 -0
- package/dist/chunks/register-BMNs2hNG.js +2157 -0
- package/dist/chunks/register-Cc9zkA5F.js +1 -0
- package/dist/chunks/register-JwwMwdRf.js +1273 -0
- package/dist/chunks/search-C3raqgOD.js +30 -0
- package/dist/chunks/search-CIhxkVjj.js +239 -0
- package/dist/chunks/select-item-4aISXm0r.js +76 -0
- package/dist/chunks/select-item-DjoxYopL.js +356 -0
- package/dist/chunks/settings-BPOpwVkr.js +594 -0
- package/dist/chunks/settings-CK2vhfPu.js +78 -0
- package/dist/chunks/shared-enums-BJDDuJr7.js +1 -0
- package/dist/chunks/shared-enums-DALKjQ7e.js +7 -0
- package/dist/chunks/state-Bpmgn27B.js +12 -0
- package/dist/chunks/state-FnSmMH94.js +5 -0
- package/dist/chunks/text-input-BygzMjjc.js +371 -0
- package/dist/chunks/text-input-cjcnMXO-.js +68 -0
- package/dist/chunks/tooltip-content-BjdZJ_Ui.js +134 -0
- package/dist/chunks/tooltip-content-DHyDYyOH.js +3 -0
- package/dist/chunks/tslib.es6-B07k2eac.js +1 -0
- package/dist/chunks/tslib.es6-C5gLNDSD.js +160 -0
- package/dist/chunks/unsafe-html-C_MKAcuC.js +5 -0
- package/dist/chunks/unsafe-html-D49sIpJ5.js +27 -0
- package/dist/chunks/validity-BMLNCMmP.js +1 -0
- package/dist/chunks/validity-CTz7ivUd.js +59 -0
- package/dist/zooy.cjs.js +1 -0
- package/dist/zooy.es.js +4 -0
- package/package.json +57 -0
- package/src/sass/carbon-icons.scss +46 -0
- package/src/sass/main.scss +7 -0
- package/src/sass/panels.scss +642 -0
- package/src/sass/reset.scss +43 -0
- package/src/sass/split.scss +131 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function r(e,...n){return e.addEventListener(...n),{release(){return e.removeEventListener(...n),null}}}exports.on=r;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";const u=require("./settings-CK2vhfPu.js");/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const l={attribute:!0,type:String,converter:u.u,reflect:!1,hasChanged:u.f},p=(t=l,o,e)=>{const{kind:a,metadata:i}=e;let r=globalThis.litPropertyMetadata.get(i);if(r===void 0&&globalThis.litPropertyMetadata.set(i,r=new Map),a==="setter"&&((t=Object.create(t)).wrapped=!0),r.set(e.name,t),a==="accessor"){const{name:s}=e;return{set(n){const c=o.get.call(this);o.set.call(this,n),this.requestUpdate(s,c,t)},init(n){return n!==void 0&&this.C(s,void 0,t,n),n}}}if(a==="setter"){const{name:s}=e;return function(n){const c=this[s];o.call(this,n),this.requestUpdate(s,c,t)}}throw Error("Unsupported decorator location: "+a)};function d(t){return(o,e)=>typeof e=="object"?p(t,o,e):((a,i,r)=>{const s=i.hasOwnProperty(r);return i.constructor.createProperty(r,a),s?Object.getOwnPropertyDescriptor(i,r):void 0})(t,o,e)}exports.n=d;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { f as p, u as l } from "./settings-BPOpwVkr.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2017 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
const u = { attribute: !0, type: String, converter: l, reflect: !1, hasChanged: p }, d = (t = u, s, e) => {
|
|
8
|
+
const { kind: a, metadata: i } = e;
|
|
9
|
+
let r = globalThis.litPropertyMetadata.get(i);
|
|
10
|
+
if (r === void 0 && globalThis.litPropertyMetadata.set(i, r = /* @__PURE__ */ new Map()), a === "setter" && ((t = Object.create(t)).wrapped = !0), r.set(e.name, t), a === "accessor") {
|
|
11
|
+
const { name: o } = e;
|
|
12
|
+
return { set(n) {
|
|
13
|
+
const c = s.get.call(this);
|
|
14
|
+
s.set.call(this, n), this.requestUpdate(o, c, t);
|
|
15
|
+
}, init(n) {
|
|
16
|
+
return n !== void 0 && this.C(o, void 0, t, n), n;
|
|
17
|
+
} };
|
|
18
|
+
}
|
|
19
|
+
if (a === "setter") {
|
|
20
|
+
const { name: o } = e;
|
|
21
|
+
return function(n) {
|
|
22
|
+
const c = this[o];
|
|
23
|
+
s.call(this, n), this.requestUpdate(o, c, t);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
throw Error("Unsupported decorator location: " + a);
|
|
27
|
+
};
|
|
28
|
+
function f(t) {
|
|
29
|
+
return (s, e) => typeof e == "object" ? d(t, s, e) : ((a, i, r) => {
|
|
30
|
+
const o = i.hasOwnProperty(r);
|
|
31
|
+
return i.constructor.createProperty(r, a), o ? Object.getOwnPropertyDescriptor(i, r) : void 0;
|
|
32
|
+
})(t, s, e);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
f as n
|
|
36
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const c = (r, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(r, t, e), e);
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/
|
|
12
|
+
function a(r, t) {
|
|
13
|
+
return (e, o, l) => {
|
|
14
|
+
const n = (u) => u.renderRoot?.querySelector(r) ?? null;
|
|
15
|
+
return c(e, o, { get() {
|
|
16
|
+
return n(this);
|
|
17
|
+
} });
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
c as a,
|
|
22
|
+
a as e
|
|
23
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/const n=(r,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(r,t,e),e);/**
|
|
6
|
+
* @license
|
|
7
|
+
* Copyright 2017 Google LLC
|
|
8
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
+
*/function i(r,t){return(e,o,l)=>{const u=c=>c.renderRoot?.querySelector(r)??null;return n(e,o,{get(){return u(this)}})}}exports.e=i;exports.e$1=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.NAVIGATION_DIRECTION=void 0;(function(o){o[o.BACKWARD=-1]="BACKWARD",o[o.FORWARD=1]="FORWARD"})(exports.NAVIGATION_DIRECTION||(exports.NAVIGATION_DIRECTION={}));class c{constructor(e){this._groups={},this.constructor._instances.set(e,this)}shouldBeFocusable(e){if(e.checked)return!0;const{name:s}=e,t=this._groups[s];return t&&Array.from(t).some(u=>u.checked)?!1:!t||t.size===1||this.getSortedGroup(e)[0]===e}getSortedGroup(e){const s=this._groups[e.name];return s&&Array.from(s).sort((t,n)=>{const r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0})}add(e){const{name:s}=e;if(s){const t=this._groups;t[s]||(t[s]=new Set),t[s].add(e)}return this}delete(e,s=e.name){const t=this._groups[s];return t?t.delete(e):!1}select(e,s){const t=this._groups[e.name];if(t){if(e.disabled)return;e.checked=!s||!0,e.tabIndex=0,e.focus(),t.forEach(n=>{e!==n&&(n.checked=s||!1,n.tabIndex=-1)})}}navigate(e,s){const t=this.getSortedGroup(e),n=t.length;let r=t.indexOf(e);for(let u=0;u<n;u++){r=(r+s+n)%n;const i=t[r];if(!i.disabled)return i}return e}static get(e){return this._instances.get(e)||new c(e)}}c._instances=new WeakMap;exports.RadioGroupManager=c;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var a;
|
|
2
|
+
(function(o) {
|
|
3
|
+
o[o.BACKWARD = -1] = "BACKWARD", o[o.FORWARD = 1] = "FORWARD";
|
|
4
|
+
})(a || (a = {}));
|
|
5
|
+
class c {
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this._groups = {}, this.constructor._instances.set(e, this);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @param radio A radio button.
|
|
11
|
+
* @returns
|
|
12
|
+
* `true` if the given radio button should be focusable, which is either:
|
|
13
|
+
* - The radio button is selected
|
|
14
|
+
* - No radio button is selected and the radio button is first one in the radio group
|
|
15
|
+
*/
|
|
16
|
+
shouldBeFocusable(e) {
|
|
17
|
+
if (e.checked)
|
|
18
|
+
return !0;
|
|
19
|
+
const { name: s } = e, t = this._groups[s];
|
|
20
|
+
return t && Array.from(t).some((u) => u.checked) ? !1 : !t || t.size === 1 || this.getSortedGroup(e)[0] === e;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @param radio A radio button.
|
|
24
|
+
* @returns The sorted radio group the given radio button is in.
|
|
25
|
+
*/
|
|
26
|
+
getSortedGroup(e) {
|
|
27
|
+
const s = this._groups[e.name];
|
|
28
|
+
return s && Array.from(s).sort((t, n) => {
|
|
29
|
+
const r = t.compareDocumentPosition(n);
|
|
30
|
+
return r & Node.DOCUMENT_POSITION_FOLLOWING || r & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : r & Node.DOCUMENT_POSITION_PRECEDING || r & Node.DOCUMENT_POSITION_CONTAINS ? 1 : 0;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Manages a radio button.
|
|
35
|
+
*
|
|
36
|
+
* @param radio The radio button to manage.
|
|
37
|
+
* @returns This object.
|
|
38
|
+
*/
|
|
39
|
+
add(e) {
|
|
40
|
+
const { name: s } = e;
|
|
41
|
+
if (s) {
|
|
42
|
+
const t = this._groups;
|
|
43
|
+
t[s] || (t[s] = /* @__PURE__ */ new Set()), t[s].add(e);
|
|
44
|
+
}
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Unmanages a radio button.
|
|
49
|
+
*
|
|
50
|
+
* @param radio The radio button to unmanage.
|
|
51
|
+
* @param name The old name of the radio button to unmanage.
|
|
52
|
+
* @returns `true` if `element` was actually managed.
|
|
53
|
+
*/
|
|
54
|
+
delete(e, s = e.name) {
|
|
55
|
+
const t = this._groups[s];
|
|
56
|
+
return t ? t.delete(e) : !1;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Selects or focuses on a radio button.
|
|
60
|
+
*
|
|
61
|
+
* @param radio The radio button to select.
|
|
62
|
+
* @param readOnly optional if radio button has readOnly.
|
|
63
|
+
*/
|
|
64
|
+
select(e, s) {
|
|
65
|
+
const t = this._groups[e.name];
|
|
66
|
+
if (t) {
|
|
67
|
+
if (e.disabled)
|
|
68
|
+
return;
|
|
69
|
+
e.checked = !s || !0, e.tabIndex = 0, e.focus(), t.forEach((n) => {
|
|
70
|
+
e !== n && (n.checked = s || !1, n.tabIndex = -1);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @param radio The currently selected radio button.
|
|
76
|
+
* @param direction The direction to navigate to.
|
|
77
|
+
* @returns The radio button that should be selected next.
|
|
78
|
+
*/
|
|
79
|
+
navigate(e, s) {
|
|
80
|
+
const t = this.getSortedGroup(e), n = t.length;
|
|
81
|
+
let r = t.indexOf(e);
|
|
82
|
+
for (let u = 0; u < n; u++) {
|
|
83
|
+
r = (r + s + n) % n;
|
|
84
|
+
const i = t[r];
|
|
85
|
+
if (!i.disabled)
|
|
86
|
+
return i;
|
|
87
|
+
}
|
|
88
|
+
return e;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @param document A document element.
|
|
92
|
+
* @returns The `RadioGroupManager` instance associated with the given document.
|
|
93
|
+
*/
|
|
94
|
+
static get(e) {
|
|
95
|
+
return this._instances.get(e) || new c(e);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
c._instances = /* @__PURE__ */ new WeakMap();
|
|
99
|
+
export {
|
|
100
|
+
a as N,
|
|
101
|
+
c as R
|
|
102
|
+
};
|