@esri/calcite-components 5.2.0-next.22 → 5.2.0-next.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{4VBSTWOV.js → 2QCMFMLY.js} +1 -1
- package/dist/cdn/{C3X7CRMS.js → 2RPXIBWE.js} +1 -1
- package/dist/cdn/2SF4WITS.js +2 -0
- package/dist/cdn/{RFA26G4S.js → 2SUOKAMW.js} +1 -1
- package/dist/cdn/{CXNFOACP.js → 2XLQPSOW.js} +1 -1
- package/dist/cdn/{OOMTSLWC.js → 33SOEGHX.js} +1 -1
- package/dist/cdn/{KIL2QSDF.js → 36R2BZ4C.js} +1 -1
- package/dist/cdn/{XHW7QUXM.js → 3LU3J5TB.js} +1 -1
- package/dist/cdn/{6GB7EFOV.js → 3MMI6PZM.js} +1 -1
- package/dist/cdn/{4Q6CYRBV.js → 3Q34HSKA.js} +1 -1
- package/dist/cdn/{P4VOPVIT.js → 3RJV46KS.js} +1 -1
- package/dist/cdn/3RQC275N.js +2 -0
- package/dist/cdn/{O26T5SDI.js → 3VD5LQJ5.js} +1 -1
- package/dist/cdn/{4OAUCEKF.js → 4DIMU6QD.js} +1 -1
- package/dist/cdn/{OIX6UKMC.js → 4LVHJRJ5.js} +1 -1
- package/dist/cdn/4PFMGWRJ.js +2 -0
- package/dist/cdn/{5FQCDEG4.js → 4UFFN3VM.js} +1 -1
- package/dist/cdn/{2MPKR2JY.js → 4VBI733W.js} +1 -1
- package/dist/cdn/{P5E4K2YU.js → 53PNWBFM.js} +1 -1
- package/dist/cdn/{OIO5CL6R.js → 5EBGPCB7.js} +1 -1
- package/dist/cdn/{WMTGARUS.js → 5EXZOLMW.js} +1 -1
- package/dist/cdn/5NHWJ32X.js +2 -0
- package/dist/cdn/{WDIF62Z2.js → 5TKQENT2.js} +1 -1
- package/dist/cdn/{3BGOYU56.js → 5W5FGFML.js} +1 -1
- package/dist/cdn/{DNUGPVHP.js → 62Y53IUP.js} +1 -1
- package/dist/cdn/{JTTSFUPV.js → 64CXTH73.js} +1 -1
- package/dist/cdn/{36BS3JSS.js → 6CJJGR2D.js} +1 -1
- package/dist/cdn/{4EWVFZVO.js → 6ENTE44N.js} +1 -1
- package/dist/cdn/{Q3JBPJGU.js → 6LW75OFQ.js} +1 -1
- package/dist/cdn/{QB2GHJ47.js → 73MVINMR.js} +1 -1
- package/dist/cdn/{GGG7ADWH.js → A3D4HQZC.js} +1 -1
- package/dist/cdn/{UWE72ONC.js → A3W4GT7L.js} +1 -1
- package/dist/cdn/{FGDLWATP.js → A4LFU7PD.js} +1 -1
- package/dist/cdn/{VLCGJHDC.js → A4XKXSUF.js} +1 -1
- package/dist/cdn/{KFOVOJVM.js → A62GLZJ2.js} +1 -1
- package/dist/cdn/{MBF6BKRT.js → AIITDYTD.js} +1 -1
- package/dist/cdn/{2LFPI2WZ.js → AIYUJEZO.js} +1 -1
- package/dist/cdn/{27GD5MNT.js → AXK7ZG2K.js} +1 -1
- package/dist/cdn/{UTTRKYQD.js → BBVTXQR6.js} +1 -1
- package/dist/cdn/{MTUZXCYG.js → BCHGB7QR.js} +1 -1
- package/dist/cdn/{GAVZISN7.js → BCSAOJEH.js} +1 -1
- package/dist/cdn/{KARX5DKV.js → BCXNQWLL.js} +1 -1
- package/dist/cdn/{HQLBVFSX.js → BHFQ4AGH.js} +1 -1
- package/dist/cdn/{PSZVYI3V.js → BPHGOBYG.js} +1 -1
- package/dist/cdn/{J4UD4FXA.js → C2P3H532.js} +1 -1
- package/dist/cdn/{V3MMSNQV.js → C4K7UKPW.js} +1 -1
- package/dist/cdn/{IFKLH4KA.js → CWLRA3MO.js} +1 -1
- package/dist/cdn/{LRPTBBVX.js → D2VKTZSJ.js} +1 -1
- package/dist/cdn/D4XL7XXX.js +2 -0
- package/dist/cdn/{BGSARPRI.js → D6LTLYJP.js} +1 -1
- package/dist/cdn/{2WNP5CYX.js → D6TDQJJO.js} +1 -1
- package/dist/cdn/DASCHY4S.js +2 -0
- package/dist/cdn/{OUGMNLTX.js → DCVGASJR.js} +1 -1
- package/dist/cdn/DKJI4BME.js +2 -0
- package/dist/cdn/{CPDXOHFE.js → DOUVRUOH.js} +1 -1
- package/dist/cdn/{YXQ2XC5W.js → DPI5XYJD.js} +1 -1
- package/dist/cdn/{26OLHRNL.js → DQTRUHEA.js} +1 -1
- package/dist/cdn/DTFPKPYY.js +2 -0
- package/dist/cdn/{T5HXYYVY.js → DWHFZOJG.js} +1 -1
- package/dist/cdn/E3UPRP7F.js +2 -0
- package/dist/cdn/{JAGZGJRH.js → E6TLVPEG.js} +1 -1
- package/dist/cdn/{PK7RJ6YJ.js → E7CBU7KA.js} +1 -1
- package/dist/cdn/{22KVAN6L.js → ELJJJX53.js} +1 -1
- package/dist/cdn/{BCOAKRTT.js → ELZSRXJN.js} +1 -1
- package/dist/cdn/{Y6EXOUZ5.js → EMYTVLMO.js} +1 -1
- package/dist/cdn/{SBMXV7O2.js → F5BALHXV.js} +1 -1
- package/dist/cdn/FIJR273R.js +2 -0
- package/dist/cdn/GB6FN7CM.js +2 -0
- package/dist/cdn/{NTYOA6QA.js → GNW37PGK.js} +1 -1
- package/dist/cdn/GQCJUPW7.js +2 -0
- package/dist/cdn/GQVNQ7OT.js +2 -0
- package/dist/cdn/{OYEIXDDT.js → GV3EJHKZ.js} +1 -1
- package/dist/cdn/{I36L52VX.js → GY3X2ZOY.js} +1 -1
- package/dist/cdn/{365NYBL5.js → HRK7GL5U.js} +1 -1
- package/dist/cdn/{ILK3JG5G.js → I6WVJ3GW.js} +1 -1
- package/dist/cdn/{HQP7FLV2.js → IAOMFAIV.js} +1 -1
- package/dist/cdn/IEJJHN6V.js +2 -0
- package/dist/cdn/{URMDF7RR.js → IR67XJSK.js} +1 -1
- package/dist/cdn/{2LRCVGFE.js → JEBOYGKS.js} +1 -1
- package/dist/cdn/{VLAD23FH.js → KGSUMQK6.js} +1 -1
- package/dist/cdn/{W5TIKXCX.js → KJ2AY64U.js} +1 -1
- package/dist/cdn/KOXPXPRR.js +2 -0
- package/dist/cdn/{E333LJCL.js → KU7LDL6J.js} +1 -1
- package/dist/cdn/{IRSSE2TG.js → KYABHN4E.js} +1 -1
- package/dist/cdn/{C37KUE54.js → KYD4GPON.js} +1 -1
- package/dist/cdn/{ZLSHN26H.js → KYIQQJCU.js} +1 -1
- package/dist/cdn/{UG4RNAUM.js → L3ZFB4YI.js} +1 -1
- package/dist/cdn/{MOW4Z6WN.js → LB4Y4BU4.js} +1 -1
- package/dist/cdn/{XUNX6H3T.js → LPSUUCDF.js} +1 -1
- package/dist/cdn/{3O3QMWZN.js → LVAMHAIR.js} +1 -1
- package/dist/cdn/M6YZ46C5.js +2 -0
- package/dist/cdn/{VJO2RT4P.js → MAYMYGHP.js} +1 -1
- package/dist/cdn/{SBNPDCMJ.js → MI52MQHY.js} +1 -1
- package/dist/cdn/{DWIXUKFP.js → MIXN26LN.js} +1 -1
- package/dist/cdn/{AXK4A4Z3.js → NH4WPQT5.js} +1 -1
- package/dist/cdn/{BNFDKGXS.js → NHCFVPJN.js} +1 -1
- package/dist/cdn/{7XTYYWT7.js → NHJJGOSD.js} +1 -1
- package/dist/cdn/{IWTJ2TMP.js → NO5C7M2G.js} +1 -1
- package/dist/cdn/{EAPHW7UM.js → NQWQFXKK.js} +1 -1
- package/dist/cdn/O6R6PDOP.js +2 -0
- package/dist/cdn/{JDSOESSY.js → OCP7BNRD.js} +1 -1
- package/dist/cdn/OJVSPIVF.js +2 -0
- package/dist/cdn/{QBU65K3X.js → OKTPXYWF.js} +1 -1
- package/dist/cdn/{TKHGW3AN.js → ONJZATUT.js} +1 -1
- package/dist/cdn/{AYZOCQGM.js → ORSP4YVL.js} +1 -1
- package/dist/cdn/{U2XR24PN.js → P3LWRKZW.js} +1 -1
- package/dist/cdn/{LKHTGXQM.js → P3W5KF7P.js} +1 -1
- package/dist/cdn/{QAZD3KBU.js → PFKU63CI.js} +1 -1
- package/dist/cdn/{QQDQTFWB.js → PM5LDKID.js} +1 -1
- package/dist/cdn/{TUQOCSQ3.js → POGQGFRZ.js} +1 -1
- package/dist/cdn/POITQYOX.js +2 -0
- package/dist/cdn/{BOU3QBXS.js → PR323OIR.js} +1 -1
- package/dist/cdn/{776O2XKF.js → Q2BOPZRE.js} +1 -1
- package/dist/cdn/{HAA7VHRS.js → Q2UZ4NJE.js} +1 -1
- package/dist/cdn/{STXD74FG.js → Q3RTTOUM.js} +1 -1
- package/dist/cdn/{PBO36O4D.js → QIH4YTMA.js} +1 -1
- package/dist/cdn/{W3TXJCVC.js → QTKLUBTW.js} +1 -1
- package/dist/cdn/{N4DITOIV.js → RJRBUL4P.js} +1 -1
- package/dist/cdn/SBCJ2GOY.js +2 -0
- package/dist/cdn/{J2NKWN2H.js → SCYHKGPW.js} +1 -1
- package/dist/cdn/{T2SWBJAS.js → SQ4QP3T2.js} +1 -1
- package/dist/cdn/SWXEG6QR.js +2 -0
- package/dist/cdn/{L7LWNCET.js → T32EPAFR.js} +1 -1
- package/dist/cdn/TUAYKQAD.js +2 -0
- package/dist/cdn/{I4BLJ23F.js → TYX2PKVM.js} +1 -1
- package/dist/cdn/{JKOKCCAM.js → UFT4E2IF.js} +1 -1
- package/dist/cdn/{44T5D4QY.js → UHAVTL4I.js} +1 -1
- package/dist/cdn/{CRYL5XII.js → UM3DNEXB.js} +1 -1
- package/dist/cdn/{54XHABHA.js → USHV7YR7.js} +1 -1
- package/dist/cdn/USVD5K4G.js +2 -0
- package/dist/cdn/{UE3S7ZG4.js → VCKK6NHV.js} +1 -1
- package/dist/cdn/VF5V6EZL.js +2 -0
- package/dist/cdn/{GHDKS4TD.js → VOCKM3G2.js} +1 -1
- package/dist/cdn/VVDI73XQ.js +2 -0
- package/dist/cdn/{4QJDFAKO.js → VWZLBNJL.js} +1 -1
- package/dist/cdn/VYITDJKP.js +2 -0
- package/dist/cdn/{FNWWNIIJ.js → WC5I5HAO.js} +1 -1
- package/dist/cdn/{YPYJCWEB.js → WDWP6EBB.js} +1 -1
- package/dist/cdn/{W22VSWB3.js → WHXCD5S3.js} +1 -1
- package/dist/cdn/{IPZXZHRH.js → X2WS6WI2.js} +1 -1
- package/dist/cdn/XRRQX2EJ.js +2 -0
- package/dist/cdn/{Z7FMYELP.js → XSH6NNUN.js} +1 -1
- package/dist/cdn/{YCIZDPEF.js → XX4NT4Z6.js} +1 -1
- package/dist/cdn/{OHGWP3KV.js → Y4NMF236.js} +1 -1
- package/dist/cdn/{NVFZLHGS.js → YEH7JU5T.js} +1 -1
- package/dist/cdn/{7GRTCXLC.js → Z2D7O3Q2.js} +1 -1
- package/dist/cdn/{TQSEINDL.js → Z4AQAAZB.js} +1 -1
- package/dist/cdn/{OT37LOCF.js → ZD6R5LP6.js} +1 -1
- package/dist/cdn/{WMXQZVKU.js → ZHJKWLFH.js} +1 -1
- package/dist/cdn/ZJ77S6YD.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/dom.js +2 -2
- package/dist/chunks/floating-ui.js +23 -13
- package/dist/chunks/label.js +1 -140
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useForm.js +1 -1
- package/dist/chunks/useInlineEditable.js +53 -0
- package/dist/chunks/useLabel.js +150 -0
- package/dist/components/calcite-accordion-item/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.js +3 -3
- package/dist/components/calcite-autocomplete-item/customElement.js +1 -1
- package/dist/components/calcite-button/customElement.js +3 -3
- package/dist/components/calcite-checkbox/customElement.js +3 -9
- package/dist/components/calcite-combobox/customElement.js +3 -3
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-dropdown/customElement.js +1 -1
- package/dist/components/calcite-inline-editable/customElement.d.ts +10 -6
- package/dist/components/calcite-inline-editable/customElement.js +30 -18
- package/dist/components/calcite-inline-editable/index.js +1 -1
- package/dist/components/calcite-input/customElement.d.ts +31 -0
- package/dist/components/calcite-input/customElement.js +95 -12
- package/dist/components/calcite-input-date-picker/customElement.js +3 -3
- package/dist/components/calcite-input-number/customElement.d.ts +31 -0
- package/dist/components/calcite-input-number/customElement.js +85 -9
- package/dist/components/calcite-input-text/customElement.d.ts +31 -0
- package/dist/components/calcite-input-text/customElement.js +83 -15
- package/dist/components/calcite-input-time-picker/customElement.js +3 -9
- package/dist/components/calcite-input-time-zone/customElement.js +2 -9
- package/dist/components/calcite-label/customElement.js +1 -1
- package/dist/components/calcite-radio-button/customElement.js +3 -3
- package/dist/components/calcite-rating/customElement.js +3 -9
- package/dist/components/calcite-segmented-control/customElement.js +3 -9
- package/dist/components/calcite-select/customElement.js +3 -3
- package/dist/components/calcite-slider/customElement.js +3 -3
- package/dist/components/calcite-switch/customElement.js +3 -9
- package/dist/components/calcite-text-area/customElement.js +3 -3
- package/dist/components/calcite-tile/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/supported-browsers.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +12 -3
- package/dist/types/preact.d.ts +12 -3
- package/dist/types/react.d.ts +12 -3
- package/dist/types/stencil.d.ts +12 -3
- package/package.json +3 -3
- package/dist/cdn/22GON63G.js +0 -2
- package/dist/cdn/2KU7YCWU.js +0 -2
- package/dist/cdn/3POGLXTA.js +0 -2
- package/dist/cdn/5OA4JQZA.js +0 -2
- package/dist/cdn/BHSQKAVV.js +0 -2
- package/dist/cdn/G36DLSRW.js +0 -2
- package/dist/cdn/KWFYPDBS.js +0 -2
- package/dist/cdn/KYBV5PSW.js +0 -2
- package/dist/cdn/LOBFFXLD.js +0 -2
- package/dist/cdn/LW7TA25C.js +0 -2
- package/dist/cdn/M637NSYT.js +0 -2
- package/dist/cdn/MBCJSLBY.js +0 -2
- package/dist/cdn/NLCXTKBC.js +0 -2
- package/dist/cdn/NWLXBG5R.js +0 -2
- package/dist/cdn/OHSZ2ST3.js +0 -2
- package/dist/cdn/RCN7XGCC.js +0 -2
- package/dist/cdn/RH7FYKAW.js +0 -2
- package/dist/cdn/RYKUXUIN.js +0 -2
- package/dist/cdn/TUR4Z6GQ.js +0 -2
- package/dist/cdn/UAS7ZB74.js +0 -2
- package/dist/cdn/ULNQCFWW.js +0 -2
- package/dist/cdn/VFZFFJJL.js +0 -2
- package/dist/cdn/VPFGSTXD.js +0 -2
- package/dist/cdn/W7JKCKDN.js +0 -2
- package/dist/cdn/WIPAP3S6.js +0 -2
- package/dist/cdn/X57EZ5QY.js +0 -2
package/dist/chunks/label.js
CHANGED
|
@@ -1,146 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { q as queryElementRoots, c as closestElementCrossShadowBoundary, p as isBefore } from "./dom.js";
|
|
3
|
-
const labelClickEvent = "calciteInternalLabelClick";
|
|
4
|
-
const labelConnectedEvent = "calciteInternalLabelConnected";
|
|
5
|
-
const labelDisconnectedEvent = "calciteInternalLabelDisconnected";
|
|
6
|
-
const labelTagName = "calcite-label";
|
|
7
|
-
const labelToLabelables = /* @__PURE__ */ new WeakMap();
|
|
8
|
-
const onLabelClickMap = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
const onLabelConnectedMap = /* @__PURE__ */ new WeakMap();
|
|
10
|
-
const onLabelDisconnectedMap = /* @__PURE__ */ new WeakMap();
|
|
11
|
-
const unlabeledComponents = /* @__PURE__ */ new Set();
|
|
12
|
-
const findLabelForComponent = (componentEl) => {
|
|
13
|
-
const { id } = componentEl;
|
|
14
|
-
const forLabel = id && queryElementRoots(componentEl, { selector: `${labelTagName}[for="${id}"]` });
|
|
15
|
-
if (forLabel) {
|
|
16
|
-
return forLabel;
|
|
17
|
-
}
|
|
18
|
-
const parentLabel = closestElementCrossShadowBoundary(componentEl, labelTagName);
|
|
19
|
-
if (!parentLabel || // labelable components within other custom elements are not considered labelable
|
|
20
|
-
hasAncestorCustomElements(parentLabel, componentEl)) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return parentLabel;
|
|
24
|
-
};
|
|
25
|
-
function hasAncestorCustomElements(label, componentEl) {
|
|
26
|
-
let traversedElements;
|
|
27
|
-
const customElementAncestorCheckEventType = "custom-element-ancestor-check";
|
|
28
|
-
const listener = ((event) => {
|
|
29
|
-
event.stopImmediatePropagation();
|
|
30
|
-
const composedPath = event.composedPath();
|
|
31
|
-
traversedElements = composedPath.slice(composedPath.indexOf(componentEl), composedPath.indexOf(label));
|
|
32
|
-
});
|
|
33
|
-
label.addEventListener(customElementAncestorCheckEventType, listener, { once: true });
|
|
34
|
-
componentEl.dispatchEvent(new CustomEvent(customElementAncestorCheckEventType, { composed: true, bubbles: true }));
|
|
35
|
-
label.removeEventListener(customElementAncestorCheckEventType, listener);
|
|
36
|
-
const ancestorCustomElements = traversedElements.filter((el) => el !== componentEl && el !== label).filter((el) => el.tagName?.includes("-"));
|
|
37
|
-
return ancestorCustomElements.length > 0;
|
|
38
|
-
}
|
|
39
|
-
function connectLabel(component) {
|
|
40
|
-
if (!component) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const labelEl = findLabelForComponent(component.el);
|
|
44
|
-
if (labelEl && onLabelClickMap.has(labelEl) && labelEl === component.labelEl || !labelEl && unlabeledComponents.has(component)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const boundOnLabelDisconnected = onLabelDisconnected.bind(component);
|
|
48
|
-
if (labelEl) {
|
|
49
|
-
component.labelEl = labelEl;
|
|
50
|
-
const labelables = labelToLabelables.get(labelEl) || [];
|
|
51
|
-
labelables.push(component);
|
|
52
|
-
labelToLabelables.set(labelEl, labelables.sort(sortByDOMOrder));
|
|
53
|
-
if (!onLabelClickMap.has(component.labelEl)) {
|
|
54
|
-
onLabelClickMap.set(component.labelEl, onLabelClick);
|
|
55
|
-
component.labelEl.addEventListener(labelClickEvent, onLabelClick);
|
|
56
|
-
}
|
|
57
|
-
unlabeledComponents.delete(component);
|
|
58
|
-
document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
|
|
59
|
-
onLabelDisconnectedMap.set(component, boundOnLabelDisconnected);
|
|
60
|
-
document.addEventListener(labelDisconnectedEvent, boundOnLabelDisconnected);
|
|
61
|
-
} else if (!unlabeledComponents.has(component)) {
|
|
62
|
-
boundOnLabelDisconnected();
|
|
63
|
-
document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function disconnectLabel(component) {
|
|
67
|
-
if (!component) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
unlabeledComponents.delete(component);
|
|
71
|
-
document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
|
|
72
|
-
document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
|
|
73
|
-
onLabelConnectedMap.delete(component);
|
|
74
|
-
onLabelDisconnectedMap.delete(component);
|
|
75
|
-
if (!component.labelEl) {
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const labelables = labelToLabelables.get(component.labelEl);
|
|
79
|
-
if (labelables.length === 1) {
|
|
80
|
-
component.labelEl.removeEventListener(labelClickEvent, onLabelClickMap.get(component.labelEl));
|
|
81
|
-
onLabelClickMap.delete(component.labelEl);
|
|
82
|
-
}
|
|
83
|
-
labelToLabelables.set(
|
|
84
|
-
component.labelEl,
|
|
85
|
-
labelables.filter((labelable) => labelable !== component).sort(sortByDOMOrder)
|
|
86
|
-
);
|
|
87
|
-
component.labelEl = void 0;
|
|
88
|
-
}
|
|
89
|
-
function sortByDOMOrder(a, b) {
|
|
90
|
-
return isBefore(a.el, b.el) ? -1 : 1;
|
|
91
|
-
}
|
|
92
2
|
function getLabelText(component) {
|
|
93
3
|
return component.label || component.labelEl?.textContent?.trim() || "";
|
|
94
4
|
}
|
|
95
|
-
function onLabelClick(event) {
|
|
96
|
-
const labelClickTarget = event.detail.sourceEvent.target;
|
|
97
|
-
const labelables = labelToLabelables.get(this);
|
|
98
|
-
const clickedLabelable = labelables.find((labelable) => labelable.el === labelClickTarget);
|
|
99
|
-
const labelableChildClicked = clickedLabelable && labelables.includes(clickedLabelable);
|
|
100
|
-
if (labelableChildClicked) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const firstLabelable = labelables[0];
|
|
104
|
-
if (firstLabelable.disabled) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
firstLabelable.onLabelClick(event);
|
|
108
|
-
}
|
|
109
|
-
function onLabelConnected() {
|
|
110
|
-
if (unlabeledComponents.has(this)) {
|
|
111
|
-
connectLabel(this);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function onLabelDisconnected() {
|
|
115
|
-
unlabeledComponents.add(this);
|
|
116
|
-
const boundOnLabelConnected = onLabelConnectedMap.get(this) || onLabelConnected.bind(this);
|
|
117
|
-
onLabelConnectedMap.set(this, boundOnLabelConnected);
|
|
118
|
-
document.addEventListener(labelConnectedEvent, boundOnLabelConnected);
|
|
119
|
-
}
|
|
120
|
-
async function associateExplicitLabelToUnlabeledComponent(label) {
|
|
121
|
-
await label.componentOnReady();
|
|
122
|
-
const alreadyLabeled = labelToLabelables.has(label);
|
|
123
|
-
if (alreadyLabeled) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const forComponentEl = label.for && label.ownerDocument?.getElementById(label.for);
|
|
127
|
-
if (!forComponentEl) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
requestAnimationFrame(() => {
|
|
131
|
-
for (const labelable of unlabeledComponents) {
|
|
132
|
-
if (labelable.el === forComponentEl) {
|
|
133
|
-
connectLabel(labelable);
|
|
134
|
-
break;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
5
|
export {
|
|
140
|
-
|
|
141
|
-
labelDisconnectedEvent as b,
|
|
142
|
-
connectLabel as c,
|
|
143
|
-
disconnectLabel as d,
|
|
144
|
-
getLabelText as g,
|
|
145
|
-
labelConnectedEvent as l
|
|
6
|
+
getLabelText as g
|
|
146
7
|
};
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -61,9 +61,9 @@ function getConfig() {
|
|
|
61
61
|
}
|
|
62
62
|
return effectiveConfig;
|
|
63
63
|
}
|
|
64
|
-
const version = "5.2.0-next.
|
|
65
|
-
const buildDate = "2026-07-
|
|
66
|
-
const revision = "
|
|
64
|
+
const version = "5.2.0-next.24";
|
|
65
|
+
const buildDate = "2026-07-14";
|
|
66
|
+
const revision = "19110c9e4";
|
|
67
67
|
function stampVersion() {
|
|
68
68
|
const config = getConfig();
|
|
69
69
|
if (config && config.version) {
|
|
@@ -86,7 +86,7 @@ if (!isServer) {
|
|
|
86
86
|
if (process.env.NODE_ENV !== "test") {
|
|
87
87
|
queueMicrotask(stampVersion);
|
|
88
88
|
}
|
|
89
|
-
const runtime = makeRuntime({ defaultAssetPath: "https://cdn.jsdelivr.net/npm/@esri/calcite-components@5.2.0-next.
|
|
89
|
+
const runtime = makeRuntime({ defaultAssetPath: "https://cdn.jsdelivr.net/npm/@esri/calcite-components@5.2.0-next.24/dist/cdn/", hydratedAttribute: "calcite-hydrated" });
|
|
90
90
|
const { customElement, getAssetPath, setAssetPath } = runtime;
|
|
91
91
|
export {
|
|
92
92
|
CSS_UTILITY as C,
|
package/dist/chunks/useForm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { makeGenericController, bypassReadOnly } from "@arcgis/lumina/controllers";
|
|
3
3
|
import { uncapitalize, kebabToPascal } from "@arcgis/toolkit/string";
|
|
4
|
-
import {
|
|
4
|
+
import { p as isCalciteFocusable } from "./dom.js";
|
|
5
5
|
import "lit";
|
|
6
6
|
const minMaxStepTypes = ["date", "datetime-local", "month", "number", "range", "time", "week"];
|
|
7
7
|
const patternTypes = ["email", "password", "search", "tel", "text", "url"];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { safeClassMap } from "@arcgis/lumina";
|
|
3
|
+
import { nothing, html } from "lit";
|
|
4
|
+
import { ref } from "lit/directives/ref.js";
|
|
5
|
+
const CSS = {
|
|
6
|
+
container: "inline-editable--container",
|
|
7
|
+
enableEditing: "enable-editing",
|
|
8
|
+
confirmChanges: "confirm-changes",
|
|
9
|
+
cancelEditing: "cancel-editing"
|
|
10
|
+
};
|
|
11
|
+
const InlineEditableControls = ({ cancelEditingLabel, confirmChangesLabel, editingEnabled, enableEditingLabel, enableEditingButtonRef, loading, onCancelEditing, onConfirmChanges, onEnableEditing, scale, showControls }) => html`<div class=${safeClassMap(CSS.container)}>${!editingEnabled && html`<calcite-action .ariaLabel=${enableEditingLabel} class=${safeClassMap(CSS.enableEditing)} icon=pencil @click=${onEnableEditing} .scale=${scale} .text=${enableEditingLabel} title=${enableEditingLabel ?? nothing} type=button ${ref(enableEditingButtonRef)}></calcite-action>` || ""}${showControls && [
|
|
12
|
+
html`<calcite-action .ariaLabel=${confirmChangesLabel} class=${safeClassMap(CSS.confirmChanges)} icon=check .loading=${loading} @click=${onConfirmChanges} .scale=${scale} .text=${confirmChangesLabel} title=${confirmChangesLabel ?? nothing} type=button></calcite-action>`,
|
|
13
|
+
html`<calcite-action .ariaLabel=${cancelEditingLabel} class=${safeClassMap(CSS.cancelEditing)} icon=x @click=${onCancelEditing} .scale=${scale} .text=${cancelEditingLabel} title=${cancelEditingLabel ?? nothing} type=button></calcite-action>`
|
|
14
|
+
] || ""}</div>`;
|
|
15
|
+
class UseInlineEditable {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
this.options = options;
|
|
18
|
+
this.valuePriorToEditing = "";
|
|
19
|
+
}
|
|
20
|
+
enable() {
|
|
21
|
+
this.valuePriorToEditing = this.options.getValue();
|
|
22
|
+
this.options.setEditingEnabled(true);
|
|
23
|
+
requestAnimationFrame(() => {
|
|
24
|
+
this.options.setFocus();
|
|
25
|
+
});
|
|
26
|
+
this.options.emitEnableEditingChange();
|
|
27
|
+
}
|
|
28
|
+
disable() {
|
|
29
|
+
this.options.setEditingEnabled(false);
|
|
30
|
+
}
|
|
31
|
+
cancelEditing() {
|
|
32
|
+
this.options.setValue(this.valuePriorToEditing);
|
|
33
|
+
this.disable();
|
|
34
|
+
this.options.emitCancel();
|
|
35
|
+
}
|
|
36
|
+
async confirm(afterConfirm, setLoading) {
|
|
37
|
+
this.options.emitConfirm();
|
|
38
|
+
try {
|
|
39
|
+
if (afterConfirm) {
|
|
40
|
+
setLoading?.(true);
|
|
41
|
+
await afterConfirm();
|
|
42
|
+
this.disable();
|
|
43
|
+
}
|
|
44
|
+
} finally {
|
|
45
|
+
setLoading?.(false);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
CSS as C,
|
|
51
|
+
InlineEditableControls as I,
|
|
52
|
+
UseInlineEditable as U
|
|
53
|
+
};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { makeGenericController } from "@arcgis/lumina/controllers";
|
|
3
|
+
import { q as queryElementRoots, c as closestElementCrossShadowBoundary, r as isBefore } from "./dom.js";
|
|
4
|
+
const useLabel = makeGenericController((component, controller) => {
|
|
5
|
+
controller.onConnected(() => {
|
|
6
|
+
connectLabel(component);
|
|
7
|
+
});
|
|
8
|
+
controller.onDisconnected(() => {
|
|
9
|
+
disconnectLabel(component);
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
const labelClickEvent = "calciteInternalLabelClick";
|
|
13
|
+
const labelConnectedEvent = "calciteInternalLabelConnected";
|
|
14
|
+
const labelDisconnectedEvent = "calciteInternalLabelDisconnected";
|
|
15
|
+
const labelTagName = "calcite-label";
|
|
16
|
+
const labelToLabelables = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
const onLabelClickMap = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
const onLabelConnectedMap = /* @__PURE__ */ new WeakMap();
|
|
19
|
+
const onLabelDisconnectedMap = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
const unlabeledComponents = /* @__PURE__ */ new Set();
|
|
21
|
+
const findLabelForComponent = (componentEl) => {
|
|
22
|
+
const { id } = componentEl;
|
|
23
|
+
const forLabel = id && queryElementRoots(componentEl, { selector: `${labelTagName}[for="${id}"]` });
|
|
24
|
+
if (forLabel) {
|
|
25
|
+
return forLabel;
|
|
26
|
+
}
|
|
27
|
+
const parentLabel = closestElementCrossShadowBoundary(componentEl, labelTagName);
|
|
28
|
+
if (!parentLabel || // labelable components within other custom elements are not considered labelable
|
|
29
|
+
hasAncestorCustomElements(parentLabel, componentEl)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return parentLabel;
|
|
33
|
+
};
|
|
34
|
+
function hasAncestorCustomElements(label, componentEl) {
|
|
35
|
+
let traversedElements;
|
|
36
|
+
const customElementAncestorCheckEventType = "custom-element-ancestor-check";
|
|
37
|
+
const listener = ((event) => {
|
|
38
|
+
event.stopImmediatePropagation();
|
|
39
|
+
const composedPath = event.composedPath();
|
|
40
|
+
traversedElements = composedPath.slice(composedPath.indexOf(componentEl), composedPath.indexOf(label));
|
|
41
|
+
});
|
|
42
|
+
label.addEventListener(customElementAncestorCheckEventType, listener, { once: true });
|
|
43
|
+
componentEl.dispatchEvent(new CustomEvent(customElementAncestorCheckEventType, { composed: true, bubbles: true }));
|
|
44
|
+
label.removeEventListener(customElementAncestorCheckEventType, listener);
|
|
45
|
+
const ancestorCustomElements = traversedElements.filter((el) => el !== componentEl && el !== label).filter((el) => el.tagName?.includes("-"));
|
|
46
|
+
return ancestorCustomElements.length > 0;
|
|
47
|
+
}
|
|
48
|
+
function connectLabel(component) {
|
|
49
|
+
if (!component) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const labelEl = findLabelForComponent(component.el);
|
|
53
|
+
if (labelEl && onLabelClickMap.has(labelEl) && labelEl === component.labelEl || !labelEl && unlabeledComponents.has(component)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const boundOnLabelDisconnected = onLabelDisconnected.bind(component);
|
|
57
|
+
if (labelEl) {
|
|
58
|
+
component.labelEl = labelEl;
|
|
59
|
+
const labelables = labelToLabelables.get(labelEl) || [];
|
|
60
|
+
labelables.push(component);
|
|
61
|
+
labelToLabelables.set(labelEl, labelables.sort(sortByDOMOrder));
|
|
62
|
+
if (!onLabelClickMap.has(component.labelEl)) {
|
|
63
|
+
onLabelClickMap.set(component.labelEl, onLabelClick);
|
|
64
|
+
component.labelEl.addEventListener(labelClickEvent, onLabelClick);
|
|
65
|
+
}
|
|
66
|
+
unlabeledComponents.delete(component);
|
|
67
|
+
document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
|
|
68
|
+
onLabelDisconnectedMap.set(component, boundOnLabelDisconnected);
|
|
69
|
+
document.addEventListener(labelDisconnectedEvent, boundOnLabelDisconnected);
|
|
70
|
+
} else if (!unlabeledComponents.has(component)) {
|
|
71
|
+
boundOnLabelDisconnected();
|
|
72
|
+
document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function disconnectLabel(component) {
|
|
76
|
+
if (!component) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
unlabeledComponents.delete(component);
|
|
80
|
+
document.removeEventListener(labelConnectedEvent, onLabelConnectedMap.get(component));
|
|
81
|
+
document.removeEventListener(labelDisconnectedEvent, onLabelDisconnectedMap.get(component));
|
|
82
|
+
onLabelConnectedMap.delete(component);
|
|
83
|
+
onLabelDisconnectedMap.delete(component);
|
|
84
|
+
if (!component.labelEl) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const labelables = labelToLabelables.get(component.labelEl);
|
|
88
|
+
if (labelables.length === 1) {
|
|
89
|
+
component.labelEl.removeEventListener(labelClickEvent, onLabelClickMap.get(component.labelEl));
|
|
90
|
+
onLabelClickMap.delete(component.labelEl);
|
|
91
|
+
}
|
|
92
|
+
labelToLabelables.set(
|
|
93
|
+
component.labelEl,
|
|
94
|
+
labelables.filter((labelable) => labelable !== component).sort(sortByDOMOrder)
|
|
95
|
+
);
|
|
96
|
+
component.labelEl = void 0;
|
|
97
|
+
}
|
|
98
|
+
function sortByDOMOrder(a, b) {
|
|
99
|
+
return isBefore(a.el, b.el) ? -1 : 1;
|
|
100
|
+
}
|
|
101
|
+
function onLabelClick(event) {
|
|
102
|
+
const labelClickTarget = event.detail.sourceEvent.target;
|
|
103
|
+
const labelables = labelToLabelables.get(this);
|
|
104
|
+
const clickedLabelable = labelables.find((labelable) => labelable.el === labelClickTarget);
|
|
105
|
+
const labelableChildClicked = clickedLabelable && labelables.includes(clickedLabelable);
|
|
106
|
+
if (labelableChildClicked) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const firstLabelable = labelables[0];
|
|
110
|
+
if (firstLabelable.disabled) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
firstLabelable.onLabelClick(event);
|
|
114
|
+
}
|
|
115
|
+
function onLabelConnected() {
|
|
116
|
+
if (unlabeledComponents.has(this)) {
|
|
117
|
+
connectLabel(this);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function onLabelDisconnected() {
|
|
121
|
+
unlabeledComponents.add(this);
|
|
122
|
+
const boundOnLabelConnected = onLabelConnectedMap.get(this) || onLabelConnected.bind(this);
|
|
123
|
+
onLabelConnectedMap.set(this, boundOnLabelConnected);
|
|
124
|
+
document.addEventListener(labelConnectedEvent, boundOnLabelConnected);
|
|
125
|
+
}
|
|
126
|
+
async function associateExplicitLabelToUnlabeledComponent(label) {
|
|
127
|
+
await label.componentOnReady();
|
|
128
|
+
const alreadyLabeled = labelToLabelables.has(label);
|
|
129
|
+
if (alreadyLabeled) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const forComponentEl = label.for && label.ownerDocument?.getElementById(label.for);
|
|
133
|
+
if (!forComponentEl) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
requestAnimationFrame(() => {
|
|
137
|
+
for (const labelable of unlabeledComponents) {
|
|
138
|
+
if (labelable.el === forComponentEl) {
|
|
139
|
+
connectLabel(labelable);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
export {
|
|
146
|
+
associateExplicitLabelToUnlabeledComponent as a,
|
|
147
|
+
labelDisconnectedEvent as b,
|
|
148
|
+
labelConnectedEvent as l,
|
|
149
|
+
useLabel as u
|
|
150
|
+
};
|
|
@@ -48,7 +48,7 @@ const ICONS = {
|
|
|
48
48
|
plus: "plus",
|
|
49
49
|
minus: "minus"
|
|
50
50
|
};
|
|
51
|
-
const styles = css`.icon-position--end,.icon-position--start{--calcite-internal-accordion-item-icon-rotation: -90deg ;--calcite-internal-accordion-item-active-icon-rotation: 0deg;--calcite-internal-accordion-item-icon-rotation-rtl: 90deg;--calcite-internal-accordion-item-active-icon-rotation-rtl: 0deg}:host([scale=s]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xxs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--3)}:host([scale=m]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xxs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--1)}:host{position:relative;display:flex;flex-direction:column;text-decoration-line:none;color:var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-color-text-3)));background-color:var(--calcite-accordion-background-color, var(--calcite-accordion-item-background-color));border-width:0}:host .header{background-color:var(--calcite-accordion-item-header-background-color)}:host .header:hover{background-color:var(--calcite-internal-accordion-item-header-background-color-hover)}:host .header:active{background-color:var(--calcite-internal-accordion-item-header-background-color-press)}.header--solid{--calcite-internal-accordion-item-header-background-color-hover: var( --calcite-accordion-item-header-background-color-hover, var(--calcite-color-foreground-2) );--calcite-internal-accordion-item-header-background-color-press: var( --calcite-accordion-item-header-background-color-press, var(--calcite-color-foreground-3) )}.header--transparent{--calcite-internal-accordion-item-header-background-color-hover: var( --calcite-accordion-item-header-background-color-hover, var(--calcite-color-transparent-hover) );--calcite-internal-accordion-item-header-background-color-press: var( --calcite-accordion-item-header-background-color-press, var(--calcite-color-transparent-press) )}.icon-position--start{--calcite-internal-accordion-item-flex-direction: row-reverse;--calcite-internal-accordion-item-icon-spacing-start: 0;--calcite-internal-accordion-item-icon-spacing-end: var(--calcite-internal-accordion-icon-margin)}.icon-position--end{--calcite-internal-accordion-item-flex-direction: row;--calcite-internal-accordion-item-icon-spacing-start: var(--calcite-internal-accordion-icon-margin);--calcite-internal-accordion-item-icon-spacing-end: 0}.icon-position--end:not(.icon-type--plus-minus){--calcite-internal-accordion-item-icon-rotation: 0deg;--calcite-internal-accordion-item-active-icon-rotation: 180deg;--calcite-internal-accordion-item-icon-rotation-rtl: 0deg;--calcite-internal-accordion-item-active-icon-rotation-rtl: -180deg }.content,.header{border-block-end-width:var(--calcite-border-width-sm);border-block-end-style:solid;border-color:var(--calcite-accordion-border-color, var(--calcite-accordion-item-border-color, var(--calcite-color-border-2)))}.header-content{padding:var(--calcite-internal-accordion-item-padding, var(--calcite-internal-accordion-item-spacing-unit, .5rem .75rem));background:none;border:none;appearance:none;-webkit-appearance:none;box-shadow:none;outline:none;font-family:inherit}.content{padding:var(--calcite-accordion-item-content-space, var(--calcite-internal-accordion-item-padding, var(--calcite-internal-accordion-item-spacing-unit, .5rem .75rem)))}.header{display:flex;align-items:stretch}.header-content,.header-container,.header .actions-start,.header .actions-end{display:flex;align-items:center;transition-timing-function:cubic-bezier(.4,0,.2,1);
|
|
51
|
+
const styles = css`.icon-position--end,.icon-position--start{--calcite-internal-accordion-item-icon-rotation: -90deg ;--calcite-internal-accordion-item-active-icon-rotation: 0deg;--calcite-internal-accordion-item-icon-rotation-rtl: 90deg;--calcite-internal-accordion-item-active-icon-rotation-rtl: 0deg}:host([scale=s]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xxs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--3)}:host([scale=m]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xxs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--2)}:host([scale=l]){--calcite-internal-accordion-item-action-slot-spacing: var(--calcite-spacing-xs);--calcite-internal-accordion-item-description-font-size: var(--calcite-font-size--1)}:host{position:relative;display:flex;flex-direction:column;text-decoration-line:none;color:var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-color-text-3)));background-color:var(--calcite-accordion-background-color, var(--calcite-accordion-item-background-color));border-width:0}:host .header{background-color:var(--calcite-accordion-item-header-background-color)}:host .header:hover{background-color:var(--calcite-internal-accordion-item-header-background-color-hover)}:host .header:active{background-color:var(--calcite-internal-accordion-item-header-background-color-press)}.header--solid{--calcite-internal-accordion-item-header-background-color-hover: var( --calcite-accordion-item-header-background-color-hover, var(--calcite-color-foreground-2) );--calcite-internal-accordion-item-header-background-color-press: var( --calcite-accordion-item-header-background-color-press, var(--calcite-color-foreground-3) )}.header--transparent{--calcite-internal-accordion-item-header-background-color-hover: var( --calcite-accordion-item-header-background-color-hover, var(--calcite-color-transparent-hover) );--calcite-internal-accordion-item-header-background-color-press: var( --calcite-accordion-item-header-background-color-press, var(--calcite-color-transparent-press) )}.icon-position--start{--calcite-internal-accordion-item-flex-direction: row-reverse;--calcite-internal-accordion-item-icon-spacing-start: 0;--calcite-internal-accordion-item-icon-spacing-end: var(--calcite-internal-accordion-icon-margin)}.icon-position--end{--calcite-internal-accordion-item-flex-direction: row;--calcite-internal-accordion-item-icon-spacing-start: var(--calcite-internal-accordion-icon-margin);--calcite-internal-accordion-item-icon-spacing-end: 0}.icon-position--end:not(.icon-type--plus-minus){--calcite-internal-accordion-item-icon-rotation: 0deg;--calcite-internal-accordion-item-active-icon-rotation: 180deg;--calcite-internal-accordion-item-icon-rotation-rtl: 0deg;--calcite-internal-accordion-item-active-icon-rotation-rtl: -180deg }.content,.header{border-block-end-width:var(--calcite-border-width-sm);border-block-end-style:solid;border-color:var(--calcite-accordion-border-color, var(--calcite-accordion-item-border-color, var(--calcite-color-border-2)))}.header-content{padding:var(--calcite-internal-accordion-item-padding, var(--calcite-internal-accordion-item-spacing-unit, .5rem .75rem));background:none;border:none;appearance:none;-webkit-appearance:none;box-shadow:none;outline:none;font-family:inherit}.content{padding:var(--calcite-accordion-item-content-space, var(--calcite-internal-accordion-item-padding, var(--calcite-internal-accordion-item-spacing-unit, .5rem .75rem)))}.header{display:flex;align-items:stretch}.header-content,.header-container,.header .actions-start,.header .actions-end{display:flex;align-items:center;transition-timing-function:cubic-bezier(.4,0,.2,1);overflow-wrap:break-word;word-break:break-word}.header .has-actions{gap:var(--calcite-internal-accordion-item-action-slot-spacing);padding-block:var(--calcite-internal-accordion-item-action-slot-spacing)}.header .actions-start.has-actions{padding-inline:var(--calcite-internal-accordion-item-action-slot-spacing) 0}.header .actions-end.has-actions{padding-inline:0 var(--calcite-internal-accordion-item-action-slot-spacing)}.header-content{flex-grow:1;cursor:pointer;outline-color:transparent;flex-direction:var(--calcite-internal-accordion-item-flex-direction);color:var(--calcite-accordion-item-heading-text-color, var(--calcite-accordion-text-color, inherit))}.header-content:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.header-content:focus,.header-content:hover,.header-content:active{color:var(--calcite-accordion-item-heading-text-color, var(--calcite-accordion-text-color-hover))}.header-content:focus .heading,.header-content:hover .heading,.header-content:active .heading{color:var(--calcite-accordion-item-heading-text-color, var(--calcite-accordion-text-color-press))}.header-container{inline-size:100%}.slot-content-end{margin-inline-start:var(--calcite-internal-accordion-icon-margin)}.slot-content-start{margin-inline-end:var(--calcite-internal-accordion-icon-margin)}.header-text{margin-block:0px;flex-grow:1;flex-direction:column;padding-block:0px;text-align:initial;margin-inline-end:auto}.heading,.description{display:flex;inline-size:100%;line-height:var(--calcite-font-line-height-relative-snug)}.heading{margin:0;padding:0;font-weight:var(--calcite-font-weight-medium)}:host([scale=s]) .heading{font-size:var(--calcite-font-size--2)}:host([scale=m]) .heading{font-size:var(--calcite-font-size--1)}:host([scale=l]) .heading{font-size:var(--calcite-font-size-0)}.icon{display:flex;align-items:center;transition-timing-function:cubic-bezier(.4,0,.2,1);margin-inline-end:var(--calcite-internal-accordion-item-icon-spacing-start);margin-inline-start:var(--calcite-internal-accordion-item-icon-spacing-end)}.icon--start{color:var(--calcite-accordion-item-icon-color-start, var(--calcite-accordion-item-start-icon-color, var(--calcite-accordion-item-icon-color, var(--calcite-ui-icon-color, currentColor))));margin-inline-end:var(--calcite-internal-accordion-icon-margin)}.icon--end{color:var(--calcite-accordion-item-icon-color-end, var(--calcite-accordion-item-end-icon-color, var(--calcite-accordion-item-icon-color, var(--calcite-ui-icon-color, currentColor))));margin-inline-end:var(--calcite-internal-accordion-icon-margin);margin-inline-start:var(--calcite-internal-accordion-icon-margin)}.expand-icon{color:var(--calcite-accordion-item-expand-icon-color, var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-color-text-3))));margin-inline-start:var(--calcite-internal-accordion-item-icon-spacing-start);margin-inline-end:var(--calcite-internal-accordion-item-icon-spacing-end);transform:rotate(var(--calcite-internal-accordion-item-icon-rotation))}.calcite--rtl .expand-icon{transform:rotate(var(--calcite-internal-accordion-item-icon-rotation-rtl))}.description{font-size:var(--calcite-internal-accordion-item-description-font-size)}.content{display:none;text-align:initial}:host(:not([expanded])) .heading{color:var(--calcite-accordion-item-heading-text-color, var(--calcite-accordion-text-color-hover, var(--calcite-accordion-item-text-color-hover, var(--calcite-color-text-1))));font-weight:var(--calcite-font-weight-normal)}:host([expanded]){color:var(--calcite-accordion-text-color-press, var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-color-text-1))))}:host([expanded]) .header{border-block-end-color:transparent}:host([expanded]) .expand-icon{color:var(--calcite-accordion-item-expand-icon-color, var(--calcite-accordion-text-color-hover, var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-accordion-item-text-color-hover, var(--calcite-color-text-2))))));transform:rotate(var(--calcite-internal-accordion-item-active-icon-rotation))}:host([expanded]) .calcite--rtl .expand-icon{transform:rotate(var(--calcite-internal-accordion-item-active-icon-rotation-rtl))}:host([expanded]) .description{color:var(--calcite-accordion-text-color-hover, var(--calcite-accordion-text-color, var(--calcite-accordion-item-text-color, var(--calcite-accordion-item-text-color-hover, var(--calcite-color-text-2)))))}:host([expanded]) .content{display:block}@media(forced-colors:active){:host([expanded]) .header{border-block-end:none}:host([expanded]) .heading{font-weight:bolder}.header-content:hover .heading,.header-content:focus .heading{text-decoration:underline}}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
52
52
|
class AccordionItem extends LitElement {
|
|
53
53
|
constructor() {
|
|
54
54
|
super();
|
|
@@ -8,7 +8,7 @@ import { debounce } from "es-toolkit";
|
|
|
8
8
|
import { escapeRegExp } from "es-toolkit/compat";
|
|
9
9
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
10
10
|
import { d as defaultMenuPlacement, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
11
|
-
import {
|
|
11
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
12
12
|
import { s as slotChangeHasAssignedElement } from "../../chunks/dom.js";
|
|
13
13
|
import { g as guid } from "../../chunks/guid.js";
|
|
14
14
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
@@ -21,6 +21,7 @@ import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
|
21
21
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
22
22
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
23
23
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
24
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
24
25
|
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:block}.input-container{position:relative;display:flex;flex:1 1 auto;flex-wrap:nowrap}.input{width:100%;--calcite-input-prefix-size: var(--calcite-autocomplete-input-prefix-size);--calcite-input-suffix-size: var(--calcite-autocomplete-input-suffix-size);--calcite-input-background-color: var(--calcite-autocomplete-input-background-color);--calcite-input-border-color: var(--calcite-autocomplete-input-border-color);--calcite-input-corner-radius: var(--calcite-autocomplete-input-corner-radius);--calcite-input-shadow: var(--calcite-autocomplete-input-shadow);--calcite-input-icon-color: var(--calcite-autocomplete-input-icon-color);--calcite-input-text-color: var(--calcite-autocomplete-input-text-color);--calcite-input-placeholder-text-color: var(--calcite-autocomplete-input-placeholder-text-color);--calcite-input-actions-background-color: var(--calcite-autocomplete-input-actions-background-color);--calcite-input-actions-background-color-hover: var(--calcite-autocomplete-input-actions-background-color-hover);--calcite-input-actions-background-color-press: var(--calcite-autocomplete-input-actions-background-color-press);--calcite-input-actions-icon-color: var(--calcite-autocomplete-input-actions-icon-color);--calcite-input-actions-icon-color-hover: var(--calcite-autocomplete-input-actions-icon-color-hover);--calcite-input-actions-icon-color-press: var(--calcite-autocomplete-input-actions-icon-color-press);--calcite-input-loading-background-color: var(--calcite-autocomplete-input-loading-background-color);--calcite-input-loading-fill-color: var(--calcite-autocomplete-input-loading-fill-color);--calcite-input-prefix-text-color: var(--calcite-autocomplete-input-prefix-text-color);--calcite-input-suffix-text-color: var(--calcite-autocomplete-input-suffix-text-color)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.content-container{box-sizing:border-box;width:100%}.floating-ui-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.floating-ui-container{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .floating-ui-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.floating-ui-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.floating-ui-container:popover-open{display:block}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.content-container .calcite-floating-ui-anim{width:100%;overflow-y:auto;box-shadow:var(--calcite-shadow-md);max-block-size:var(--calcite-autocomplete-menu-max-size-y, 45vh);color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-1));background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-autocomplete-corner-radius, var(--calcite-corner-radius-round))}.content--hidden{display:none}@media(forced-colors:active){.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
25
26
|
const SLOTS = {
|
|
26
27
|
contentBottom: "content-bottom",
|
|
@@ -55,6 +56,7 @@ class Autocomplete extends LitElement {
|
|
|
55
56
|
inputType: "text"
|
|
56
57
|
})(this);
|
|
57
58
|
this.inputId = IDS.input(this.guid);
|
|
59
|
+
this.labelable = useLabel(this);
|
|
58
60
|
this.listId = IDS.list(this.guid);
|
|
59
61
|
this.messages = useT9n();
|
|
60
62
|
this.transitionProp = "opacity";
|
|
@@ -143,7 +145,6 @@ class Autocomplete extends LitElement {
|
|
|
143
145
|
childList: true,
|
|
144
146
|
subtree: true
|
|
145
147
|
});
|
|
146
|
-
connectLabel(this);
|
|
147
148
|
this.getAllItemsDebounced();
|
|
148
149
|
connectFloatingUI(this);
|
|
149
150
|
this.cancelable.add(this.getAllItemsDebounced);
|
|
@@ -184,7 +185,6 @@ class Autocomplete extends LitElement {
|
|
|
184
185
|
super.disconnectedCallback();
|
|
185
186
|
this.mutationObserver?.disconnect();
|
|
186
187
|
this.resizeObserver?.disconnect();
|
|
187
|
-
disconnectLabel(this);
|
|
188
188
|
disconnectFloatingUI(this);
|
|
189
189
|
}
|
|
190
190
|
setFloatingElSize() {
|
|
@@ -24,7 +24,7 @@ const idPrefix = "autocomplete-item";
|
|
|
24
24
|
const IDS = {
|
|
25
25
|
host: (id) => `${idPrefix}-${id}`
|
|
26
26
|
};
|
|
27
|
-
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-autocomplete-item-spacing-unit-l: .5rem;--calcite-internal-autocomplete-item-spacing-unit-s: .25rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-autocomplete-item-spacing-unit-l: .75rem;--calcite-internal-autocomplete-item-spacing-unit-s: .375rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-autocomplete-item-spacing-unit-l: 1rem;--calcite-internal-autocomplete-item-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size)}:host{display:flex}.container{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;outline-color:transparent;background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-3));gap:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-inline:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-block:var(--calcite-internal-autocomplete-item-spacing-unit-s);
|
|
27
|
+
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-autocomplete-item-spacing-unit-l: .5rem;--calcite-internal-autocomplete-item-spacing-unit-s: .25rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-autocomplete-item-spacing-unit-l: .75rem;--calcite-internal-autocomplete-item-spacing-unit-s: .375rem;--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-autocomplete-item-spacing-unit-l: 1rem;--calcite-internal-autocomplete-item-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-internal-autocomplete-item-description-font-size: var(--calcite-font-size)}:host{display:flex}.container{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;outline-color:transparent;background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-3));gap:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-inline:var(--calcite-internal-autocomplete-item-spacing-unit-l);padding-block:var(--calcite-internal-autocomplete-item-spacing-unit-s);overflow-wrap:break-word;word-break:break-word;justify-content:space-around}.description{color:var(--calcite-autocomplete-description-text-color);font-size:var(--calcite-internal-autocomplete-item-description-font-size)}.heading{color:var(--calcite-autocomplete-heading-text-color, var(--calcite-color-text-1))}.heading,.description{line-height:var(--calcite-font-line-height-relative-snug)}:host([selected]) .container{color:var(--calcite-color-text-1);background-color:var(--calcite-color-surface-highlight)}:host([selected]) .container .description{color:var(--calcite-autocomplete-description-text-color, var(--calcite-color-text-2))}:host([selected]) .heading{font-weight:var(--calcite-font-weight-medium)}:host(:hover:not([disabled])) .container{background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-2))}:host(:hover:not([disabled])) .container .description{color:var(--calcite-autocomplete-description-text-color, var(--calcite-color-text-2))}.container--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.content-center{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;
|
|
28
28
|
class AutocompleteItem extends LitElement {
|
|
29
29
|
constructor() {
|
|
30
30
|
super(...arguments);
|
|
@@ -5,7 +5,8 @@ import { createRef, ref } from "lit/directives/ref.js";
|
|
|
5
5
|
import { literal, html as html$1 } from "lit/static-html.js";
|
|
6
6
|
import { LitElement, stringOrBoolean, safeClassMap, nothing } from "@arcgis/lumina";
|
|
7
7
|
import { useWatchAttributes } from "@arcgis/lumina/controllers";
|
|
8
|
-
import {
|
|
8
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
9
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
9
10
|
import { c as createObserver, u as updateRefObserver } from "../../chunks/observers.js";
|
|
10
11
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
11
12
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
@@ -39,6 +40,7 @@ class Button extends LitElement {
|
|
|
39
40
|
this.focusSetter = useSetFocus()(this);
|
|
40
41
|
this.messages = useT9n();
|
|
41
42
|
this.interactiveContainer = useInteractive(this);
|
|
43
|
+
this.labelable = useLabel(this);
|
|
42
44
|
this.hasContent = false;
|
|
43
45
|
this.alignment = "center";
|
|
44
46
|
this.appearance = "solid";
|
|
@@ -67,7 +69,6 @@ class Button extends LitElement {
|
|
|
67
69
|
connectedCallback() {
|
|
68
70
|
super.connectedCallback();
|
|
69
71
|
this.setupTextContentObserver();
|
|
70
|
-
connectLabel(this);
|
|
71
72
|
}
|
|
72
73
|
async load() {
|
|
73
74
|
this.updateHasContent();
|
|
@@ -78,7 +79,6 @@ class Button extends LitElement {
|
|
|
78
79
|
disconnectedCallback() {
|
|
79
80
|
super.disconnectedCallback();
|
|
80
81
|
this.mutationObserver?.disconnect();
|
|
81
|
-
disconnectLabel(this);
|
|
82
82
|
this.resizeObserver?.disconnect();
|
|
83
83
|
}
|
|
84
84
|
handleGlobalAttributesChanged() {
|
|
@@ -5,12 +5,13 @@ import { createRef, ref } from "lit/directives/ref.js";
|
|
|
5
5
|
import { LitElement, createEvent, nothing, safeClassMap } from "@arcgis/lumina";
|
|
6
6
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
7
7
|
import { i as isActivationKey } from "../../chunks/key.js";
|
|
8
|
-
import {
|
|
8
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
9
9
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
10
10
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
11
11
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
12
12
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
13
13
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
14
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
14
15
|
const CSS = {
|
|
15
16
|
toggle: "toggle",
|
|
16
17
|
check: "check-svg"
|
|
@@ -23,6 +24,7 @@ class Checkbox extends LitElement {
|
|
|
23
24
|
this.direction = useDirection();
|
|
24
25
|
this.formSupport = useForm({ inputType: "checkbox" })(this);
|
|
25
26
|
this.indeterminatePath = "M13 8v1H3V8z";
|
|
27
|
+
this.labelable = useLabel(this);
|
|
26
28
|
this.onLabelClick = () => {
|
|
27
29
|
this.toggle();
|
|
28
30
|
};
|
|
@@ -55,14 +57,6 @@ class Checkbox extends LitElement {
|
|
|
55
57
|
async setFocus(options) {
|
|
56
58
|
return this.focusSetter(() => this.toggleRef.value, options);
|
|
57
59
|
}
|
|
58
|
-
connectedCallback() {
|
|
59
|
-
super.connectedCallback();
|
|
60
|
-
connectLabel(this);
|
|
61
|
-
}
|
|
62
|
-
disconnectedCallback() {
|
|
63
|
-
super.disconnectedCallback();
|
|
64
|
-
disconnectLabel(this);
|
|
65
|
-
}
|
|
66
60
|
getPath() {
|
|
67
61
|
return this.indeterminate ? this.indeterminatePath : this.checked ? this.checkedPath : "";
|
|
68
62
|
}
|
|
@@ -13,9 +13,10 @@ import { f as filter } from "../../chunks/filter.js";
|
|
|
13
13
|
import { k as getElementWidth, l as getTextWidth, i as focusElement } from "../../chunks/dom.js";
|
|
14
14
|
import { d as defaultMenuPlacement, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, f as filterValidFlipPlacements, h as hideFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
15
15
|
import { g as guid } from "../../chunks/guid.js";
|
|
16
|
-
import {
|
|
16
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
17
17
|
import { c as createObserver, u as updateRefObserver } from "../../chunks/observers.js";
|
|
18
18
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
19
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
19
20
|
import { i as isHidden, g as getIconScale } from "../../chunks/component.js";
|
|
20
21
|
import { C as ClearButton } from "../../chunks/ClearButton.js";
|
|
21
22
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
@@ -91,6 +92,7 @@ class Combobox extends LitElement {
|
|
|
91
92
|
this.internalValueChangeFlag = false;
|
|
92
93
|
this.previousAllSelected = false;
|
|
93
94
|
this.refreshingSelectionDisplay = false;
|
|
95
|
+
this.labelable = useLabel(this);
|
|
94
96
|
this.mutationObserver = createObserver("mutation", () => this.updateItems());
|
|
95
97
|
this.onLabelClick = () => {
|
|
96
98
|
this.setFocus();
|
|
@@ -262,7 +264,6 @@ class Combobox extends LitElement {
|
|
|
262
264
|
}
|
|
263
265
|
connectedCallback() {
|
|
264
266
|
super.connectedCallback();
|
|
265
|
-
connectLabel(this);
|
|
266
267
|
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
267
268
|
this.setFilteredPlacements();
|
|
268
269
|
connectFloatingUI(this);
|
|
@@ -300,7 +301,6 @@ class Combobox extends LitElement {
|
|
|
300
301
|
super.disconnectedCallback();
|
|
301
302
|
this.mutationObserver?.disconnect();
|
|
302
303
|
this.resizeObserver?.disconnect();
|
|
303
|
-
disconnectLabel(this);
|
|
304
304
|
disconnectFloatingUI(this);
|
|
305
305
|
}
|
|
306
306
|
emitComboboxChange() {
|
|
@@ -36,7 +36,7 @@ const SLOTS = {
|
|
|
36
36
|
contentStart: "content-start"
|
|
37
37
|
};
|
|
38
38
|
const itemSpacingMultiplier = "--calcite-combobox-item-spacing-indent-multiplier";
|
|
39
|
-
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([hidden]){display:none}[hidden]{display:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-combobox-item-spacing-unit-s: .25rem;--calcite-internal-combobox-item-spacing-unit-l: .5rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-combobox-item-spacing-unit-s: .375rem;--calcite-internal-combobox-item-spacing-unit-l: .75rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-combobox-item-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-internal-combobox-item-spacing-unit-l: 1rem;--calcite-combobox-item-selector-icon-size: 1.5rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size)}.container{--calcite-combobox-item-indent-value: calc( var(--calcite-internal-combobox-item-spacing-unit-l) * var(--calcite-combobox-item-spacing-indent-multiplier) )}:host(:focus){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host,ul{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;text-decoration-line:none;transition-timing-function:cubic-bezier(.4,0,.2,1);outline-color:transparent;
|
|
39
|
+
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([hidden]){display:none}[hidden]{display:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-combobox-item-spacing-unit-s: .25rem;--calcite-internal-combobox-item-spacing-unit-l: .5rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-combobox-item-spacing-unit-s: .375rem;--calcite-internal-combobox-item-spacing-unit-l: .75rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-combobox-item-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-internal-combobox-item-spacing-unit-l: 1rem;--calcite-combobox-item-selector-icon-size: 1.5rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size)}.container{--calcite-combobox-item-indent-value: calc( var(--calcite-internal-combobox-item-spacing-unit-l) * var(--calcite-combobox-item-spacing-indent-multiplier) )}:host(:focus){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host,ul{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;text-decoration-line:none;transition-timing-function:cubic-bezier(.4,0,.2,1);outline-color:transparent;overflow-wrap:break-word;word-break:break-word;justify-content:space-around;gap:var(--calcite-internal-combobox-item-spacing-unit-l);padding-block:var(--calcite-internal-combobox-item-spacing-unit-s);padding-inline-end:var(--calcite-internal-combobox-item-spacing-unit-l);padding-inline-start:var(--calcite-combobox-item-indent-value);color:var(--calcite-combobox-text-color, var(--calcite-color-text-3));transition-duration:var(--calcite-animation-timing)}:host([disabled]) .label{cursor:default}.label--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.label:hover{background-color:var(--calcite-combobox-item-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}.label:active{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-3))}:host([selected]) .label,.label:active{color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}:host([selected]) .label .description,:host([selected]) .label .short-text,.label:active .description,.label:active .short-text{color:var(--calcite-combobox-description-text-color-press, var(--calcite-color-text-2))}.icon{display:inline-flex;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-color-border-input)}:host([selected]) .icon,:host([indeterminate]) .icon{color:var(--calcite-combobox-selected-icon-color, var(--calcite-color-brand))}.icon--custom{margin-block-start:-1px}.center-content{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.description{font-size:var(--calcite-internal-combobox-item-description-font-size)}.short-text{white-space:nowrap}.heading{color:var(--calcite-combobox-heading-text-color, var(--calcite-color-text-1))}.description,.short-text{color:var(--calcite-combobox-description-text-color, var(--calcite-color-text-3))}:host([selected]) .heading{font-weight:var(--calcite-font-weight-medium)}.heading,.description,.short-text{line-height:var(--calcite-font-line-height-relative-snug)}.container--highlight-selected{background-color:var(--calcite-color-surface-highlight)}:host([item-hidden]){display:none}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}`;
|
|
40
40
|
class ComboboxItem extends LitElement {
|
|
41
41
|
constructor() {
|
|
42
42
|
super(...arguments);
|