@esri/calcite-components 5.1.1-next.4 → 5.1.1-next.6
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/{6URRYJJC.js → 25SUELBY.js} +1 -1
- package/dist/cdn/{UWYNYTMN.js → 27MK2V4G.js} +1 -1
- package/dist/cdn/2MRL4RKW.js +2 -0
- package/dist/cdn/{FAXETKEB.js → 2PEF7GQE.js} +1 -1
- package/dist/cdn/{3E5HT7WV.js → 2VL3OCAZ.js} +1 -1
- package/dist/cdn/{WG6S2XJI.js → 32QFEQZS.js} +1 -1
- package/dist/cdn/{GZLUCGFN.js → 34WAUXUE.js} +1 -1
- package/dist/cdn/{DT2W5XTJ.js → 3BUDIEL3.js} +1 -1
- package/dist/cdn/{JV3HNXO4.js → 3H6RVKMN.js} +1 -1
- package/dist/cdn/{WKGWLLC5.js → 3NNR2AZU.js} +1 -1
- package/dist/cdn/{SCWOG2PF.js → 3VNZC64N.js} +1 -1
- package/dist/cdn/{ICR6VGXW.js → 3XFDQDVC.js} +1 -1
- package/dist/cdn/{NUAG24SD.js → 3XMNPYNB.js} +1 -1
- package/dist/cdn/{ACTDFQ7A.js → 45C4ENM6.js} +1 -1
- package/dist/cdn/{4ZPAVVYJ.js → 4NYY44U4.js} +1 -1
- package/dist/cdn/{EZMKINVL.js → 4Q7PL2KY.js} +1 -1
- package/dist/cdn/{KCOVOOEW.js → 5CBFI2KM.js} +1 -1
- package/dist/cdn/{SAP7K723.js → 5JIKOOZ6.js} +1 -1
- package/dist/cdn/{TB6QF6QC.js → 5L5RJCKK.js} +1 -1
- package/dist/cdn/{ZNN7Y3Q2.js → 5N32D533.js} +1 -1
- package/dist/cdn/{CQYUSMYI.js → 5QXKHC54.js} +1 -1
- package/dist/cdn/{7TRR6NS7.js → 5RJTKL4J.js} +1 -1
- package/dist/cdn/{TNBTRBEH.js → 5SYOHCLD.js} +1 -1
- package/dist/cdn/{TXPXLQUH.js → 5WFJNGXP.js} +1 -1
- package/dist/cdn/5X2CR2NN.js +2 -0
- package/dist/cdn/{M4N5KK5H.js → 6MUZLYOR.js} +1 -1
- package/dist/cdn/{2ESXTULI.js → 6N246L5H.js} +1 -1
- package/dist/cdn/{H3KW6SFE.js → 6UM5PQBD.js} +1 -1
- package/dist/cdn/6W4CWLXH.js +2 -0
- package/dist/cdn/{BAK72T45.js → 72EJ64LI.js} +1 -1
- package/dist/cdn/{6TAMH7YM.js → 72XY7IDN.js} +1 -1
- package/dist/cdn/{QMKT34NA.js → 73EQ5TEB.js} +1 -1
- package/dist/cdn/74CLXGQH.js +2 -0
- package/dist/cdn/{YZYPUE3P.js → 74UIHSVE.js} +1 -1
- package/dist/cdn/{AVEA3JYC.js → 773VWCGD.js} +1 -1
- package/dist/cdn/{54FANYIK.js → 7AOQ4FPG.js} +1 -1
- package/dist/cdn/{YVAWGS4S.js → 7M4ANW77.js} +1 -1
- package/dist/cdn/{B4XZL24D.js → 7YNDWV76.js} +1 -1
- package/dist/cdn/{2IBAD62X.js → A332WZ6V.js} +1 -1
- package/dist/cdn/ATWAUE4R.js +2 -0
- package/dist/cdn/{WC7KZ5RN.js → BTSHRUHD.js} +1 -1
- package/dist/cdn/BZJYGCDK.js +2 -0
- package/dist/cdn/{ZC4LZHSU.js → C2BK5CUC.js} +1 -1
- package/dist/cdn/{H36BMH7D.js → C4DX6ZIA.js} +1 -1
- package/dist/cdn/{3WYNE4QF.js → C4PPQBLW.js} +1 -1
- package/dist/cdn/{UEXXVM6G.js → CBUNIAKL.js} +1 -1
- package/dist/cdn/{FJHS7DDZ.js → CDGEWGDD.js} +1 -1
- package/dist/cdn/{AFDMIMYJ.js → CQYI4Z2Z.js} +1 -1
- package/dist/cdn/{SUKQDR3P.js → CUSR767T.js} +1 -1
- package/dist/cdn/{JSEQVKIC.js → CUTXFNYN.js} +1 -1
- package/dist/cdn/{GUV5FMJI.js → CZPSEMDH.js} +1 -1
- package/dist/cdn/{GLXEUJPR.js → D2HPEC7F.js} +1 -1
- package/dist/cdn/{KY6BBDSF.js → DAXLXKIY.js} +1 -1
- package/dist/cdn/{IFEFYG7Y.js → DEQNFOAS.js} +1 -1
- package/dist/cdn/{DPV2S2W4.js → DJMAPSDY.js} +1 -1
- package/dist/cdn/{UZZ34E4T.js → DZSC3TJX.js} +1 -1
- package/dist/cdn/{VNENCDEM.js → E4MGJ47Y.js} +1 -1
- package/dist/cdn/{6334DHXU.js → EHS7L663.js} +1 -1
- package/dist/cdn/{JJ2XXUYL.js → EJUEMY56.js} +1 -1
- package/dist/cdn/{ACJ3OWNF.js → ERBKUSSX.js} +1 -1
- package/dist/cdn/{7Y3634W2.js → F3E7QPPC.js} +1 -1
- package/dist/cdn/{GVWCR74G.js → F5MS5PBN.js} +1 -1
- package/dist/cdn/{B6TEVZWE.js → F7RQCNJ4.js} +1 -1
- package/dist/cdn/{KN2YMMJU.js → FE3TGEP7.js} +1 -1
- package/dist/cdn/{4KMJ4MXD.js → FKPCRFUW.js} +1 -1
- package/dist/cdn/{WRN5WBB6.js → FKX46Z6K.js} +1 -1
- package/dist/cdn/{7UDR7DFA.js → FZTLSQJL.js} +1 -1
- package/dist/cdn/{7HNSFXSY.js → G62VTWNT.js} +1 -1
- package/dist/cdn/{LNQQJUF3.js → GEKASHNF.js} +1 -1
- package/dist/cdn/{IONE557M.js → GYYFBZS2.js} +1 -1
- package/dist/cdn/{N32WSYSG.js → HQHM5NWX.js} +1 -1
- package/dist/cdn/{XKBIB37X.js → I2DNOFC6.js} +1 -1
- package/dist/cdn/{CKKHWLPH.js → I5HZNPIE.js} +1 -1
- package/dist/cdn/{ACPUOOSS.js → IHGSINVA.js} +1 -1
- package/dist/cdn/{LZFQODN7.js → IRDSJTUK.js} +1 -1
- package/dist/cdn/{62HI5T32.js → IXQQO6HC.js} +1 -1
- package/dist/cdn/{6QHKZ6N2.js → JDAOWOTY.js} +1 -1
- package/dist/cdn/{WVRMCTHV.js → JMKB4CRU.js} +1 -1
- package/dist/cdn/JQIHTMWX.js +2 -0
- package/dist/cdn/{B6JI7EFV.js → KB2WIMAL.js} +1 -1
- package/dist/cdn/{EPDFNXOA.js → KCENWQ6Z.js} +1 -1
- package/dist/cdn/KJNTF66K.js +2 -0
- package/dist/cdn/{M7L5IJNX.js → KQGUXAM6.js} +1 -1
- package/dist/cdn/M2TFDONT.js +2 -0
- package/dist/cdn/{H7USABMA.js → MD2UCHOX.js} +1 -1
- package/dist/cdn/{HCDCLO25.js → MRRVOAJL.js} +1 -1
- package/dist/cdn/{ZQZPGG2I.js → MWMTHMMN.js} +1 -1
- package/dist/cdn/{WF3KH3KX.js → N3YQ6P66.js} +1 -1
- package/dist/cdn/{D53MEGF3.js → N6V2UT62.js} +1 -1
- package/dist/cdn/{KZII5LW7.js → NAJTDRNC.js} +1 -1
- package/dist/cdn/{ISATMK3J.js → ND7KY7GE.js} +1 -1
- package/dist/cdn/{HRXTLTVO.js → NDVX6CLP.js} +1 -1
- package/dist/cdn/{RCL7WVWK.js → O6PZKJ7R.js} +1 -1
- package/dist/cdn/OB3Z74X6.js +2 -0
- package/dist/cdn/{S6Y5KXTC.js → OGNY6ZIB.js} +1 -1
- package/dist/cdn/{WGTXCQ3O.js → OJO5NPP3.js} +1 -1
- package/dist/cdn/{EILZPSBO.js → OWJYARYV.js} +1 -1
- package/dist/cdn/{NKHYGAEA.js → OXKGEAUB.js} +1 -1
- package/dist/cdn/{YVL6U4S3.js → PJSI5N6F.js} +1 -1
- package/dist/cdn/{H5AJS6TE.js → PW2XM5HR.js} +1 -1
- package/dist/cdn/{LNTMBB4T.js → QABVNEOF.js} +1 -1
- package/dist/cdn/{PJFK6R25.js → QN4XN67Z.js} +1 -1
- package/dist/cdn/QXPWDVC2.js +2 -0
- package/dist/cdn/{ADNBYFDU.js → R4C3WA5S.js} +1 -1
- package/dist/cdn/{J7AXA5LK.js → RDOHAXOA.js} +1 -1
- package/dist/cdn/{SJCVYBDF.js → REW7C42W.js} +1 -1
- package/dist/cdn/{GS6RPTCF.js → RIEKXKB2.js} +1 -1
- package/dist/cdn/{ROZCUEUS.js → ROY5CHB3.js} +1 -1
- package/dist/cdn/{MGC2TVCO.js → RUNWK23I.js} +1 -1
- package/dist/cdn/{SGRN6ZVC.js → RVXZUGJA.js} +1 -1
- package/dist/cdn/{ID36ZNWO.js → RZR44QGM.js} +1 -1
- package/dist/cdn/{X5NQ6JCY.js → SBQVCX2M.js} +1 -1
- package/dist/cdn/{54YEESGE.js → SGZ3IG5W.js} +1 -1
- package/dist/cdn/{4KKONFB4.js → SH7DQCS7.js} +1 -1
- package/dist/cdn/SS4J7QES.js +2 -0
- package/dist/cdn/{JPLDIX5B.js → TFTS26NS.js} +1 -1
- package/dist/cdn/{2URTQOMI.js → TMWGSGAP.js} +1 -1
- package/dist/cdn/{VRXZT4W2.js → TPML2DIA.js} +1 -1
- package/dist/cdn/{2DULJTZM.js → TQJK5WF5.js} +1 -1
- package/dist/cdn/{W3RFQNTS.js → TRN7FUFM.js} +1 -1
- package/dist/cdn/U6NA5WAH.js +2 -0
- package/dist/cdn/{D2VHXI3B.js → UE4QYUAU.js} +1 -1
- package/dist/cdn/{OVLA6XSV.js → UIFHJ5IO.js} +1 -1
- package/dist/cdn/UOSSQPFY.js +2 -0
- package/dist/cdn/{XPPVR4JK.js → VCDOY22T.js} +1 -1
- package/dist/cdn/{GMX26I6Z.js → VVJGLEIA.js} +1 -1
- package/dist/cdn/{HOII54SV.js → VWQPK5JA.js} +1 -1
- package/dist/cdn/{OKQZCFIY.js → VYXKMJSU.js} +1 -1
- package/dist/cdn/{MVD7UGWN.js → VYZ6WAWT.js} +1 -1
- package/dist/cdn/W3N2DKPC.js +2 -0
- package/dist/cdn/{IHAUCNQX.js → WAXTXFBL.js} +1 -1
- package/dist/cdn/{3ZONR255.js → WRQD4O6A.js} +1 -1
- package/dist/cdn/{FO5JD4B6.js → WUBPEGFV.js} +1 -1
- package/dist/cdn/{PHXN4HLP.js → WVJUNLFN.js} +1 -1
- package/dist/cdn/{GBZSLSHZ.js → WYGNUS2B.js} +1 -1
- package/dist/cdn/{KDQ3UZH7.js → XCNAJ4XA.js} +1 -1
- package/dist/cdn/{KVFTDPP2.js → XTGDCTQE.js} +1 -1
- package/dist/cdn/{FBWOZGYD.js → Y44WJ7Z2.js} +1 -1
- package/dist/cdn/{UZDC6JVX.js → Y6WCKCHJ.js} +1 -1
- package/dist/cdn/{BIBFBRJ4.js → YBFI2FQL.js} +1 -1
- package/dist/cdn/{ORWPOYLO.js → YFUBBPNI.js} +1 -1
- package/dist/cdn/{LJBIF6OV.js → YI3ZMHS5.js} +1 -1
- package/dist/cdn/{GMC5U6MT.js → YNG6JO67.js} +1 -1
- package/dist/cdn/{5DZK4XYB.js → Z2GSU7Q2.js} +1 -1
- package/dist/cdn/{X433YAPN.js → Z7NNDJEN.js} +1 -1
- package/dist/cdn/{TWFY346Z.js → ZBN5LXKS.js} +1 -1
- package/dist/cdn/{YQWYH3MV.js → ZEEFJOPQ.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/date.js +3 -3
- package/dist/chunks/dom.js +15 -3
- package/dist/chunks/floating-ui.js +1 -1
- package/dist/chunks/label.js +6 -6
- package/dist/chunks/locale.js +3 -6
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useForm.js +10 -4
- package/dist/chunks/useTime.js +40 -45
- package/dist/components/calcite-card/customElement.d.ts +1 -1
- package/dist/components/calcite-carousel/customElement.js +5 -6
- package/dist/components/calcite-checkbox/customElement.d.ts +4 -4
- package/dist/components/calcite-chip-group/customElement.js +1 -1
- package/dist/components/calcite-color-picker/customElement.js +1 -1
- package/dist/components/calcite-color-picker-hex-input/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.js +11 -6
- package/dist/components/calcite-flow/customElement.d.ts +2 -2
- package/dist/components/calcite-flow/customElement.js +1 -1
- package/dist/components/calcite-flow-item/customElement.js +1 -1
- package/dist/components/calcite-input/customElement.js +4 -6
- package/dist/components/calcite-input-text/customElement.js +1 -1
- package/dist/components/calcite-list/customElement.d.ts +4 -4
- package/dist/components/calcite-list/customElement.js +4 -5
- package/dist/components/calcite-list-item/customElement.d.ts +6 -6
- package/dist/components/calcite-list-item/customElement.js +17 -16
- package/dist/components/calcite-list-item-group/customElement.d.ts +1 -1
- package/dist/components/calcite-loader/customElement.js +3 -3
- package/dist/components/calcite-radio-button/customElement.d.ts +5 -5
- package/dist/components/calcite-radio-button/customElement.js +1 -1
- package/dist/components/calcite-radio-button-group/customElement.d.ts +4 -4
- package/dist/components/calcite-radio-button-group/customElement.js +3 -3
- package/dist/components/calcite-rating/customElement.d.ts +7 -7
- package/dist/components/calcite-rating/customElement.js +13 -9
- package/dist/components/calcite-tab/customElement.d.ts +1 -1
- package/dist/components/calcite-tab/customElement.js +2 -1
- package/dist/components/calcite-tab-nav/customElement.d.ts +3 -3
- package/dist/components/calcite-tab-nav/customElement.js +12 -7
- package/dist/components/calcite-tab-title/customElement.d.ts +3 -3
- package/dist/components/calcite-tab-title/customElement.js +2 -0
- package/dist/components/calcite-table/customElement.js +22 -14
- package/dist/components/calcite-table-cell/customElement.d.ts +2 -2
- package/dist/components/calcite-table-cell/customElement.js +6 -0
- package/dist/components/calcite-table-header/customElement.d.ts +4 -4
- package/dist/components/calcite-table-header/customElement.js +2 -0
- package/dist/components/calcite-table-row/customElement.js +5 -3
- package/dist/components/calcite-tabs/customElement.js +3 -2
- package/dist/components/calcite-text-area/customElement.d.ts +12 -12
- package/dist/components/calcite-text-area/customElement.js +5 -3
- package/dist/components/calcite-tile/customElement.d.ts +6 -6
- package/dist/components/calcite-time-picker/customElement.d.ts +1 -1
- package/dist/components/calcite-time-picker/customElement.js +35 -15
- package/dist/components/calcite-tooltip/customElement.d.ts +2 -2
- package/dist/components/calcite-tooltip/customElement.js +1 -1
- package/dist/components/calcite-tree/customElement.js +7 -6
- package/dist/components/calcite-tree-item/customElement.d.ts +3 -3
- package/dist/components/calcite-tree-item/customElement.js +12 -6
- package/dist/controllers/useSortable.d.ts +2 -2
- package/dist/controllers/useTime.d.ts +20 -20
- 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.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/utils/dom.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/2MWPMRNJ.js +0 -2
- package/dist/cdn/5ZXYOEVA.js +0 -2
- package/dist/cdn/AO2HCAIF.js +0 -2
- package/dist/cdn/AP2LDRUV.js +0 -2
- package/dist/cdn/BAKFDEYB.js +0 -2
- package/dist/cdn/BTML4MEJ.js +0 -2
- package/dist/cdn/GZU4L4YE.js +0 -2
- package/dist/cdn/IVJ5CA2B.js +0 -2
- package/dist/cdn/RW3PY4A7.js +0 -2
- package/dist/cdn/SB3DKUEP.js +0 -2
- package/dist/cdn/T7EQTOMC.js +0 -2
- package/dist/cdn/UWZCA674.js +0 -2
- package/dist/cdn/VYRAJF74.js +0 -2
- package/dist/cdn/ZWWMN3TM.js +0 -2
- package/dist/cdn/ZXAA7KJS.js +0 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as customElement } from "../../chunks/runtime.js";
|
|
3
3
|
import { keyed } from "lit/directives/keyed.js";
|
|
4
|
+
import { isEqual } from "es-toolkit";
|
|
4
5
|
import { css, html, nothing } from "lit";
|
|
5
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
7
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
@@ -35,7 +36,6 @@ class ListItem extends LitElement {
|
|
|
35
36
|
this.hasContentEnd = false;
|
|
36
37
|
this.hasContentStart = false;
|
|
37
38
|
this.hasCustomContent = false;
|
|
38
|
-
this.level = null;
|
|
39
39
|
this.expandable = false;
|
|
40
40
|
this.active = false;
|
|
41
41
|
this.bordered = false;
|
|
@@ -47,13 +47,11 @@ class ListItem extends LitElement {
|
|
|
47
47
|
this.dragHandle = false;
|
|
48
48
|
this.expanded = false;
|
|
49
49
|
this.filterHidden = false;
|
|
50
|
-
this.interactionMode = null;
|
|
51
50
|
this.displayMode = "flat";
|
|
52
51
|
this.addToItems = [];
|
|
53
52
|
this.moveToItems = [];
|
|
54
53
|
this.scale = "m";
|
|
55
54
|
this.selected = false;
|
|
56
|
-
this.selectionMode = null;
|
|
57
55
|
this.sortHandleOpen = false;
|
|
58
56
|
this.unavailable = false;
|
|
59
57
|
this.topLayerDisabled = false;
|
|
@@ -110,7 +108,7 @@ class ListItem extends LitElement {
|
|
|
110
108
|
connectedCallback() {
|
|
111
109
|
super.connectedCallback();
|
|
112
110
|
const { el } = this;
|
|
113
|
-
this.parentListEl = el.closest(listSelector);
|
|
111
|
+
this.parentListEl = el.closest(listSelector) || void 0;
|
|
114
112
|
this.level = getDepth(el) + 1;
|
|
115
113
|
this.setSelectionDefaults();
|
|
116
114
|
}
|
|
@@ -133,7 +131,10 @@ class ListItem extends LitElement {
|
|
|
133
131
|
if (changes.has("displayMode") && this.hasUpdated) {
|
|
134
132
|
this.handleExpandableChange(this.defaultSlotRef.value);
|
|
135
133
|
}
|
|
136
|
-
|
|
134
|
+
const metadataChanged = changes.has("metadata");
|
|
135
|
+
const previousMetadata = changes.get("metadata");
|
|
136
|
+
const shouldEmitMetadataChange = metadataChanged && !isEqual(this.metadata, previousMetadata);
|
|
137
|
+
if ((changes.has("label") || changes.has("description") || shouldEmitMetadataChange) && this.hasUpdated) {
|
|
137
138
|
this.emitCalciteInternalListItemChange();
|
|
138
139
|
}
|
|
139
140
|
if (changes.has("expanded") && this.hasUpdated) {
|
|
@@ -151,7 +152,7 @@ class ListItem extends LitElement {
|
|
|
151
152
|
}
|
|
152
153
|
activeHandler(active) {
|
|
153
154
|
if (!active) {
|
|
154
|
-
this.focusCell(
|
|
155
|
+
this.focusCell(void 0, false);
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
158
|
handleClosedChange() {
|
|
@@ -289,7 +290,7 @@ class ListItem extends LitElement {
|
|
|
289
290
|
this.actionsStartRef.value,
|
|
290
291
|
this.contentRef.value,
|
|
291
292
|
this.actionsEndRef.value
|
|
292
|
-
].filter((el) => el && !el.hidden);
|
|
293
|
+
].filter((el) => !!(el && !el.hidden));
|
|
293
294
|
}
|
|
294
295
|
handleItemKeyDown(event) {
|
|
295
296
|
if (event.defaultPrevented) {
|
|
@@ -300,7 +301,7 @@ class ListItem extends LitElement {
|
|
|
300
301
|
const { containerRef, actionsStartRef: { value: actionsStartEl }, actionsEndRef: { value: actionsEndEl }, expanded, expandable } = this;
|
|
301
302
|
const cells = this.getGridCells();
|
|
302
303
|
const currentIndex = cells.findIndex((cell) => composedPath.includes(cell));
|
|
303
|
-
if (key === "Enter" && !composedPath.includes(actionsStartEl) && !composedPath.includes(actionsEndEl)) {
|
|
304
|
+
if (key === "Enter" && actionsStartEl && !composedPath.includes(actionsStartEl) && actionsEndEl && !composedPath.includes(actionsEndEl)) {
|
|
304
305
|
event.preventDefault();
|
|
305
306
|
this.toggleSelected(event.shiftKey);
|
|
306
307
|
} else if (key === "ArrowRight") {
|
|
@@ -309,7 +310,7 @@ class ListItem extends LitElement {
|
|
|
309
310
|
if (currentIndex === -1) {
|
|
310
311
|
if (!expanded && expandable) {
|
|
311
312
|
this.toggle(true);
|
|
312
|
-
this.focusCell(
|
|
313
|
+
this.focusCell();
|
|
313
314
|
} else if (cells[0]) {
|
|
314
315
|
this.focusCell(cells[0]);
|
|
315
316
|
}
|
|
@@ -320,27 +321,27 @@ class ListItem extends LitElement {
|
|
|
320
321
|
event.preventDefault();
|
|
321
322
|
const prevIndex = currentIndex - 1;
|
|
322
323
|
if (currentIndex === -1) {
|
|
323
|
-
this.focusCell(
|
|
324
|
+
this.focusCell();
|
|
324
325
|
if (expanded && expandable) {
|
|
325
326
|
this.toggle(false);
|
|
326
327
|
} else {
|
|
327
328
|
this.calciteInternalFocusPreviousItem.emit();
|
|
328
329
|
}
|
|
329
330
|
} else if (currentIndex === 0) {
|
|
330
|
-
this.focusCell(
|
|
331
|
+
this.focusCell();
|
|
331
332
|
containerRef.value.focus();
|
|
332
333
|
} else if (cells[currentIndex] && cells[prevIndex]) {
|
|
333
334
|
this.focusCell(cells[prevIndex]);
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
|
-
|
|
338
|
-
this.focusCell(
|
|
338
|
+
clearCellFocus() {
|
|
339
|
+
this.focusCell();
|
|
339
340
|
}
|
|
340
341
|
setFocusCell(focusEl, focusedEl, saveFocusIndex) {
|
|
341
342
|
const { parentListEl } = this;
|
|
342
343
|
if (saveFocusIndex) {
|
|
343
|
-
focusMap.set(parentListEl,
|
|
344
|
+
focusMap.set(parentListEl, void 0);
|
|
344
345
|
}
|
|
345
346
|
const gridCells = this.getGridCells();
|
|
346
347
|
gridCells.forEach((tableCell) => {
|
|
@@ -459,14 +460,14 @@ class ListItem extends LitElement {
|
|
|
459
460
|
const showSelectionBorder = selectionMode !== "none" && selectionAppearance === "border";
|
|
460
461
|
const showSelectionHighlight = selectionMode !== "none" && selectionAppearance === "highlight";
|
|
461
462
|
const containerInteractive = interactionMode === "interactive";
|
|
462
|
-
return this.interactiveContainer({ disabled, children: html`<div class=${safeClassMap({ [CSS.wrapper]: true, [CSS.wrapperBordered]: wrapperBordered })}><div .ariaExpanded=${expandable ? expanded :
|
|
463
|
+
return this.interactiveContainer({ disabled, children: html`<div class=${safeClassMap({ [CSS.wrapper]: true, [CSS.wrapperBordered]: wrapperBordered })}><div .ariaExpanded=${expandable ? expanded : void 0} .ariaLabel=${label} .ariaLevel=${level} .ariaSelected=${selected} class=${safeClassMap({
|
|
463
464
|
[CSS.row]: true,
|
|
464
465
|
[CSS.container]: true,
|
|
465
466
|
[CSS.containerHover]: containerInteractive,
|
|
466
467
|
[CSS.containerBorder]: showSelectionBorder,
|
|
467
468
|
[CSS.containerBorderSelected]: showSelectionBorder && selected,
|
|
468
469
|
[CSS.containerHighlightSelected]: showSelectionHighlight && selected
|
|
469
|
-
})} .hidden=${closed || filterHidden} @focus=${this.
|
|
470
|
+
})} .hidden=${closed || filterHidden} @focus=${this.clearCellFocus} @focusin=${this.emitInternalListItemActive} @keydown=${this.handleItemKeyDown} role=row .tabIndex=${active ? 0 : -1} ${ref(this.containerRef)}>${this.renderDragHandle()}${this.renderSelected()}${this.renderExpanded()}<div class=${safeClassMap({
|
|
470
471
|
[CSS.contentContainerWrapper]: true,
|
|
471
472
|
[CSS.contentContainerWrapperBordered]: contentContainerWrapperBordered
|
|
472
473
|
})}>${this.renderActionsStart()}${this.renderContentContainer()}${this.renderActionsEnd()}</div></div>${this.renderContentBottom()}</div>${this.renderDefaultContainer()}` });
|
|
@@ -15,7 +15,7 @@ export abstract class ListItemGroup extends LitElement {
|
|
|
15
15
|
*/
|
|
16
16
|
accessor disabled: boolean;
|
|
17
17
|
/** Specifies the heading text for the nested `calcite-list-item` rows. */
|
|
18
|
-
accessor heading: string;
|
|
18
|
+
accessor heading: string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Specifies the size of the component.
|
|
21
21
|
*
|
|
@@ -82,9 +82,9 @@ class Loader extends LitElement {
|
|
|
82
82
|
const isDeterminate = type !== "indeterminate";
|
|
83
83
|
const valueNow = Math.floor(value);
|
|
84
84
|
this.el.ariaLabel = label;
|
|
85
|
-
this.el.ariaValueMax = isDeterminate ? "100" :
|
|
86
|
-
this.el.ariaValueMin = isDeterminate ? "0" :
|
|
87
|
-
this.el.ariaValueNow = isDeterminate ? valueNow.toString() :
|
|
85
|
+
this.el.ariaValueMax = isDeterminate ? "100" : null;
|
|
86
|
+
this.el.ariaValueMin = isDeterminate ? "0" : null;
|
|
87
|
+
this.el.ariaValueNow = isDeterminate ? valueNow.toString() : null;
|
|
88
88
|
setAttribute(this.el, "id", id);
|
|
89
89
|
this.el.role = "progressbar";
|
|
90
90
|
return html`<div class=${safeClassMap(CSS.rings)}>${this.renderRing("track")}${this.renderRing("progress")}${!inline && isDeterminate && html`<div class=${safeClassMap(CSS.percentage)}>${this.formatValue()}</div>` || ""}</div>${!inline && text && html`<div class=${safeClassMap(CSS.text)}>${text}</div>` || ""}`;
|
|
@@ -26,11 +26,11 @@ export abstract class RadioButton extends LitElement {
|
|
|
26
26
|
*
|
|
27
27
|
* When not set, the component is associated with its ancestor form element, if one exists.
|
|
28
28
|
*/
|
|
29
|
-
accessor form: string;
|
|
29
|
+
accessor form: string | undefined;
|
|
30
30
|
/** Specifies the component's label text. */
|
|
31
|
-
accessor labelText: string;
|
|
31
|
+
accessor labelText: string | undefined;
|
|
32
32
|
/** Specifies the name of the component. Required to pass the component's `value` on form submission. */
|
|
33
|
-
accessor name: string;
|
|
33
|
+
accessor name: string | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* When `true` and the component resides in a form,
|
|
36
36
|
* the component must have a value selected from the `calcite-radio-button-group` in order for the form to submit.
|
|
@@ -56,7 +56,7 @@ export abstract class RadioButton extends LitElement {
|
|
|
56
56
|
* @internal
|
|
57
57
|
* @mdn [validationMessage](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/validationMessage)
|
|
58
58
|
*/
|
|
59
|
-
accessor validationMessage: string;
|
|
59
|
+
accessor validationMessage: string | undefined;
|
|
60
60
|
/**
|
|
61
61
|
* The component's current validation state.
|
|
62
62
|
*
|
|
@@ -84,7 +84,7 @@ export abstract class RadioButton extends LitElement {
|
|
|
84
84
|
* @param validationMessage
|
|
85
85
|
* @internal
|
|
86
86
|
*/
|
|
87
|
-
setValidity(validity: ValidityStateFlags, validationMessage?: string): Promise<void>;
|
|
87
|
+
setValidity(validity: ValidityStateFlags, validationMessage?: string | undefined): Promise<void>;
|
|
88
88
|
/**
|
|
89
89
|
* Fires only when the radio button is checked. This behavior is identical to the native HTML input element.
|
|
90
90
|
* Since this event does not fire when the radio button is unchecked, it's not recommended to attach a listener for this event
|
|
@@ -55,7 +55,7 @@ class RadioButton extends LitElement {
|
|
|
55
55
|
return this.focusSetter(() => this.containerRef.value, options);
|
|
56
56
|
}
|
|
57
57
|
async setValidity(validity, validationMessage = this.validationMessage) {
|
|
58
|
-
this.elementInternals.setValidity(validity, validationMessage);
|
|
58
|
+
this.elementInternals.setValidity(validity, validationMessage || "");
|
|
59
59
|
}
|
|
60
60
|
connectedCallback() {
|
|
61
61
|
this.rootNode = this.el.getRootNode();
|
|
@@ -18,7 +18,7 @@ export abstract class RadioButtonGroup extends LitElement {
|
|
|
18
18
|
*/
|
|
19
19
|
accessor disabled: boolean;
|
|
20
20
|
/** Specifies the component's label text. */
|
|
21
|
-
accessor labelText: string;
|
|
21
|
+
accessor labelText: string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Specifies the layout of the component.
|
|
24
24
|
*
|
|
@@ -47,7 +47,7 @@ export abstract class RadioButtonGroup extends LitElement {
|
|
|
47
47
|
*/
|
|
48
48
|
accessor scale: Scale;
|
|
49
49
|
/** Specifies the component's selected item. */
|
|
50
|
-
get selectedItem(): RadioButton;
|
|
50
|
+
get selectedItem(): RadioButton | null;
|
|
51
51
|
/**
|
|
52
52
|
* Specifies the status of the validation message.
|
|
53
53
|
*
|
|
@@ -55,9 +55,9 @@ export abstract class RadioButtonGroup extends LitElement {
|
|
|
55
55
|
*/
|
|
56
56
|
accessor status: Status;
|
|
57
57
|
/** Specifies the validation icon to display under the component. */
|
|
58
|
-
accessor validationIcon: IconName | boolean;
|
|
58
|
+
accessor validationIcon: IconName | boolean | undefined;
|
|
59
59
|
/** Specifies the validation message to display under the component. */
|
|
60
|
-
accessor validationMessage: string;
|
|
60
|
+
accessor validationMessage: string | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* Sets focus on the fist focusable `calcite-radio-button` element in the component.
|
|
63
63
|
*
|
|
@@ -64,7 +64,7 @@ class RadioButtonGroup extends LitElement {
|
|
|
64
64
|
this.mutationObserver?.disconnect();
|
|
65
65
|
}
|
|
66
66
|
handleInvalidFormEvent(event) {
|
|
67
|
-
const message = this.validationMessage || event.target.validationMessage;
|
|
67
|
+
const message = this.validationMessage || event.target.validationMessage || "";
|
|
68
68
|
displayValidationMessage(this, {
|
|
69
69
|
message,
|
|
70
70
|
icon: true,
|
|
@@ -73,7 +73,7 @@ class RadioButtonGroup extends LitElement {
|
|
|
73
73
|
}
|
|
74
74
|
passPropsToRadioButtons() {
|
|
75
75
|
this.radioButtons = Array.from(this.el.querySelectorAll("calcite-radio-button"));
|
|
76
|
-
this.selectedItem = Array.from(this.radioButtons).reverse().find((radioButton) => radioButton.checked)
|
|
76
|
+
this.selectedItem = Array.from(this.radioButtons).reverse().find((radioButton) => radioButton.checked) ?? null;
|
|
77
77
|
if (this.radioButtons.length > 0) {
|
|
78
78
|
this.radioButtons.forEach((radioButton) => {
|
|
79
79
|
if (this.hasUpdated) {
|
|
@@ -87,7 +87,7 @@ class RadioButtonGroup extends LitElement {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
getFocusableRadioButton() {
|
|
90
|
-
return this.radioButtons.find((radiobutton) => !radiobutton.disabled)
|
|
90
|
+
return this.radioButtons.find((radiobutton) => !radiobutton.disabled);
|
|
91
91
|
}
|
|
92
92
|
radioButtonChangeHandler(event) {
|
|
93
93
|
this.selectedItem = event.target;
|
|
@@ -15,9 +15,9 @@ import type { IconName } from "../calcite-icon/interfaces.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export abstract class Rating extends LitElement {
|
|
17
17
|
/** Specifies a cumulative average from previous ratings to display. */
|
|
18
|
-
accessor average: number;
|
|
18
|
+
accessor average: number | undefined;
|
|
19
19
|
/** Specifies the number of previous ratings to display. */
|
|
20
|
-
accessor count: number;
|
|
20
|
+
accessor count: number | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* When `true`, interaction is prevented and the component is displayed with lower opacity.
|
|
23
23
|
*
|
|
@@ -29,9 +29,9 @@ export abstract class Rating extends LitElement {
|
|
|
29
29
|
*
|
|
30
30
|
* When not set, the component is associated with its ancestor form element, if one exists.
|
|
31
31
|
*/
|
|
32
|
-
accessor form: string;
|
|
32
|
+
accessor form: string | undefined;
|
|
33
33
|
/** Specifies the component's label text. */
|
|
34
|
-
accessor labelText: string;
|
|
34
|
+
accessor labelText: string | undefined;
|
|
35
35
|
/** Overrides individual strings used by the component. */
|
|
36
36
|
accessor messageOverrides: {
|
|
37
37
|
rating?: string;
|
|
@@ -39,7 +39,7 @@ export abstract class Rating extends LitElement {
|
|
|
39
39
|
stars?: string;
|
|
40
40
|
};
|
|
41
41
|
/** Specifies the name of the component. Required to pass the component's `value` on form submission. */
|
|
42
|
-
accessor name: string;
|
|
42
|
+
accessor name: string | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* When `true`, the component's value can be read, but cannot be modified.
|
|
45
45
|
*
|
|
@@ -65,9 +65,9 @@ export abstract class Rating extends LitElement {
|
|
|
65
65
|
*/
|
|
66
66
|
accessor status: Status;
|
|
67
67
|
/** Specifies the validation icon to display under the component. */
|
|
68
|
-
accessor validationIcon: IconName | boolean;
|
|
68
|
+
accessor validationIcon: IconName | boolean | undefined;
|
|
69
69
|
/** Specifies the validation message to display under the component. */
|
|
70
|
-
accessor validationMessage: string;
|
|
70
|
+
accessor validationMessage: string | undefined;
|
|
71
71
|
/**
|
|
72
72
|
* The component's current validation state.
|
|
73
73
|
*
|
|
@@ -90,12 +90,16 @@ class Rating extends LitElement {
|
|
|
90
90
|
willUpdate() {
|
|
91
91
|
this.starsMap = Array.from({ length: this.max }, (_, i) => {
|
|
92
92
|
const value = i + 1;
|
|
93
|
-
const
|
|
93
|
+
const hoverValue = this.hoverValue ?? 0;
|
|
94
|
+
const hasHoverValue = hoverValue > 0;
|
|
95
|
+
const hasAverage = this.average != null;
|
|
96
|
+
const averageValue = this.average ?? 0;
|
|
97
|
+
const average = !hasHoverValue && hasAverage && !this.value && value <= averageValue;
|
|
94
98
|
const checked = value === this.value;
|
|
95
|
-
const fraction =
|
|
96
|
-
const hovered = value <=
|
|
99
|
+
const fraction = hasAverage ? averageValue + 1 - value : 0;
|
|
100
|
+
const hovered = hasHoverValue && value <= hoverValue;
|
|
97
101
|
const id = `${this.guid}-${value}`;
|
|
98
|
-
const partial = !
|
|
102
|
+
const partial = !hasHoverValue && !this.value && hasAverage && !hovered && fraction > 0 && fraction < 1;
|
|
99
103
|
const selected = this.value >= value;
|
|
100
104
|
const tabIndex = this.getTabIndex(value);
|
|
101
105
|
return {
|
|
@@ -133,7 +137,7 @@ class Rating extends LitElement {
|
|
|
133
137
|
}
|
|
134
138
|
handleRatingPointerOut() {
|
|
135
139
|
this.isKeyboardInteraction = true;
|
|
136
|
-
this.hoverValue =
|
|
140
|
+
this.hoverValue = void 0;
|
|
137
141
|
}
|
|
138
142
|
handleHostKeyDown() {
|
|
139
143
|
this.isKeyboardInteraction = true;
|
|
@@ -141,7 +145,7 @@ class Rating extends LitElement {
|
|
|
141
145
|
handleLabelKeyDown(event) {
|
|
142
146
|
const inputValue = this.getValueFromLabelEvent(event);
|
|
143
147
|
const key = event.key;
|
|
144
|
-
const numberKey = key == " " ?
|
|
148
|
+
const numberKey = key == " " ? NaN : Number(key);
|
|
145
149
|
this.emit = true;
|
|
146
150
|
if (isNaN(numberKey)) {
|
|
147
151
|
switch (key) {
|
|
@@ -160,7 +164,7 @@ class Rating extends LitElement {
|
|
|
160
164
|
event.preventDefault();
|
|
161
165
|
break;
|
|
162
166
|
case "Tab":
|
|
163
|
-
this.hoverValue =
|
|
167
|
+
this.hoverValue = void 0;
|
|
164
168
|
break;
|
|
165
169
|
}
|
|
166
170
|
} else {
|
|
@@ -174,7 +178,7 @@ class Rating extends LitElement {
|
|
|
174
178
|
}
|
|
175
179
|
handleInputChange(event) {
|
|
176
180
|
if (this.isKeyboardInteraction === true) {
|
|
177
|
-
const inputVal = Number(event.target
|
|
181
|
+
const inputVal = Number(event.target.value);
|
|
178
182
|
this.hoverValue = inputVal;
|
|
179
183
|
this.value = inputVal;
|
|
180
184
|
}
|
|
@@ -199,7 +203,7 @@ class Rating extends LitElement {
|
|
|
199
203
|
}
|
|
200
204
|
updateFocus() {
|
|
201
205
|
this.hoverValue = this.value;
|
|
202
|
-
this.labelElements[this.value - 1]
|
|
206
|
+
this.labelElements[this.value - 1]?.focus();
|
|
203
207
|
}
|
|
204
208
|
getTabIndex(value) {
|
|
205
209
|
if (this.readOnly || this.value !== value && (this.value || value !== 1)) {
|
|
@@ -20,7 +20,7 @@ export abstract class Tab extends LitElement {
|
|
|
20
20
|
*
|
|
21
21
|
* When specified, use the same value on the `calcite-tab-title`.
|
|
22
22
|
*/
|
|
23
|
-
accessor tab: string;
|
|
23
|
+
accessor tab: string | undefined;
|
|
24
24
|
/** Returns the index of the component item within the tab array. */
|
|
25
25
|
getTabIndex(): Promise<number>;
|
|
26
26
|
}
|
|
@@ -17,6 +17,7 @@ class Tab extends LitElement {
|
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
19
|
this.guid = IDS.tabTitleId(guid());
|
|
20
|
+
this.parentTabsEl = null;
|
|
20
21
|
this.scale = "m";
|
|
21
22
|
this.selected = false;
|
|
22
23
|
this.listenOn(document.body, "calciteInternalTabChange", this.internalTabChangeHandler);
|
|
@@ -31,7 +32,7 @@ class Tab extends LitElement {
|
|
|
31
32
|
return Array.prototype.indexOf.call(nodeListToArray(this.el.parentElement.children).filter((el) => el.matches("calcite-tab")), this.el);
|
|
32
33
|
}
|
|
33
34
|
_updateAriaInfo(tabIds = [], titleIds = []) {
|
|
34
|
-
this.labeledBy = titleIds[tabIds.indexOf(this.el.id)] ||
|
|
35
|
+
this.labeledBy = titleIds[tabIds.indexOf(this.el.id)] || void 0;
|
|
35
36
|
}
|
|
36
37
|
connectedCallback() {
|
|
37
38
|
super.connectedCallback();
|
|
@@ -24,11 +24,11 @@ export abstract class TabNav extends LitElement {
|
|
|
24
24
|
*/
|
|
25
25
|
accessor position: TabPosition;
|
|
26
26
|
/** Specifies the component's selected `calcite-tab-title`. */
|
|
27
|
-
get selectedTitle(): TabTitle;
|
|
27
|
+
get selectedTitle(): TabTitle | null;
|
|
28
28
|
/** Specifies the name when saving selected `calcite-tab` data to `localStorage`. */
|
|
29
|
-
accessor storageId: string;
|
|
29
|
+
accessor storageId: string | undefined;
|
|
30
30
|
/** Specifies text to update multiple components to keep in sync if one changes. */
|
|
31
|
-
accessor syncId: string;
|
|
31
|
+
accessor syncId: string | undefined;
|
|
32
32
|
/** Emits when the selected `calcite-tab` changes. */
|
|
33
33
|
readonly calciteTabChange: import("@arcgis/lumina").TargetedEvent<this, void>;
|
|
34
34
|
readonly "@eventTypes": {
|
|
@@ -49,9 +49,9 @@ class TabNav extends LitElement {
|
|
|
49
49
|
this.listen("calciteInternalTabsFocusNext", this.focusNextTabHandler);
|
|
50
50
|
this.listen("calciteInternalTabsFocusFirst", this.focusFirstTabHandler);
|
|
51
51
|
this.listen("calciteInternalTabsFocusLast", this.focusLastTabHandler);
|
|
52
|
+
this.listen("calciteInternalTabTitleRegister", this.updateTabTitles);
|
|
52
53
|
this.listen("calciteInternalTabsActivate", this.internalActivateTabHandler);
|
|
53
54
|
this.listen("calciteInternalTabsClose", this.internalCloseTabHandler);
|
|
54
|
-
this.listen("calciteInternalTabTitleRegister", this.updateTabTitles);
|
|
55
55
|
this.listenOn(document.body, "calciteInternalTabChange", this.globalInternalTabChangeHandler);
|
|
56
56
|
}
|
|
57
57
|
static {
|
|
@@ -62,14 +62,17 @@ class TabNav extends LitElement {
|
|
|
62
62
|
}
|
|
63
63
|
connectedCallback() {
|
|
64
64
|
super.connectedCallback();
|
|
65
|
-
this.parentTabsEl = this.el.closest("calcite-tabs");
|
|
65
|
+
this.parentTabsEl = this.el.closest("calcite-tabs") ?? void 0;
|
|
66
66
|
this.resizeObserver?.observe(this.el);
|
|
67
67
|
}
|
|
68
68
|
async load() {
|
|
69
69
|
const storageKey = `calcite-tab-nav-${this.storageId}`;
|
|
70
|
-
if (localStorage && this.storageId
|
|
71
|
-
const
|
|
72
|
-
|
|
70
|
+
if (localStorage && this.storageId) {
|
|
71
|
+
const storageItem = localStorage.getItem(storageKey);
|
|
72
|
+
if (storageItem) {
|
|
73
|
+
const storedTab = JSON.parse(storageItem);
|
|
74
|
+
this.selectedTabId = storedTab;
|
|
75
|
+
}
|
|
73
76
|
}
|
|
74
77
|
}
|
|
75
78
|
willUpdate(changes) {
|
|
@@ -82,8 +85,10 @@ class TabNav extends LitElement {
|
|
|
82
85
|
this.selectedTabIdChanged();
|
|
83
86
|
}
|
|
84
87
|
const { parentTabsEl } = this;
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
if (parentTabsEl) {
|
|
89
|
+
this.layout = parentTabsEl.layout;
|
|
90
|
+
this.bordered = parentTabsEl.bordered;
|
|
91
|
+
}
|
|
87
92
|
this.effectiveDir = this.direction;
|
|
88
93
|
}
|
|
89
94
|
loaded() {
|
|
@@ -44,11 +44,11 @@ export abstract class TabTitle extends LitElement {
|
|
|
44
44
|
*/
|
|
45
45
|
accessor disabled: boolean;
|
|
46
46
|
/** Specifies an icon to display at the end of the component. */
|
|
47
|
-
accessor iconEnd: IconName;
|
|
47
|
+
accessor iconEnd: IconName | undefined;
|
|
48
48
|
/** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
|
|
49
|
-
accessor iconFlipRtl: FlipContext;
|
|
49
|
+
accessor iconFlipRtl: FlipContext | undefined;
|
|
50
50
|
/** Specifies an icon to display at the start of the component. */
|
|
51
|
-
accessor iconStart: IconName;
|
|
51
|
+
accessor iconStart: IconName | undefined;
|
|
52
52
|
/** Overrides individual strings used by the component. */
|
|
53
53
|
accessor messageOverrides: { close?: string; };
|
|
54
54
|
/**
|
|
@@ -37,11 +37,13 @@ class TabTitle extends LitElement {
|
|
|
37
37
|
this.direction = useDirection();
|
|
38
38
|
this.guid = IDS.host(guid());
|
|
39
39
|
this.mutationObserver = createObserver("mutation", () => this.updateHasText());
|
|
40
|
+
this.parentTabsEl = null;
|
|
40
41
|
this.resizeObserver = createObserver("resize", () => {
|
|
41
42
|
this.calciteInternalTabIconChanged.emit();
|
|
42
43
|
});
|
|
43
44
|
this.messages = useT9n();
|
|
44
45
|
this.interactiveContainer = useInteractive(this);
|
|
46
|
+
this.controls = null;
|
|
45
47
|
this.hasText = false;
|
|
46
48
|
this.bordered = false;
|
|
47
49
|
this.closable = false;
|
|
@@ -44,6 +44,10 @@ const styles = css`@charset "UTF-8";:host([scale=s]){--calcite-internal-table-ce
|
|
|
44
44
|
class Table extends LitElement {
|
|
45
45
|
constructor() {
|
|
46
46
|
super();
|
|
47
|
+
this.allRows = [];
|
|
48
|
+
this.bodyRows = [];
|
|
49
|
+
this.footRows = [];
|
|
50
|
+
this.headRows = [];
|
|
47
51
|
this.paginationRef = createRef();
|
|
48
52
|
this.tableBodySlotRef = createRef();
|
|
49
53
|
this.tableFootSlotRef = createRef();
|
|
@@ -51,6 +55,7 @@ class Table extends LitElement {
|
|
|
51
55
|
this.messages = useT9n({ blocking: true });
|
|
52
56
|
this.colCount = 0;
|
|
53
57
|
this.pageStartRow = 1;
|
|
58
|
+
this.readCellContentsToAT = false;
|
|
54
59
|
this.selectedCount = 0;
|
|
55
60
|
this._selectedItems = [];
|
|
56
61
|
this.bordered = false;
|
|
@@ -135,8 +140,8 @@ class Table extends LitElement {
|
|
|
135
140
|
rowPosition = leavingFooter ? lastBodyRow : enteringHeader ? lastHeadRow : rowPos - 1;
|
|
136
141
|
break;
|
|
137
142
|
}
|
|
138
|
-
const destinationCount = this.allRows
|
|
139
|
-
const adjustedPos = cellPosition > destinationCount ? destinationCount : cellPosition;
|
|
143
|
+
const destinationCount = this.allRows.find((row) => row.positionAll === rowPosition)?.cellCount;
|
|
144
|
+
const adjustedPos = destinationCount && cellPosition > destinationCount ? destinationCount : cellPosition;
|
|
140
145
|
if (rowPosition !== void 0) {
|
|
141
146
|
this.calciteInternalTableRowFocusChange.emit({
|
|
142
147
|
cellPosition: adjustedPos,
|
|
@@ -147,32 +152,35 @@ class Table extends LitElement {
|
|
|
147
152
|
}
|
|
148
153
|
}
|
|
149
154
|
getSlottedRows(el) {
|
|
150
|
-
|
|
155
|
+
if (!el) {
|
|
156
|
+
return [];
|
|
157
|
+
}
|
|
158
|
+
return el.assignedElements({ flatten: true }).filter((el2) => el2.matches("calcite-table-row"));
|
|
151
159
|
}
|
|
152
160
|
updateRows() {
|
|
153
|
-
const headRows = this.getSlottedRows(this.tableHeadSlotRef.value)
|
|
154
|
-
const bodyRows = this.getSlottedRows(this.tableBodySlotRef.value)
|
|
155
|
-
const footRows = this.getSlottedRows(this.tableFootSlotRef.value)
|
|
161
|
+
const headRows = this.getSlottedRows(this.tableHeadSlotRef.value);
|
|
162
|
+
const bodyRows = this.getSlottedRows(this.tableBodySlotRef.value);
|
|
163
|
+
const footRows = this.getSlottedRows(this.tableFootSlotRef.value);
|
|
156
164
|
const allRows = [...headRows, ...bodyRows, ...footRows];
|
|
157
|
-
headRows
|
|
158
|
-
const position = headRows
|
|
165
|
+
headRows.forEach((row) => {
|
|
166
|
+
const position = headRows.indexOf(row);
|
|
159
167
|
row.rowType = "head";
|
|
160
168
|
row.positionSection = position;
|
|
161
169
|
row.positionSectionLocalized = this.localizeNumber((position + 1).toString());
|
|
162
170
|
});
|
|
163
|
-
bodyRows
|
|
164
|
-
const position = bodyRows
|
|
171
|
+
bodyRows.forEach((row) => {
|
|
172
|
+
const position = bodyRows.indexOf(row);
|
|
165
173
|
row.rowType = "body";
|
|
166
174
|
row.positionSection = position;
|
|
167
175
|
row.positionSectionLocalized = this.localizeNumber((position + 1).toString());
|
|
168
176
|
});
|
|
169
|
-
footRows
|
|
170
|
-
const position = footRows
|
|
177
|
+
footRows.forEach((row) => {
|
|
178
|
+
const position = footRows.indexOf(row);
|
|
171
179
|
row.rowType = "foot";
|
|
172
180
|
row.positionSection = position;
|
|
173
181
|
row.positionSectionLocalized = this.localizeNumber((position + 1).toString());
|
|
174
182
|
});
|
|
175
|
-
allRows
|
|
183
|
+
allRows.forEach((row) => {
|
|
176
184
|
row.interactionMode = this.interactionMode;
|
|
177
185
|
row.selectionMode = this.selectionMode;
|
|
178
186
|
row.bodyRowCount = bodyRows?.length;
|
|
@@ -282,7 +290,7 @@ class Table extends LitElement {
|
|
|
282
290
|
[CSS.striped]: this.striped,
|
|
283
291
|
[CSS.tableContainer]: true
|
|
284
292
|
})}><table .ariaColCount=${this.colCount} .ariaMultiSelectable=${/* workaround to ensure the attr gets removed; we should be able to avoid the ternary when fixed */
|
|
285
|
-
this.selectionMode === "multiple" ? "true" :
|
|
293
|
+
this.selectionMode === "multiple" ? "true" : void 0} .ariaRowCount=${this.allRows?.length} class=${safeClassMap({ [CSS.tableFixed]: this.layout === "fixed" })} .role=${this.interactionMode === "interactive" ? "grid" : "table"} ${ref((el) => {
|
|
286
294
|
if (!el) {
|
|
287
295
|
return;
|
|
288
296
|
}
|
|
@@ -20,7 +20,7 @@ export abstract class TableCell extends LitElement {
|
|
|
20
20
|
*/
|
|
21
21
|
accessor alignment: Alignment;
|
|
22
22
|
/** Specifies the number of columns the component should span. */
|
|
23
|
-
accessor colSpan: number;
|
|
23
|
+
accessor colSpan: number | undefined;
|
|
24
24
|
/** Overrides individual strings used by the component. */
|
|
25
25
|
accessor messageOverrides: {
|
|
26
26
|
keyboardDeselect?: string;
|
|
@@ -30,7 +30,7 @@ export abstract class TableCell extends LitElement {
|
|
|
30
30
|
unselected?: string;
|
|
31
31
|
};
|
|
32
32
|
/** Specifies the number of rows the component should span. */
|
|
33
|
-
accessor rowSpan: number;
|
|
33
|
+
accessor rowSpan: number | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Sets focus on the component.
|
|
36
36
|
*
|
|
@@ -30,9 +30,15 @@ class TableCell extends LitElement {
|
|
|
30
30
|
this.focused = false;
|
|
31
31
|
this.selectionText = "";
|
|
32
32
|
this.alignment = "start";
|
|
33
|
+
this.disabled = false;
|
|
33
34
|
this.interactionMode = "interactive";
|
|
35
|
+
this.lastCell = false;
|
|
36
|
+
this.numberCell = false;
|
|
34
37
|
this.parentRowAlignment = "start";
|
|
38
|
+
this.parentRowIsSelected = false;
|
|
39
|
+
this.readCellContentsToAT = false;
|
|
35
40
|
this.scale = "m";
|
|
41
|
+
this.selectionCell = false;
|
|
36
42
|
}
|
|
37
43
|
static {
|
|
38
44
|
this.properties = { contentsText: [16, {}, { state: true }], focused: [16, {}, { state: true }], selectionText: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], colSpan: [11, {}, { reflect: true, type: Number }], disabled: [5, {}, { type: Boolean }], interactionMode: 1, lastCell: [5, {}, { type: Boolean }], messageOverrides: [0, {}, { attribute: false }], numberCell: [5, {}, { type: Boolean }], parentRowAlignment: 1, parentRowIsSelected: [5, {}, { type: Boolean }], parentRowPositionLocalized: 1, parentRowType: 1, positionInRow: [9, {}, { type: Number }], readCellContentsToAT: [5, {}, { type: Boolean }], rowSpan: [11, {}, { reflect: true, type: Number }], scale: 1, selectionCell: [5, {}, { type: Boolean }] };
|
|
@@ -17,11 +17,11 @@ export abstract class TableHeader extends LitElement {
|
|
|
17
17
|
*/
|
|
18
18
|
accessor alignment: Alignment;
|
|
19
19
|
/** Specifies the number of columns the component should span. */
|
|
20
|
-
accessor colSpan: number;
|
|
20
|
+
accessor colSpan: number | undefined;
|
|
21
21
|
/** Specifies a description for the component. Displays below the `heading`. */
|
|
22
|
-
accessor description: string;
|
|
22
|
+
accessor description: string | undefined;
|
|
23
23
|
/** Specifies the component's heading text. Displays above the `description`. */
|
|
24
|
-
accessor heading: string;
|
|
24
|
+
accessor heading: string | undefined;
|
|
25
25
|
/** Overrides individual strings used by the component. */
|
|
26
26
|
accessor messageOverrides: {
|
|
27
27
|
all?: string;
|
|
@@ -32,7 +32,7 @@ export abstract class TableHeader extends LitElement {
|
|
|
32
32
|
selectionColumn?: string;
|
|
33
33
|
};
|
|
34
34
|
/** Specifies the number of rows the component should span. */
|
|
35
|
-
accessor rowSpan: number;
|
|
35
|
+
accessor rowSpan: number | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* Sets focus on the component.
|
|
38
38
|
*
|
|
@@ -37,8 +37,10 @@ class TableHeader extends LitElement {
|
|
|
37
37
|
this.screenReaderText = "";
|
|
38
38
|
this.alignment = "start";
|
|
39
39
|
this.interactionMode = "interactive";
|
|
40
|
+
this.lastCell = false;
|
|
40
41
|
this.numberCell = false;
|
|
41
42
|
this.parentRowAlignment = "start";
|
|
43
|
+
this.parentRowIsSelected = false;
|
|
42
44
|
this.selectionCell = false;
|
|
43
45
|
}
|
|
44
46
|
static {
|