@esri/calcite-components 5.2.0-next.23 → 5.2.0-next.25
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/{RPHF57ID.js → 22GC3RG5.js} +1 -1
- package/dist/cdn/{PE6HZSXG.js → 2LLTIUO2.js} +1 -1
- package/dist/cdn/{OKQBN2MY.js → 2RCCZVTQ.js} +1 -1
- package/dist/cdn/{VA6P67UG.js → 2WN5V5VV.js} +1 -1
- package/dist/cdn/2Y7V37OD.js +2 -0
- package/dist/cdn/{UQAL22P6.js → 37D7AZ7D.js} +1 -1
- package/dist/cdn/{N4VAVTXN.js → 3YHV4V2E.js} +1 -1
- package/dist/cdn/{W5QVWKA4.js → 4JVIOGR3.js} +1 -1
- package/dist/cdn/{5E34F2H7.js → 4TWFL7MF.js} +1 -1
- package/dist/cdn/4V5AT4ZJ.js +2 -0
- package/dist/cdn/{X2Y3U24F.js → 4VEXFJNW.js} +1 -1
- package/dist/cdn/{E7YSE7PA.js → 4XLWVEK2.js} +1 -1
- package/dist/cdn/56B4W3IX.js +2 -0
- package/dist/cdn/{QAVBQFIM.js → 5K6W25QR.js} +1 -1
- package/dist/cdn/{YURDXUY6.js → 5KEHJCHZ.js} +1 -1
- package/dist/cdn/5ZZL6VT5.js +2 -0
- package/dist/cdn/{J2WA3W5U.js → 6EUPYBJ7.js} +1 -1
- package/dist/cdn/{56DNJRTH.js → 6KMBQHVA.js} +1 -1
- package/dist/cdn/{XEKJUQX2.js → 6LJFVX4I.js} +1 -1
- package/dist/cdn/{MB2RASRM.js → 6XSZN5UI.js} +1 -1
- package/dist/cdn/{QJ4X6JEF.js → 73FYBQX2.js} +1 -1
- package/dist/cdn/{DHAK5MVE.js → 7MSJVPGW.js} +1 -1
- package/dist/cdn/{4MRGSEQH.js → 7OJ66Q4X.js} +1 -1
- package/dist/cdn/{XBNPHSQR.js → ABSKISJZ.js} +1 -1
- package/dist/cdn/{CKDOITAW.js → AKJDXNSH.js} +1 -1
- package/dist/cdn/{ZLY4AI4O.js → B55YECTU.js} +1 -1
- package/dist/cdn/B5JEWPWI.js +2 -0
- package/dist/cdn/{PXHOVMKD.js → BVZVGHBC.js} +1 -1
- package/dist/cdn/{44BCM4WD.js → C5GR7BRQ.js} +1 -1
- package/dist/cdn/{LSYCKJVH.js → CBFJM3WF.js} +1 -1
- package/dist/cdn/{XP7XYKMD.js → CBUAGE6G.js} +1 -1
- package/dist/cdn/{SSTWHVRD.js → CE4KECUJ.js} +1 -1
- package/dist/cdn/{RG2RKIDH.js → CNCYAYZV.js} +1 -1
- package/dist/cdn/{L6CCUDY4.js → CSEUL5M3.js} +1 -1
- package/dist/cdn/{2PFID3W6.js → CTYSCOBK.js} +1 -1
- package/dist/cdn/DKJI4BME.js +2 -0
- package/dist/cdn/{OCLWYV7X.js → DXKCNUEV.js} +1 -1
- package/dist/cdn/{MPUIKIV2.js → EEOXZS6M.js} +1 -1
- package/dist/cdn/EP5RWWWG.js +2 -0
- package/dist/cdn/{P2M56OT6.js → EPT63H4X.js} +1 -1
- package/dist/cdn/{JZSJTLPL.js → EQCD6SKO.js} +1 -1
- package/dist/cdn/{V4PSJEH7.js → EVWEP3U6.js} +1 -1
- package/dist/cdn/{32RBXVF4.js → F6JPKWYM.js} +1 -1
- package/dist/cdn/{GA5ZHZLZ.js → FH4FVT6N.js} +1 -1
- package/dist/cdn/{ETSNIYVJ.js → FH4NWCNH.js} +1 -1
- package/dist/cdn/{Q2XCENUN.js → FS7TGNLS.js} +1 -1
- package/dist/cdn/{5S2UFHFC.js → G7QXJNLL.js} +1 -1
- package/dist/cdn/{4YCUPVHB.js → GBPBKE62.js} +1 -1
- package/dist/cdn/GFU7D6D5.js +2 -0
- package/dist/cdn/GIZ3Q3DF.js +2 -0
- package/dist/cdn/{E3HA6ARS.js → GKGNNXHT.js} +1 -1
- package/dist/cdn/{UTFIFRAB.js → GRRE3UKT.js} +1 -1
- package/dist/cdn/{SHQXC5KI.js → GTOH3BST.js} +1 -1
- package/dist/cdn/GTUVDLDW.js +2 -0
- package/dist/cdn/GVH35AYA.js +2 -0
- package/dist/cdn/{WZS5WOVS.js → H3TOK6XZ.js} +1 -1
- package/dist/cdn/{WU7GZ3ZT.js → HHDUX7PF.js} +1 -1
- package/dist/cdn/{ZIHHVT6X.js → HIZXZAYX.js} +1 -1
- package/dist/cdn/{DMBFYRBO.js → HVUT6LOX.js} +1 -1
- package/dist/cdn/{HPCNE2D3.js → ICSW3D3J.js} +1 -1
- package/dist/cdn/{OF3NKVWJ.js → IDM3HU5C.js} +1 -1
- package/dist/cdn/{7KEQRK7M.js → IGKO7D7N.js} +1 -1
- package/dist/cdn/{GNQ7HT6N.js → IKUMXD7A.js} +1 -1
- package/dist/cdn/{DD6HKLEH.js → IPTKGSGY.js} +1 -1
- package/dist/cdn/{6AWM3III.js → J7I3EQSN.js} +1 -1
- package/dist/cdn/{EDJC2HTH.js → JA7OZCB3.js} +1 -1
- package/dist/cdn/{WI7WTRBR.js → JGRQ6CUV.js} +1 -1
- package/dist/cdn/{NCZEPH5R.js → JPKGBSWT.js} +1 -1
- package/dist/cdn/{YGCQA6I2.js → JPXIUUMZ.js} +1 -1
- package/dist/cdn/{26NLIAOY.js → JUR52VUJ.js} +1 -1
- package/dist/cdn/{ZTOH6K4N.js → K4O4I3A5.js} +1 -1
- package/dist/cdn/{3RRQA2FI.js → K5FXO3QH.js} +1 -1
- package/dist/cdn/{XKENPJIG.js → K7CNN7XW.js} +1 -1
- package/dist/cdn/{OX7WKNVG.js → KG53W6XH.js} +1 -1
- package/dist/cdn/{WEQLYKHQ.js → KPSXCXHX.js} +1 -1
- package/dist/cdn/{ZYUCFWLH.js → KUYDXE2F.js} +1 -1
- package/dist/cdn/{QDGKS7LE.js → KY5RECBD.js} +1 -1
- package/dist/cdn/{M6IGUW4G.js → KZPBMIPA.js} +1 -1
- package/dist/cdn/{MR3JPLGQ.js → L57CN7OS.js} +1 -1
- package/dist/cdn/{QR2UFQCP.js → L653U6TD.js} +1 -1
- package/dist/cdn/{V22TQ7PZ.js → L7CV2BYA.js} +1 -1
- package/dist/cdn/{PJS3MBW2.js → LJAJPLLO.js} +1 -1
- package/dist/cdn/{3TUJGRZ2.js → N3UBJVDD.js} +1 -1
- package/dist/cdn/{FWIPONLY.js → N62ZA5VU.js} +1 -1
- package/dist/cdn/{IDGW2P7Y.js → NEKKMY32.js} +1 -1
- package/dist/cdn/{OY3Z7S4F.js → OBUUDLYG.js} +1 -1
- package/dist/cdn/{YAFFQQRB.js → OI2PRXQX.js} +1 -1
- package/dist/cdn/OKWOTSY3.js +2 -0
- package/dist/cdn/{Y3K3KZ7C.js → OLLANWS4.js} +1 -1
- package/dist/cdn/{HPWZD6ES.js → OMBTETZO.js} +1 -1
- package/dist/cdn/{RV2VGY5Y.js → OMPGBFWM.js} +1 -1
- package/dist/cdn/OMYPRL6N.js +2 -0
- package/dist/cdn/{SPDOAEZW.js → OQCWMWIO.js} +1 -1
- package/dist/cdn/{MCHEB6JH.js → OQJB4DX3.js} +1 -1
- package/dist/cdn/{CKU3WVI5.js → OTEBTN57.js} +1 -1
- package/dist/cdn/{CW75VNTM.js → OTSVF2WP.js} +1 -1
- package/dist/cdn/{GQFOAB5T.js → PH74VKTL.js} +1 -1
- package/dist/cdn/{3O74FQRX.js → PRGZNHUH.js} +1 -1
- package/dist/cdn/PZPFL6PE.js +2 -0
- package/dist/cdn/{3JVMYXOC.js → QCK2MWTK.js} +1 -1
- package/dist/cdn/{C6VPC36M.js → QT3J2A2Q.js} +1 -1
- package/dist/cdn/{UINO3MUN.js → RM6HWC7A.js} +1 -1
- package/dist/cdn/SEQCBIEU.js +2 -0
- package/dist/cdn/{ATKSPCQC.js → SQT2NXTL.js} +1 -1
- package/dist/cdn/{XEDH2KRM.js → T3DRXPGG.js} +1 -1
- package/dist/cdn/{UFBPVUSS.js → T7S6WIFD.js} +1 -1
- package/dist/cdn/TDJEPWU5.js +2 -0
- package/dist/cdn/{W3EDPW5C.js → TGYKMD2U.js} +1 -1
- package/dist/cdn/{M7X4MZ4X.js → THCUZB6I.js} +1 -1
- package/dist/cdn/{TU2IDUJN.js → TIBJT3W7.js} +1 -1
- package/dist/cdn/{7XW3S3DN.js → TOGPTZKU.js} +1 -1
- package/dist/cdn/{PHZDEOBE.js → TRNEFG5H.js} +1 -1
- package/dist/cdn/TTIJIR65.js +2 -0
- package/dist/cdn/{N24IIHGN.js → U7YK4VGO.js} +1 -1
- package/dist/cdn/{VVDB4JOU.js → UCMA7O7D.js} +1 -1
- package/dist/cdn/{ASNTOIAQ.js → UHXPF3G6.js} +1 -1
- package/dist/cdn/{YQYSA6GQ.js → UJKDADQA.js} +1 -1
- package/dist/cdn/{J7OTKRVL.js → UTWBK7O2.js} +1 -1
- package/dist/cdn/{2OHOVQMB.js → UU4JZ5J7.js} +1 -1
- package/dist/cdn/UUL2RZBV.js +2 -0
- package/dist/cdn/{ADGSWGZE.js → UX7G2X3I.js} +1 -1
- package/dist/cdn/{4A4AQLXS.js → V3IQOTQA.js} +1 -1
- package/dist/cdn/{PB33ZFMH.js → VFIWF7UJ.js} +1 -1
- package/dist/cdn/VJXFPW34.js +2 -0
- package/dist/cdn/{4CTX7AWR.js → VUHZYZSW.js} +1 -1
- package/dist/cdn/{SGBGFWSI.js → VYOJ3KUJ.js} +1 -1
- package/dist/cdn/{GWNGI6C4.js → WGNMVVLL.js} +1 -1
- package/dist/cdn/{QBKW557S.js → X2UERL5J.js} +1 -1
- package/dist/cdn/{OQ7IXAQT.js → X7KIJRQX.js} +1 -1
- package/dist/cdn/{UKFONMST.js → XOOBZNX6.js} +1 -1
- package/dist/cdn/{UO7DMOAA.js → XTGEBM27.js} +1 -1
- package/dist/cdn/Y3CHBQSV.js +2 -0
- package/dist/cdn/{JEE2673Z.js → Y56HNNPM.js} +1 -1
- package/dist/cdn/{SLXOGLQG.js → YBUVMHQW.js} +1 -1
- package/dist/cdn/{W6WPGWK4.js → YCYEMH7U.js} +1 -1
- package/dist/cdn/{GYHJQTDE.js → YE7FX543.js} +1 -1
- package/dist/cdn/{7FDY66P2.js → YHY7NVSU.js} +1 -1
- package/dist/cdn/{LVCHWMHH.js → YNKMBNC7.js} +1 -1
- package/dist/cdn/{2RJOFMZ3.js → YOFWNW72.js} +1 -1
- package/dist/cdn/{Q4YMF7OQ.js → YQKI5E6J.js} +1 -1
- package/dist/cdn/{AOSWHTDQ.js → YU3LOETT.js} +1 -1
- package/dist/cdn/YVVQJVA6.js +2 -0
- package/dist/cdn/ZBKPVPD7.js +2 -0
- package/dist/cdn/{HL5J554X.js → ZTSMW2D4.js} +1 -1
- package/dist/cdn/{O2XJCEO6.js → ZXQXD2SB.js} +1 -1
- package/dist/cdn/{VNDV5V2E.js → ZXZVZLSA.js} +1 -1
- 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/useLabel.js +150 -0
- package/dist/components/calcite-autocomplete/customElement.js +3 -3
- 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-inline-editable/customElement.js +3 -9
- package/dist/components/calcite-input/customElement.js +3 -3
- package/dist/components/calcite-input-date-picker/customElement.js +3 -3
- package/dist/components/calcite-input-number/customElement.js +3 -3
- package/dist/components/calcite-input-text/customElement.js +3 -6
- 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.d.ts +13 -0
- package/dist/components/calcite-switch/customElement.js +5 -10
- package/dist/components/calcite-text-area/customElement.js +3 -3
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.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 +1 -1
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +3 -3
- package/dist/cdn/2JBFUIQH.js +0 -2
- package/dist/cdn/66ZAZMZH.js +0 -2
- package/dist/cdn/7NI3U4HX.js +0 -2
- package/dist/cdn/CQHOIB7Q.js +0 -2
- package/dist/cdn/DP7TXQLL.js +0 -2
- package/dist/cdn/EAYVGI7U.js +0 -2
- package/dist/cdn/EDDCKZDB.js +0 -2
- package/dist/cdn/F73XHF2M.js +0 -2
- package/dist/cdn/FPCQ5FII.js +0 -2
- package/dist/cdn/IE6SKFME.js +0 -2
- package/dist/cdn/II3HZQGY.js +0 -2
- package/dist/cdn/KLUVMIWX.js +0 -2
- package/dist/cdn/PV4J5OMF.js +0 -2
- package/dist/cdn/QB7DF7HL.js +0 -2
- package/dist/cdn/R3DCDJ4K.js +0 -2
- package/dist/cdn/RP3AR4AB.js +0 -2
- package/dist/cdn/SQIK6UYZ.js +0 -2
- package/dist/cdn/UVHXLQFS.js +0 -2
- package/dist/cdn/YDN74HYW.js +0 -2
- package/dist/cdn/Z7YWEK6A.js +0 -2
- package/dist/cdn/ZSMB7MEM.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.25";
|
|
65
|
+
const buildDate = "2026-07-15";
|
|
66
|
+
const revision = "5fad817a4";
|
|
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.25/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,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
|
+
};
|
|
@@ -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() {
|
|
@@ -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() {
|
|
@@ -3,7 +3,8 @@ import { c as customElement } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
5
|
import { LitElement, createEvent, nothing, safeClassMap } from "@arcgis/lumina";
|
|
6
|
-
import {
|
|
6
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
7
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
7
8
|
import { a as slotChangeGetAssignedElements } from "../../chunks/dom.js";
|
|
8
9
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
9
10
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
@@ -36,6 +37,7 @@ class InlineEditable extends LitElement {
|
|
|
36
37
|
this.messages = useT9n();
|
|
37
38
|
this.focusSetter = useSetFocus()(this);
|
|
38
39
|
this.interactiveContainer = useInteractive(this);
|
|
40
|
+
this.labelable = useLabel(this);
|
|
39
41
|
this.controls = false;
|
|
40
42
|
this.disabled = false;
|
|
41
43
|
this.loading = false;
|
|
@@ -73,14 +75,6 @@ class InlineEditable extends LitElement {
|
|
|
73
75
|
async setFocus(options) {
|
|
74
76
|
return this.focusSetter(() => this.inputEl, options);
|
|
75
77
|
}
|
|
76
|
-
connectedCallback() {
|
|
77
|
-
super.connectedCallback();
|
|
78
|
-
connectLabel(this);
|
|
79
|
-
}
|
|
80
|
-
disconnectedCallback() {
|
|
81
|
-
super.disconnectedCallback();
|
|
82
|
-
disconnectLabel(this);
|
|
83
|
-
}
|
|
84
78
|
editingEnabledWatcher(newValue, oldValue) {
|
|
85
79
|
if (this.inputEl) {
|
|
86
80
|
this.inputEl.editingEnabled = newValue;
|
|
@@ -8,8 +8,9 @@ import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/
|
|
|
8
8
|
import { useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
9
9
|
import { b as setRequestedIcon, j as isPrimaryPointerButton } from "../../chunks/dom.js";
|
|
10
10
|
import { n as numberKeys } from "../../chunks/key.js";
|
|
11
|
-
import {
|
|
11
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
12
12
|
import { i as isValidNumber, B as BigDecimal, n as numberStringFormatter, p as parseNumberString, s as sanitizeNumberString, a as addLocalizedTrailingDecimalZeros } from "../../chunks/locale.js";
|
|
13
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
13
14
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
14
15
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
15
16
|
import { U as UseInlineEditable, C as CSS$1, I as InlineEditableControls } from "../../chunks/useInlineEditable.js";
|
|
@@ -77,6 +78,7 @@ class Input extends LitElement {
|
|
|
77
78
|
getValue: () => this.type === "file" ? this.childRef.value?.files ?? null : this.value
|
|
78
79
|
})(this);
|
|
79
80
|
this.inputWrapperRef = createRef();
|
|
81
|
+
this.labelable = useLabel(this);
|
|
80
82
|
this.previousValueOrigin = "initial";
|
|
81
83
|
this.userChangedValue = false;
|
|
82
84
|
this._value = "";
|
|
@@ -181,7 +183,6 @@ class Input extends LitElement {
|
|
|
181
183
|
if (this.inlineEditableEl) {
|
|
182
184
|
this.editingEnabled = this.inlineEditableEl.editingEnabled || false;
|
|
183
185
|
}
|
|
184
|
-
connectLabel(this);
|
|
185
186
|
}
|
|
186
187
|
async load() {
|
|
187
188
|
this.maxString = this.max?.toString();
|
|
@@ -221,7 +222,6 @@ class Input extends LitElement {
|
|
|
221
222
|
}
|
|
222
223
|
disconnectedCallback() {
|
|
223
224
|
super.disconnectedCallback();
|
|
224
|
-
disconnectLabel(this);
|
|
225
225
|
this.stopNudging();
|
|
226
226
|
}
|
|
227
227
|
stopNudging() {
|
|
@@ -8,8 +8,9 @@ import { u as useFocusTrap } from "../../chunks/useFocusTrap.js";
|
|
|
8
8
|
import { l as datePartsFromISO, d as dateFromISO, a as dateToISO, b as dateFromRange, m as datePartsFromLocalizedString, o as dateFromLocalizedString, i as inRange } from "../../chunks/date.js";
|
|
9
9
|
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";
|
|
10
10
|
import { n as numberKeys } from "../../chunks/key.js";
|
|
11
|
-
import {
|
|
11
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
12
12
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
13
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
13
14
|
import { b as getSupportedNumberingSystem, c as getDateFormatSupportedLocale, n as numberStringFormatter } from "../../chunks/locale.js";
|
|
14
15
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
15
16
|
import { g as getMinMaxSource, a as getValueAsDateRange, b as applyLocaleOverride, c as getLocaleData } from "../../chunks/utils3.js";
|
|
@@ -95,6 +96,7 @@ class InputDatePicker extends LitElement {
|
|
|
95
96
|
this.formSupport = useForm({
|
|
96
97
|
inputType: "date"
|
|
97
98
|
})(this);
|
|
99
|
+
this.labelable = useLabel(this);
|
|
98
100
|
this.transitionProp = "opacity";
|
|
99
101
|
this.placeholderTextId = IDS.placeholder(guid());
|
|
100
102
|
this.rangeStartValueChangedByUser = false;
|
|
@@ -178,7 +180,6 @@ class InputDatePicker extends LitElement {
|
|
|
178
180
|
if (open) {
|
|
179
181
|
this.openHandler();
|
|
180
182
|
}
|
|
181
|
-
connectLabel(this);
|
|
182
183
|
this.setFilteredPlacements();
|
|
183
184
|
connectFloatingUI(this);
|
|
184
185
|
}
|
|
@@ -240,7 +241,6 @@ class InputDatePicker extends LitElement {
|
|
|
240
241
|
}
|
|
241
242
|
disconnectedCallback() {
|
|
242
243
|
super.disconnectedCallback();
|
|
243
|
-
disconnectLabel(this);
|
|
244
244
|
disconnectFloatingUI(this);
|
|
245
245
|
}
|
|
246
246
|
handleDisabledAndReadOnlyChange(value) {
|
|
@@ -8,7 +8,8 @@ import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/
|
|
|
8
8
|
import { useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
9
9
|
import { b as setRequestedIcon, j as isPrimaryPointerButton } from "../../chunks/dom.js";
|
|
10
10
|
import { n as numberKeys } from "../../chunks/key.js";
|
|
11
|
-
import {
|
|
11
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
12
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
12
13
|
import { i as isValidNumber, n as numberStringFormatter, B as BigDecimal, p as parseNumberString, s as sanitizeNumberString, a as addLocalizedTrailingDecimalZeros } from "../../chunks/locale.js";
|
|
13
14
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
14
15
|
import { C as ClearButton } from "../../chunks/ClearButton.js";
|
|
@@ -96,6 +97,7 @@ class InputNumber extends LitElement {
|
|
|
96
97
|
this.calciteInputNumberInlineEditableChange.emit();
|
|
97
98
|
}
|
|
98
99
|
});
|
|
100
|
+
this.labelable = useLabel(this);
|
|
99
101
|
this.inlineEditableLoading = false;
|
|
100
102
|
this.slottedActionElDisabledInternally = false;
|
|
101
103
|
this.alignment = "start";
|
|
@@ -173,7 +175,6 @@ class InputNumber extends LitElement {
|
|
|
173
175
|
if (this.inlineEditableEl) {
|
|
174
176
|
this.editingEnabled = this.inlineEditableEl.editingEnabled || false;
|
|
175
177
|
}
|
|
176
|
-
connectLabel(this);
|
|
177
178
|
}
|
|
178
179
|
async load() {
|
|
179
180
|
this.maxString = this.max?.toString();
|
|
@@ -215,7 +216,6 @@ class InputNumber extends LitElement {
|
|
|
215
216
|
}
|
|
216
217
|
disconnectedCallback() {
|
|
217
218
|
super.disconnectedCallback();
|
|
218
|
-
disconnectLabel(this);
|
|
219
219
|
this.stopNudging();
|
|
220
220
|
}
|
|
221
221
|
stopNudging() {
|
|
@@ -7,7 +7,8 @@ import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/
|
|
|
7
7
|
import { useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
8
8
|
import { b as setRequestedIcon } from "../../chunks/dom.js";
|
|
9
9
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
10
|
-
import {
|
|
10
|
+
import { g as getLabelText } from "../../chunks/label.js";
|
|
11
|
+
import { u as useLabel } from "../../chunks/useLabel.js";
|
|
11
12
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
12
13
|
import { C as ClearButton } from "../../chunks/ClearButton.js";
|
|
13
14
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
@@ -81,6 +82,7 @@ class InputText extends LitElement {
|
|
|
81
82
|
this.calciteInputTextInlineEditableChange.emit();
|
|
82
83
|
}
|
|
83
84
|
});
|
|
85
|
+
this.labelable = useLabel(this);
|
|
84
86
|
this.inlineEditableLoading = false;
|
|
85
87
|
this.slottedActionElDisabledInternally = false;
|
|
86
88
|
this.alignment = "start";
|
|
@@ -148,7 +150,6 @@ class InputText extends LitElement {
|
|
|
148
150
|
if (this.inlineEditableEl) {
|
|
149
151
|
this.editingEnabled = this.inlineEditableEl.editingEnabled || false;
|
|
150
152
|
}
|
|
151
|
-
connectLabel(this);
|
|
152
153
|
}
|
|
153
154
|
async load() {
|
|
154
155
|
this.requestedIcon = setRequestedIcon({}, this.icon, "text");
|
|
@@ -160,10 +161,6 @@ class InputText extends LitElement {
|
|
|
160
161
|
this.requestedIcon = setRequestedIcon({}, this.icon, "text");
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
disconnectedCallback() {
|
|
164
|
-
super.disconnectedCallback();
|
|
165
|
-
disconnectLabel(this);
|
|
166
|
-
}
|
|
167
164
|
handleGlobalAttributesChanged() {
|
|
168
165
|
this.requestUpdate();
|
|
169
166
|
}
|