@esri/calcite-components 5.1.1-next.5 → 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/{ZACTCZNT.js → 27MK2V4G.js} +1 -1
- package/dist/cdn/{VOXGCDBD.js → 2MRL4RKW.js} +1 -1
- package/dist/cdn/{VNLB6ONW.js → 2PEF7GQE.js} +1 -1
- package/dist/cdn/{BQES6LWB.js → 2VL3OCAZ.js} +1 -1
- package/dist/cdn/{LYU2H6SF.js → 32QFEQZS.js} +1 -1
- package/dist/cdn/{V4P7PWKU.js → 34WAUXUE.js} +1 -1
- package/dist/cdn/{3WWVPHTN.js → 3BUDIEL3.js} +1 -1
- package/dist/cdn/{FIDNERXC.js → 3H6RVKMN.js} +1 -1
- package/dist/cdn/{KC4N5X3R.js → 3NNR2AZU.js} +1 -1
- package/dist/cdn/{YHXTGLCG.js → 3VNZC64N.js} +1 -1
- package/dist/cdn/{5KHTOS43.js → 3XFDQDVC.js} +1 -1
- package/dist/cdn/{KOB2L5OF.js → 3XMNPYNB.js} +1 -1
- package/dist/cdn/{ZG5BEBIM.js → 45C4ENM6.js} +1 -1
- package/dist/cdn/{5CZT7ZF2.js → 4NYY44U4.js} +1 -1
- package/dist/cdn/{ONJA74QA.js → 4Q7PL2KY.js} +1 -1
- package/dist/cdn/{YDF4DHQ3.js → 5CBFI2KM.js} +1 -1
- package/dist/cdn/{27CKMD4S.js → 5JIKOOZ6.js} +1 -1
- package/dist/cdn/{W3FK3ZCB.js → 5L5RJCKK.js} +1 -1
- package/dist/cdn/{SKUVMTOE.js → 5N32D533.js} +1 -1
- package/dist/cdn/{TQ74DQDG.js → 5QXKHC54.js} +1 -1
- package/dist/cdn/{M3IE6HID.js → 5RJTKL4J.js} +1 -1
- package/dist/cdn/{ANS7V4RO.js → 5SYOHCLD.js} +1 -1
- package/dist/cdn/{F5LUOXQA.js → 5WFJNGXP.js} +1 -1
- package/dist/cdn/5X2CR2NN.js +2 -0
- package/dist/cdn/{HETBUMGG.js → 6MUZLYOR.js} +1 -1
- package/dist/cdn/{VPAYQE3N.js → 6N246L5H.js} +1 -1
- package/dist/cdn/{UWMTXTYU.js → 6UM5PQBD.js} +1 -1
- package/dist/cdn/{H4MCSFNA.js → 6W4CWLXH.js} +1 -1
- package/dist/cdn/{VG7NP4T6.js → 72EJ64LI.js} +1 -1
- package/dist/cdn/{ZFON2VHB.js → 72XY7IDN.js} +1 -1
- package/dist/cdn/{M47XC6PF.js → 73EQ5TEB.js} +1 -1
- package/dist/cdn/{VPGSTQTT.js → 74CLXGQH.js} +1 -1
- package/dist/cdn/{OORT75JS.js → 74UIHSVE.js} +1 -1
- package/dist/cdn/{ZYP2R6KW.js → 773VWCGD.js} +1 -1
- package/dist/cdn/{SSDV2Z4W.js → 7AOQ4FPG.js} +1 -1
- package/dist/cdn/{APBFB6S3.js → 7M4ANW77.js} +1 -1
- package/dist/cdn/{7MDIWERA.js → 7YNDWV76.js} +1 -1
- package/dist/cdn/{4ZARBNVE.js → A332WZ6V.js} +1 -1
- package/dist/cdn/ATWAUE4R.js +2 -0
- package/dist/cdn/{QKYRWKTU.js → BTSHRUHD.js} +1 -1
- package/dist/cdn/BZJYGCDK.js +2 -0
- package/dist/cdn/{DYWNKQ25.js → C2BK5CUC.js} +1 -1
- package/dist/cdn/{4OKNI2ME.js → C4DX6ZIA.js} +1 -1
- package/dist/cdn/{3BFO4M6M.js → C4PPQBLW.js} +1 -1
- package/dist/cdn/{ZCF63ZNP.js → CBUNIAKL.js} +1 -1
- package/dist/cdn/{GLRM5ZT5.js → CDGEWGDD.js} +1 -1
- package/dist/cdn/{T6AQWGKD.js → CQYI4Z2Z.js} +1 -1
- package/dist/cdn/{SY4OTCR3.js → CUSR767T.js} +1 -1
- package/dist/cdn/{EV4D2B4G.js → CUTXFNYN.js} +1 -1
- package/dist/cdn/{ODZLYUK3.js → CZPSEMDH.js} +1 -1
- package/dist/cdn/{WY23ABPE.js → D2HPEC7F.js} +1 -1
- package/dist/cdn/{HIUFMP4S.js → DAXLXKIY.js} +1 -1
- package/dist/cdn/{KU7JKZKM.js → DEQNFOAS.js} +1 -1
- package/dist/cdn/{U54ZTDU5.js → DJMAPSDY.js} +1 -1
- package/dist/cdn/{F7DJCE7J.js → DZSC3TJX.js} +1 -1
- package/dist/cdn/{MUUP34X3.js → E4MGJ47Y.js} +1 -1
- package/dist/cdn/{LTTOM2CS.js → EHS7L663.js} +1 -1
- package/dist/cdn/{HWD5HVPG.js → EJUEMY56.js} +1 -1
- package/dist/cdn/{KLK5B7QV.js → ERBKUSSX.js} +1 -1
- package/dist/cdn/{DBQJQXU6.js → F3E7QPPC.js} +1 -1
- package/dist/cdn/{GATVDTCX.js → F5MS5PBN.js} +1 -1
- package/dist/cdn/{3NAS4Q4X.js → F7RQCNJ4.js} +1 -1
- package/dist/cdn/{6PNEL3GY.js → FE3TGEP7.js} +1 -1
- package/dist/cdn/{ARP32LFE.js → FKPCRFUW.js} +1 -1
- package/dist/cdn/{2B22J6N7.js → FKX46Z6K.js} +1 -1
- package/dist/cdn/{5UM2PD3Y.js → FZTLSQJL.js} +1 -1
- package/dist/cdn/{CISWZLPM.js → G62VTWNT.js} +1 -1
- package/dist/cdn/{BJ4ABCUP.js → GEKASHNF.js} +1 -1
- package/dist/cdn/{D2VTJOPM.js → GYYFBZS2.js} +1 -1
- package/dist/cdn/{L3DV3PDZ.js → HQHM5NWX.js} +1 -1
- package/dist/cdn/{FNQJGIT5.js → I2DNOFC6.js} +1 -1
- package/dist/cdn/{4YU7KVLN.js → I5HZNPIE.js} +1 -1
- package/dist/cdn/{LLESMANM.js → IHGSINVA.js} +1 -1
- package/dist/cdn/{PWME5N37.js → IRDSJTUK.js} +1 -1
- package/dist/cdn/{G2GTTVSE.js → IXQQO6HC.js} +1 -1
- package/dist/cdn/{7P74AKWI.js → JDAOWOTY.js} +1 -1
- package/dist/cdn/{7TWNW2BD.js → JMKB4CRU.js} +1 -1
- package/dist/cdn/JQIHTMWX.js +2 -0
- package/dist/cdn/{WTNLCUMG.js → KB2WIMAL.js} +1 -1
- package/dist/cdn/{H4DJFHRD.js → KCENWQ6Z.js} +1 -1
- package/dist/cdn/KJNTF66K.js +2 -0
- package/dist/cdn/{6JJSMJ5O.js → KQGUXAM6.js} +1 -1
- package/dist/cdn/M2TFDONT.js +2 -0
- package/dist/cdn/{HHH7H3RQ.js → MD2UCHOX.js} +1 -1
- package/dist/cdn/{GLODC255.js → MRRVOAJL.js} +1 -1
- package/dist/cdn/{JCCTCJBT.js → MWMTHMMN.js} +1 -1
- package/dist/cdn/{J4CNKBKA.js → N3YQ6P66.js} +1 -1
- package/dist/cdn/{AXVF2756.js → N6V2UT62.js} +1 -1
- package/dist/cdn/{WA2S45EI.js → NAJTDRNC.js} +1 -1
- package/dist/cdn/{ISATMK3J.js → ND7KY7GE.js} +1 -1
- package/dist/cdn/{5X5GP5QD.js → NDVX6CLP.js} +1 -1
- package/dist/cdn/{YL72ZNRG.js → O6PZKJ7R.js} +1 -1
- package/dist/cdn/OB3Z74X6.js +2 -0
- package/dist/cdn/{YIUURHN4.js → OGNY6ZIB.js} +1 -1
- package/dist/cdn/{AJKRULVQ.js → OJO5NPP3.js} +1 -1
- package/dist/cdn/{EOXVTTON.js → OWJYARYV.js} +1 -1
- package/dist/cdn/{6PA56XE3.js → OXKGEAUB.js} +1 -1
- package/dist/cdn/{QAQYS3BO.js → PJSI5N6F.js} +1 -1
- package/dist/cdn/{BTFUTGOB.js → PW2XM5HR.js} +1 -1
- package/dist/cdn/{QJNZ4DGE.js → QABVNEOF.js} +1 -1
- package/dist/cdn/{TR3GWZR3.js → QN4XN67Z.js} +1 -1
- package/dist/cdn/QXPWDVC2.js +2 -0
- package/dist/cdn/{L4PX2B5Q.js → R4C3WA5S.js} +1 -1
- package/dist/cdn/{D2NNUCFT.js → RDOHAXOA.js} +1 -1
- package/dist/cdn/{2UXB22NZ.js → REW7C42W.js} +1 -1
- package/dist/cdn/{6OQ7N7VS.js → RIEKXKB2.js} +1 -1
- package/dist/cdn/{WCQV2FD5.js → ROY5CHB3.js} +1 -1
- package/dist/cdn/{LBC3QOSD.js → RUNWK23I.js} +1 -1
- package/dist/cdn/{YENIJIGH.js → RVXZUGJA.js} +1 -1
- package/dist/cdn/{QGJMSJYV.js → RZR44QGM.js} +1 -1
- package/dist/cdn/{ACHU3T7F.js → SBQVCX2M.js} +1 -1
- package/dist/cdn/{JZQC7UCN.js → SGZ3IG5W.js} +1 -1
- package/dist/cdn/{7YW5YF3W.js → SH7DQCS7.js} +1 -1
- package/dist/cdn/{BDZQSO2J.js → SS4J7QES.js} +1 -1
- package/dist/cdn/{BZ2ZKLD7.js → TFTS26NS.js} +1 -1
- package/dist/cdn/{ZD5WXZ5Y.js → TMWGSGAP.js} +1 -1
- package/dist/cdn/{GKHYTKRX.js → TPML2DIA.js} +1 -1
- package/dist/cdn/{D5H6K3NA.js → TQJK5WF5.js} +1 -1
- package/dist/cdn/{2TUMH7BJ.js → TRN7FUFM.js} +1 -1
- package/dist/cdn/{KNKMPJAL.js → U6NA5WAH.js} +1 -1
- package/dist/cdn/{CY2QEKCK.js → UE4QYUAU.js} +1 -1
- package/dist/cdn/{VOJ3FHN7.js → UIFHJ5IO.js} +1 -1
- package/dist/cdn/UOSSQPFY.js +2 -0
- package/dist/cdn/{ZD2AZI2C.js → VCDOY22T.js} +1 -1
- package/dist/cdn/{26TKJ45G.js → VVJGLEIA.js} +1 -1
- package/dist/cdn/{RX6W4SRU.js → VWQPK5JA.js} +1 -1
- package/dist/cdn/{MUEVO64B.js → VYXKMJSU.js} +1 -1
- package/dist/cdn/{SB5RUV2I.js → VYZ6WAWT.js} +1 -1
- package/dist/cdn/{P3CJF65O.js → W3N2DKPC.js} +1 -1
- package/dist/cdn/{6HZDBIQR.js → WAXTXFBL.js} +1 -1
- package/dist/cdn/{MR5GODA3.js → WRQD4O6A.js} +1 -1
- package/dist/cdn/{TL7FQYNH.js → WUBPEGFV.js} +1 -1
- package/dist/cdn/{AQ3IFEKN.js → WVJUNLFN.js} +1 -1
- package/dist/cdn/{FIIPI4TO.js → WYGNUS2B.js} +1 -1
- package/dist/cdn/{56OUAFHZ.js → XCNAJ4XA.js} +1 -1
- package/dist/cdn/{4U2T5QCF.js → XTGDCTQE.js} +1 -1
- package/dist/cdn/{MKMBDYHE.js → Y44WJ7Z2.js} +1 -1
- package/dist/cdn/{5VR5L3IN.js → Y6WCKCHJ.js} +1 -1
- package/dist/cdn/{K3J3HP3C.js → YBFI2FQL.js} +1 -1
- package/dist/cdn/{FMGMUK7H.js → YFUBBPNI.js} +1 -1
- package/dist/cdn/{VWXOBCBN.js → YI3ZMHS5.js} +1 -1
- package/dist/cdn/{V4PO6GRD.js → YNG6JO67.js} +1 -1
- package/dist/cdn/{YWOGIBVU.js → Z2GSU7Q2.js} +1 -1
- package/dist/cdn/{H4QDWLO2.js → Z7NNDJEN.js} +1 -1
- package/dist/cdn/{RQWRV3MX.js → ZBN5LXKS.js} +1 -1
- package/dist/cdn/{ZRMUXK2V.js → ZEEFJOPQ.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useTime.js +40 -45
- package/dist/components/calcite-combobox/customElement.js +11 -6
- package/dist/components/calcite-list-item/customElement.js +5 -1
- 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/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/web-types.json +1 -1
- package/package.json +4 -4
- package/dist/cdn/7UQ4BXIA.js +0 -2
- package/dist/cdn/A7T3VN2V.js +0 -2
- package/dist/cdn/AP2LDRUV.js +0 -2
- package/dist/cdn/ECNYDS76.js +0 -2
- package/dist/cdn/FGLX24UP.js +0 -2
- package/dist/cdn/IPV6SRQB.js +0 -2
- package/dist/cdn/LW32DABQ.js +0 -2
- package/dist/cdn/QER5D477.js +0 -2
- package/dist/cdn/V7UCH3LL.js +0 -2
package/dist/chunks/useTime.js
CHANGED
|
@@ -128,23 +128,28 @@ function getLocalizedTimePart(part, parts, locale = "en") {
|
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
130
|
if (part === "hourSuffix") {
|
|
131
|
-
const
|
|
132
|
-
const
|
|
131
|
+
const hourPart = parts.find(({ type }) => type === "hour");
|
|
132
|
+
const minutePart = parts.find(({ type }) => type === "minute");
|
|
133
|
+
const hourIndex = hourPart ? parts.indexOf(hourPart) : -1;
|
|
134
|
+
const minuteIndex = minutePart ? parts.indexOf(minutePart) : -1;
|
|
133
135
|
const hourSuffix = parts[hourIndex + 1];
|
|
134
136
|
return hourSuffix?.type === "literal" && minuteIndex - hourIndex === 2 ? hourSuffix.value || null : null;
|
|
135
137
|
}
|
|
136
138
|
if (part === "minuteSuffix") {
|
|
137
|
-
const
|
|
139
|
+
const minutePart = parts.find(({ type }) => type === "minute");
|
|
140
|
+
const minuteIndex = minutePart ? parts.indexOf(minutePart) : -1;
|
|
138
141
|
const minuteSuffix = parts[minuteIndex + 1];
|
|
139
142
|
return minuteSuffix?.type === "literal" ? minuteSuffix.value || null : null;
|
|
140
143
|
}
|
|
141
144
|
if (part === "secondSuffix") {
|
|
142
145
|
let secondSuffixPart;
|
|
143
|
-
const
|
|
146
|
+
const fractionalSecondPart = parts.find(({ type }) => type === "fractionalSecond");
|
|
147
|
+
const fractionalSecondIndex = fractionalSecondPart ? parts.indexOf(fractionalSecondPart) : -1;
|
|
144
148
|
if (fractionalSecondIndex !== -1) {
|
|
145
149
|
secondSuffixPart = parts[fractionalSecondIndex + 1];
|
|
146
150
|
} else {
|
|
147
|
-
const
|
|
151
|
+
const secondPart = parts.find(({ type }) => type === "second");
|
|
152
|
+
const secondIndex = secondPart ? parts.indexOf(secondPart) : -1;
|
|
148
153
|
secondSuffixPart = parts[secondIndex + 1];
|
|
149
154
|
}
|
|
150
155
|
return secondSuffixPart?.type === "literal" && secondSuffixPart.value || null;
|
|
@@ -152,7 +157,7 @@ function getLocalizedTimePart(part, parts, locale = "en") {
|
|
|
152
157
|
if (part === "meridiem") {
|
|
153
158
|
const meridiemFromBrowser = parts.find(({ type }) => type === "dayPeriod")?.value || null;
|
|
154
159
|
if (meridiemFromBrowser) {
|
|
155
|
-
return getLocalizedMeridiem({ locale, parts });
|
|
160
|
+
return getLocalizedMeridiem({ locale, parts }) ?? null;
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
163
|
return parts.find(({ type }) => type === part)?.value || null;
|
|
@@ -192,14 +197,11 @@ function isValidTime(value) {
|
|
|
192
197
|
}
|
|
193
198
|
const hourAsNumber = parseInt(hour);
|
|
194
199
|
const minuteAsNumber = parseInt(minute);
|
|
195
|
-
const secondAsNumber = parseInt(second);
|
|
200
|
+
const secondAsNumber = parseInt(second ?? "");
|
|
196
201
|
const hourValid = isValidNumber(hour) && hourAsNumber >= 0 && hourAsNumber < 24;
|
|
197
202
|
const minuteValid = isValidNumber(minute) && minuteAsNumber >= 0 && minuteAsNumber < 60;
|
|
198
203
|
const secondValid = isValidNumber(second) && secondAsNumber >= 0 && secondAsNumber < 60;
|
|
199
|
-
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
return false;
|
|
204
|
+
return hourValid && minuteValid && (!second || secondValid);
|
|
203
205
|
}
|
|
204
206
|
function isValidTimePart(value, part) {
|
|
205
207
|
if (part === "meridiem") {
|
|
@@ -208,7 +210,8 @@ function isValidTimePart(value, part) {
|
|
|
208
210
|
if (!isValidNumber(value)) {
|
|
209
211
|
return false;
|
|
210
212
|
}
|
|
211
|
-
const
|
|
213
|
+
const valueAsString = value;
|
|
214
|
+
const valueAsNumber = Number(valueAsString);
|
|
212
215
|
const isZeroOrGreater = valueAsNumber >= 0;
|
|
213
216
|
const isLessThanMaxHour = valueAsNumber < 24;
|
|
214
217
|
const isLessThanMaxSecond = valueAsNumber < 60;
|
|
@@ -290,8 +293,8 @@ function localizeTimeString({
|
|
|
290
293
|
0,
|
|
291
294
|
parseInt(hour),
|
|
292
295
|
parseInt(minute),
|
|
293
|
-
includeSeconds && parseInt(second),
|
|
294
|
-
includeSeconds && fractionalSecond
|
|
296
|
+
includeSeconds && typeof second === "string" ? parseInt(second) : 0,
|
|
297
|
+
includeSeconds && fractionalSecond ? fractionalSecondPartToMilliseconds(fractionalSecond) : 0
|
|
295
298
|
)
|
|
296
299
|
);
|
|
297
300
|
const formatter = createLocaleDateTimeFormatter({
|
|
@@ -311,7 +314,7 @@ function localizeTimeString({
|
|
|
311
314
|
second: getLocalizedTimePart("second", parts),
|
|
312
315
|
decimalSeparator: getLocalizedDecimalSeparator(locale, numberingSystem),
|
|
313
316
|
fractionalSecond: getLocalizedTimePart("fractionalSecond", parts),
|
|
314
|
-
secondSuffix: locale !== "bg"
|
|
317
|
+
secondSuffix: locale !== "bg" ? getLocalizedTimePart("secondSuffix", parts) : null,
|
|
315
318
|
meridiem: getLocalizedTimePart("meridiem", parts, locale)
|
|
316
319
|
};
|
|
317
320
|
} else {
|
|
@@ -341,7 +344,7 @@ function parseTimeString(value, step) {
|
|
|
341
344
|
if (secondDecimal?.includes(".")) {
|
|
342
345
|
[second, fractionalSecond] = secondDecimal.split(".");
|
|
343
346
|
}
|
|
344
|
-
if (step) {
|
|
347
|
+
if (step && typeof fractionalSecond === "string") {
|
|
345
348
|
fractionalSecond = formatFractionalSecond(fractionalSecond, step);
|
|
346
349
|
}
|
|
347
350
|
return {
|
|
@@ -422,7 +425,7 @@ class TimeController extends GenericController {
|
|
|
422
425
|
case "Backspace":
|
|
423
426
|
case "Delete":
|
|
424
427
|
event.preventDefault();
|
|
425
|
-
this.setValuePart("hour",
|
|
428
|
+
this.setValuePart("hour", void 0);
|
|
426
429
|
break;
|
|
427
430
|
case "ArrowDown":
|
|
428
431
|
event.preventDefault();
|
|
@@ -444,7 +447,7 @@ class TimeController extends GenericController {
|
|
|
444
447
|
if (numberKeys.includes(key)) {
|
|
445
448
|
const keyAsNumber = parseInt(key);
|
|
446
449
|
let newMinute;
|
|
447
|
-
if (isValidNumber(this.minute) && this.minute.startsWith("0")) {
|
|
450
|
+
if (typeof this.minute === "string" && isValidNumber(this.minute) && this.minute.startsWith("0")) {
|
|
448
451
|
const minuteAsNumber = parseInt(this.minute);
|
|
449
452
|
newMinute = minuteAsNumber > maxTenthForMinuteAndSecond ? keyAsNumber : `${minuteAsNumber}${keyAsNumber}`;
|
|
450
453
|
} else {
|
|
@@ -456,7 +459,7 @@ class TimeController extends GenericController {
|
|
|
456
459
|
case "Backspace":
|
|
457
460
|
case "Delete":
|
|
458
461
|
event.preventDefault();
|
|
459
|
-
this.setValuePart("minute",
|
|
462
|
+
this.setValuePart("minute", void 0);
|
|
460
463
|
break;
|
|
461
464
|
case "ArrowDown":
|
|
462
465
|
event.preventDefault();
|
|
@@ -478,7 +481,7 @@ class TimeController extends GenericController {
|
|
|
478
481
|
if (numberKeys.includes(key)) {
|
|
479
482
|
const keyAsNumber = parseInt(key);
|
|
480
483
|
let newSecond;
|
|
481
|
-
if (isValidNumber(this.second) && this.second.startsWith("0")) {
|
|
484
|
+
if (typeof this.second === "string" && isValidNumber(this.second) && this.second.startsWith("0")) {
|
|
482
485
|
const secondAsNumber = parseInt(this.second);
|
|
483
486
|
newSecond = secondAsNumber > maxTenthForMinuteAndSecond ? keyAsNumber : `${secondAsNumber}${keyAsNumber}`;
|
|
484
487
|
} else {
|
|
@@ -490,7 +493,7 @@ class TimeController extends GenericController {
|
|
|
490
493
|
case "Backspace":
|
|
491
494
|
case "Delete":
|
|
492
495
|
event.preventDefault();
|
|
493
|
-
this.setValuePart("second",
|
|
496
|
+
this.setValuePart("second", void 0);
|
|
494
497
|
break;
|
|
495
498
|
case "ArrowDown":
|
|
496
499
|
event.preventDefault();
|
|
@@ -525,7 +528,7 @@ class TimeController extends GenericController {
|
|
|
525
528
|
case "Backspace":
|
|
526
529
|
case "Delete":
|
|
527
530
|
event.preventDefault();
|
|
528
|
-
this.setValuePart("fractionalSecond",
|
|
531
|
+
this.setValuePart("fractionalSecond", void 0);
|
|
529
532
|
break;
|
|
530
533
|
case "ArrowDown":
|
|
531
534
|
event.preventDefault();
|
|
@@ -583,7 +586,7 @@ class TimeController extends GenericController {
|
|
|
583
586
|
this.decrementMinuteOrSecond("second");
|
|
584
587
|
}
|
|
585
588
|
incrementHour() {
|
|
586
|
-
const newHour = isValidNumber(this.hour) ? this.hour === "23" ? 0 : parseInt(this.hour) + 1 : 1;
|
|
589
|
+
const newHour = typeof this.hour === "string" && isValidNumber(this.hour) ? this.hour === "23" ? 0 : parseInt(this.hour) + 1 : 1;
|
|
587
590
|
this.setValuePart("hour", newHour);
|
|
588
591
|
}
|
|
589
592
|
incrementMinute() {
|
|
@@ -694,17 +697,7 @@ class TimeController extends GenericController {
|
|
|
694
697
|
const newValue = toISOTimeString(value, step);
|
|
695
698
|
if (isValidTime(value)) {
|
|
696
699
|
const { hour, minute, second, fractionalSecond } = parseTimeString(newValue, step);
|
|
697
|
-
const {
|
|
698
|
-
hour: localizedHour,
|
|
699
|
-
hourSuffix: localizedHourSuffix,
|
|
700
|
-
minute: localizedMinute,
|
|
701
|
-
minuteSuffix: localizedMinuteSuffix,
|
|
702
|
-
second: localizedSecond,
|
|
703
|
-
secondSuffix: localizedSecondSuffix,
|
|
704
|
-
decimalSeparator: localizedDecimalSeparator,
|
|
705
|
-
fractionalSecond: localizedFractionalSecond,
|
|
706
|
-
meridiem: localizedMeridiem
|
|
707
|
-
} = localizeTimeString({
|
|
700
|
+
const localized = localizeTimeString({
|
|
708
701
|
hour12,
|
|
709
702
|
locale,
|
|
710
703
|
numberingSystem,
|
|
@@ -716,17 +709,19 @@ class TimeController extends GenericController {
|
|
|
716
709
|
this.minute = minute;
|
|
717
710
|
this.second = second;
|
|
718
711
|
this.fractionalSecond = fractionalSecond;
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
712
|
+
if (localized) {
|
|
713
|
+
this.localizedHour = localized.hour;
|
|
714
|
+
this.localizedHourSuffix = localized.hourSuffix;
|
|
715
|
+
this.localizedMinute = localized.minute;
|
|
716
|
+
this.localizedMinuteSuffix = localized.minuteSuffix;
|
|
717
|
+
this.localizedSecond = localized.second;
|
|
718
|
+
this.localizedDecimalSeparator = localized.decimalSeparator;
|
|
719
|
+
this.localizedFractionalSecond = localized.fractionalSecond;
|
|
720
|
+
this.localizedSecondSuffix = localized.secondSuffix;
|
|
721
|
+
if (localized.meridiem) {
|
|
722
|
+
this.meridiem = getMeridiem(this.hour);
|
|
723
|
+
this.localizedMeridiem = localized.meridiem;
|
|
724
|
+
}
|
|
730
725
|
}
|
|
731
726
|
} else {
|
|
732
727
|
this.hour = null;
|
|
@@ -484,9 +484,9 @@ class Combobox extends LitElement {
|
|
|
484
484
|
break;
|
|
485
485
|
case " ":
|
|
486
486
|
if (!this.textInputRef.value.value && !event.defaultPrevented) {
|
|
487
|
-
if (!this.open) {
|
|
487
|
+
if (!this.open && this.keyboardNavItems.length) {
|
|
488
488
|
this.open = true;
|
|
489
|
-
this.
|
|
489
|
+
this.ensureRecentSelectedItemIsActive();
|
|
490
490
|
}
|
|
491
491
|
event.preventDefault();
|
|
492
492
|
}
|
|
@@ -566,7 +566,7 @@ class Combobox extends LitElement {
|
|
|
566
566
|
this.topLayer.show();
|
|
567
567
|
this.reposition();
|
|
568
568
|
this.calciteComboboxBeforeOpen.emit();
|
|
569
|
-
setTimeout(() => this.scrollToActiveOrSelectedItem(
|
|
569
|
+
setTimeout(() => this.scrollToActiveOrSelectedItem(this.activeItemIndex < 0), 0);
|
|
570
570
|
}
|
|
571
571
|
onOpen() {
|
|
572
572
|
this.calciteComboboxOpen.emit();
|
|
@@ -615,9 +615,14 @@ class Combobox extends LitElement {
|
|
|
615
615
|
this.ensureRecentSelectedItemIsActive();
|
|
616
616
|
}
|
|
617
617
|
ensureRecentSelectedItemIsActive() {
|
|
618
|
-
const { selectedItems } = this;
|
|
619
|
-
|
|
620
|
-
|
|
618
|
+
const { activeItemIndex, selectedItems, keyboardNavItems } = this;
|
|
619
|
+
if (activeItemIndex > -1 && keyboardNavItems[activeItemIndex]) {
|
|
620
|
+
this.updateActiveItemIndex(activeItemIndex);
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
const selectedItem = selectedItems[selectedItems.length - 1];
|
|
624
|
+
const targetIndex = selectedItem ? keyboardNavItems.indexOf(selectedItem) : keyboardNavItems.length ? 0 : -1;
|
|
625
|
+
this.updateActiveItemIndex(targetIndex > -1 ? targetIndex : keyboardNavItems.length ? 0 : -1);
|
|
621
626
|
}
|
|
622
627
|
hideChip(chipEl) {
|
|
623
628
|
chipEl.classList.add(CSS.chipInvisible);
|
|
@@ -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";
|
|
@@ -130,7 +131,10 @@ class ListItem extends LitElement {
|
|
|
130
131
|
if (changes.has("displayMode") && this.hasUpdated) {
|
|
131
132
|
this.handleExpandableChange(this.defaultSlotRef.value);
|
|
132
133
|
}
|
|
133
|
-
|
|
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) {
|
|
134
138
|
this.emitCalciteInternalListItemChange();
|
|
135
139
|
}
|
|
136
140
|
if (changes.has("expanded") && this.hasUpdated) {
|
|
@@ -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 {
|
|
@@ -40,6 +40,7 @@ class TableRow extends LitElement {
|
|
|
40
40
|
this.itemHidden = false;
|
|
41
41
|
this.disabled = false;
|
|
42
42
|
this.interactionMode = "interactive";
|
|
43
|
+
this.lastVisibleRow = false;
|
|
43
44
|
this.numbered = false;
|
|
44
45
|
this.selectionMode = "none";
|
|
45
46
|
this.calciteInternalTableRowFocusRequest = createEvent({ cancelable: false });
|
|
@@ -169,7 +170,7 @@ class TableRow extends LitElement {
|
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
emitTableRowFocusRequest(cellPosition, rowPosition, destination, lastCell) {
|
|
173
|
+
emitTableRowFocusRequest(cellPosition, rowPosition, destination, lastCell = false) {
|
|
173
174
|
this.calciteInternalTableRowFocusRequest.emit({
|
|
174
175
|
cellPosition,
|
|
175
176
|
rowPosition,
|
|
@@ -179,8 +180,9 @@ class TableRow extends LitElement {
|
|
|
179
180
|
}
|
|
180
181
|
updateCells() {
|
|
181
182
|
const alignment = this.alignment ? this.alignment : this.rowType !== "head" ? "center" : "start";
|
|
182
|
-
const slottedCells = this.tableRowSlotRef.value?.assignedElements({ flatten: true })?.filter((el) => el.matches("calcite-table-cell") || el.matches("calcite-table-header"));
|
|
183
|
-
const
|
|
183
|
+
const slottedCells = this.tableRowSlotRef.value?.assignedElements({ flatten: true })?.filter((el) => el.matches("calcite-table-cell") || el.matches("calcite-table-header")) ?? [];
|
|
184
|
+
const tableRowEls = this.tableRowEl?.querySelectorAll("calcite-table-header, calcite-table-cell");
|
|
185
|
+
const renderedCells = tableRowEls ? Array.from(tableRowEls).filter((el) => el.numberCell || el.selectionCell) : void 0;
|
|
184
186
|
const cells = renderedCells ? renderedCells.concat(slottedCells) : slottedCells;
|
|
185
187
|
if (cells.length > 0) {
|
|
186
188
|
cells?.forEach((cell, index) => {
|
|
@@ -64,7 +64,7 @@ class Tabs extends LitElement {
|
|
|
64
64
|
const tabs = getSlotAssignedElements(this.slotRef.value, "calcite-tab");
|
|
65
65
|
await Promise.all([...tabs, ...this.titles].map((tabOrTitle) => tabOrTitle.componentOnReady()));
|
|
66
66
|
if (tabs.some((el) => el.tab) || this.titles.some((el) => el.tab)) {
|
|
67
|
-
tabIds = tabs.sort((a, b) => a.tab.localeCompare(b.tab)).map((el) => el.id);
|
|
67
|
+
tabIds = tabs.sort((a, b) => a.tab && b.tab ? a.tab.localeCompare(b.tab) : 0).map((el) => el.id);
|
|
68
68
|
titleIds = this.titles.sort((a, b) => a.tab.localeCompare(b.tab)).map((el) => el.id);
|
|
69
69
|
} else {
|
|
70
70
|
const tabDomIndexes = await Promise.all(tabs.map((el) => el.getTabIndex()));
|
|
@@ -93,7 +93,8 @@ class Tabs extends LitElement {
|
|
|
93
93
|
tab.scale = scale;
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
|
|
96
|
+
const tabTitleEls = this.el.querySelectorAll("calcite-tab-nav > calcite-tab-title");
|
|
97
|
+
Array.from(tabTitleEls).forEach((title) => {
|
|
97
98
|
title.position = position;
|
|
98
99
|
title.scale = scale;
|
|
99
100
|
});
|