@esri/calcite-components 5.1.1-next.0 → 5.1.1-next.2
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/{SFJW4TZX.js → 25E6V6DD.js} +1 -1
- package/dist/cdn/{UQ4U2WKO.js → 25G5SA4Q.js} +1 -1
- package/dist/cdn/{HZZHIGHG.js → 2E53OHKU.js} +1 -1
- package/dist/cdn/{6H3CYBMZ.js → 2NYZMRRD.js} +1 -1
- package/dist/cdn/{EGJCIQXC.js → 2SGPZ2OL.js} +1 -1
- package/dist/cdn/{S6DQQTW3.js → 2ZK6DQ2U.js} +1 -1
- package/dist/cdn/{QO5UB5D4.js → 34X7NSBK.js} +1 -1
- package/dist/cdn/{ALDJUEQ6.js → 3ATY4VRY.js} +1 -1
- package/dist/cdn/{LT4BKZ77.js → 422VOMHU.js} +1 -1
- package/dist/cdn/{MREXPRS4.js → 4WV5KYRR.js} +1 -1
- package/dist/cdn/{TZI723KV.js → 5FI2X47S.js} +1 -1
- package/dist/cdn/{X7CHFMN5.js → 5FRM3GVJ.js} +1 -1
- package/dist/cdn/{IVWQJUEE.js → 5HLSHKB4.js} +1 -1
- package/dist/cdn/{AZHDD5QW.js → 5IMNHFTU.js} +1 -1
- package/dist/cdn/{MOOXNG3K.js → 63ATMMEF.js} +1 -1
- package/dist/cdn/{VZDAEJEF.js → 6DJ5YPBS.js} +1 -1
- package/dist/cdn/{B5SIF6E3.js → 6KC2DOFL.js} +1 -1
- package/dist/cdn/{6CEBXQSC.js → 6LRFOBVJ.js} +1 -1
- package/dist/cdn/{3RBTYVUD.js → 6NWOOIXP.js} +1 -1
- package/dist/cdn/{5AMCYZ6W.js → 6XSYXX43.js} +1 -1
- package/dist/cdn/{ILQX7Y7Q.js → 76KBU7AH.js} +1 -1
- package/dist/cdn/{URRCLJJL.js → 7COI7LVO.js} +1 -1
- package/dist/cdn/{AA3NSH3U.js → 7NJ5JTBR.js} +1 -1
- package/dist/cdn/{KTBY2CGR.js → A7EJ44LC.js} +1 -1
- package/dist/cdn/{3SYGBKWR.js → AU3YMK5A.js} +1 -1
- package/dist/cdn/{UH5QPC23.js → B3XYD7KK.js} +1 -1
- package/dist/cdn/{DPVKTTT4.js → BOQ4PBCL.js} +1 -1
- package/dist/cdn/{FFQ7TM4J.js → C2IZTBPT.js} +1 -1
- package/dist/cdn/{G4W7YKDH.js → CRWJA7I7.js} +1 -1
- package/dist/cdn/{2IWGUAWA.js → D6PQBEUI.js} +1 -1
- package/dist/cdn/{XM4MM6Q2.js → DQ4LYHVZ.js} +1 -1
- package/dist/cdn/{75I5SJ4X.js → DUY4X6VD.js} +1 -1
- package/dist/cdn/{5IISC3HD.js → DWKTGMAF.js} +1 -1
- package/dist/cdn/{56VYPYFF.js → E25MFA2R.js} +1 -1
- package/dist/cdn/{ACAPEXIF.js → E6TDQAXW.js} +1 -1
- package/dist/cdn/{HLF26T4C.js → EBG7P4AV.js} +1 -1
- package/dist/cdn/{FAMRE5HY.js → EEJ3TQCF.js} +1 -1
- package/dist/cdn/{5IYNIOCS.js → EHRISGMA.js} +1 -1
- package/dist/cdn/{4ERCP6XO.js → EK3ADZMZ.js} +1 -1
- package/dist/cdn/{GQDKVK3D.js → EYF72BFK.js} +1 -1
- package/dist/cdn/{KZ3LUSU2.js → FA7DV6EI.js} +1 -1
- package/dist/cdn/{LRZTZSHC.js → FL2SUJQR.js} +1 -1
- package/dist/cdn/{UFURWY36.js → FQ6WY62D.js} +1 -1
- package/dist/cdn/FQW4VGBQ.js +2 -0
- package/dist/cdn/{QAASRSQZ.js → GCBRC77Z.js} +1 -1
- package/dist/cdn/{Y4RJBGTN.js → GIIEIMPX.js} +1 -1
- package/dist/cdn/{SZSMPM6E.js → GJ7BDRPS.js} +1 -1
- package/dist/cdn/{G456YVPG.js → GJVJDX6U.js} +1 -1
- package/dist/cdn/{US2R5SI2.js → GLYGWUJI.js} +1 -1
- package/dist/cdn/{HVO2U7ZI.js → H633EPML.js} +1 -1
- package/dist/cdn/{7RS475AK.js → HKCPOX75.js} +1 -1
- package/dist/cdn/{KLCLUDIS.js → HMZJJMDN.js} +1 -1
- package/dist/cdn/{CAU3D7O6.js → HOXYU7K6.js} +1 -1
- package/dist/cdn/{KQCAFH4L.js → HS624KMA.js} +1 -1
- package/dist/cdn/{DEUPIV3Z.js → HSUQ6QCT.js} +1 -1
- package/dist/cdn/{SRXPPFYE.js → HVX336C7.js} +1 -1
- package/dist/cdn/{R7KZTTEV.js → I2CWSWSH.js} +1 -1
- package/dist/cdn/{O7YMPQUI.js → I2GWQU3Z.js} +1 -1
- package/dist/cdn/{ZHTE4PVO.js → J2APFSVP.js} +1 -1
- package/dist/cdn/{HVGZLEM5.js → JTL527CY.js} +1 -1
- package/dist/cdn/{6J6NDAUF.js → JVBQACDW.js} +1 -1
- package/dist/cdn/{BZVESTLV.js → JYBC5CRH.js} +1 -1
- package/dist/cdn/{JHTPQLAI.js → JZZIYBTI.js} +1 -1
- package/dist/cdn/{Z3AYOD3V.js → K5KVOYJV.js} +1 -1
- package/dist/cdn/{5TNWLRB6.js → K7XPCT22.js} +1 -1
- package/dist/cdn/{HP3ZLN4B.js → KARS3PXW.js} +1 -1
- package/dist/cdn/{LZRUNHQB.js → KFTB4ORQ.js} +1 -1
- package/dist/cdn/{7TFO6D5F.js → KH6NFWMG.js} +1 -1
- package/dist/cdn/{MJEQO4QJ.js → KHGMTZM3.js} +1 -1
- package/dist/cdn/{MLSILTYB.js → KM3GQDOM.js} +1 -1
- package/dist/cdn/{A7U6OOWG.js → KNRJJMFP.js} +1 -1
- package/dist/cdn/{6JKXCCTG.js → KWBEH72U.js} +1 -1
- package/dist/cdn/{3BPI3O6E.js → KYHAYUN4.js} +1 -1
- package/dist/cdn/{4CB2O5QG.js → LDU267SZ.js} +1 -1
- package/dist/cdn/{MUOYIJVV.js → LXMMPOKJ.js} +1 -1
- package/dist/cdn/{2KGEPRUF.js → M4SJ4ZWQ.js} +1 -1
- package/dist/cdn/{ZLL3IOQH.js → MCJEYHRO.js} +1 -1
- package/dist/cdn/{ZX5NT7BW.js → MEIMF65V.js} +1 -1
- package/dist/cdn/{GQ7DKFA5.js → MPBR66PF.js} +1 -1
- package/dist/cdn/{U3EXF4ZG.js → MPR6P5ZQ.js} +1 -1
- package/dist/cdn/{QXQDUUO7.js → MSGCQDRV.js} +1 -1
- package/dist/cdn/{GURB6TIJ.js → MSHPGKFG.js} +1 -1
- package/dist/cdn/{3GV45XL7.js → MYDCGCGV.js} +1 -1
- package/dist/cdn/{D2IHG7U6.js → N2IIHI5L.js} +1 -1
- package/dist/cdn/{4SJPPENI.js → N5JZWBDK.js} +1 -1
- package/dist/cdn/{5BXGV5ZQ.js → NTNNSHUM.js} +1 -1
- package/dist/cdn/{YK5IMHQT.js → O5HHK3WX.js} +1 -1
- package/dist/cdn/{TOEE2LYN.js → OBFSBQIQ.js} +1 -1
- package/dist/cdn/{ZQRR6YTB.js → OBLX62IJ.js} +1 -1
- package/dist/cdn/OE4WJN6O.js +2 -0
- package/dist/cdn/{UZ6A3EVC.js → OI5K4FGU.js} +1 -1
- package/dist/cdn/{DCLKVSQL.js → OTKY2C5F.js} +1 -1
- package/dist/cdn/{FVT27KQD.js → OTM7SVGP.js} +1 -1
- package/dist/cdn/{ADCXSL56.js → P2DWHOK7.js} +1 -1
- package/dist/cdn/{PBNKEMBL.js → PASWG6ME.js} +1 -1
- package/dist/cdn/{INTGSZ5Z.js → PCF5YHKG.js} +1 -1
- package/dist/cdn/{I3XG7K6C.js → PF6TAWUY.js} +1 -1
- package/dist/cdn/{6SLXQWU4.js → PNZO7UBI.js} +1 -1
- package/dist/cdn/{AGRNONET.js → Q2H2PQXD.js} +1 -1
- package/dist/cdn/{LJ4KTE6Y.js → QALQEASP.js} +1 -1
- package/dist/cdn/{AVN7GDNI.js → QAOIVGQN.js} +1 -1
- package/dist/cdn/{NIOQGKNW.js → QBDTJOHQ.js} +1 -1
- package/dist/cdn/{SIAFDW7Y.js → QSY2SDG7.js} +1 -1
- package/dist/cdn/{N5GIKXDL.js → QYENJ22N.js} +1 -1
- package/dist/cdn/{JOCO4XI3.js → R2DJRKFJ.js} +1 -1
- package/dist/cdn/{SZD4HZMW.js → RRKXCRYN.js} +1 -1
- package/dist/cdn/{BXRNRAM4.js → RVYCJSSJ.js} +1 -1
- package/dist/cdn/{M4FJ2QZO.js → RVZKJPEM.js} +1 -1
- package/dist/cdn/{MBFZ33SM.js → RZDFQXYS.js} +1 -1
- package/dist/cdn/{ZJBIXCJU.js → SAI6OQQT.js} +1 -1
- package/dist/cdn/{EBCHRNQU.js → SG4RBVWV.js} +1 -1
- package/dist/cdn/{XHP4ORWZ.js → SGE62UPZ.js} +1 -1
- package/dist/cdn/{2JARICGO.js → SX6TMPIT.js} +1 -1
- package/dist/cdn/{FDZMMKDF.js → TGMATTT3.js} +1 -1
- package/dist/cdn/{CQMZOIYT.js → TKLDOUMB.js} +1 -1
- package/dist/cdn/{HEIK7T3T.js → TTUCCNLX.js} +1 -1
- package/dist/cdn/{I4VNM5NL.js → UDEHQIZY.js} +1 -1
- package/dist/cdn/{2DXIZU6R.js → UDPWCXAG.js} +1 -1
- package/dist/cdn/{W3AYPD7P.js → UFZ5NLCO.js} +1 -1
- package/dist/cdn/{QGKI3OMJ.js → ULIK666O.js} +1 -1
- package/dist/cdn/{D36FINW3.js → UTOGWTZA.js} +1 -1
- package/dist/cdn/{IEF6JYBC.js → UUJFJ4FQ.js} +1 -1
- package/dist/cdn/{LZRGGTLJ.js → UX5HBPON.js} +1 -1
- package/dist/cdn/{H2UXQDON.js → VB63I6DV.js} +1 -1
- package/dist/cdn/{XSAUQUSM.js → VROP4YZD.js} +1 -1
- package/dist/cdn/{RMTFO2LM.js → W3SEEU5B.js} +1 -1
- package/dist/cdn/{ZWHKM56M.js → W4AJ5WQI.js} +1 -1
- package/dist/cdn/{V2R55PMZ.js → WAWJRWCC.js} +1 -1
- package/dist/cdn/{XLD2OUA2.js → WEUGW625.js} +1 -1
- package/dist/cdn/{4FUCDFGK.js → WFNBGFBU.js} +1 -1
- package/dist/cdn/{L4A2ANF6.js → WLEZ3PKG.js} +1 -1
- package/dist/cdn/{6BDNCIAA.js → WMC5J245.js} +1 -1
- package/dist/cdn/{DBKOSP2J.js → WOEHH6JP.js} +1 -1
- package/dist/cdn/{6RRQ22LO.js → WZEVWNGF.js} +1 -1
- package/dist/cdn/{BAMXLXKZ.js → XFYTD2GE.js} +1 -1
- package/dist/cdn/{E4DM4ZJR.js → YAEU7WPO.js} +1 -1
- package/dist/cdn/{RF73TS72.js → YL4HBV5J.js} +1 -1
- package/dist/cdn/{FHT56RXI.js → YSZ4LDJS.js} +1 -1
- package/dist/cdn/{FSIXQSOF.js → Z3K3V76T.js} +1 -1
- package/dist/cdn/{JHXH6UZJ.js → Z62EPPFO.js} +1 -1
- package/dist/cdn/{POYAO7CJ.js → ZC2OUE5B.js} +1 -1
- package/dist/cdn/{YX2QYEVF.js → ZK3VS2OO.js} +1 -1
- package/dist/cdn/{X3P7R4XF.js → ZKMX263L.js} +1 -1
- package/dist/cdn/{UDMEFBNA.js → ZNRSTTYO.js} +1 -1
- package/dist/cdn/{IPPMCVC6.js → ZO4TQWNN.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ExpandToggle.js +1 -1
- package/dist/chunks/resources5.js +2 -1
- package/dist/chunks/runtime.js +3 -3
- package/dist/components/calcite-accordion-item/customElement.d.ts +6 -6
- package/dist/components/calcite-accordion-item/customElement.js +1 -1
- package/dist/components/calcite-alert/customElement.d.ts +2 -2
- package/dist/components/calcite-alert/customElement.js +6 -4
- package/dist/components/calcite-autocomplete/customElement.d.ts +16 -16
- package/dist/components/calcite-autocomplete/customElement.js +4 -4
- package/dist/components/calcite-autocomplete-item/customElement.d.ts +5 -5
- package/dist/components/calcite-avatar/customElement.d.ts +5 -5
- package/dist/components/calcite-combobox/customElement.js +133 -33
- package/dist/components/calcite-dialog/customElement.js +7 -7
- package/dist/components/calcite-dropdown/customElement.js +3 -0
- package/dist/components/calcite-sheet/customElement.js +32 -27
- 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/dist/loader.js +1 -1
- package/package.json +2 -2
- package/dist/cdn/KUL73QJV.js +0 -2
- package/dist/cdn/N7F4APVB.js +0 -2
|
@@ -46,7 +46,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
46
46
|
*
|
|
47
47
|
* @see [MDN - autocomplete](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete)
|
|
48
48
|
*/
|
|
49
|
-
accessor autocomplete: AutoFill;
|
|
49
|
+
accessor autocomplete: AutoFill | undefined;
|
|
50
50
|
/**
|
|
51
51
|
* When `true`, interaction is prevented and the component is displayed with lower opacity.
|
|
52
52
|
*
|
|
@@ -54,19 +54,19 @@ export abstract class Autocomplete extends LitElement {
|
|
|
54
54
|
*/
|
|
55
55
|
accessor disabled: boolean;
|
|
56
56
|
/** Specifies the component's fallback `placement` for slotted content when it's initial or specified `placement` has insufficient space available. */
|
|
57
|
-
accessor flipPlacements: FlipPlacement[];
|
|
57
|
+
accessor flipPlacements: FlipPlacement[] | undefined;
|
|
58
58
|
/**
|
|
59
59
|
* Specifies the `id` of the component's associated form.
|
|
60
60
|
*
|
|
61
61
|
* When not set, the component is associated with its ancestor form element, if one exists.
|
|
62
62
|
*/
|
|
63
|
-
accessor form: string;
|
|
63
|
+
accessor form: string | undefined;
|
|
64
64
|
/**
|
|
65
65
|
* When `true` or not set, shows a default recommended icon. Alternatively, pass a Calcite UI Icon name to display a specific icon.
|
|
66
66
|
*
|
|
67
67
|
* To hide the default icon, set the property to `false` using JavaScript.
|
|
68
68
|
*/
|
|
69
|
-
accessor icon: IconName | boolean;
|
|
69
|
+
accessor icon: IconName | boolean | undefined;
|
|
70
70
|
/**
|
|
71
71
|
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
|
|
72
72
|
*
|
|
@@ -74,11 +74,11 @@ export abstract class Autocomplete extends LitElement {
|
|
|
74
74
|
*/
|
|
75
75
|
accessor iconFlipRtl: boolean;
|
|
76
76
|
/** Specifies the text typed into the component and is used to filter slotted `autocomplete-item`s. */
|
|
77
|
-
accessor inputValue: string;
|
|
77
|
+
accessor inputValue: string | undefined;
|
|
78
78
|
/** Specifies an accessible label for the component. */
|
|
79
|
-
accessor label: string;
|
|
79
|
+
accessor label: string | undefined;
|
|
80
80
|
/** Specifies the component's label text. */
|
|
81
|
-
accessor labelText: string;
|
|
81
|
+
accessor labelText: string | undefined;
|
|
82
82
|
/**
|
|
83
83
|
* When `true`, a busy indicator is displayed.
|
|
84
84
|
*
|
|
@@ -91,7 +91,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
91
91
|
*
|
|
92
92
|
* @see [MDN - maxlength](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength)
|
|
93
93
|
*/
|
|
94
|
-
accessor maxLength: number;
|
|
94
|
+
accessor maxLength: number | undefined;
|
|
95
95
|
/** Overrides individual strings used by the component. */
|
|
96
96
|
accessor messageOverrides: {
|
|
97
97
|
clear?: string;
|
|
@@ -104,7 +104,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
104
104
|
*
|
|
105
105
|
* @see [MDN - minlength](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength)
|
|
106
106
|
*/
|
|
107
|
-
accessor minLength: number;
|
|
107
|
+
accessor minLength: number | undefined;
|
|
108
108
|
/**
|
|
109
109
|
* Specifies the name of the component.
|
|
110
110
|
*
|
|
@@ -112,7 +112,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
112
112
|
*
|
|
113
113
|
* @see [MDN - name](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name)
|
|
114
114
|
*/
|
|
115
|
-
accessor name: string;
|
|
115
|
+
accessor name: string | undefined;
|
|
116
116
|
/**
|
|
117
117
|
* When `true`, displays and positions the component.
|
|
118
118
|
*
|
|
@@ -136,13 +136,13 @@ export abstract class Autocomplete extends LitElement {
|
|
|
136
136
|
*
|
|
137
137
|
* @see [MDN - step](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/pattern)
|
|
138
138
|
*/
|
|
139
|
-
accessor pattern: string;
|
|
139
|
+
accessor pattern: string | undefined;
|
|
140
140
|
/**
|
|
141
141
|
* Specifies placeholder text for the component.
|
|
142
142
|
*
|
|
143
143
|
* @see [MDN - placeholder](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#placeholder)
|
|
144
144
|
*/
|
|
145
|
-
accessor placeholder: string;
|
|
145
|
+
accessor placeholder: string | undefined;
|
|
146
146
|
/**
|
|
147
147
|
* Determines where the component will be positioned relative to the container element.
|
|
148
148
|
*
|
|
@@ -150,7 +150,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
150
150
|
*/
|
|
151
151
|
accessor placement: MenuPlacement;
|
|
152
152
|
/** Specifies the component's prefix text. */
|
|
153
|
-
accessor prefixText: string;
|
|
153
|
+
accessor prefixText: string | undefined;
|
|
154
154
|
/**
|
|
155
155
|
* When `true`, the component's value can be read, but cannot be modified.
|
|
156
156
|
*
|
|
@@ -178,7 +178,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
178
178
|
*/
|
|
179
179
|
accessor status: Status;
|
|
180
180
|
/** Specifies the component's suffix text. */
|
|
181
|
-
accessor suffixText: string;
|
|
181
|
+
accessor suffixText: string | undefined;
|
|
182
182
|
/**
|
|
183
183
|
* When `true` and the component is `open`, disables top layer placement.
|
|
184
184
|
*
|
|
@@ -189,9 +189,9 @@ export abstract class Autocomplete extends LitElement {
|
|
|
189
189
|
*/
|
|
190
190
|
accessor topLayerDisabled: boolean;
|
|
191
191
|
/** Specifies the validation icon to display under the component. */
|
|
192
|
-
accessor validationIcon: IconName | boolean;
|
|
192
|
+
accessor validationIcon: IconName | boolean | undefined;
|
|
193
193
|
/** Specifies the validation message to display under the component. */
|
|
194
|
-
accessor validationMessage: string;
|
|
194
|
+
accessor validationMessage: string | undefined;
|
|
195
195
|
/**
|
|
196
196
|
* The component's current validation state.
|
|
197
197
|
*
|
|
@@ -130,7 +130,7 @@ class Autocomplete extends LitElement {
|
|
|
130
130
|
this.transitionRef.value?.scrollTo(options);
|
|
131
131
|
}
|
|
132
132
|
async selectText() {
|
|
133
|
-
return this.referenceEl
|
|
133
|
+
return this.referenceEl?.selectText();
|
|
134
134
|
}
|
|
135
135
|
async setFocus(options) {
|
|
136
136
|
return this.focusSetter(() => this.referenceEl, options);
|
|
@@ -163,7 +163,7 @@ class Autocomplete extends LitElement {
|
|
|
163
163
|
}
|
|
164
164
|
let itemsAndGroupsUpdated = false;
|
|
165
165
|
if (changes.has("inputValue") && (this.hasUpdated || this.inputValue)) {
|
|
166
|
-
this.inputValueMatchPattern = this.inputValue
|
|
166
|
+
this.inputValueMatchPattern = this.inputValue ? new RegExp(`(${escapeRegExp(this.inputValue)})`, "i") : void 0;
|
|
167
167
|
this.updateItems();
|
|
168
168
|
this.updateGroups();
|
|
169
169
|
itemsAndGroupsUpdated = true;
|
|
@@ -260,7 +260,7 @@ class Autocomplete extends LitElement {
|
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
262
|
updateItems() {
|
|
263
|
-
let activeDescendant =
|
|
263
|
+
let activeDescendant = "";
|
|
264
264
|
this.items.forEach((item) => {
|
|
265
265
|
item.scale = this.scale;
|
|
266
266
|
item.inputValueMatchPattern = this.inputValueMatchPattern;
|
|
@@ -386,7 +386,7 @@ class Autocomplete extends LitElement {
|
|
|
386
386
|
const autofocus = this.el.autofocus;
|
|
387
387
|
const enterKeyHint = this.el.enterKeyHint;
|
|
388
388
|
const inputMode = this.el.inputMode;
|
|
389
|
-
return this.interactiveContainer({ disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div class=${safeClassMap(CSS.inputContainer)}><calcite-input .alignment=${this.alignment} aria-activedescendant=${this.activeDescendant ?? nothing} aria-controls=${listId ?? nothing} aria-label=${getLabelText(this) ?? nothing} aria-owns=${listId ?? nothing} aria-autocomplete=list .ariaExpanded=${isOpen} aria-haspopup=listbox .autocomplete=${this.autocomplete} .autofocus=${autofocus} class=${safeClassMap(CSS.input)} clearable .disabled=${disabled} enterkeyhint=${enterKeyHint ?? nothing} .form=${this.form} .icon=${this.icon ?? true} .iconFlipRtl=${this.iconFlipRtl} id=${inputId ?? nothing} inputmode=${inputMode ?? nothing} .label=${this.label} .loading=${this.loading} .maxLength=${this.maxLength} .messageOverrides=${this.messages} .minLength=${this.minLength} .name=${this.name} @
|
|
389
|
+
return this.interactiveContainer({ disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div class=${safeClassMap(CSS.inputContainer)}><calcite-input .alignment=${this.alignment} aria-activedescendant=${this.activeDescendant ?? nothing} aria-controls=${listId ?? nothing} aria-label=${getLabelText(this) ?? nothing} aria-owns=${listId ?? nothing} aria-autocomplete=list .ariaExpanded=${isOpen} aria-haspopup=listbox .autocomplete=${this.autocomplete} .autofocus=${autofocus} class=${safeClassMap(CSS.input)} clearable .disabled=${disabled} enterkeyhint=${enterKeyHint ?? nothing} .form=${this.form} .icon=${this.icon ?? true} .iconFlipRtl=${this.iconFlipRtl} id=${inputId ?? nothing} inputmode=${inputMode ?? nothing} .label=${this.label} .loading=${this.loading} .maxLength=${this.maxLength} .messageOverrides=${this.messages} .minLength=${this.minLength} .name=${this.name} @calciteInputChange=${this.changeHandler} @calciteInputInput=${this.inputHandler} @calciteInternalInputFocus=${this.handleInputFocus} @click=${this.inputClickHandler} @keydown=${this.keyDownHandler} .pattern=${this.pattern} .placeholder=${this.placeholder} .prefixText=${this.prefixText} .readOnly=${this.readOnly} .required=${this.required} role=combobox .scale=${this.scale} .status=${this.status} .suffixText=${this.suffixText} type=search .value=${this.inputValue} ${ref(this.setReferenceEl)}></calcite-input>${this.renderListBox()}<div class=${safeClassMap({
|
|
390
390
|
[CSS.contentContainer]: true,
|
|
391
391
|
[CSS.floatingUIContainer]: true,
|
|
392
392
|
[CSS.floatingUIContainerActive]: isOpen
|
|
@@ -13,7 +13,7 @@ import type { IconName } from "../calcite-icon/interfaces.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export abstract class AutocompleteItem extends LitElement {
|
|
15
15
|
/** Specifies a description for the component. Displays below the label text. */
|
|
16
|
-
accessor description: string;
|
|
16
|
+
accessor description: string | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* When `true`, interaction is prevented and the component is displayed with lower opacity.
|
|
19
19
|
*
|
|
@@ -27,13 +27,13 @@ export abstract class AutocompleteItem extends LitElement {
|
|
|
27
27
|
*/
|
|
28
28
|
accessor heading: string;
|
|
29
29
|
/** Specifies an icon to display at the end of the component. */
|
|
30
|
-
accessor iconEnd: IconName;
|
|
30
|
+
accessor iconEnd: IconName | undefined;
|
|
31
31
|
/** Displays the `iconStart` and/or `iconEnd` as flipped when the element direction is right-to-left (`"rtl"`). */
|
|
32
|
-
accessor iconFlipRtl: FlipContext;
|
|
32
|
+
accessor iconFlipRtl: FlipContext | undefined;
|
|
33
33
|
/** Specifies an icon to display at the start of the component. */
|
|
34
|
-
accessor iconStart: IconName;
|
|
34
|
+
accessor iconStart: IconName | undefined;
|
|
35
35
|
/** Specifies an accessible label for the component. */
|
|
36
|
-
accessor label: string;
|
|
36
|
+
accessor label: string | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* When `true`, the component is selected.
|
|
39
39
|
*
|
|
@@ -9,9 +9,9 @@ import type { Scale } from "../interfaces.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export abstract class Avatar extends LitElement {
|
|
11
11
|
/** Specifies the full name of the user. When `label` and `thumbnail` are not defined, specifies the accessible name for the component. */
|
|
12
|
-
accessor fullName: string;
|
|
12
|
+
accessor fullName: string | undefined;
|
|
13
13
|
/** Specifies alternative text when `thumbnail` is defined, otherwise specifies an accessible label for the component. */
|
|
14
|
-
accessor label: string;
|
|
14
|
+
accessor label: string | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Specifies the size of the component.
|
|
17
17
|
*
|
|
@@ -19,9 +19,9 @@ export abstract class Avatar extends LitElement {
|
|
|
19
19
|
*/
|
|
20
20
|
accessor scale: Scale;
|
|
21
21
|
/** Specifies the `src` to an image. If the image is private, include an access token in the URL. */
|
|
22
|
-
accessor thumbnail: string;
|
|
22
|
+
accessor thumbnail: string | undefined;
|
|
23
23
|
/** Specifies the unique id of the user. */
|
|
24
|
-
accessor userId: string;
|
|
24
|
+
accessor userId: string | undefined;
|
|
25
25
|
/** Specifies the username of the user. */
|
|
26
|
-
accessor username: string;
|
|
26
|
+
accessor username: string | undefined;
|
|
27
27
|
}
|
|
@@ -29,7 +29,7 @@ import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
|
29
29
|
import { u as useForm } from "../../chunks/useForm.js";
|
|
30
30
|
import { I as IDS, C as CSS, a as ComboboxItemSelector, b as ComboboxItemGroupSelector, c as ICONS } from "../../chunks/resources5.js";
|
|
31
31
|
import { h as hasActiveChildren, i as isSingleLike, g as getLabel, a as getItemAncestors, b as getItemChildren } from "../../chunks/utils2.js";
|
|
32
|
-
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}:host([scale=s]){font-size:var(--calcite-font-size-relative-sm);--calcite-internal-combobox-spacing-unit-l: .5rem;--calcite-internal-combobox-spacing-unit-s: .25rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-2xs);--calcite-internal-combobox-no-matches-spacing-unit-s: .25rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.25rem - 1px) ;--calcite-internal-close-size: 1rem}:host([scale=m]){font-size:var(--calcite-font-size-relative-base);--calcite-internal-combobox-spacing-unit-l: .75rem;--calcite-internal-combobox-spacing-unit-s: .5rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm);--calcite-internal-combobox-no-matches-spacing-unit-s: .375rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.5rem - 1px) ;--calcite-internal-close-size: 1.5rem}:host([scale=l]){font-size:var(--calcite-font-size-relative-md);--calcite-internal-combobox-spacing-unit-l: 1rem;--calcite-internal-combobox-spacing-unit-s: .75rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm-plus);--calcite-internal-combobox-no-matches-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-combobox-input-height: 1.5rem;--calcite-internal-combobox-input-margin-block: calc(var(--calcite-space-sm-plus) - 1px);--calcite-internal-close-size: 2rem}.wrapper{display:flex;border-width:1px;border-style:solid;outline-color:transparent;padding-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);background-color:var(--calcite-combobox-input-background-color, var(--calcite-color-foreground-1));color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));border-color:var(--calcite-combobox-input-border-color, var(--calcite-color-border-input))}.wrapper:hover .icon{color:var(--calcite-combobox-icon-color-hover, var(--calcite-color-text-1))}:host(:focus-within) .wrapper,.wrapper--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.wrapper--single{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;gap:var(--calcite-internal-combobox-spacing-unit-s);margin-inline-end:var(--calcite-internal-combobox-spacing-unit-s)}.grid-input.selection-display--fit,.grid-input.selection-display--single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;appearance:none;overflow:hidden;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-internal-combobox-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:placeholder-shown{text-overflow:ellipsis}.input--single{padding:0;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;width:0px;min-width:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.placeholder-icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;max-width:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.icon-end .icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.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}}.floating-ui-container .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}@media(forced-colors:active){.wrapper,.floating-ui-container{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}.list-container{max-height:45vh;overflow-y:auto;inline-size:var(--calcite-dropdown-width, 100%);background-color:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1))}.list{margin:0;display:block;padding:0;line-height:var(--calcite-font-line-height-relative-snug)}.list--hide{height:0px;overflow:hidden}calcite-chip{--calcite-animation-timing: 0}.chip{margin-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);max-inline-size:100%}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.select-all{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-1));border-block-end-color:var(--calcite-combobox-divider-color, var(--calcite-combobox-item-border-color, var(--calcite-color-border-3)));border-block-end-style:solid;border-block-end-width:var(--calcite-border-width-sm);inset-block-start:0;position:sticky;z-index:var(--calcite-z-index-sticky)}.no-matches{padding-block:var(--calcite-internal-combobox-no-matches-spacing-unit-s);padding-inline:var(--calcite-internal-combobox-spacing-unit-l);color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));background:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1));cursor:pointer}.no-matches-placeholder{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3));cursor:default}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.clear-button--container{display:flex;cursor:pointer;align-items:center}.clear-button--container:hover calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color: var(--calcite-clear-button-icon-color-hover, var(--calcite-color-text-1))}.clear-button--container:active calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color-press, var(--calcite-color-text-1))}.clear-button--container calcite-action{--calcite-internal-action-height: 100%;--calcite-internal-action-padding-inline: var(--calcite-spacing-none);--calcite-internal-action-padding-block: var(--calcite-spacing-none);--calcite-action-background-color: var(--calcite-clear-button-background-color, var(--calcite-color-foreground-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color)}.clear-button--container calcite-action:hover{--calcite-action-background-color-hover: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-hover)}.clear-button--container calcite-action:active{--calcite-action-background-color-press: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-press)}:host([scale=s]) .clear-button--container{padding:var(--calcite-spacing-xxs)}:host([scale=m]) .clear-button--container{padding:var(--calcite-spacing-xxs);padding-inline-end:var(--calcite-space-sm)}:host([scale=l]) .clear-button--container{padding-inline-end:var(--calcite-spacing-sm-plus)}.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}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}.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)}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`;
|
|
32
|
+
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}:host([scale=s]){font-size:var(--calcite-font-size-relative-sm);--calcite-internal-combobox-spacing-unit-l: .5rem;--calcite-internal-combobox-spacing-unit-s: .25rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-2xs);--calcite-internal-combobox-no-matches-spacing-unit-s: .25rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.25rem - 1px) ;--calcite-internal-close-size: 1rem}:host([scale=m]){font-size:var(--calcite-font-size-relative-base);--calcite-internal-combobox-spacing-unit-l: .75rem;--calcite-internal-combobox-spacing-unit-s: .5rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm);--calcite-internal-combobox-no-matches-spacing-unit-s: .375rem;--calcite-combobox-input-height: 1rem;--calcite-internal-combobox-input-margin-block: calc(.5rem - 1px) ;--calcite-internal-close-size: 1.5rem}:host([scale=l]){font-size:var(--calcite-font-size-relative-md);--calcite-internal-combobox-spacing-unit-l: 1rem;--calcite-internal-combobox-spacing-unit-s: .75rem;--calcite-internal-combobox-padding-inline-end: var(--calcite-space-sm-plus);--calcite-internal-combobox-no-matches-spacing-unit-s: var(--calcite-space-sm-plus);--calcite-combobox-input-height: 1.5rem;--calcite-internal-combobox-input-margin-block: calc(var(--calcite-space-sm-plus) - 1px);--calcite-internal-close-size: 2rem}.wrapper{display:flex;border-width:1px;border-style:solid;outline-color:transparent;padding-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);background-color:var(--calcite-combobox-input-background-color, var(--calcite-color-foreground-1));color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));border-color:var(--calcite-combobox-input-border-color, var(--calcite-color-border-input))}.wrapper:hover .icon{color:var(--calcite-combobox-icon-color-hover, var(--calcite-color-text-1))}:host(:focus-within) .wrapper,.wrapper--active{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([read-only]) .wrapper{background-color:var(--calcite-color-background)}:host([read-only]) .label{font-weight:var(--calcite-font-weight-medium)}:host([status=invalid]) .wrapper{border-color:var(--calcite-color-status-danger)}:host([status=invalid]:focus-within) .wrapper{outline:var(--calcite-border-width-md) solid var(--calcite-color-status-danger);outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.wrapper--single{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l) var(--calcite-internal-combobox-padding-inline-end);cursor:pointer;flex-wrap:nowrap}.grid-input{position:relative;display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;gap:var(--calcite-internal-combobox-spacing-unit-s);margin-inline-end:var(--calcite-internal-combobox-spacing-unit-s)}.grid-input.selection-display--fit,.grid-input.selection-display--single{flex-wrap:nowrap;overflow:hidden}.input{flex-grow:1;appearance:none;overflow:hidden;text-overflow:ellipsis;border-style:none;background-color:transparent;padding:0;font-family:inherit;color:var(--calcite-color-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);inline-size:100%;margin-block-end:var(--calcite-internal-combobox-spacing-unit-s);min-inline-size:4.8125rem}.input:focus{outline:2px solid transparent;outline-offset:2px}.input:placeholder-shown{text-overflow:ellipsis}.input--single{padding:0;margin-block:var(--calcite-internal-combobox-input-margin-block)}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;width:0px;min-width:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.placeholder-icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.input-wrap{display:flex;flex-grow:1;align-items:center}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;max-width:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-internal-combobox-spacing-unit-l)}.icon-end,.icon-start{display:flex;cursor:pointer;align-items:center}.icon-end{flex:none}.icon-end .icon{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3))}.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}}.floating-ui-container .calcite-floating-ui-anim{box-shadow:var(--calcite-shadow-md)}@media(forced-colors:active){.wrapper,.floating-ui-container{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}.list-container{max-height:45vh;overflow-y:auto;inline-size:var(--calcite-dropdown-width, 100%);background-color:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1))}.list{margin:0;display:block;padding:0;line-height:var(--calcite-font-line-height-relative-snug)}.list--hide{height:0px;overflow:hidden}calcite-chip{--calcite-animation-timing: 0}.chip{margin-block:calc(var(--calcite-internal-combobox-spacing-unit-s) / 4);max-inline-size:100%}.chip--invisible{visibility:hidden;position:absolute}.item{display:block}.select-all{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-1));border-block-end-color:var(--calcite-combobox-divider-color, var(--calcite-combobox-item-border-color, var(--calcite-color-border-3)));border-block-end-style:solid;border-block-end-width:var(--calcite-border-width-sm);inset-block-start:0;position:sticky;z-index:var(--calcite-z-index-sticky)}.no-matches{padding-block:var(--calcite-internal-combobox-no-matches-spacing-unit-s);padding-inline:var(--calcite-internal-combobox-spacing-unit-l);color:var(--calcite-combobox-input-text-color, var(--calcite-color-text-1));background:var(--calcite-combobox-background-color, var(--calcite-color-foreground-1));cursor:pointer}.no-matches-placeholder{color:var(--calcite-combobox-icon-color, var(--calcite-color-text-3));cursor:default}.disabled{opacity:.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.clear-button--container{display:flex;cursor:pointer;align-items:center}.clear-button--container:hover calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color: var(--calcite-clear-button-icon-color-hover, var(--calcite-color-text-1))}.clear-button--container:active calcite-action{--calcite-action-background-color: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color-press, var(--calcite-color-text-1))}.clear-button--container calcite-action{--calcite-internal-action-height: 100%;--calcite-internal-action-padding-inline: var(--calcite-spacing-none);--calcite-internal-action-padding-block: var(--calcite-spacing-none);--calcite-action-background-color: var(--calcite-clear-button-background-color, var(--calcite-color-foreground-2));--calcite-action-text-color: var(--calcite-clear-button-icon-color)}.clear-button--container calcite-action:hover{--calcite-action-background-color-hover: var(--calcite-clear-button-background-color-hover, var(--calcite-color-foreground-3));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-hover)}.clear-button--container calcite-action:active{--calcite-action-background-color-press: var(--calcite-clear-button-background-color-press, var(--calcite-color-border-2));--calcite-action-text-color-press: var(--calcite-clear-button-icon-color-press)}:host([scale=s]) .clear-button--container{padding:var(--calcite-spacing-xxs)}:host([scale=m]) .clear-button--container{padding:var(--calcite-spacing-xxs);padding-inline-end:var(--calcite-space-sm)}:host([scale=l]) .clear-button--container{padding-inline-end:var(--calcite-spacing-sm-plus)}.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}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}.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)}::placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-input-placeholder-text-color, var(--calcite-color-text-3))}`;
|
|
33
33
|
class Combobox extends LitElement {
|
|
34
34
|
constructor() {
|
|
35
35
|
super();
|
|
@@ -122,6 +122,7 @@ class Combobox extends LitElement {
|
|
|
122
122
|
this.compactSelectionDisplay = false;
|
|
123
123
|
this.selectedHiddenChipsCount = 0;
|
|
124
124
|
this.selectedVisibleChipsCount = 0;
|
|
125
|
+
this.allItems = [];
|
|
125
126
|
this.items = [];
|
|
126
127
|
this.clearDisabled = false;
|
|
127
128
|
this.disabled = false;
|
|
@@ -152,7 +153,7 @@ class Combobox extends LitElement {
|
|
|
152
153
|
this.listen("click", this.comboboxFocusHandler);
|
|
153
154
|
}
|
|
154
155
|
static {
|
|
155
|
-
this.properties = { activeChipIndex: [16, {}, { state: true }], activeDescendant: [16, {}, { state: true }], activeItemIndex: [16, {}, { state: true }], compactSelectionDisplay: [16, {}, { state: true }], selectedHiddenChipsCount: [16, {}, { state: true }], selectedVisibleChipsCount: [16, {}, { state: true }], items: [16, {}, { state: true }], noMatchesFound: [16, {}, { state: true }], allowCustomValues: [7, {}, { reflect: true, type: Boolean }], clearDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], filterText: [3, {}, { reflect: true }], filterProps: [0, {}, { attribute: false }], filteredItems: [32, {}, { attribute: false, readOnly: true }], flipPlacements: [0, {}, { attribute: false }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, maxItems: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placeholder: 1, placeholderIcon: [3, { type: String }, { reflect: true }], placeholderIconFlipRtl: [7, {}, { reflect: true, type: Boolean }], placement: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectAllEnabled: [7, {}, { reflect: true, type: Boolean }], selectedItems: [0, {}, { attribute: false }], selectionDisplay: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1 };
|
|
156
|
+
this.properties = { activeChipIndex: [16, {}, { state: true }], activeDescendant: [16, {}, { state: true }], activeItemIndex: [16, {}, { state: true }], compactSelectionDisplay: [16, {}, { state: true }], selectedHiddenChipsCount: [16, {}, { state: true }], selectedVisibleChipsCount: [16, {}, { state: true }], allItems: [16, {}, { state: true }], items: [16, {}, { state: true }], noMatchesFound: [16, {}, { state: true }], allowCustomValues: [7, {}, { reflect: true, type: Boolean }], clearDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], filterText: [3, {}, { reflect: true }], filterProps: [0, {}, { attribute: false }], filteredItems: [32, {}, { attribute: false, readOnly: true }], flipPlacements: [0, {}, { attribute: false }], form: [3, {}, { reflect: true }], label: 1, labelText: 1, maxItems: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placeholder: 1, placeholderIcon: [3, { type: String }, { reflect: true }], placeholderIconFlipRtl: [7, {}, { reflect: true, type: Boolean }], placement: [3, {}, { reflect: true }], readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], selectAllEnabled: [7, {}, { reflect: true, type: Boolean }], selectedItems: [0, {}, { attribute: false }], selectionDisplay: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }], selectionMode: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [32, {}, { readOnly: true, attribute: false }], value: 1 };
|
|
156
157
|
}
|
|
157
158
|
static {
|
|
158
159
|
this.formAssociated = true;
|
|
@@ -174,10 +175,21 @@ class Combobox extends LitElement {
|
|
|
174
175
|
return !open && selectedItem ? !!selectedIcon && singleSelectionMode : !!placeholderIcon && (!selectedItem || singleSelectionMode);
|
|
175
176
|
}
|
|
176
177
|
get allSelected() {
|
|
177
|
-
|
|
178
|
+
const enabledItems = this.allItems.filter((item) => !item.disabled);
|
|
179
|
+
return enabledItems.length > 0 && enabledItems.every((item) => item.selected);
|
|
180
|
+
}
|
|
181
|
+
get hasDisabledItems() {
|
|
182
|
+
return this.allItems.some((item) => item.disabled);
|
|
183
|
+
}
|
|
184
|
+
get hasDisabledSelected() {
|
|
185
|
+
return this.allItems.some((item) => item.disabled && item.selected);
|
|
178
186
|
}
|
|
179
187
|
get indeterminate() {
|
|
180
|
-
|
|
188
|
+
const hasAnySelected = this.selectedItems.length > 0 || this.hasDisabledSelected;
|
|
189
|
+
if (!this.selectAllEnabled) {
|
|
190
|
+
return this.selectedItems.length > 0 && !this.allSelected;
|
|
191
|
+
}
|
|
192
|
+
return !this.allSelected && hasAnySelected;
|
|
181
193
|
}
|
|
182
194
|
get keyboardNavItems() {
|
|
183
195
|
const { selectAllComboboxItemRef } = this;
|
|
@@ -302,7 +314,7 @@ class Combobox extends LitElement {
|
|
|
302
314
|
}
|
|
303
315
|
valueHandler(value) {
|
|
304
316
|
if (!this.internalValueChangeFlag) {
|
|
305
|
-
this.
|
|
317
|
+
this.items.forEach((item) => {
|
|
306
318
|
item.selected = Array.isArray(value) ? value.includes(item.value) : value === item.value;
|
|
307
319
|
});
|
|
308
320
|
this.updateItems();
|
|
@@ -316,6 +328,9 @@ class Combobox extends LitElement {
|
|
|
316
328
|
this.internalValueChangeFlag = true;
|
|
317
329
|
this.value = this.getValue();
|
|
318
330
|
this.internalValueChangeFlag = false;
|
|
331
|
+
if (this.selectionDisplay === "fit" && this.isMulti()) {
|
|
332
|
+
this.refreshSelectionDisplay();
|
|
333
|
+
}
|
|
319
334
|
}
|
|
320
335
|
async documentClickHandler(event) {
|
|
321
336
|
if (this.disabled || event.composedPath().includes(this.el)) {
|
|
@@ -336,7 +351,7 @@ class Combobox extends LitElement {
|
|
|
336
351
|
if (isSelectAllTarget) {
|
|
337
352
|
this.toggleSelectAll();
|
|
338
353
|
}
|
|
339
|
-
if (this.allSelected) {
|
|
354
|
+
if (this.allSelected && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
340
355
|
this.selectedItems.forEach((item) => {
|
|
341
356
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
342
357
|
if (chipEl) {
|
|
@@ -397,8 +412,13 @@ class Combobox extends LitElement {
|
|
|
397
412
|
}
|
|
398
413
|
toggleSelectAll() {
|
|
399
414
|
const toggledValue = !this.allSelected;
|
|
400
|
-
this.
|
|
401
|
-
|
|
415
|
+
this.allItems.forEach((item) => {
|
|
416
|
+
if (item.disabled) {
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
item.selected = toggledValue;
|
|
420
|
+
});
|
|
421
|
+
this.selectedItems = this.getSelectedItems();
|
|
402
422
|
this.emitComboboxChange();
|
|
403
423
|
}
|
|
404
424
|
keyDownHandler(event) {
|
|
@@ -643,7 +663,7 @@ class Combobox extends LitElement {
|
|
|
643
663
|
inputWidth,
|
|
644
664
|
largestSelectedIndicatorChipWidth
|
|
645
665
|
});
|
|
646
|
-
if (this.allSelected && this.selectAllEnabled) {
|
|
666
|
+
if (this.allSelected && this.selectAllEnabled && (!this.hasDisabledItems || this.hasDisabledSelected)) {
|
|
647
667
|
this.selectedItems.forEach((item) => {
|
|
648
668
|
const chipEl = this.referenceEl.querySelector(`#${IDS.chip(item.guid)}`);
|
|
649
669
|
if (chipEl) {
|
|
@@ -700,7 +720,7 @@ class Combobox extends LitElement {
|
|
|
700
720
|
if (newSelectedVisibleChipsCount !== this.selectedVisibleChipsCount) {
|
|
701
721
|
this.selectedVisibleChipsCount = newSelectedVisibleChipsCount;
|
|
702
722
|
}
|
|
703
|
-
const newSelectedHiddenChipsCount = this.getSelectedItems().length - newSelectedVisibleChipsCount;
|
|
723
|
+
const newSelectedHiddenChipsCount = Math.max(0, this.getSelectedItems().length - newSelectedVisibleChipsCount);
|
|
704
724
|
if (newSelectedHiddenChipsCount !== this.selectedHiddenChipsCount) {
|
|
705
725
|
this.selectedHiddenChipsCount = newSelectedHiddenChipsCount;
|
|
706
726
|
}
|
|
@@ -784,7 +804,12 @@ class Combobox extends LitElement {
|
|
|
784
804
|
el.selected = true;
|
|
785
805
|
});
|
|
786
806
|
} else {
|
|
787
|
-
children.forEach((el) =>
|
|
807
|
+
children.forEach((el) => {
|
|
808
|
+
if (el.disabled) {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
el.selected = false;
|
|
812
|
+
});
|
|
788
813
|
[...ancestors].forEach((el) => {
|
|
789
814
|
if (!hasActiveChildren(el)) {
|
|
790
815
|
el.selected = false;
|
|
@@ -793,7 +818,8 @@ class Combobox extends LitElement {
|
|
|
793
818
|
}
|
|
794
819
|
}
|
|
795
820
|
updateItems() {
|
|
796
|
-
this.
|
|
821
|
+
this.allItems = this.getItems(true);
|
|
822
|
+
this.items = this.allItems.filter((item) => !item.disabled);
|
|
797
823
|
this.groupItems = this.getGroupItems();
|
|
798
824
|
this.data = this.getData();
|
|
799
825
|
this.groupData = this.getGroupData();
|
|
@@ -801,7 +827,7 @@ class Combobox extends LitElement {
|
|
|
801
827
|
this.selectedItems = this.getSelectedItems();
|
|
802
828
|
}
|
|
803
829
|
updateItemProps() {
|
|
804
|
-
this.
|
|
830
|
+
this.allItems.forEach((item) => {
|
|
805
831
|
item.selectionMode = this.selectionMode;
|
|
806
832
|
item.selectionAppearance = this.selectionAppearance;
|
|
807
833
|
item.scale = this.scale;
|
|
@@ -963,40 +989,111 @@ class Combobox extends LitElement {
|
|
|
963
989
|
const value = Array.isArray(this.value) ? this.value.join(", ") : this.value;
|
|
964
990
|
return this.readOnly ? this.messages.nonEditable?.replace("{value}", `${value}`) : value;
|
|
965
991
|
}
|
|
992
|
+
getChipLabel(item, isAncestors) {
|
|
993
|
+
if (!isAncestors) {
|
|
994
|
+
return getLabel(item);
|
|
995
|
+
}
|
|
996
|
+
const ancestors = [...getItemAncestors(item)].reverse();
|
|
997
|
+
return [...ancestors, item].map((el) => getLabel(el)).join(" / ");
|
|
998
|
+
}
|
|
999
|
+
renderChip({ activeChipIndex, disabled, index, item, messages, readOnly, scale, isAncestors }) {
|
|
1000
|
+
const label = this.getChipLabel(item, isAncestors);
|
|
1001
|
+
return keyed(item.guid || item.value || label, html`<calcite-chip .appearance=${readOnly ? "outline" : "solid"} class=${safeClassMap({
|
|
1002
|
+
[CSS.chip]: true,
|
|
1003
|
+
[CSS.disabled]: disabled
|
|
1004
|
+
})} .closable=${!disabled && !readOnly} .disabled=${disabled} .icon=${item.icon} .iconFlipRtl=${item.iconFlipRtl} id=${(!disabled && item.guid ? `${IDS.chip(item.guid)}` : null) ?? nothing} .label=${label} .messageOverrides=${!disabled ? { dismissLabel: messages.removeTag } : null} @calciteChipClose=${!disabled ? () => this.calciteChipCloseHandler(item) : null} @focusin=${!disabled ? () => this.activeChipIndex = index : null} .scale=${scale} .selected=${item.selected} .tabIndex=${!disabled && activeChipIndex === index ? 0 : -1} title=${label ?? nothing} .value=${item.value}>${label}</calcite-chip>`);
|
|
1005
|
+
}
|
|
1006
|
+
renderChipCount(count, scale) {
|
|
1007
|
+
const label = this.messages.disabledSelectedCount?.replace("{count}", `${count}`) ?? `+${count}`;
|
|
1008
|
+
return html`<calcite-chip appearance=solid class=${safeClassMap({
|
|
1009
|
+
[CSS.chip]: true
|
|
1010
|
+
})} .label=${label} .scale=${scale} tabindex=-1 title=${label ?? nothing}>${label}</calcite-chip>`;
|
|
1011
|
+
}
|
|
966
1012
|
renderChips() {
|
|
967
|
-
const { activeChipIndex, readOnly, scale, selectionMode, messages } = this;
|
|
968
|
-
|
|
1013
|
+
const { activeChipIndex, readOnly, scale, selectionDisplay, selectionMode, messages } = this;
|
|
1014
|
+
const chips = [];
|
|
1015
|
+
const isAncestors = selectionMode === "ancestors";
|
|
1016
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1017
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1018
|
+
const disabledItems = this.allItems.filter((item) => item.disabled && item.selected && (!isAncestors || !hasActiveChildren(item)));
|
|
1019
|
+
const preserveOrder = selectionDisplay === "all";
|
|
1020
|
+
if (selectionDisplay === "fit" && (allSelectedNoDisabled || allSelectedWithDisabledSelected) || selectionDisplay === "all" && this.selectAllEnabled && allSelectedWithDisabledSelected || this.selectAllEnabled && this.allSelected && !this.hasDisabledItems) {
|
|
969
1021
|
return null;
|
|
970
1022
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
1023
|
+
let selectedIndex = 0;
|
|
1024
|
+
let disabledIndex = 0;
|
|
1025
|
+
if (preserveOrder) {
|
|
1026
|
+
this.allItems.forEach((item) => {
|
|
1027
|
+
if (item.disabled) {
|
|
1028
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1029
|
+
chips.push(this.renderChip({
|
|
1030
|
+
activeChipIndex,
|
|
1031
|
+
disabled: true,
|
|
1032
|
+
index: disabledIndex++,
|
|
1033
|
+
item,
|
|
1034
|
+
messages,
|
|
1035
|
+
readOnly,
|
|
1036
|
+
scale,
|
|
1037
|
+
isAncestors
|
|
1038
|
+
}));
|
|
1039
|
+
}
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1043
|
+
if (item.selected && (!isAncestors || !hasActiveChildren(item))) {
|
|
1044
|
+
chips.push(this.renderChip({
|
|
1045
|
+
activeChipIndex,
|
|
1046
|
+
disabled: false,
|
|
1047
|
+
index: selectedIndex++,
|
|
1048
|
+
item,
|
|
1049
|
+
messages,
|
|
1050
|
+
readOnly,
|
|
1051
|
+
scale,
|
|
1052
|
+
isAncestors
|
|
1053
|
+
}));
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
} else if (!this.selectAllEnabled || !this.allSelected || this.hasDisabledItems) {
|
|
1058
|
+
this.selectedItems.forEach((item) => {
|
|
1059
|
+
chips.push(this.renderChip({
|
|
1060
|
+
activeChipIndex,
|
|
1061
|
+
disabled: false,
|
|
1062
|
+
index: selectedIndex++,
|
|
1063
|
+
item,
|
|
1064
|
+
messages,
|
|
1065
|
+
readOnly,
|
|
1066
|
+
scale,
|
|
1067
|
+
isAncestors
|
|
1068
|
+
}));
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
1071
|
+
if (selectionDisplay === "fit" && disabledItems.length) {
|
|
1072
|
+
chips.push(this.renderChipCount(disabledItems.length, scale));
|
|
1073
|
+
}
|
|
1074
|
+
return chips.length ? chips : null;
|
|
981
1075
|
}
|
|
982
1076
|
renderAllSelectedIndicatorChip() {
|
|
983
1077
|
const { allSelectedIndicatorChipRef, compactSelectionDisplay, scale, selectedVisibleChipsCount } = this;
|
|
984
1078
|
const label = compactSelectionDisplay ? this.messages.all : this.messages.allSelected;
|
|
1079
|
+
const showAllSelectedChip = this.allSelected && (this.selectionDisplay === "single" || !selectedVisibleChipsCount || this.selectionDisplay === "fit" && this.hasDisabledSelected || this.selectionDisplay === "all" && this.hasDisabledSelected);
|
|
985
1080
|
return html`<calcite-chip class=${safeClassMap({
|
|
986
1081
|
[CSS.chip]: true,
|
|
987
|
-
[CSS.chipInvisible]: !
|
|
1082
|
+
[CSS.chipInvisible]: !showAllSelectedChip,
|
|
988
1083
|
[CSS.allSelected]: true
|
|
989
1084
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(allSelectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
990
1085
|
}
|
|
991
1086
|
renderSelectedIndicatorChip() {
|
|
992
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1087
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount, selectedVisibleChipsCount, selectedIndicatorChipRef } = this;
|
|
1088
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1089
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
993
1090
|
let chipInvisible;
|
|
994
1091
|
let label;
|
|
995
1092
|
if (compactSelectionDisplay) {
|
|
996
1093
|
chipInvisible = true;
|
|
997
1094
|
} else {
|
|
998
1095
|
if (selectionDisplay === "single") {
|
|
999
|
-
const selectedItemsCount =
|
|
1096
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1000
1097
|
if (this.allSelected) {
|
|
1001
1098
|
chipInvisible = true;
|
|
1002
1099
|
} else if (selectedItemsCount > 0) {
|
|
@@ -1006,7 +1103,7 @@ class Combobox extends LitElement {
|
|
|
1006
1103
|
}
|
|
1007
1104
|
label = `${selectedItemsCount} ${this.messages.selected}`;
|
|
1008
1105
|
} else if (selectionDisplay === "fit") {
|
|
1009
|
-
chipInvisible = !!(
|
|
1106
|
+
chipInvisible = !!((allSelectedNoDisabled || allSelectedWithDisabledSelected) && selectedVisibleChipsCount === 0 || selectedHiddenChipsCount === 0);
|
|
1010
1107
|
label = selectedVisibleChipsCount > 0 ? `+${selectedHiddenChipsCount}` : `${selectedHiddenChipsCount} ${this.messages.selected}`;
|
|
1011
1108
|
}
|
|
1012
1109
|
}
|
|
@@ -1016,12 +1113,14 @@ class Combobox extends LitElement {
|
|
|
1016
1113
|
})} .label=${label} .scale=${scale} title=${label ?? nothing} value ${ref(selectedIndicatorChipRef)}>${label}</calcite-chip>`;
|
|
1017
1114
|
}
|
|
1018
1115
|
renderSelectedIndicatorChipCompact() {
|
|
1019
|
-
const { compactSelectionDisplay, selectionDisplay,
|
|
1116
|
+
const { compactSelectionDisplay, selectionDisplay, scale, selectedHiddenChipsCount } = this;
|
|
1117
|
+
const allSelectedNoDisabled = this.allSelected && !this.hasDisabledItems;
|
|
1118
|
+
const allSelectedWithDisabledSelected = this.allSelected && this.hasDisabledSelected;
|
|
1020
1119
|
let chipInvisible;
|
|
1021
1120
|
let label;
|
|
1022
1121
|
if (compactSelectionDisplay) {
|
|
1023
|
-
const selectedItemsCount =
|
|
1024
|
-
if (this.allSelected) {
|
|
1122
|
+
const selectedItemsCount = this.allItems.filter((item) => item.selected && (this.selectionMode !== "ancestors" || !hasActiveChildren(item))).length;
|
|
1123
|
+
if (allSelectedNoDisabled || allSelectedWithDisabledSelected || selectionDisplay === "single" && this.allSelected) {
|
|
1025
1124
|
chipInvisible = true;
|
|
1026
1125
|
} else if (selectionDisplay === "fit") {
|
|
1027
1126
|
chipInvisible = !(selectedHiddenChipsCount > 0);
|
|
@@ -1109,6 +1208,7 @@ class Combobox extends LitElement {
|
|
|
1109
1208
|
const singleSelectionDisplay = selectionDisplay === "single";
|
|
1110
1209
|
const fitSelectionDisplay = !singleSelectionMode && selectionDisplay === "fit";
|
|
1111
1210
|
const isClearable = !this.clearDisabled && this.selectionMode !== "single-persist" && !!this.value?.length;
|
|
1211
|
+
const hasDisabledItems = this.hasDisabledItems;
|
|
1112
1212
|
return this.interactiveContainer({ disabled: this.disabled, children: html`${this.labelText && InternalLabel({ labelText: this.labelText, onClick: this.onLabelClick, required: this.required, tooltipText: this.messages.required }) || ""}<div aria-live=polite class=${safeClassMap({
|
|
1113
1213
|
[CSS.wrapper]: true,
|
|
1114
1214
|
[CSS.wrapperSingle]: singleSelectionMode || !this.selectedItems.length,
|
|
@@ -1117,7 +1217,7 @@ class Combobox extends LitElement {
|
|
|
1117
1217
|
[CSS.gridInput]: true,
|
|
1118
1218
|
[CSS.selectionDisplayFit]: fitSelectionDisplay,
|
|
1119
1219
|
[CSS.selectionDisplaySingle]: singleSelectionDisplay
|
|
1120
|
-
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1220
|
+
})} ${ref(this.setChipContainerEl)}>${!singleSelectionMode && !singleSelectionDisplay && this.renderChips() || ""}${!singleSelectionMode && !singleSelectionDisplay && this.selectAllEnabled && allSelectionDisplay && (!hasDisabledItems || this.hasDisabledSelected) && this.renderAllSelectedIndicatorChip() || ""}${!singleSelectionMode && !allSelectionDisplay && [
|
|
1121
1221
|
this.renderSelectedIndicatorChip(),
|
|
1122
1222
|
this.renderSelectedIndicatorChipCompact(),
|
|
1123
1223
|
this.renderAllSelectedIndicatorChip()
|
|
@@ -158,11 +158,11 @@ class Dialog extends LitElement {
|
|
|
158
158
|
connectedCallback() {
|
|
159
159
|
super.connectedCallback();
|
|
160
160
|
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
161
|
-
this.
|
|
161
|
+
this.setUpInteractions();
|
|
162
162
|
}
|
|
163
163
|
willUpdate(changes) {
|
|
164
164
|
if (changes.has("open") && (this.hasUpdated || this.open !== false) || changes.has("placement") && (this.hasUpdated || this.placement !== "center") || changes.has("resizable") && (this.hasUpdated || this.resizable !== false) || changes.has("dragEnabled") && (this.hasUpdated || this.dragEnabled !== false)) {
|
|
165
|
-
this.
|
|
165
|
+
this.setUpInteractions();
|
|
166
166
|
}
|
|
167
167
|
if (changes.has("messages") || changes.has("dragEnabled") && (this.hasUpdated || this.dragEnabled !== false) || changes.has("resizable") && (this.hasUpdated || this.resizable !== false)) {
|
|
168
168
|
this.updateAssistiveText();
|
|
@@ -175,7 +175,7 @@ class Dialog extends LitElement {
|
|
|
175
175
|
super.disconnectedCallback();
|
|
176
176
|
this.mutationObserver?.disconnect();
|
|
177
177
|
this.embedded = false;
|
|
178
|
-
this.
|
|
178
|
+
this.cleanUpInteractions();
|
|
179
179
|
}
|
|
180
180
|
focusTrapDisabledOverride() {
|
|
181
181
|
return !this.modal && this.focusTrapDisabled;
|
|
@@ -335,7 +335,7 @@ class Dialog extends LitElement {
|
|
|
335
335
|
const translateY = Math.round(y + top + bottom);
|
|
336
336
|
this.transitionEl.style.transform = translateX || translateY ? `translate(${translateX}px, ${translateY}px)` : null;
|
|
337
337
|
}
|
|
338
|
-
|
|
338
|
+
cleanUpInteractions() {
|
|
339
339
|
this.interaction?.unset();
|
|
340
340
|
this.updateSizeInternal({
|
|
341
341
|
inline: null,
|
|
@@ -345,8 +345,8 @@ class Dialog extends LitElement {
|
|
|
345
345
|
this.resizePosition = { ...initialResizePosition };
|
|
346
346
|
this.updateTransform();
|
|
347
347
|
}
|
|
348
|
-
async
|
|
349
|
-
this.
|
|
348
|
+
async setUpInteractions() {
|
|
349
|
+
this.cleanUpInteractions();
|
|
350
350
|
const { el, transitionEl, resizable, dragEnabled, resizePosition, dragPosition } = this;
|
|
351
351
|
if (!transitionEl || !this.open) {
|
|
352
352
|
return;
|
|
@@ -447,7 +447,7 @@ class Dialog extends LitElement {
|
|
|
447
447
|
return;
|
|
448
448
|
}
|
|
449
449
|
this.transitionEl = el;
|
|
450
|
-
this.
|
|
450
|
+
this.setUpInteractions();
|
|
451
451
|
}
|
|
452
452
|
handleInternalPanelScroll(event) {
|
|
453
453
|
if (event.target !== this.panelRef.value) {
|
|
@@ -269,6 +269,9 @@ class Dropdown extends LitElement {
|
|
|
269
269
|
const previousReferenceEl = this.referenceEl instanceof HTMLElement ? this.referenceEl : null;
|
|
270
270
|
const nextReferenceEl = el instanceof HTMLElement ? el : null;
|
|
271
271
|
updateRefObserver(this.resizeObserver, previousReferenceEl, nextReferenceEl);
|
|
272
|
+
if (this.referenceElementType || !nextReferenceEl) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
272
275
|
this.referenceEl = el;
|
|
273
276
|
connectFloatingUI(this);
|
|
274
277
|
}
|