@esri/calcite-components 5.1.0-next.4 → 5.1.0-next.5
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/{FAHLSHDH.js → 22IPJDDL.js} +1 -1
- package/dist/cdn/25CWB6HX.js +2 -0
- package/dist/cdn/25YVFVC7.js +2 -0
- package/dist/cdn/{VLGFWPBL.js → 2GS6R2BX.js} +1 -1
- package/dist/cdn/2QARK4VJ.js +2 -0
- package/dist/cdn/{BWUA5WU5.js → 2Z4Z3NMS.js} +1 -1
- package/dist/cdn/{GW7IPUQS.js → 3KLZFJXW.js} +1 -1
- package/dist/cdn/3L2WKJUB.js +2 -0
- package/dist/cdn/{CZYFEVKF.js → 3LOKHBAB.js} +1 -1
- package/dist/cdn/{A4OYPK5D.js → 3NNVHOGK.js} +1 -1
- package/dist/cdn/{HVBNJRAQ.js → 3WLFK4RW.js} +1 -1
- package/dist/cdn/{ZIOXZBYF.js → 42NQN6DY.js} +1 -1
- package/dist/cdn/462JN5WF.js +2 -0
- package/dist/cdn/{GDTRICJF.js → 464S36UH.js} +1 -1
- package/dist/cdn/{ULBA6IRN.js → 4ALKCXNH.js} +1 -1
- package/dist/cdn/4GQPJFUJ.js +2 -0
- package/dist/cdn/{WAC3IAWB.js → 4GVH7HTQ.js} +1 -1
- package/dist/cdn/{7CZHE7FZ.js → 4J6YW6EK.js} +1 -1
- package/dist/cdn/{7CLOFSLV.js → 52ZOO5HQ.js} +1 -1
- package/dist/cdn/5HTRQR7F.js +2 -0
- package/dist/cdn/{IFHMJCAE.js → 5J2UYJYX.js} +1 -1
- package/dist/cdn/{TCAGY7OI.js → 5L7CGWWD.js} +1 -1
- package/dist/cdn/{LIJYENWJ.js → 5SU52VYR.js} +1 -1
- package/dist/cdn/5TCLHXAD.js +2 -0
- package/dist/cdn/{7KCC74EE.js → 6NEHFZMJ.js} +1 -1
- package/dist/cdn/{RSCA2AM5.js → 6VRXKEA7.js} +1 -1
- package/dist/cdn/{EW6277QZ.js → 6XJYCX76.js} +1 -1
- package/dist/cdn/{XYAZINKS.js → 752PQ7IA.js} +1 -1
- package/dist/cdn/{ILES2J66.js → 7RSGSW76.js} +1 -1
- package/dist/cdn/7UOYXJ3K.js +2 -0
- package/dist/cdn/{EIFNZZAD.js → A2UZRUUF.js} +1 -1
- package/dist/cdn/{GFZYTB3O.js → A7IQIXR3.js} +1 -1
- package/dist/cdn/{R3EE76WN.js → AEUCGVU4.js} +1 -1
- package/dist/cdn/{RA4KNUNM.js → AJKEEG2Z.js} +1 -1
- package/dist/cdn/{5TWM6GKK.js → ALC6PGDZ.js} +1 -1
- package/dist/cdn/{HRUVPNCI.js → B55VO4LW.js} +1 -1
- package/dist/cdn/{JKLX623E.js → BIEIKUB2.js} +1 -1
- package/dist/cdn/{MXRMT4RB.js → BPSXK66S.js} +1 -1
- package/dist/cdn/BS22M3WT.js +2 -0
- package/dist/cdn/{MASQZEFU.js → BWDCDFXW.js} +1 -1
- package/dist/cdn/C25VFIND.js +2 -0
- package/dist/cdn/{UTFS3HNB.js → CWQZDXHH.js} +1 -1
- package/dist/cdn/CXVISA7Y.js +2 -0
- package/dist/cdn/{X7JEHH2B.js → D7UER3G6.js} +1 -1
- package/dist/cdn/{3W4NT367.js → DR7JKZAI.js} +1 -1
- package/dist/cdn/{AMZPSRIA.js → DY6SXW3X.js} +1 -1
- package/dist/cdn/{IMOAPVVW.js → ED7SQQHM.js} +1 -1
- package/dist/cdn/EFNE45MK.js +2 -0
- package/dist/cdn/{MUGKSK5F.js → EGK4PSW5.js} +1 -1
- package/dist/cdn/{YOYLPMEA.js → EJCQCHH7.js} +1 -1
- package/dist/cdn/{A22XLAKZ.js → ENCYKNKN.js} +1 -1
- package/dist/cdn/EY4MG3NU.js +2 -0
- package/dist/cdn/{Z22BRBT4.js → EZW5GK73.js} +1 -1
- package/dist/cdn/{MTNYIXZQ.js → FWEFFYYZ.js} +1 -1
- package/dist/cdn/{KVSU3DLB.js → G4QI7VSJ.js} +1 -1
- package/dist/cdn/{V4KATS7H.js → GEQ3EBJO.js} +1 -1
- package/dist/cdn/GLJVCFQW.js +2 -0
- package/dist/cdn/GNDNKP2Q.js +2 -0
- package/dist/cdn/H77SNVVI.js +2 -0
- package/dist/cdn/{FAOX7WLQ.js → HAUWZRL4.js} +1 -1
- package/dist/cdn/{FDGUUC3D.js → HBUNMGZ3.js} +1 -1
- package/dist/cdn/{R6D5F2V7.js → HFGDCX3I.js} +1 -1
- package/dist/cdn/{XDOFVA4S.js → HGRVTRR3.js} +1 -1
- package/dist/cdn/{WR6QBFCR.js → HHOMMC4H.js} +1 -1
- package/dist/cdn/{LGKOEBZ4.js → HUNZU2OF.js} +1 -1
- package/dist/cdn/{DFXECQ6Z.js → IFLPCKYL.js} +1 -1
- package/dist/cdn/{AYPT6VGV.js → IJP6ZKHZ.js} +1 -1
- package/dist/cdn/{Z3IVC2AV.js → IU4TJIME.js} +1 -1
- package/dist/cdn/J42TNDHM.js +2 -0
- package/dist/cdn/J4J65DN5.js +2 -0
- package/dist/cdn/{SYSNPKVM.js → K4R3HUW3.js} +1 -1
- package/dist/cdn/KBHLSIAR.js +2 -0
- package/dist/cdn/{FRI4RPRX.js → KKMGV3S6.js} +1 -1
- package/dist/cdn/{IOSK2I75.js → KUC6KV4R.js} +1 -1
- package/dist/cdn/{ED2GANBI.js → KVPLQQ75.js} +1 -1
- package/dist/cdn/{37APBABQ.js → KVRUYI63.js} +1 -1
- package/dist/cdn/MLQDQZZR.js +2 -0
- package/dist/cdn/{OVU2NGHU.js → MM6LZCYO.js} +1 -1
- package/dist/cdn/{MJCRT7H4.js → MQMNX7AM.js} +1 -1
- package/dist/cdn/N47CSPB7.js +2 -0
- package/dist/cdn/{RRHN2PDB.js → NAFJ5ZYO.js} +1 -1
- package/dist/cdn/{HXS3PD57.js → NIBBUVHR.js} +1 -1
- package/dist/cdn/NMIBGEIB.js +2 -0
- package/dist/cdn/{5HQ3O27G.js → NNSUCRNU.js} +1 -1
- package/dist/cdn/{ZZNRLKQQ.js → NT6RQTF7.js} +1 -1
- package/dist/cdn/O6ZRTXVO.js +2 -0
- package/dist/cdn/{7DA7BZM3.js → O75ZRZLS.js} +1 -1
- package/dist/cdn/{SXVCUXNL.js → OCFKSX5L.js} +1 -1
- package/dist/cdn/{6IZMIAV2.js → ODOOWGRW.js} +1 -1
- package/dist/cdn/{CAAZHUX4.js → OGOI7JTF.js} +1 -1
- package/dist/cdn/{FCNCDBSI.js → OO556Q5A.js} +1 -1
- package/dist/cdn/PGUOVY7V.js +2 -0
- package/dist/cdn/{GZNBU3BV.js → PJ3GHZ7T.js} +1 -1
- package/dist/cdn/PNXNTD3R.js +2 -0
- package/dist/cdn/{HXVXRVZW.js → PYD5GHXA.js} +1 -1
- package/dist/cdn/{CPDXUV3S.js → Q4EG6G7W.js} +1 -1
- package/dist/cdn/{7B4D4WJ2.js → Q52IY7SS.js} +1 -1
- package/dist/cdn/{S22OVJTO.js → QEPJF6TC.js} +2 -2
- package/dist/cdn/{P7U46JDU.js → QHZAKDI7.js} +1 -1
- package/dist/cdn/{SBPWZDAB.js → QIUVPLV2.js} +1 -1
- package/dist/cdn/{KKH2HVQW.js → QVTLP2LK.js} +1 -1
- package/dist/cdn/R3DLH5BB.js +2 -0
- package/dist/cdn/R5DGN3O6.js +2 -0
- package/dist/cdn/{LHJSBAM5.js → RGKOGN5W.js} +1 -1
- package/dist/cdn/{GM6FZWSL.js → RRNEZXM4.js} +1 -1
- package/dist/cdn/{YUJ33VWR.js → RU3YCR42.js} +1 -1
- package/dist/cdn/{TLAXB6HU.js → SF7SFEKA.js} +1 -1
- package/dist/cdn/SKOYS4HM.js +2 -0
- package/dist/cdn/{F7XISEIT.js → SP22KLIK.js} +1 -1
- package/dist/cdn/{HCJDTU7F.js → SVHI2LRC.js} +1 -1
- package/dist/cdn/{4MFRMO5M.js → T2MUZ4UN.js} +1 -1
- package/dist/cdn/{GAUJK4Z7.js → TAS3P2HU.js} +1 -1
- package/dist/cdn/{LRL6N22U.js → TBA5ATIB.js} +1 -1
- package/dist/cdn/{KNDQJ2XX.js → TW2SRS2O.js} +1 -1
- package/dist/cdn/{CDTY6WOM.js → TZFOTRCX.js} +1 -1
- package/dist/cdn/{5YROPSGB.js → UUHRTJGO.js} +1 -1
- package/dist/cdn/{QKUQGG2M.js → UVJ3XYK5.js} +1 -1
- package/dist/cdn/{7TEW7OYZ.js → UYYGQ6AY.js} +1 -1
- package/dist/cdn/V2PPBU7J.js +2 -0
- package/dist/cdn/{5WKPS2ZT.js → VB7GHJWK.js} +1 -1
- package/dist/cdn/VIMF6KPF.js +2 -0
- package/dist/cdn/{6NGWODBG.js → VYSJFEY6.js} +1 -1
- package/dist/cdn/WI7KEIGV.js +2 -0
- package/dist/cdn/WOJJ53FN.js +2 -0
- package/dist/cdn/WSRLM2TQ.js +2 -0
- package/dist/cdn/{GJE7FY35.js → X53XDNBL.js} +1 -1
- package/dist/cdn/{Q7WYXKFZ.js → XPXJW5E3.js} +1 -1
- package/dist/cdn/XXVIE4SD.js +2 -0
- package/dist/cdn/{RROGXGP5.js → Y5FMVLYP.js} +1 -1
- package/dist/cdn/{PS64W4X6.js → YBZVV5BN.js} +1 -1
- package/dist/cdn/{HYYJZO6T.js → YQOYGBGD.js} +1 -1
- package/dist/cdn/{3TCEXRVB.js → Z3B276DZ.js} +1 -1
- package/dist/cdn/Z6LSD6MR.js +2 -0
- package/dist/cdn/ZDZGWD2Y.js +2 -0
- package/dist/cdn/{2ZJ5ADD2.js → ZIKLLQSU.js} +1 -1
- package/dist/cdn/{QBLAE2O5.js → ZKCFISUX.js} +1 -1
- package/dist/cdn/{QOSBMGOZ.js → ZKPCUAN2.js} +1 -1
- package/dist/cdn/{XLGGANFA.js → ZPJ4FGXO.js} +1 -1
- package/dist/cdn/{YQY6DOSF.js → ZVFZSDLX.js} +1 -1
- package/dist/cdn/ZZ746O36.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ExpandToggle.js +2 -3
- package/dist/chunks/dom.js +22 -29
- package/dist/chunks/floating-ui.js +2 -2
- package/dist/chunks/input.js +17 -7
- package/dist/chunks/label.js +1 -1
- package/dist/chunks/openCloseComponent.js +1 -1
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFocusTrap.js +1 -1
- package/dist/chunks/useSetFocus.js +1 -1
- package/dist/chunks/utils2.js +1 -1
- package/dist/components/calcite-accordion-item/customElement.js +4 -3
- package/dist/components/calcite-action-bar/customElement.js +4 -2
- package/dist/components/calcite-action-pad/customElement.js +4 -2
- package/dist/components/calcite-alert/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.js +3 -1
- package/dist/components/calcite-avatar/customElement.js +1 -1
- package/dist/components/calcite-block/customElement.js +1 -1
- package/dist/components/calcite-block-group/customElement.js +1 -1
- package/dist/components/calcite-button/customElement.js +1 -1
- package/dist/components/calcite-carousel/customElement.js +27 -25
- package/dist/components/calcite-checkbox/customElement.js +3 -2
- package/dist/components/calcite-chip/customElement.js +1 -1
- package/dist/components/calcite-chip-group/customElement.js +1 -1
- package/dist/components/calcite-color-picker/customElement.js +4 -2
- package/dist/components/calcite-color-picker-swatch/customElement.js +1 -1
- package/dist/components/calcite-combobox/customElement.d.ts +11 -1
- package/dist/components/calcite-combobox/customElement.js +8 -3
- package/dist/components/calcite-combobox-item/customElement.js +10 -4
- package/dist/components/calcite-date-picker-month-header/customElement.js +1 -1
- package/dist/components/calcite-dialog/customElement.d.ts +2 -2
- package/dist/components/calcite-dialog/customElement.js +1 -1
- package/dist/components/calcite-dropdown/customElement.js +4 -1
- package/dist/components/calcite-flow-item/customElement.d.ts +3 -3
- package/dist/components/calcite-flow-item/customElement.js +3 -3
- package/dist/components/calcite-icon/customElement.js +4 -3
- package/dist/components/calcite-inline-editable/customElement.js +1 -1
- package/dist/components/calcite-input/customElement.js +4 -3
- package/dist/components/calcite-input-date-picker/customElement.js +3 -0
- package/dist/components/calcite-input-message/customElement.js +1 -1
- package/dist/components/calcite-input-number/customElement.js +4 -3
- package/dist/components/calcite-input-text/customElement.d.ts +1 -1
- package/dist/components/calcite-input-text/customElement.js +174 -27
- package/dist/components/calcite-input-time-picker/customElement.js +3 -2
- package/dist/components/calcite-link/customElement.js +4 -3
- package/dist/components/calcite-list/customElement.js +1 -1
- package/dist/components/calcite-list-item/customElement.js +5 -3
- package/dist/components/calcite-menu/customElement.js +1 -1
- package/dist/components/calcite-menu-item/customElement.js +4 -2
- package/dist/components/calcite-meter/customElement.js +1 -1
- package/dist/components/calcite-notice/customElement.js +1 -1
- package/dist/components/calcite-panel/customElement.d.ts +4 -4
- package/dist/components/calcite-panel/customElement.js +1 -1
- package/dist/components/calcite-popover/customElement.js +4 -1
- package/dist/components/calcite-progress/customElement.js +3 -2
- package/dist/components/calcite-radio-button/customElement.js +3 -3
- package/dist/components/calcite-scrim/customElement.js +1 -1
- package/dist/components/calcite-segmented-control/customElement.js +5 -3
- package/dist/components/calcite-segmented-control-item/customElement.js +1 -1
- package/dist/components/calcite-sheet/customElement.js +8 -5
- package/dist/components/calcite-shell/customElement.js +1 -1
- package/dist/components/calcite-shell-panel/customElement.js +7 -5
- package/dist/components/calcite-slider/customElement.js +1 -1
- package/dist/components/calcite-sortable-list/customElement.js +1 -1
- package/dist/components/calcite-stepper/customElement.js +1 -1
- package/dist/components/calcite-stepper-item/customElement.js +1 -1
- package/dist/components/calcite-swatch-group/customElement.js +1 -1
- package/dist/components/calcite-tab/customElement.js +1 -1
- package/dist/components/calcite-tab-nav/customElement.js +4 -2
- package/dist/components/calcite-tab-title/customElement.js +5 -3
- package/dist/components/calcite-table-cell/customElement.js +3 -2
- package/dist/components/calcite-tabs/customElement.js +1 -1
- package/dist/components/calcite-time-picker/customElement.js +3 -2
- package/dist/components/calcite-tooltip/customElement.js +4 -1
- package/dist/components/calcite-tree/customElement.js +1 -1
- package/dist/components/calcite-tree-item/customElement.js +4 -2
- package/dist/controllers/useForm.d.ts +3 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/supported-browsers.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +6 -6
- package/dist/cdn/256EMMKX.js +0 -2
- package/dist/cdn/3OIE2RR5.js +0 -2
- package/dist/cdn/43T3HPVW.js +0 -2
- package/dist/cdn/4ET37OQN.js +0 -2
- package/dist/cdn/4SJVPWEI.js +0 -2
- package/dist/cdn/7WPF3NTF.js +0 -2
- package/dist/cdn/F7SGO63N.js +0 -2
- package/dist/cdn/G6R56WT6.js +0 -2
- package/dist/cdn/HBVQ77SB.js +0 -2
- package/dist/cdn/HD23H6LX.js +0 -2
- package/dist/cdn/I6CQ5UW5.js +0 -2
- package/dist/cdn/IR6Z2XSF.js +0 -2
- package/dist/cdn/IUAHSZQ6.js +0 -2
- package/dist/cdn/JLB2FYLL.js +0 -2
- package/dist/cdn/JRCEHRYP.js +0 -2
- package/dist/cdn/L6F7C3O7.js +0 -2
- package/dist/cdn/LIZ5IMMJ.js +0 -2
- package/dist/cdn/LR57FDVO.js +0 -2
- package/dist/cdn/LYKD5N65.js +0 -2
- package/dist/cdn/MAXAPKJ5.js +0 -2
- package/dist/cdn/MQPFYNQR.js +0 -2
- package/dist/cdn/N6QRZM7N.js +0 -2
- package/dist/cdn/NQEVKT6K.js +0 -2
- package/dist/cdn/OS7NHPEF.js +0 -2
- package/dist/cdn/P7RXOG72.js +0 -2
- package/dist/cdn/PBMFDSRI.js +0 -2
- package/dist/cdn/Q52SIZ3L.js +0 -2
- package/dist/cdn/R6YSSNOG.js +0 -2
- package/dist/cdn/SFEXJ2YW.js +0 -2
- package/dist/cdn/TPXLAPIE.js +0 -2
- package/dist/cdn/TSZAQNPK.js +0 -2
- package/dist/cdn/U6LKEFFT.js +0 -2
- package/dist/cdn/UAADJQTQ.js +0 -2
- package/dist/cdn/UOIMVKXE.js +0 -2
- package/dist/cdn/XSSG2WBN.js +0 -2
- package/dist/cdn/YHGC7HRA.js +0 -2
- package/dist/cdn/Z53AVC5H.js +0 -2
- package/dist/cdn/ZXUITROT.js +0 -2
|
@@ -6,7 +6,7 @@ import { LitElement, createEvent, safeClassMap, safeStyleMap } from "@arcgis/lum
|
|
|
6
6
|
import { g as guid } from "../../chunks/guid.js";
|
|
7
7
|
import { c as getAncestors, i as isSingleLike, d as getDepth } from "../../chunks/utils2.js";
|
|
8
8
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
9
|
-
import {
|
|
9
|
+
import { m as slotChangeHasContent } from "../../chunks/dom.js";
|
|
10
10
|
import { h as highlightText } from "../../chunks/text.js";
|
|
11
11
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
12
12
|
const CSS = {
|
|
@@ -17,6 +17,7 @@ const CSS = {
|
|
|
17
17
|
description: "description",
|
|
18
18
|
icon: "icon",
|
|
19
19
|
label: "label",
|
|
20
|
+
containerHighlightSelected: "container--highlight-selected",
|
|
20
21
|
scale: (scale) => `scale--${scale}`,
|
|
21
22
|
shortText: "short-text",
|
|
22
23
|
single: "label--single",
|
|
@@ -35,7 +36,7 @@ const SLOTS = {
|
|
|
35
36
|
contentStart: "content-start"
|
|
36
37
|
};
|
|
37
38
|
const itemSpacingMultiplier = "--calcite-combobox-item-spacing-indent-multiplier";
|
|
38
|
-
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([hidden]){display:none}[hidden]{display:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-combobox-item-spacing-unit-s: .25rem;--calcite-internal-combobox-item-spacing-unit-l: .5rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-combobox-item-spacing-unit-s: .375rem;--calcite-internal-combobox-item-spacing-unit-l: .75rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-combobox-item-spacing-unit-s: .625rem;--calcite-internal-combobox-item-spacing-unit-l: 1rem;--calcite-combobox-item-selector-icon-size: 1.5rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size)}.container{--calcite-combobox-item-indent-value: calc( var(--calcite-internal-combobox-item-spacing-unit-l) * var(--calcite-combobox-item-spacing-indent-multiplier) )}:host(:focus){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host,ul{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;text-decoration-line:none;transition-timing-function:cubic-bezier(.4,0,.2,1);outline-color:transparent;word-wrap:break-word;word-break:break-word;justify-content:space-around;gap:var(--calcite-internal-combobox-item-spacing-unit-l);padding-block:var(--calcite-internal-combobox-item-spacing-unit-s);padding-inline-end:var(--calcite-internal-combobox-item-spacing-unit-l);padding-inline-start:var(--calcite-combobox-item-indent-value);color:var(--calcite-combobox-text-color, var(--calcite-color-text-3));transition-duration:var(--calcite-animation-timing)}:host([disabled]) .label{cursor:default}.label--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))))}.label:hover{background-color:var(--calcite-combobox-item-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}.label:active{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-3))}:host([selected]) .label,.label:active{color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}:host([selected]) .label .description,:host([selected]) .label .short-text,.label:active .description,.label:active .short-text{color:var(--calcite-combobox-description-text-color-press, var(--calcite-color-text-2))}.icon{display:inline-flex;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-color-border-input)}:host([selected]) .icon,:host([indeterminate]) .icon{color:var(--calcite-combobox-selected-icon-color, var(--calcite-color-brand))}.icon--custom{margin-block-start:-1px}.center-content{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.description{font-size:var(--calcite-internal-combobox-item-description-font-size)}.short-text{white-space:nowrap}.heading{color:var(--calcite-combobox-heading-text-color, var(--calcite-color-text-1))}.description,.short-text{color:var(--calcite-combobox-description-text-color, var(--calcite-color-text-3))}:host([selected]) .heading{font-weight:var(--calcite-font-weight-medium)}.heading,.description,.short-text{line-height:var(--calcite-font-line-height-relative-snug)}:host([item-hidden]){display:none}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}`;
|
|
39
|
+
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([hidden]){display:none}[hidden]{display:none}.scale--s{font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-sm);--calcite-internal-combobox-item-spacing-unit-s: .25rem;--calcite-internal-combobox-item-spacing-unit-l: .5rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-xs)}.scale--m{font-size:var(--calcite-font-size-relative-base);line-height:var(--calcite-font-line-height-base);--calcite-internal-combobox-item-spacing-unit-s: .375rem;--calcite-internal-combobox-item-spacing-unit-l: .75rem;--calcite-combobox-item-selector-icon-size: 1rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size-sm)}.scale--l{font-size:var(--calcite-font-size-relative-md);line-height:var(--calcite-font-line-height-md);--calcite-internal-combobox-item-spacing-unit-s: .625rem;--calcite-internal-combobox-item-spacing-unit-l: 1rem;--calcite-combobox-item-selector-icon-size: 1.5rem;--calcite-internal-combobox-item-description-font-size: var(--calcite-font-size)}.container{--calcite-combobox-item-indent-value: calc( var(--calcite-internal-combobox-item-spacing-unit-l) * var(--calcite-combobox-item-spacing-indent-multiplier) )}:host(:focus){--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host,ul{margin:0;display:flex;flex-direction:column;padding:0}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;text-decoration-line:none;transition-timing-function:cubic-bezier(.4,0,.2,1);outline-color:transparent;word-wrap:break-word;word-break:break-word;justify-content:space-around;gap:var(--calcite-internal-combobox-item-spacing-unit-l);padding-block:var(--calcite-internal-combobox-item-spacing-unit-s);padding-inline-end:var(--calcite-internal-combobox-item-spacing-unit-l);padding-inline-start:var(--calcite-combobox-item-indent-value);color:var(--calcite-combobox-text-color, var(--calcite-color-text-3));transition-duration:var(--calcite-animation-timing)}:host([disabled]) .label{cursor:default}.label--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))))}.label:hover{background-color:var(--calcite-combobox-item-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}.label:active{background-color:var(--calcite-combobox-item-background-color-active, var(--calcite-color-foreground-3))}:host([selected]) .label,.label:active{color:var(--calcite-combobox-text-color-hover, var(--calcite-color-text-1))}:host([selected]) .label .description,:host([selected]) .label .short-text,.label:active .description,.label:active .short-text{color:var(--calcite-combobox-description-text-color-press, var(--calcite-color-text-2))}.icon{display:inline-flex;transition-timing-function:cubic-bezier(.4,0,.2,1);color:var(--calcite-color-border-input)}:host([selected]) .icon,:host([indeterminate]) .icon{color:var(--calcite-combobox-selected-icon-color, var(--calcite-color-brand))}.icon--custom{margin-block-start:-1px}.center-content{display:flex;flex-direction:column;flex-grow:1;padding-block:0}.description{font-size:var(--calcite-internal-combobox-item-description-font-size)}.short-text{white-space:nowrap}.heading{color:var(--calcite-combobox-heading-text-color, var(--calcite-color-text-1))}.description,.short-text{color:var(--calcite-combobox-description-text-color, var(--calcite-color-text-3))}:host([selected]) .heading{font-weight:var(--calcite-font-weight-medium)}.heading,.description,.short-text{line-height:var(--calcite-font-line-height-relative-snug)}.container--highlight-selected{background-color:var(--calcite-color-surface-highlight)}:host([item-hidden]){display:none}.text-match{background-color:transparent;color:inherit;font-weight:var(--calcite-font-weight-bold)}`;
|
|
39
40
|
class ComboboxItem extends LitElement {
|
|
40
41
|
constructor() {
|
|
41
42
|
super(...arguments);
|
|
@@ -48,13 +49,14 @@ class ComboboxItem extends LitElement {
|
|
|
48
49
|
this.iconFlipRtl = false;
|
|
49
50
|
this.scale = "m";
|
|
50
51
|
this.selectionMode = "multiple";
|
|
52
|
+
this.selectionAppearance = "icon";
|
|
51
53
|
this.itemHidden = false;
|
|
52
54
|
this.indeterminate = false;
|
|
53
55
|
this.calciteComboboxItemChange = createEvent({ cancelable: false });
|
|
54
56
|
this.calciteInternalComboboxItemChange = createEvent({ cancelable: false });
|
|
55
57
|
}
|
|
56
58
|
static {
|
|
57
|
-
this.properties = { hasContent: [16, {}, { state: true }], active: [7, {}, { reflect: true, type: Boolean }], ancestors: [0, {}, { attribute: false }], description: 1, disabled: [7, {}, { reflect: true, type: Boolean }], filterDisabled: [7, {}, { reflect: true, type: Boolean }], filterTextMatchPattern: [3, {}, { reflect: true }], guid: [3, {}, { reflect: true }], heading: 1, icon: [3, { type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], label: 1, metadata: [0, {}, { attribute: false }], scale: 1, selected: [7, {}, { reflect: true, type: Boolean }], selectionMode: [3, {}, { reflect: true }], shortHeading: 1, value: [3, {}, { reflect: true }], itemHidden: [7, {}, { reflect: true, type: Boolean }], indeterminate: [7, {}, { reflect: true, type: Boolean }] };
|
|
59
|
+
this.properties = { hasContent: [16, {}, { state: true }], active: [7, {}, { reflect: true, type: Boolean }], ancestors: [0, {}, { attribute: false }], description: 1, disabled: [7, {}, { reflect: true, type: Boolean }], filterDisabled: [7, {}, { reflect: true, type: Boolean }], filterTextMatchPattern: [3, {}, { reflect: true }], guid: [3, {}, { reflect: true }], heading: 1, icon: [3, { type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], label: 1, metadata: [0, {}, { attribute: false }], scale: 1, selected: [7, {}, { reflect: true, type: Boolean }], selectionMode: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }], shortHeading: 1, value: [3, {}, { reflect: true }], itemHidden: [7, {}, { reflect: true, type: Boolean }], indeterminate: [7, {}, { reflect: true, type: Boolean }] };
|
|
58
60
|
}
|
|
59
61
|
static {
|
|
60
62
|
this.styles = styles;
|
|
@@ -107,6 +109,9 @@ class ComboboxItem extends LitElement {
|
|
|
107
109
|
})} .flipRtl=${this.iconFlipRtl} .icon=${this.icon || iconPath} .scale=${getIconScale(this.scale)}></calcite-icon>`) : null;
|
|
108
110
|
}
|
|
109
111
|
renderSelectIndicator(icon) {
|
|
112
|
+
if (this.selectionAppearance === "highlight") {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
110
115
|
return keyed("indicator", html`<calcite-icon class=${safeClassMap({
|
|
111
116
|
[CSS.icon]: true
|
|
112
117
|
})} .flipRtl=${this.iconFlipRtl} .icon=${icon} .scale=${getIconScale(this.scale)}></calcite-icon>`);
|
|
@@ -124,7 +129,8 @@ class ComboboxItem extends LitElement {
|
|
|
124
129
|
const classes = {
|
|
125
130
|
[CSS.label]: true,
|
|
126
131
|
[CSS.active]: this.active,
|
|
127
|
-
[CSS.single]: isSingleSelect
|
|
132
|
+
[CSS.single]: isSingleSelect,
|
|
133
|
+
[CSS.containerHighlightSelected]: this.selected && this.selectionAppearance === "highlight"
|
|
128
134
|
};
|
|
129
135
|
const depth = getDepth(this.el);
|
|
130
136
|
this.el.ariaHidden = "true";
|
|
@@ -6,7 +6,7 @@ import { css, html, nothing } from "lit";
|
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
7
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
8
8
|
import { b as dateFromRange, n as nextMonth, p as prevMonth, f as formatCalendarYear, e as parseCalendarYear, j as getDateInMonth, i as inRange, h as hasSameMonthAndYear, k as getOrder } from "../../chunks/date.js";
|
|
9
|
-
import { c as closestElementCrossShadowBoundary,
|
|
9
|
+
import { c as closestElementCrossShadowBoundary, l as getTextWidth } from "../../chunks/dom.js";
|
|
10
10
|
import { i as isActivationKey } from "../../chunks/key.js";
|
|
11
11
|
import { n as numberStringFormatter } from "../../chunks/locale.js";
|
|
12
12
|
const styles = css`:host{display:block}.header{display:flex;block-size:100%;align-items:center;justify-content:space-between}.chevron-container{display:flex;align-items:center}:host([scale=s]){block-size:24px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .chevron-container,:host([scale=s]) .chevron{min-inline-size:24px;block-size:24px}:host([scale=m]){block-size:32px;margin:var(--calcite-spacing-sm);margin-inline-start:var(--calcite-spacing-sm-plus)}:host([scale=m]) .chevron-container,:host([scale=m]) .chevron{min-inline-size:32px;block-size:32px;--calcite-internal-action-padding-block: var(--calcite-spacing-xxs)}:host([scale=l]){block-size:44px;margin:var(--calcite-spacing-xs);margin-inline-start:var(--calcite-spacing-sm)}:host([scale=l]) .chevron-container,:host([scale=l]) .chevron{min-inline-size:44px;block-size:44px;--calcite-internal-action-padding-block: var(--calcite-spacing-sm-plus)}.chevron{box-sizing:content-box;display:flex;block-size:100%;inline-size:100%;flex-grow:0;cursor:pointer;align-items:center;justify-content:center;border-style:none;outline-color:transparent;transition-property:background-color,block-size,border-color,box-shadow,color,inset-block-end,inset-block-start,inset-inline-end,inset-inline-start,inset-size,opacity,outline-color,transform;transition-duration:var(--calcite-animation-timing);transition-timing-function:ease-in-out;--calcite-internal-action-padding-block: 0;--calcite-action-background-color: var(--calcite-date-picker-header-action-background-color);--calcite-action-background-color-hover: var(--calcite-date-picker-header-action-background-color-hover);--calcite-action-background-color-press: var(--calcite-date-picker-header-action-background-color-press);--calcite-action-text-color: var(--calcite-date-picker-header-action-text-color);--calcite-action-text-color-press: var(--calcite-date-picker-header-action-text-color-press)}.chevron:focus{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))))}.chevron[aria-disabled=true]{pointer-events:none}.month-year-container{display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;align-items:center;justify-content:flex-start;text-align:center;line-height:1;gap:var(--calcite-spacing-xxs)}.month-year-container.range-calendar{justify-content:center}.year-container{position:relative;display:flex;block-size:100%}.suffix{display:flex;align-items:center}.year,.suffix{margin-inline:var(--calcite-spacing-xxs);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-date-picker-year-text-color, var(--calcite-color-text-1));font-size:var(--calcite-font-size-md);line-height:var(--calcite-font-line-height-fixed-lg)}.year{position:relative;display:inline-block;border-style:none;background-color:transparent;text-align:center;font-family:inherit;outline-color:transparent;inline-size:44px}.year:hover{transition-timing-function:cubic-bezier(.4,0,.2,1);transition-property:outline-color;outline:2px solid var(--calcite-color-border-2);outline-offset:-2px}.year:focus{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))))}.month-select{--calcite-select-internal-border-width: 0;--calcite-select-internal-icon-border-inline-end-width: 0;--calcite-select-spacing-inline: var(--calcite-spacing-xxs);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-md));--calcite-select-text-color: var(--calcite-date-picker-month-select-text-color, var(--calcite-color-text-1));--calcite-select-icon-color: var(--calcite-date-picker-month-select-icon-color);--calcite-select-icon-color-hover: var(--calcite-date-picker-month-select-icon-color-hover);--calcite-internal-select-spacing-block: var(--calcite-spacing-xxs);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-xxs);--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-lg);--calcite-internal-select-font-weight: var(--calcite-font-weight-medium)}:host([scale=s]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-base);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size));--calcite-internal-select-spacing-block: var(--calcite-spacing-base);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-base);--calcite-internal-select-block-size: 24px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-base)}:host([scale=s]) .month-year-container .year{inline-size:40px}:host([scale=s]) .month-year-container .year,:host([scale=s]) .month-year-container .suffix{font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-fixed-base)}:host([scale=l]) .month-year-container .month-select{--calcite-select-spacing-inline: var(--calcite-spacing-sm);--calcite-select-font-size: var(--calcite-date-picker-month-select-font-size, var(--calcite-font-size-lg));--calcite-internal-select-spacing-block: var(--calcite-spacing-sm);--calcite-internal-select-icon-container-padding-inline: var(--calcite-spacing-sm);--calcite-internal-select-block-size: 44px;--calcite-internal-select-line-height: var(--calcite-font-line-height-fixed-xl)}:host([scale=l]) .month-year-container .year{inline-size:48px}:host([scale=l]) .month-year-container .year,:host([scale=l]) .month-year-container .suffix{font-size:var(--calcite-font-size-lg);line-height:var(--calcite-font-line-height-fixed-xl)}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
@@ -16,8 +16,8 @@ import type { DialogPlacement } from "./interfaces.js";
|
|
|
16
16
|
* @cssproperty [--calcite-dialog-min-size-y] - Specifies the component's minimum height, using `px`, `em`, `rem`, `vh`, or `%`.
|
|
17
17
|
* @cssproperty [--calcite-dialog-max-size-y] - Specifies the component's maximum height, using `px`, `em`, `rem`, `vh`, or `%`.
|
|
18
18
|
* @cssproperty [--calcite-dialog-content-space] - Specifies the padding of the component's content.
|
|
19
|
-
* @cssproperty [--calcite-dialog-content-top-space] - Specifies the padding of the `
|
|
20
|
-
* @cssproperty [--calcite-dialog-content-bottom-space] - Specifies the padding of the `
|
|
19
|
+
* @cssproperty [--calcite-dialog-content-top-space] - Specifies the padding of the component's `content-top` slot.
|
|
20
|
+
* @cssproperty [--calcite-dialog-content-bottom-space] - Specifies the padding of the component's `content-bottom` slot.
|
|
21
21
|
* @cssproperty [--calcite-dialog-footer-space] - Specifies the padding of the component's footer.
|
|
22
22
|
* @cssproperty [--calcite-dialog-border-color] - Specifies the component's border color.
|
|
23
23
|
* @cssproperty [--calcite-dialog-offset-x] - Specifies the component's horizontal offset.
|
|
@@ -5,7 +5,7 @@ import { u as useSizeOverride, i as interact } from "../../chunks/useSizeOverrid
|
|
|
5
5
|
import { css, html } from "lit";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
7
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
8
|
-
import {
|
|
8
|
+
import { g as getStylePixelValue } from "../../chunks/dom.js";
|
|
9
9
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
10
10
|
import { g as getDimensionClass } from "../../chunks/dynamicClasses.js";
|
|
11
11
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
@@ -4,7 +4,8 @@ import { ref } from "lit/directives/ref.js";
|
|
|
4
4
|
import { css, nothing, html } from "lit";
|
|
5
5
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
6
6
|
import { queryAssignedElements } from "lit/decorators.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
|
+
import { f as focusElementInGroup, i as focusElement, r as nextFrame } from "../../chunks/dom.js";
|
|
8
9
|
import { d as defaultMenuPlacement, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, f as filterValidFlipPlacements, h as hideFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
9
10
|
import { g as guid } from "../../chunks/guid.js";
|
|
10
11
|
import { i as isActivationKey } from "../../chunks/key.js";
|
|
@@ -40,6 +41,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
40
41
|
class Dropdown extends LitElement {
|
|
41
42
|
constructor() {
|
|
42
43
|
super();
|
|
44
|
+
this.direction = useDirection();
|
|
43
45
|
this.focusLastDropdownItem = false;
|
|
44
46
|
this.groups = [];
|
|
45
47
|
this.guid = guid();
|
|
@@ -89,6 +91,7 @@ class Dropdown extends LitElement {
|
|
|
89
91
|
async reposition(delayed = false) {
|
|
90
92
|
const { filteredFlipPlacements, floatingEl, offsetDistance, offsetSkidding, overlayPositioning, placement, referenceEl } = this;
|
|
91
93
|
return reposition(this, {
|
|
94
|
+
direction: this.direction,
|
|
92
95
|
floatingEl,
|
|
93
96
|
referenceEl,
|
|
94
97
|
offsetDistance,
|
|
@@ -14,12 +14,12 @@ import type { IconName } from "../calcite-icon/interfaces.js";
|
|
|
14
14
|
* @cssproperty [--calcite-flow-description-text-color] - Specifies the text color of the component's `description`.
|
|
15
15
|
* @cssproperty [--calcite-flow-border-color] - Specifies the component's border color.
|
|
16
16
|
* @cssproperty [--calcite-flow-background-color] - Specifies the component's background color.
|
|
17
|
-
* @cssproperty [--calcite-flow-content-top-space] - Specifies the padding of the `
|
|
18
|
-
* @cssproperty [--calcite-flow-content-bottom-space] - Specifies the padding of the `
|
|
17
|
+
* @cssproperty [--calcite-flow-content-top-space] - Specifies the padding of the component's `content-top` slot.
|
|
18
|
+
* @cssproperty [--calcite-flow-content-bottom-space] - Specifies the padding of the component's `content-bottom` slot.
|
|
19
19
|
* @cssproperty [--calcite-flow-header-background-color] - Specifies the background color of the component's header.
|
|
20
20
|
* @cssproperty [--calcite-flow-footer-background-color] - Specifies the background color of the component's footer.
|
|
21
21
|
* @cssproperty [--calcite-flow-space] - Specifies the padding of the component's `unnamed (default)` slot.
|
|
22
|
-
* @cssproperty [--calcite-flow-header-content-space] - Specifies the padding of the `header-content` slot.
|
|
22
|
+
* @cssproperty [--calcite-flow-header-content-space] - Specifies the padding of the component's `header-content` slot.
|
|
23
23
|
* @cssproperty [--calcite-flow-footer-space] - Specifies the padding of the component's footer.
|
|
24
24
|
* @cssproperty [--calcite-action-background-color] - Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s. Applies to any slotted `calcite-action`s.
|
|
25
25
|
* @cssproperty [--calcite-action-background-color-hover] - Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when hovered. Applies to any slotted `calcite-action`s.
|
|
@@ -4,7 +4,7 @@ import { keyed } from "lit/directives/keyed.js";
|
|
|
4
4
|
import { css, nothing, html } from "lit";
|
|
5
5
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
8
|
import { S as SLOTS$1 } from "../../chunks/resources6.js";
|
|
9
9
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
10
10
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
@@ -36,6 +36,7 @@ class FlowItem extends LitElement {
|
|
|
36
36
|
super(...arguments);
|
|
37
37
|
this.backButtonRef = createRef();
|
|
38
38
|
this.containerRef = createRef();
|
|
39
|
+
this.direction = useDirection();
|
|
39
40
|
this.messages = useT9n();
|
|
40
41
|
this.focusSetter = useSetFocus()(this);
|
|
41
42
|
this.interactiveContainer = useInteractive(this);
|
|
@@ -112,8 +113,7 @@ class FlowItem extends LitElement {
|
|
|
112
113
|
this.calciteFlowItemBack.emit();
|
|
113
114
|
}
|
|
114
115
|
renderBackButton() {
|
|
115
|
-
const
|
|
116
|
-
const rtl = getElementDir(el) === "rtl";
|
|
116
|
+
const rtl = this.direction === "rtl";
|
|
117
117
|
const { showBackButton, backButtonClick, messages } = this;
|
|
118
118
|
const label = messages.back;
|
|
119
119
|
const icon = rtl ? ICONS.backRight : ICONS.backLeft;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { g as getAssetPath, c as customElement } from "../../chunks/runtime.js";
|
|
3
3
|
import { css, isServer, nothing, svg, html } from "lit";
|
|
4
4
|
import { LitElement, safeClassMap } from "@arcgis/lumina";
|
|
5
|
-
import {
|
|
5
|
+
import { useDirection } from "@arcgis/lumina/controllers";
|
|
6
6
|
import { t as toAriaBoolean } from "../../chunks/aria.js";
|
|
7
7
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
8
8
|
import { l as logger } from "../../chunks/logger.js";
|
|
@@ -68,6 +68,7 @@ const styles = css`:host{display:inline-flex;color:var(--calcite-icon-color, var
|
|
|
68
68
|
class Icon extends LitElement {
|
|
69
69
|
constructor() {
|
|
70
70
|
super(...arguments);
|
|
71
|
+
this.direction = useDirection();
|
|
71
72
|
this.visible = false;
|
|
72
73
|
this.flipRtl = false;
|
|
73
74
|
this.icon = null;
|
|
@@ -133,8 +134,8 @@ class Icon extends LitElement {
|
|
|
133
134
|
this.intersectionObserver.observe(this.el);
|
|
134
135
|
}
|
|
135
136
|
render() {
|
|
136
|
-
const {
|
|
137
|
-
const dir =
|
|
137
|
+
const { flipRtl, pathData, scale, textLabel } = this;
|
|
138
|
+
const dir = this.direction;
|
|
138
139
|
const size = scaleToPx[scale];
|
|
139
140
|
const semantic = !!textLabel;
|
|
140
141
|
const paths = [].concat(pathData || "");
|
|
@@ -4,7 +4,7 @@ import { css, html } from "lit";
|
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
5
|
import { LitElement, createEvent, safeClassMap, nothing } from "@arcgis/lumina";
|
|
6
6
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
7
|
-
import {
|
|
7
|
+
import { a as slotChangeGetAssignedElements } from "../../chunks/dom.js";
|
|
8
8
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
9
9
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
10
10
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
@@ -5,8 +5,8 @@ import { keyed } from "lit/directives/keyed.js";
|
|
|
5
5
|
import { css, html, nothing } from "lit";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
7
|
import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
|
|
8
|
-
import { useWatchAttributes } from "@arcgis/lumina/controllers";
|
|
9
|
-
import {
|
|
8
|
+
import { useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
9
|
+
import { b as setRequestedIcon, j as isPrimaryPointerButton } from "../../chunks/dom.js";
|
|
10
10
|
import { c as connectForm, i as internalHiddenInputInputEvent, d as disconnectForm, s as submitForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
|
|
11
11
|
import { n as numberKeys } from "../../chunks/key.js";
|
|
12
12
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
@@ -67,6 +67,7 @@ class Input extends LitElement {
|
|
|
67
67
|
this.attributeWatch = useWatchAttributes(["autofocus", "enterkeyhint", "inputmode", "spellcheck"], this.handleGlobalAttributesChanged);
|
|
68
68
|
this.childRef = createRef();
|
|
69
69
|
this.childNumberRef = createRef();
|
|
70
|
+
this.direction = useDirection();
|
|
70
71
|
this.inputWrapperRef = createRef();
|
|
71
72
|
this.onHiddenFormInputInput = (event) => {
|
|
72
73
|
if (event.target.name === this.name) {
|
|
@@ -514,7 +515,7 @@ class Input extends LitElement {
|
|
|
514
515
|
}
|
|
515
516
|
}
|
|
516
517
|
render() {
|
|
517
|
-
const dir =
|
|
518
|
+
const dir = this.direction;
|
|
518
519
|
const loader = html`<div class=${safeClassMap(CSS.loader)}><calcite-progress .label=${this.messages.loading} type=indeterminate></calcite-progress></div>`;
|
|
519
520
|
const inputClearButton = html`<button .ariaLabel=${this.messages.clear} class=${safeClassMap(CSS.clearButton)} .disabled=${this.disabled || this.readOnly} @click=${this.clearInputValue} tabindex=-1 title=${this.messages.clear ?? nothing} type=button><calcite-icon .icon=${ICONS.close} .scale=${getIconScale(this.scale)}></calcite-icon></button>`;
|
|
520
521
|
const iconEl = html`<calcite-icon class=${safeClassMap(CSS.inputIcon)} .flipRtl=${this.iconFlipRtl} .icon=${this.requestedIcon} .scale=${getIconScale(this.scale)}></calcite-icon>`;
|
|
@@ -3,6 +3,7 @@ import { c as customElement } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css, isServer, nothing, html } from "lit";
|
|
4
4
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
5
5
|
import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
|
|
6
|
+
import { useDirection } from "@arcgis/lumina/controllers";
|
|
6
7
|
import { u as useFocusTrap } from "../../chunks/useFocusTrap.js";
|
|
7
8
|
import { l as datePartsFromISO, d as dateFromISO, b as dateFromRange, a as dateToISO, m as datePartsFromLocalizedString, o as dateFromLocalizedString, i as inRange } from "../../chunks/date.js";
|
|
8
9
|
import { d as defaultMenuPlacement, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, f as filterValidFlipPlacements, h as hideFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
@@ -72,6 +73,7 @@ class InputDatePicker extends LitElement {
|
|
|
72
73
|
super();
|
|
73
74
|
this.commonDateSeparators = [".", "-", "/"];
|
|
74
75
|
this.dialogId = IDS.dialog(guid());
|
|
76
|
+
this.direction = useDirection();
|
|
75
77
|
this.endInputRef = createRef();
|
|
76
78
|
this.focusOnOpen = false;
|
|
77
79
|
this.focusTrap = useFocusTrap({
|
|
@@ -168,6 +170,7 @@ class InputDatePicker extends LitElement {
|
|
|
168
170
|
async reposition(delayed = false) {
|
|
169
171
|
const { floatingEl, referenceEl, placement, overlayPositioning, filteredFlipPlacements } = this;
|
|
170
172
|
return reposition(this, {
|
|
173
|
+
direction: this.direction,
|
|
171
174
|
floatingEl,
|
|
172
175
|
referenceEl,
|
|
173
176
|
overlayPositioning,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { c as customElement } from "../../chunks/runtime.js";
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { LitElement, stringOrBoolean, setAttribute, safeClassMap } from "@arcgis/lumina";
|
|
5
|
-
import {
|
|
5
|
+
import { b as setRequestedIcon } from "../../chunks/dom.js";
|
|
6
6
|
const StatusIconDefaults = {
|
|
7
7
|
valid: "check-circle",
|
|
8
8
|
invalid: "exclamation-mark-triangle",
|
|
@@ -5,8 +5,8 @@ import { keyed } from "lit/directives/keyed.js";
|
|
|
5
5
|
import { css, html, nothing } from "lit";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
7
|
import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
|
|
8
|
-
import { useWatchAttributes } from "@arcgis/lumina/controllers";
|
|
9
|
-
import {
|
|
8
|
+
import { useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
9
|
+
import { b as setRequestedIcon, j as isPrimaryPointerButton } from "../../chunks/dom.js";
|
|
10
10
|
import { c as connectForm, i as internalHiddenInputInputEvent, d as disconnectForm, s as submitForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
|
|
11
11
|
import { n as numberKeys } from "../../chunks/key.js";
|
|
12
12
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
@@ -57,6 +57,7 @@ class InputNumber extends LitElement {
|
|
|
57
57
|
this.actionWrapperRef = createRef();
|
|
58
58
|
this.attributeWatch = useWatchAttributes(["autofocus", "enterkeyhint", "inputmode"], this.handleGlobalAttributesChanged);
|
|
59
59
|
this.childNumberRef = createRef();
|
|
60
|
+
this.direction = useDirection();
|
|
60
61
|
this.inputWrapperRef = createRef();
|
|
61
62
|
this.onHiddenFormInputInput = (event) => {
|
|
62
63
|
if (event.target.name === this.name) {
|
|
@@ -513,7 +514,7 @@ class InputNumber extends LitElement {
|
|
|
513
514
|
}
|
|
514
515
|
}
|
|
515
516
|
render() {
|
|
516
|
-
const dir =
|
|
517
|
+
const dir = this.direction;
|
|
517
518
|
const loader = html`<div class=${safeClassMap(CSS.loader)}><calcite-progress .label=${this.messages.loading} type=indeterminate></calcite-progress></div>`;
|
|
518
519
|
const inputClearButton = html`<button .ariaLabel=${this.messages.clear} class=${safeClassMap(CSS.clearButton)} .disabled=${this.disabled || this.readOnly} @click=${this.clearInputValue} tabindex=-1 type=button><calcite-icon .icon=${ICONS.clear} .scale=${getIconScale(this.scale)}></calcite-icon></button>`;
|
|
519
520
|
const iconEl = html`<calcite-icon class=${safeClassMap(CSS.inputIcon)} .flipRtl=${this.iconFlipRtl} .icon=${this.requestedIcon} .scale=${getIconScale(this.scale)}></calcite-icon>`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
-
import type { MutableValidityState } from "../../
|
|
3
|
+
import type { MutableValidityState } from "../../controllers/useForm.js";
|
|
4
4
|
import type { Alignment, Scale, Status } from "../interfaces.js";
|
|
5
5
|
import type { IconName } from "../calcite-icon/interfaces.js";
|
|
6
6
|
|
|
@@ -4,17 +4,175 @@ import { live } from "lit/directives/live.js";
|
|
|
4
4
|
import { css, html, nothing } from "lit";
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import { LitElement, createEvent, stringOrBoolean, safeClassMap } from "@arcgis/lumina";
|
|
7
|
-
import { useWatchAttributes } from "@arcgis/lumina/controllers";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { makeGenericController, useWatchAttributes, useDirection } from "@arcgis/lumina/controllers";
|
|
8
|
+
import { b as setRequestedIcon } from "../../chunks/dom.js";
|
|
9
|
+
import { uncapitalize, kebabToPascal } from "@arcgis/toolkit/string";
|
|
10
|
+
import { a as syncInputDelegate, i as isSupportedType } from "../../chunks/input.js";
|
|
10
11
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
11
12
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
12
13
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
13
14
|
import { V as Validation } from "../../chunks/Validation.js";
|
|
14
|
-
import { s as syncHiddenFormInput } from "../../chunks/input.js";
|
|
15
15
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
16
16
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
17
17
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
18
|
+
const componentsWithInputEvent = [
|
|
19
|
+
"calcite-input",
|
|
20
|
+
"calcite-input-number",
|
|
21
|
+
"calcite-input-text",
|
|
22
|
+
"calcite-text-area"
|
|
23
|
+
];
|
|
24
|
+
function getClearValidationEventName(componentTag) {
|
|
25
|
+
const componentTagCamelCase = uncapitalize(kebabToPascal(componentTag));
|
|
26
|
+
return `${componentTagCamelCase}${componentsWithInputEvent.includes(componentTag) ? "Input" : "Change"}`;
|
|
27
|
+
}
|
|
28
|
+
function displayValidationMessage(component, { status, message, icon }) {
|
|
29
|
+
if ("status" in component) {
|
|
30
|
+
component.status = status;
|
|
31
|
+
}
|
|
32
|
+
if ("validationIcon" in component && typeof component.validationIcon !== "string") {
|
|
33
|
+
component.validationIcon = icon;
|
|
34
|
+
}
|
|
35
|
+
if ("validationMessage" in component && !component.validationMessage) {
|
|
36
|
+
component.validationMessage = message;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function syncInternalInput(component, input) {
|
|
40
|
+
const { disabled, required } = component;
|
|
41
|
+
input.disabled = disabled;
|
|
42
|
+
input.required = !!required;
|
|
43
|
+
if (isCheckable(component)) {
|
|
44
|
+
input.checked = component.checked;
|
|
45
|
+
} else if (isInputComponent(component, input)) {
|
|
46
|
+
syncInputDelegate(input.type, component, input);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isCheckable(component) {
|
|
50
|
+
return "checked" in component;
|
|
51
|
+
}
|
|
52
|
+
function isInputComponent(component, input) {
|
|
53
|
+
return component && isSupportedType(input.type);
|
|
54
|
+
}
|
|
55
|
+
const useForm = (options) => {
|
|
56
|
+
return makeGenericController((component, controller) => {
|
|
57
|
+
let defaultValueDirty = false;
|
|
58
|
+
let defaultCheckedDirty = false;
|
|
59
|
+
let inputDelegate;
|
|
60
|
+
let lastAssociatedForm = null;
|
|
61
|
+
if (options.inputType) {
|
|
62
|
+
inputDelegate = document.createElement("input");
|
|
63
|
+
inputDelegate.type = options.inputType;
|
|
64
|
+
}
|
|
65
|
+
function invalidFormHandler(event) {
|
|
66
|
+
event?.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
function onFormReset() {
|
|
69
|
+
if ("status" in component) {
|
|
70
|
+
component.status = "idle";
|
|
71
|
+
}
|
|
72
|
+
if ("validationIcon" in component) {
|
|
73
|
+
component.validationIcon = false;
|
|
74
|
+
}
|
|
75
|
+
if ("validationMessage" in component) {
|
|
76
|
+
component.validationMessage = "";
|
|
77
|
+
}
|
|
78
|
+
if (isCheckable(component)) {
|
|
79
|
+
component.checked = defaultCheckedDirty ? component.defaultChecked : component.checked;
|
|
80
|
+
}
|
|
81
|
+
component.value = defaultValueDirty ? component.defaultValue : component.value;
|
|
82
|
+
defaultValueDirty = false;
|
|
83
|
+
defaultCheckedDirty = false;
|
|
84
|
+
}
|
|
85
|
+
component.listen("luminaFormResetCallback", () => {
|
|
86
|
+
onFormReset();
|
|
87
|
+
});
|
|
88
|
+
component.listen("luminaFormAssociatedCallback", ({ detail: [form] }) => {
|
|
89
|
+
if (form) {
|
|
90
|
+
form.addEventListener("invalid", invalidFormHandler, { capture: true });
|
|
91
|
+
} else {
|
|
92
|
+
lastAssociatedForm?.removeEventListener("invalid", invalidFormHandler, { capture: true });
|
|
93
|
+
}
|
|
94
|
+
lastAssociatedForm = form;
|
|
95
|
+
});
|
|
96
|
+
function handleInvalidInput() {
|
|
97
|
+
const validationMsg = inputDelegate?.validationMessage || "";
|
|
98
|
+
component.el.dispatchEvent(
|
|
99
|
+
// allows users to set custom validation messages
|
|
100
|
+
new CustomEvent("calciteInvalid", { bubbles: true, composed: true })
|
|
101
|
+
);
|
|
102
|
+
displayValidationMessage(component, {
|
|
103
|
+
message: validationMsg,
|
|
104
|
+
icon: true,
|
|
105
|
+
status: "invalid"
|
|
106
|
+
});
|
|
107
|
+
const clearValidationEvent = getClearValidationEventName(component.el.tagName.toLowerCase());
|
|
108
|
+
component.listen(
|
|
109
|
+
clearValidationEvent,
|
|
110
|
+
() => {
|
|
111
|
+
if ("status" in component) {
|
|
112
|
+
component.status = "idle";
|
|
113
|
+
}
|
|
114
|
+
if ("validationIcon" in component && (!component.validationIcon || component.validationIcon === true)) {
|
|
115
|
+
component.validationIcon = false;
|
|
116
|
+
}
|
|
117
|
+
if ("validationMessage" in component && component.validationMessage === validationMsg) {
|
|
118
|
+
component.validationMessage = "";
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{ once: true }
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
controller.onConnected(() => {
|
|
125
|
+
component.el.addEventListener("invalid", handleInvalidInput);
|
|
126
|
+
});
|
|
127
|
+
controller.onDisconnected(() => {
|
|
128
|
+
component.el.removeEventListener("invalid", handleInvalidInput);
|
|
129
|
+
});
|
|
130
|
+
controller.onUpdate((changes) => {
|
|
131
|
+
if (changes.has("value") && !defaultValueDirty) {
|
|
132
|
+
defaultValueDirty = true;
|
|
133
|
+
component.defaultValue = component.value;
|
|
134
|
+
}
|
|
135
|
+
if (isCheckable(component) && changes.has("checked") && !defaultCheckedDirty) {
|
|
136
|
+
defaultCheckedDirty = true;
|
|
137
|
+
component.defaultChecked = component.checked;
|
|
138
|
+
}
|
|
139
|
+
if (changes.has("value") || isCheckable(component) && changes.has("checked")) {
|
|
140
|
+
component.elementInternals.setFormValue(getFormValue());
|
|
141
|
+
}
|
|
142
|
+
if (inputDelegate) {
|
|
143
|
+
inputDelegate.value = component.value;
|
|
144
|
+
syncInternalInput(component, inputDelegate);
|
|
145
|
+
inputDelegate.checkValidity();
|
|
146
|
+
component.elementInternals.setValidity(inputDelegate.validity, inputDelegate.validationMessage);
|
|
147
|
+
if ("validity" in component) {
|
|
148
|
+
component.validity = component.elementInternals.validity;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
function getFormValue() {
|
|
153
|
+
if (Array.isArray(component.value)) {
|
|
154
|
+
const formData = new FormData();
|
|
155
|
+
component.value.forEach((value) => formData.append(component.name, value));
|
|
156
|
+
return formData;
|
|
157
|
+
}
|
|
158
|
+
if (isCheckable(component)) {
|
|
159
|
+
if (component.checked) {
|
|
160
|
+
return component.defaultValue === void 0 && !defaultValueDirty && component.value === void 0 ? "on" : component.value;
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
return component.value;
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
get active() {
|
|
168
|
+
return !!component.elementInternals.form;
|
|
169
|
+
},
|
|
170
|
+
requestSubmit: () => {
|
|
171
|
+
component.elementInternals.form?.requestSubmit();
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
});
|
|
175
|
+
};
|
|
18
176
|
const CSS = {
|
|
19
177
|
loader: "loader",
|
|
20
178
|
clearable: "clearable",
|
|
@@ -43,22 +201,16 @@ class InputText extends LitElement {
|
|
|
43
201
|
this.actionWrapperRef = createRef();
|
|
44
202
|
this.attributeWatch = useWatchAttributes(["autofocus", "enterkeyhint", "inputmode", "spellcheck"], this.handleGlobalAttributesChanged);
|
|
45
203
|
this.childRef = createRef();
|
|
204
|
+
this.direction = useDirection();
|
|
46
205
|
this.inputWrapperRef = createRef();
|
|
47
|
-
this.onHiddenFormInputInput = (event) => {
|
|
48
|
-
if (event.target.name === this.name) {
|
|
49
|
-
this.setValue({
|
|
50
|
-
value: event.target.value,
|
|
51
|
-
origin: "direct"
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
this.setFocus();
|
|
55
|
-
event.stopPropagation();
|
|
56
|
-
};
|
|
57
206
|
this.previousValueOrigin = "initial";
|
|
58
207
|
this.userChangedValue = false;
|
|
59
208
|
this._value = "";
|
|
60
209
|
this.messages = useT9n();
|
|
61
210
|
this.focusSetter = useSetFocus()(this);
|
|
211
|
+
this.formSupport = useForm({
|
|
212
|
+
inputType: "text"
|
|
213
|
+
})(this);
|
|
62
214
|
this.interactiveContainer = useInteractive(this);
|
|
63
215
|
this.slottedActionElDisabledInternally = false;
|
|
64
216
|
this.alignment = "start";
|
|
@@ -94,6 +246,9 @@ class InputText extends LitElement {
|
|
|
94
246
|
static {
|
|
95
247
|
this.properties = { slottedActionElDisabledInternally: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], autocomplete: 1, clearable: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], editingEnabled: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], icon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], label: 1, labelText: 1, loading: [7, {}, { reflect: true, type: Boolean }], maxLength: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], minLength: [11, {}, { reflect: true, type: Number }], name: [3, {}, { reflect: true }], pattern: 1, placeholder: 1, prefixText: 1, readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], suffixText: 1, validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [0, {}, { attribute: false }], value: 1 };
|
|
96
248
|
}
|
|
249
|
+
static {
|
|
250
|
+
this.formAssociated = true;
|
|
251
|
+
}
|
|
97
252
|
static {
|
|
98
253
|
this.styles = styles;
|
|
99
254
|
}
|
|
@@ -123,8 +278,6 @@ class InputText extends LitElement {
|
|
|
123
278
|
this.editingEnabled = this.inlineEditableEl.editingEnabled || false;
|
|
124
279
|
}
|
|
125
280
|
connectLabel(this);
|
|
126
|
-
connectForm(this);
|
|
127
|
-
this.el.addEventListener(internalHiddenInputInputEvent, this.onHiddenFormInputInput);
|
|
128
281
|
}
|
|
129
282
|
async load() {
|
|
130
283
|
this.requestedIcon = setRequestedIcon({}, this.icon, "text");
|
|
@@ -139,8 +292,6 @@ class InputText extends LitElement {
|
|
|
139
292
|
disconnectedCallback() {
|
|
140
293
|
super.disconnectedCallback();
|
|
141
294
|
disconnectLabel(this);
|
|
142
|
-
disconnectForm(this);
|
|
143
|
-
this.el.removeEventListener(internalHiddenInputInputEvent, this.onHiddenFormInputInput);
|
|
144
295
|
}
|
|
145
296
|
handleGlobalAttributesChanged() {
|
|
146
297
|
this.requestUpdate();
|
|
@@ -163,10 +314,9 @@ class InputText extends LitElement {
|
|
|
163
314
|
this.clearInputTextValue(event);
|
|
164
315
|
event.preventDefault();
|
|
165
316
|
}
|
|
166
|
-
if (event.key === "Enter") {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
317
|
+
if (event.key === "Enter" && this.formSupport.active) {
|
|
318
|
+
this.formSupport.requestSubmit();
|
|
319
|
+
event.preventDefault();
|
|
170
320
|
}
|
|
171
321
|
}
|
|
172
322
|
onLabelClick() {
|
|
@@ -227,9 +377,6 @@ class InputText extends LitElement {
|
|
|
227
377
|
this.emitChangeIfUserModified();
|
|
228
378
|
}
|
|
229
379
|
}
|
|
230
|
-
syncHiddenFormInput(input) {
|
|
231
|
-
syncHiddenFormInput("text", this, input);
|
|
232
|
-
}
|
|
233
380
|
setInputValue(newInputValue) {
|
|
234
381
|
if (!this.childRef.value) {
|
|
235
382
|
return;
|
|
@@ -261,7 +408,7 @@ class InputText extends LitElement {
|
|
|
261
408
|
}
|
|
262
409
|
}
|
|
263
410
|
render() {
|
|
264
|
-
const dir =
|
|
411
|
+
const dir = this.direction;
|
|
265
412
|
const loader = html`<div class=${safeClassMap(CSS.loader)}><calcite-progress .label=${this.messages.loading} type=indeterminate></calcite-progress></div>`;
|
|
266
413
|
const inputClearButton = html`<button .ariaLabel=${this.messages.clear} class=${safeClassMap(CSS.clearButton)} .disabled=${this.disabled || this.readOnly} @click=${this.clearInputTextValue} tabindex=-1 type=button><calcite-icon icon=x .scale=${getIconScale(this.scale)}></calcite-icon></button>`;
|
|
267
414
|
const iconEl = html`<calcite-icon class=${safeClassMap(CSS.inputIcon)} .flipRtl=${this.iconFlipRtl} .icon=${this.requestedIcon} .scale=${getIconScale(this.scale)}></calcite-icon>`;
|
|
@@ -277,7 +424,7 @@ class InputText extends LitElement {
|
|
|
277
424
|
[CSS.clearable]: this.isClearable,
|
|
278
425
|
[CSS.hasSuffix]: this.suffixText,
|
|
279
426
|
[CSS.hasPrefix]: this.prefixText
|
|
280
|
-
})} ${ref(this.inputWrapperRef)}>${this.prefixText ? prefixText : null}<div class=${safeClassMap(CSS.wrapper)}>${childEl}${this.isClearable ? inputClearButton : null}${this.requestedIcon ? iconEl : null}${this.loading ? loader : null}</div><div class=${safeClassMap(CSS.actionWrapper)} ${ref(this.actionWrapperRef)}><slot name=${SLOTS.action}></slot></div>${this.suffixText ? suffixText : null}
|
|
427
|
+
})} ${ref(this.inputWrapperRef)}>${this.prefixText ? prefixText : null}<div class=${safeClassMap(CSS.wrapper)}>${childEl}${this.isClearable ? inputClearButton : null}${this.requestedIcon ? iconEl : null}${this.loading ? loader : null}</div><div class=${safeClassMap(CSS.actionWrapper)} ${ref(this.actionWrapperRef)}><slot name=${SLOTS.action}></slot></div>${this.suffixText ? suffixText : null}</div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
|
|
281
428
|
}
|
|
282
429
|
}
|
|
283
430
|
customElement("calcite-input-text", InputText);
|