@esri/calcite-components 5.2.0-next.1 → 5.2.0-next.3
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/{SG43VAY2.js → 25REF2NN.js} +1 -1
- package/dist/cdn/{2DTD2NAQ.js → 2HNTBRGI.js} +1 -1
- package/dist/cdn/{EYO37APD.js → 2KQYBSYT.js} +1 -1
- package/dist/cdn/{5BXJCRHG.js → 2QPDMP77.js} +1 -1
- package/dist/cdn/{RSDMKNTP.js → 2R5575FD.js} +1 -1
- package/dist/cdn/{L4Z32DDI.js → 2V5PWFGL.js} +1 -1
- package/dist/cdn/{6DUYQARM.js → 2ZHE6WYE.js} +1 -1
- package/dist/cdn/{NSFNE7JF.js → 3E5PTGBR.js} +1 -1
- package/dist/cdn/{XRQ6ALBW.js → 3I6JOWLC.js} +1 -1
- package/dist/cdn/{YOMDRGFX.js → 3QDH4BSH.js} +1 -1
- package/dist/cdn/{25KULUYL.js → 3Z5JAFWG.js} +1 -1
- package/dist/cdn/{GHBTJCIE.js → 45GYNS4N.js} +1 -1
- package/dist/cdn/{RDJ3NPD2.js → 45OM3TVW.js} +1 -1
- package/dist/cdn/{IMHBTKOK.js → 46V4FBEL.js} +1 -1
- package/dist/cdn/{TKWNZUZC.js → 46YJO7ZX.js} +1 -1
- package/dist/cdn/{7LKWZYMO.js → 4KPRVK5B.js} +1 -1
- package/dist/cdn/{WMJFCYAQ.js → 4NKWSPPP.js} +1 -1
- package/dist/cdn/{XVA6JBXQ.js → 4QUJLWDM.js} +1 -1
- package/dist/cdn/{AYIHFCPW.js → 55C3E7K2.js} +1 -1
- package/dist/cdn/{YEOA76XG.js → 5ERAQVFI.js} +1 -1
- package/dist/cdn/{TUOZOBAX.js → 5HLTQ2LF.js} +1 -1
- package/dist/cdn/5MF7KGEH.js +2 -0
- package/dist/cdn/{54LRKMZS.js → 5OIVOI4E.js} +1 -1
- package/dist/cdn/{DOQVMLYE.js → 5P3KUKVG.js} +1 -1
- package/dist/cdn/5SMFDB2H.js +2 -0
- package/dist/cdn/{UTYK5GN7.js → 5TANECZK.js} +1 -1
- package/dist/cdn/{ESXXYY4U.js → 5TLZJ44V.js} +1 -1
- package/dist/cdn/{LLBCU6W2.js → 5UK4QYJH.js} +1 -1
- package/dist/cdn/{GPZK2XCA.js → 5YMFALSV.js} +1 -1
- package/dist/cdn/{PVLYFAFT.js → 64Q6HGDE.js} +1 -1
- package/dist/cdn/{W6FGHS7T.js → 6T2ZPNFA.js} +1 -1
- package/dist/cdn/{RL3BQHH7.js → 74BKHZU7.js} +1 -1
- package/dist/cdn/{XKLVTSH7.js → 77P5NIL6.js} +1 -1
- package/dist/cdn/{N5V52FVE.js → 7R2AK6N6.js} +1 -1
- package/dist/cdn/{MZGWIJTE.js → A5BV4RXA.js} +1 -1
- package/dist/cdn/{NLG3XARE.js → ASUBNSLW.js} +1 -1
- package/dist/cdn/{NSSVAO6G.js → AXKBFCNE.js} +1 -1
- package/dist/cdn/{ACTWXLMU.js → B2TFN5WO.js} +1 -1
- package/dist/cdn/{WJ2DBVDY.js → B3XEP4OJ.js} +1 -1
- package/dist/cdn/{OM2LRTKI.js → BPEX76AH.js} +1 -1
- package/dist/cdn/{ES72YVWM.js → C4T3FNZ6.js} +1 -1
- package/dist/cdn/{MIR7TMZV.js → CM6N5CTY.js} +1 -1
- package/dist/cdn/{3F6G62ML.js → CPRYH6HJ.js} +1 -1
- package/dist/cdn/{4ETK64XH.js → CS5FMS2X.js} +1 -1
- package/dist/cdn/{6WRZDS46.js → DNCOUN25.js} +1 -1
- package/dist/cdn/{GX22FMPB.js → DZ3BSHVB.js} +1 -1
- package/dist/cdn/{OMEUUIN3.js → E7ZJND2K.js} +1 -1
- package/dist/cdn/ECM52CXF.js +2 -0
- package/dist/cdn/ECQHUL2I.js +2 -0
- package/dist/cdn/{PK24O5FM.js → EDVESYWS.js} +1 -1
- package/dist/cdn/{CYL77NSA.js → EMVLBTN2.js} +1 -1
- package/dist/cdn/{V4N6LLPL.js → EUNOZE74.js} +1 -1
- package/dist/cdn/{GQYGI42P.js → F6A3EV5Z.js} +1 -1
- package/dist/cdn/{R66RRO3R.js → FA3N4SCO.js} +1 -1
- package/dist/cdn/{XKZW6PMR.js → FFGBSJ3K.js} +1 -1
- package/dist/cdn/{5B3SU7K7.js → FH3ISPWF.js} +1 -1
- package/dist/cdn/{T6WFAXGK.js → FLRXMVF6.js} +1 -1
- package/dist/cdn/{AWONW44Y.js → FMFRALQU.js} +1 -1
- package/dist/cdn/{4XMK7RES.js → FP6LX7PQ.js} +1 -1
- package/dist/cdn/{CWQ3PMYG.js → FRW722GZ.js} +1 -1
- package/dist/cdn/{SYWS7CRW.js → FVWMPMHM.js} +1 -1
- package/dist/cdn/{Y77IPFJ6.js → FW4A2RXA.js} +1 -1
- package/dist/cdn/{JYV5JY66.js → G2DHRTQC.js} +1 -1
- package/dist/cdn/{EAMIHL5M.js → G3IACNMC.js} +1 -1
- package/dist/cdn/{EARL5L6Z.js → G3MFBUAJ.js} +1 -1
- package/dist/cdn/{TBBD7RAC.js → G4OJO3U4.js} +1 -1
- package/dist/cdn/{MOVYXJPM.js → GFTCJY52.js} +1 -1
- package/dist/cdn/{TOW6FGVT.js → GTSHC732.js} +1 -1
- package/dist/cdn/{HPG25RGF.js → H5OQSDKX.js} +1 -1
- package/dist/cdn/{A7VRJEQ7.js → HAJB6MIB.js} +1 -1
- package/dist/cdn/HKIP6O5B.js +2 -0
- package/dist/cdn/{CJ6HLMWM.js → HTYBEKT4.js} +1 -1
- package/dist/cdn/{3274MQBE.js → HURRNHB4.js} +1 -1
- package/dist/cdn/I5C2XC5I.js +2 -0
- package/dist/cdn/{YLSRMNDL.js → I7GYAHCX.js} +1 -1
- package/dist/cdn/{UWEY77AH.js → IKHJ3B3O.js} +1 -1
- package/dist/cdn/{6I7CG5ZI.js → IKKOQYJ3.js} +1 -1
- package/dist/cdn/{IFGOL2KZ.js → ILPS2EH6.js} +1 -1
- package/dist/cdn/{DOEPGWZO.js → J6NGVSKR.js} +1 -1
- package/dist/cdn/{MDH6YMD3.js → JWS6J7PU.js} +1 -1
- package/dist/cdn/{ZALKF7AK.js → KBAOMH37.js} +1 -1
- package/dist/cdn/{7BPZSHP5.js → KFBRWS3D.js} +1 -1
- package/dist/cdn/KRZT7UVD.js +2 -0
- package/dist/cdn/L4UV3JUD.js +2 -0
- package/dist/cdn/{4DBDLDKL.js → LGHZN3MI.js} +1 -1
- package/dist/cdn/LGJJ3IVS.js +2 -0
- package/dist/cdn/{FGBYK22Q.js → LJVNR3MM.js} +1 -1
- package/dist/cdn/{2WQCK6Z3.js → LXNSAHEI.js} +1 -1
- package/dist/cdn/{DYTBN43V.js → LZB4RQKP.js} +1 -1
- package/dist/cdn/{6HQ7WHUL.js → M7C3FAEE.js} +1 -1
- package/dist/cdn/{JFBAD4EH.js → MJULDZYK.js} +1 -1
- package/dist/cdn/{YWSUGSZQ.js → MKTDHS2D.js} +1 -1
- package/dist/cdn/{UYY6Z6VK.js → MYKQDV34.js} +1 -1
- package/dist/cdn/{JNIRX7D3.js → NA2SOXT6.js} +1 -1
- package/dist/cdn/{VNHCZF5S.js → NE4W2KYY.js} +1 -1
- package/dist/cdn/{WBEFTFTM.js → NXAZFXVJ.js} +1 -1
- package/dist/cdn/{PV5JONG7.js → O4YDLMH4.js} +1 -1
- package/dist/cdn/{VWJDFV4M.js → O6PZ7XSR.js} +1 -1
- package/dist/cdn/{V2ZQL3ON.js → OF67Q5H4.js} +1 -1
- package/dist/cdn/{DCQW26QE.js → OHEDJJP3.js} +1 -1
- package/dist/cdn/PIPT523T.js +2 -0
- package/dist/cdn/{T64D27BK.js → PKZQRMZP.js} +1 -1
- package/dist/cdn/{GIWBHPUL.js → PX6CN3BM.js} +1 -1
- package/dist/cdn/{DE6F4LEP.js → PYIKGUJ2.js} +1 -1
- package/dist/cdn/{RX7YQTRT.js → PZ2JFTG3.js} +1 -1
- package/dist/cdn/Q45HAOK7.js +2 -0
- package/dist/cdn/QCU7UPIO.js +2 -0
- package/dist/cdn/QFXBPBV6.js +2 -0
- package/dist/cdn/{SVIZ25MX.js → QSAWZORD.js} +1 -1
- package/dist/cdn/QSMEIRS5.js +2 -0
- package/dist/cdn/{T2B7YQBZ.js → QVYX2WRU.js} +1 -1
- package/dist/cdn/{MM6ZG6HL.js → RQUJRPWK.js} +1 -1
- package/dist/cdn/{QJVQP6SA.js → RWUXB3VT.js} +1 -1
- package/dist/cdn/{7BAH3USN.js → S4DHIY5S.js} +1 -1
- package/dist/cdn/{VINHY2BO.js → SQVIEOWT.js} +1 -1
- package/dist/cdn/{7T64APC5.js → SVCYJ4XS.js} +1 -1
- package/dist/cdn/{AIWMELGE.js → TVOZYOEI.js} +1 -1
- package/dist/cdn/{VOLQZMH5.js → UDGWJQLI.js} +1 -1
- package/dist/cdn/{H6TQ2ZT5.js → UR3E5C47.js} +1 -1
- package/dist/cdn/UWAER5W3.js +2 -0
- package/dist/cdn/{BXSBN734.js → VFOFNA4N.js} +1 -1
- package/dist/cdn/{RJJY3IYM.js → VHNQUJ3I.js} +1 -1
- package/dist/cdn/{VOYNOWTM.js → VI4U7JDU.js} +1 -1
- package/dist/cdn/{7MVJZ7CE.js → VYOTQ57Z.js} +1 -1
- package/dist/cdn/{6SJDD32D.js → WVDLNASH.js} +1 -1
- package/dist/cdn/{AHIMAWOG.js → WXVKYWR3.js} +1 -1
- package/dist/cdn/{JAMAODSH.js → WYHTLF5H.js} +1 -1
- package/dist/cdn/{D2F4S4IN.js → X2KGYKIA.js} +1 -1
- package/dist/cdn/{6VJGFXTB.js → XGOD2THM.js} +1 -1
- package/dist/cdn/{JQOYQOAO.js → XH36YHWX.js} +1 -1
- package/dist/cdn/{XRGFDJYN.js → XMMZONMQ.js} +1 -1
- package/dist/cdn/{ZOVBFLHG.js → XQKJ2MAY.js} +1 -1
- package/dist/cdn/{JSEZIWE7.js → XVSPVAAK.js} +1 -1
- package/dist/cdn/{2QRPMWMD.js → XWQGS5WX.js} +1 -1
- package/dist/cdn/{ASL35FGE.js → XWVX33VP.js} +1 -1
- package/dist/cdn/{FEGURFPP.js → XXX7LPUI.js} +1 -1
- package/dist/cdn/{TX53ZOIB.js → XY6ZZY3N.js} +1 -1
- package/dist/cdn/{DXKVNK72.js → Y3AQSDDG.js} +1 -1
- package/dist/cdn/{ERXINDJK.js → Y5ML7MYH.js} +1 -1
- package/dist/cdn/{4MGZ6ADZ.js → YHD7HKDX.js} +1 -1
- package/dist/cdn/{ZSURDLTS.js → YIYK2AH7.js} +1 -1
- package/dist/cdn/{HI5BMWLV.js → YKKTX575.js} +1 -1
- package/dist/cdn/{IQC2I5QX.js → YPXCM33T.js} +1 -1
- package/dist/cdn/{DOTGEOAD.js → YU26YM2P.js} +1 -1
- package/dist/cdn/{O4JLFLGJ.js → YVOGB4KL.js} +1 -1
- package/dist/cdn/{DXJL2WZO.js → ZBDHEOSY.js} +1 -1
- package/dist/cdn/{6P2QCONQ.js → ZFKR3EYV.js} +1 -1
- package/dist/cdn/{QUKECT32.js → ZMPSTGQA.js} +1 -1
- package/dist/cdn/{3IC622AE.js → ZU5TOIDV.js} +1 -1
- package/dist/cdn/ZWWFCCZ7.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/openCloseComponent.js +1 -1
- package/dist/chunks/resources10.js +19 -0
- package/dist/chunks/resources11.js +63 -0
- package/dist/chunks/resources5.js +40 -51
- package/dist/chunks/resources6.js +24 -46
- package/dist/chunks/resources7.js +53 -8
- package/dist/chunks/resources8.js +50 -10
- package/dist/chunks/resources9.js +7 -53
- package/dist/chunks/runtime.js +3 -3
- package/dist/chunks/utils.js +9 -15
- package/dist/chunks/utils2.js +59 -6
- package/dist/components/calcite-block/customElement.d.ts +9 -9
- package/dist/components/calcite-block/customElement.js +8 -49
- package/dist/components/calcite-block-group/customElement.js +3 -5
- package/dist/components/calcite-block-section/customElement.d.ts +5 -5
- package/dist/components/calcite-block-section/customElement.js +1 -1
- package/dist/components/calcite-button/customElement.d.ts +8 -8
- package/dist/components/calcite-button/customElement.js +3 -3
- package/dist/components/calcite-chip/customElement.js +1 -27
- package/dist/components/calcite-color-picker/customElement.d.ts +3 -3
- package/dist/components/calcite-color-picker/customElement.js +23 -20
- package/dist/components/calcite-color-picker-hex-input/customElement.d.ts +1 -1
- package/dist/components/calcite-color-picker-hex-input/customElement.js +4 -4
- package/dist/components/calcite-color-picker-swatch/customElement.d.ts +1 -1
- package/dist/components/calcite-color-picker-swatch/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.js +286 -132
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-combobox-item-group/customElement.js +1 -1
- package/dist/components/calcite-dialog/customElement.js +1 -1
- package/dist/components/calcite-dropdown-group/customElement.js +1 -1
- package/dist/components/calcite-dropdown-item/customElement.js +1 -1
- package/dist/components/calcite-flow-item/customElement.js +1 -1
- package/dist/components/calcite-input/customElement.js +1 -1
- package/dist/components/calcite-input-date-picker/customElement.js +5 -10
- package/dist/components/calcite-input-number/customElement.js +1 -1
- package/dist/components/calcite-input-text/customElement.js +1 -1
- package/dist/components/calcite-input-time-zone/customElement.js +1 -1
- package/dist/components/calcite-list/customElement.js +1 -1
- package/dist/components/calcite-list-item/customElement.js +1 -1
- package/dist/components/calcite-list-item-group/customElement.js +1 -1
- package/dist/components/calcite-panel/customElement.js +1 -1
- package/dist/components/calcite-stack/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +2 -2
- package/dist/cdn/6THNFXTV.js +0 -2
- package/dist/cdn/7RTTBZVL.js +0 -2
- package/dist/cdn/DHXGSMMN.js +0 -2
- package/dist/cdn/DV6Z2ZUP.js +0 -2
- package/dist/cdn/GEQANJCK.js +0 -2
- package/dist/cdn/JLRS6GUS.js +0 -2
- package/dist/cdn/JWZRDSEQ.js +0 -2
- package/dist/cdn/OWVDY7XZ.js +0 -2
- package/dist/cdn/P7VFZYNM.js +0 -2
- package/dist/cdn/POCA3O3T.js +0 -2
- package/dist/cdn/S2ACIYIJ.js +0 -2
- package/dist/cdn/SKBNA7MO.js +0 -2
- package/dist/cdn/WBKHM7GQ.js +0 -2
- package/dist/cdn/WWXFCBIC.js +0 -2
- /package/dist/cdn/{XJY76HZ5.js → 2QCI6TGY.js} +0 -0
- /package/dist/cdn/{O2A6CQZA.js → BLWTCPBG.js} +0 -0
- /package/dist/cdn/{5OPFL4DZ.js → KWIC32XQ.js} +0 -0
- /package/dist/cdn/{SG5FNFQO.js → Q24FQVQ4.js} +0 -0
- /package/dist/cdn/{DE7OTXX2.js → QBJZUEM2.js} +0 -0
|
@@ -95,7 +95,7 @@ export abstract class ColorPicker extends LitElement {
|
|
|
95
95
|
value?: string;
|
|
96
96
|
};
|
|
97
97
|
/** Specifies the Unicode numeral system used by the component for localization. */
|
|
98
|
-
accessor numberingSystem: NumberingSystem;
|
|
98
|
+
accessor numberingSystem: NumberingSystem | undefined;
|
|
99
99
|
/**
|
|
100
100
|
* When `true`, hides the saved colors section.
|
|
101
101
|
*
|
|
@@ -109,7 +109,7 @@ export abstract class ColorPicker extends LitElement {
|
|
|
109
109
|
*/
|
|
110
110
|
accessor scale: Scale;
|
|
111
111
|
/** Specifies the storage ID for colors. */
|
|
112
|
-
accessor storageId: string;
|
|
112
|
+
accessor storageId: string | undefined;
|
|
113
113
|
/**
|
|
114
114
|
* The component's value, where the value can be a CSS color string, or a RGB, HSL or HSV object.
|
|
115
115
|
*
|
|
@@ -118,7 +118,7 @@ export abstract class ColorPicker extends LitElement {
|
|
|
118
118
|
* @see [MDN - CSS Color](https://developer.mozilla.org/en-US/docs/Web/CSS/color),
|
|
119
119
|
* @see [ColorValue](https://github.com/Esri/calcite-design-system/blob/dev/packages/components/src/components/color-picker/interfaces.ts#L10).
|
|
120
120
|
*/
|
|
121
|
-
accessor value: ColorValue | null;
|
|
121
|
+
accessor value: ColorValue | null | undefined;
|
|
122
122
|
/**
|
|
123
123
|
* Sets focus on the component's first focusable element.
|
|
124
124
|
*
|
|
@@ -26,13 +26,11 @@ class ColorPicker extends LitElement {
|
|
|
26
26
|
this.colorFieldScopeRef = createRef();
|
|
27
27
|
this.direction = useDirection();
|
|
28
28
|
this.hueScopeRef = createRef();
|
|
29
|
-
this.internalColorUpdateContext = null;
|
|
30
29
|
this.isActiveChannelInputEmpty = false;
|
|
31
30
|
this.mode = CSSColorMode.HEX;
|
|
32
31
|
this.opacityScopeRef = createRef();
|
|
33
32
|
this.resizeObserver = createObserver("resize", (entries) => this.resizeCanvas(entries));
|
|
34
33
|
this.shiftKeyChannelAdjustment = 0;
|
|
35
|
-
this.upOrDownArrowKeyTracker = null;
|
|
36
34
|
this._valueWasSet = false;
|
|
37
35
|
this.messages = useT9n({ blocking: true });
|
|
38
36
|
this.captureColorFieldColor = (x, y, skipEqual = true) => {
|
|
@@ -94,7 +92,7 @@ class ColorPicker extends LitElement {
|
|
|
94
92
|
return;
|
|
95
93
|
}
|
|
96
94
|
const previouslyDragging = this.activeCanvasInfo;
|
|
97
|
-
this.activeCanvasInfo =
|
|
95
|
+
this.activeCanvasInfo = void 0;
|
|
98
96
|
this.drawColorControls();
|
|
99
97
|
if (previouslyDragging) {
|
|
100
98
|
this.calciteColorPickerChange.emit();
|
|
@@ -168,8 +166,9 @@ class ColorPicker extends LitElement {
|
|
|
168
166
|
}
|
|
169
167
|
set value(value) {
|
|
170
168
|
const oldValue = this._value;
|
|
171
|
-
|
|
172
|
-
this.
|
|
169
|
+
const effectiveValue = value || void 0;
|
|
170
|
+
this._value = effectiveValue;
|
|
171
|
+
this.handleValueChange(effectiveValue, oldValue);
|
|
173
172
|
this._valueWasSet = true;
|
|
174
173
|
}
|
|
175
174
|
async setFocus(options) {
|
|
@@ -184,7 +183,8 @@ class ColorPicker extends LitElement {
|
|
|
184
183
|
if (!this._valueWasSet) {
|
|
185
184
|
this._value ??= normalizeHex(hexify(DEFAULT_COLOR, this.alphaChannel));
|
|
186
185
|
}
|
|
187
|
-
const { clearable, color, format
|
|
186
|
+
const { clearable, color, format } = this;
|
|
187
|
+
const value = this.value;
|
|
188
188
|
const willSetNoColor = clearable && !value;
|
|
189
189
|
const parsedMode = parseMode(value);
|
|
190
190
|
const valueIsCompatible = willSetNoColor || format === "auto" && parsedMode || format === parsedMode;
|
|
@@ -197,8 +197,11 @@ class ColorPicker extends LitElement {
|
|
|
197
197
|
this.updateStaticDimensions(this.scale);
|
|
198
198
|
this.updateDynamicDimensions(STATIC_DIMENSIONS[this.scale].minWidth);
|
|
199
199
|
const storageKey = `${DEFAULT_STORAGE_KEY_PREFIX}${this.storageId}`;
|
|
200
|
-
if (this.storageId
|
|
201
|
-
|
|
200
|
+
if (this.storageId) {
|
|
201
|
+
const storedItem = localStorage.getItem(storageKey);
|
|
202
|
+
if (storedItem) {
|
|
203
|
+
this.savedColors = JSON.parse(storedItem);
|
|
204
|
+
}
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
207
|
willUpdate(changes) {
|
|
@@ -263,7 +266,7 @@ class ColorPicker extends LitElement {
|
|
|
263
266
|
return;
|
|
264
267
|
}
|
|
265
268
|
modeChanged = this.mode !== nextMode;
|
|
266
|
-
this.setMode(nextMode, this.internalColorUpdateContext ===
|
|
269
|
+
this.setMode(nextMode, this.internalColorUpdateContext === void 0);
|
|
267
270
|
}
|
|
268
271
|
const dragging = this.activeCanvasInfo;
|
|
269
272
|
if (this.internalColorUpdateContext === "initial") {
|
|
@@ -323,7 +326,7 @@ class ColorPicker extends LitElement {
|
|
|
323
326
|
const input = event.target;
|
|
324
327
|
const hex = input.value;
|
|
325
328
|
if (clearable && !hex) {
|
|
326
|
-
this.internalColorSet(
|
|
329
|
+
this.internalColorSet(void 0);
|
|
327
330
|
return;
|
|
328
331
|
}
|
|
329
332
|
const normalizedHex = color && normalizeHex(hexify(color, alphaCompatible(this.mode)));
|
|
@@ -344,7 +347,7 @@ class ColorPicker extends LitElement {
|
|
|
344
347
|
if (!input.value) {
|
|
345
348
|
inputValue = "";
|
|
346
349
|
this.isActiveChannelInputEmpty = true;
|
|
347
|
-
this.upOrDownArrowKeyTracker =
|
|
350
|
+
this.upOrDownArrowKeyTracker = void 0;
|
|
348
351
|
} else {
|
|
349
352
|
const value = Number(input.value);
|
|
350
353
|
const adjustedValue = value + this.shiftKeyChannelAdjustment;
|
|
@@ -364,7 +367,7 @@ class ColorPicker extends LitElement {
|
|
|
364
367
|
const channels = [...this.channels];
|
|
365
368
|
const restoreValueDueToEmptyInput = !input.value && !this.clearable;
|
|
366
369
|
if (restoreValueDueToEmptyInput) {
|
|
367
|
-
input.value = channels[channelIndex]?.toString();
|
|
370
|
+
input.value = channels[channelIndex]?.toString() ?? "";
|
|
368
371
|
}
|
|
369
372
|
}
|
|
370
373
|
handleChannelFocus(event) {
|
|
@@ -399,18 +402,18 @@ class ColorPicker extends LitElement {
|
|
|
399
402
|
handleChannelChange(event) {
|
|
400
403
|
const input = event.currentTarget;
|
|
401
404
|
const channelIndex = Number(input.getAttribute("data-channel-index"));
|
|
402
|
-
const channels = [...this.channels];
|
|
403
405
|
const shouldClearChannels = this.clearable && !input.value;
|
|
404
406
|
if (shouldClearChannels) {
|
|
405
|
-
this.channels = [
|
|
406
|
-
this.internalColorSet(
|
|
407
|
+
this.channels = [void 0, void 0, void 0, void 0];
|
|
408
|
+
this.internalColorSet(void 0);
|
|
407
409
|
return;
|
|
408
410
|
}
|
|
411
|
+
const channels = [...this.channels];
|
|
409
412
|
const isAlphaChannel = channelIndex === 3;
|
|
410
413
|
if (this.isActiveChannelInputEmpty && this.upOrDownArrowKeyTracker) {
|
|
411
414
|
input.value = this.upOrDownArrowKeyTracker === "up" ? (channels[channelIndex] + 1 <= this.getChannelInputLimit(channelIndex) ? channels[channelIndex] + 1 : this.getChannelInputLimit(channelIndex)).toString() : (channels[channelIndex] - 1 >= 0 ? channels[channelIndex] - 1 : 0).toString();
|
|
412
415
|
this.isActiveChannelInputEmpty = false;
|
|
413
|
-
this.upOrDownArrowKeyTracker =
|
|
416
|
+
this.upOrDownArrowKeyTracker = void 0;
|
|
414
417
|
}
|
|
415
418
|
const value = input.value ? Number(input.value) : channels[channelIndex];
|
|
416
419
|
channels[channelIndex] = isAlphaChannel ? opacityToAlpha(value) : value;
|
|
@@ -497,11 +500,11 @@ class ColorPicker extends LitElement {
|
|
|
497
500
|
this.internalColorUpdateContext = context;
|
|
498
501
|
this.color = color;
|
|
499
502
|
this.value = this.toValue(color);
|
|
500
|
-
this.internalColorUpdateContext =
|
|
503
|
+
this.internalColorUpdateContext = void 0;
|
|
501
504
|
}
|
|
502
505
|
toValue(color, format = this.mode) {
|
|
503
506
|
if (!color) {
|
|
504
|
-
return
|
|
507
|
+
return void 0;
|
|
505
508
|
}
|
|
506
509
|
const hexMode = "hex";
|
|
507
510
|
if (format.includes(hexMode)) {
|
|
@@ -814,7 +817,7 @@ class ColorPicker extends LitElement {
|
|
|
814
817
|
this.internalColorSet(Color(channels, this.channelMode));
|
|
815
818
|
}
|
|
816
819
|
updateChannelsFromColor(color) {
|
|
817
|
-
this.channels = color ? this.toChannels(color) : [
|
|
820
|
+
this.channels = color ? this.toChannels(color) : [void 0, void 0, void 0, void 0];
|
|
818
821
|
}
|
|
819
822
|
toChannels(color) {
|
|
820
823
|
const { channelMode } = this;
|
|
@@ -830,7 +833,7 @@ class ColorPicker extends LitElement {
|
|
|
830
833
|
render() {
|
|
831
834
|
const { channelsDisabled, color, colorFieldScopeLeft, colorFieldScopeTop, staticDimensions: { thumb: { radius: thumbRadius } }, fieldDisabled, hexDisabled, hueScopeLeft, messages, alphaChannel, opacityScopeLeft, savedColors, savedDisabled, scale, scopeOrientation } = this;
|
|
832
835
|
const sliderWidth = this.effectiveSliderWidth;
|
|
833
|
-
const selectedColorInHex = color ? hexify(color, alphaChannel) :
|
|
836
|
+
const selectedColorInHex = color ? hexify(color, alphaChannel) : void 0;
|
|
834
837
|
const hueTop = thumbRadius;
|
|
835
838
|
const hueLeft = hueScopeLeft ?? sliderWidth * DEFAULT_COLOR.hue() / HSV_LIMITS.h;
|
|
836
839
|
const opacityTop = thumbRadius;
|
|
@@ -39,7 +39,7 @@ class ColorPickerHexInput extends LitElement {
|
|
|
39
39
|
}
|
|
40
40
|
connectedCallback() {
|
|
41
41
|
super.connectedCallback();
|
|
42
|
-
this.
|
|
42
|
+
this.previousDefinedValue = this.value;
|
|
43
43
|
const { allowEmpty, alphaChannel, value } = this;
|
|
44
44
|
if (value) {
|
|
45
45
|
const normalized = normalizeHex(value, alphaChannel);
|
|
@@ -144,7 +144,7 @@ class ColorPickerHexInput extends LitElement {
|
|
|
144
144
|
const oldValue = this.value;
|
|
145
145
|
if (isNudgeKey) {
|
|
146
146
|
if (!value) {
|
|
147
|
-
this.internalSetValue(this.
|
|
147
|
+
this.internalSetValue(this.previousDefinedValue, oldValue);
|
|
148
148
|
event.preventDefault();
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
@@ -162,7 +162,7 @@ class ColorPickerHexInput extends LitElement {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
onHexInputPaste(event) {
|
|
165
|
-
const hex = event.clipboardData
|
|
165
|
+
const hex = event.clipboardData?.getData("text");
|
|
166
166
|
if (isValidHex(hex, this.alphaChannel) && isLonghandHex(hex, this.alphaChannel)) {
|
|
167
167
|
event.preventDefault();
|
|
168
168
|
this.hexInputRef.value.value = hex.slice(1);
|
|
@@ -179,7 +179,7 @@ class ColorPickerHexInput extends LitElement {
|
|
|
179
179
|
const normalizedLonghand = normalizeHex(hexify(nextColor, alphaChannel), alphaChannel);
|
|
180
180
|
const changed = !currentColor || normalizedLonghand !== normalizeHex(hexify(currentColor, alphaChannel), alphaChannel);
|
|
181
181
|
this.internalColor = nextColor;
|
|
182
|
-
this.
|
|
182
|
+
this.previousDefinedValue = normalizedLonghand;
|
|
183
183
|
this.value = normalizedLonghand;
|
|
184
184
|
if (changed && emit) {
|
|
185
185
|
this.calciteColorPickerHexInputChange.emit();
|
|
@@ -15,7 +15,7 @@ export abstract class ColorPickerSwatch extends LitElement {
|
|
|
15
15
|
*
|
|
16
16
|
* @see [MDN - Color CSS data type](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value).
|
|
17
17
|
*/
|
|
18
|
-
accessor color: string |
|
|
18
|
+
accessor color: string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Specifies the size of the component.
|
|
21
21
|
*
|