@esri/calcite-components 5.1.0-next.9 → 5.1.1-next.0
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/README.md +1 -1
- package/dist/cdn/2DXIZU6R.js +2 -0
- package/dist/cdn/2IWGUAWA.js +2 -0
- package/dist/cdn/{EB4M47KA.js → 2JARICGO.js} +1 -1
- package/dist/cdn/{34EJXQYF.js → 2KGEPRUF.js} +1 -1
- package/dist/cdn/3BPI3O6E.js +2 -0
- package/dist/cdn/3RBTYVUD.js +2 -0
- package/dist/cdn/{67QHQNZF.js → 3SYGBKWR.js} +1 -1
- package/dist/cdn/{U4MTAQRM.js → 4CB2O5QG.js} +1 -1
- package/dist/cdn/{VQHTMUYJ.js → 4ERCP6XO.js} +1 -1
- package/dist/cdn/4FUCDFGK.js +2 -0
- package/dist/cdn/4SJPPENI.js +2 -0
- package/dist/cdn/56VYPYFF.js +2 -0
- package/dist/cdn/5AMCYZ6W.js +2 -0
- package/dist/cdn/5BXGV5ZQ.js +2 -0
- package/dist/cdn/{CNR7IJIS.js → 5IISC3HD.js} +1 -1
- package/dist/cdn/5IYNIOCS.js +2 -0
- package/dist/cdn/5TNWLRB6.js +2 -0
- package/dist/cdn/{3GXLGKZV.js → 6BDNCIAA.js} +1 -1
- package/dist/cdn/{BG7CCT2Q.js → 6CEBXQSC.js} +1 -1
- package/dist/cdn/6H3CYBMZ.js +2 -0
- package/dist/cdn/6J6NDAUF.js +2 -0
- package/dist/cdn/{5TJGOI64.js → 6JKXCCTG.js} +1 -1
- package/dist/cdn/6RRQ22LO.js +2 -0
- package/dist/cdn/6SLXQWU4.js +2 -0
- package/dist/cdn/75I5SJ4X.js +2 -0
- package/dist/cdn/7RS475AK.js +2 -0
- package/dist/cdn/{6C76CPWO.js → 7TFO6D5F.js} +1 -1
- package/dist/cdn/{MVA4NE6I.js → A7U6OOWG.js} +1 -1
- package/dist/cdn/AA3NSH3U.js +2 -0
- package/dist/cdn/ACAPEXIF.js +2 -0
- package/dist/cdn/ADCXSL56.js +2 -0
- package/dist/cdn/{XW3UC4FN.js → AGRNONET.js} +1 -1
- package/dist/cdn/ALDJUEQ6.js +2 -0
- package/dist/cdn/{BPIG37CO.js → AVN7GDNI.js} +1 -1
- package/dist/cdn/AZHDD5QW.js +2 -0
- package/dist/cdn/B5SIF6E3.js +2 -0
- package/dist/cdn/BAMXLXKZ.js +2 -0
- package/dist/cdn/{UKC7JB7P.js → BXRNRAM4.js} +1 -1
- package/dist/cdn/BZVESTLV.js +2 -0
- package/dist/cdn/CAU3D7O6.js +2 -0
- package/dist/cdn/CQMZOIYT.js +3 -0
- package/dist/cdn/D2IHG7U6.js +2 -0
- package/dist/cdn/D36FINW3.js +2 -0
- package/dist/cdn/DBKOSP2J.js +2 -0
- package/dist/cdn/DCLKVSQL.js +2 -0
- package/dist/cdn/{EHIAXJAL.js → DCWL5FUH.js} +1 -1
- package/dist/cdn/DEUPIV3Z.js +2 -0
- package/dist/cdn/DPVKTTT4.js +2 -0
- package/dist/cdn/E4DM4ZJR.js +2 -0
- package/dist/cdn/{RPT5BJMD.js → EBCHRNQU.js} +1 -1
- package/dist/cdn/EGJCIQXC.js +2 -0
- package/dist/cdn/FAMRE5HY.js +2 -0
- package/dist/cdn/{TKH5LW5O.js → FDZMMKDF.js} +1 -1
- package/dist/cdn/{AS2M2ZWD.js → FFQ7TM4J.js} +1 -1
- package/dist/cdn/FHT56RXI.js +2 -0
- package/dist/cdn/{EIXE62NK.js → FSIXQSOF.js} +1 -1
- package/dist/cdn/{S7XHDLIF.js → FVT27KQD.js} +1 -1
- package/dist/cdn/G456YVPG.js +2 -0
- package/dist/cdn/G4W7YKDH.js +2 -0
- package/dist/cdn/GQ7DKFA5.js +2 -0
- package/dist/cdn/GQDKVK3D.js +2 -0
- package/dist/cdn/GURB6TIJ.js +2 -0
- package/dist/cdn/{WBJUAZ65.js → H2UXQDON.js} +1 -1
- package/dist/cdn/{CMVTCAFL.js → HEIK7T3T.js} +1 -1
- package/dist/cdn/{JVAE3MLA.js → HLF26T4C.js} +1 -1
- package/dist/cdn/HP3ZLN4B.js +2 -0
- package/dist/cdn/{YMHR4PKM.js → HVGZLEM5.js} +1 -1
- package/dist/cdn/HVO2U7ZI.js +2 -0
- package/dist/cdn/{ZGJRTQBX.js → HZZHIGHG.js} +1 -1
- package/dist/cdn/{PIU3YYLU.js → I3XG7K6C.js} +1 -1
- package/dist/cdn/{LQD663MA.js → I4VNM5NL.js} +1 -1
- package/dist/cdn/{HQDFIE2B.js → IEF6JYBC.js} +1 -1
- package/dist/cdn/{TXRFE5GH.js → ILQX7Y7Q.js} +1 -1
- package/dist/cdn/INTGSZ5Z.js +2 -0
- package/dist/cdn/{NJRKH5Q7.js → IPPMCVC6.js} +1 -1
- package/dist/cdn/{VOTW2RMD.js → IVWQJUEE.js} +1 -1
- package/dist/cdn/JHTPQLAI.js +2 -0
- package/dist/cdn/JHXH6UZJ.js +2 -0
- package/dist/cdn/{OQ2UCUQP.js → JOCO4XI3.js} +1 -1
- package/dist/cdn/{WEAILY72.js → KLCLUDIS.js} +1 -1
- package/dist/cdn/{7XBTO6NQ.js → KQCAFH4L.js} +1 -1
- package/dist/cdn/KTBY2CGR.js +2 -0
- package/dist/cdn/KUL73QJV.js +2 -0
- package/dist/cdn/{SHD6TE4R.js → KZ3LUSU2.js} +1 -1
- package/dist/cdn/{HZGU4N3I.js → L4A2ANF6.js} +1 -1
- package/dist/cdn/LJ4KTE6Y.js +2 -0
- package/dist/cdn/{BZGE52YU.js → LRZTZSHC.js} +1 -1
- package/dist/cdn/{IWG7JAQJ.js → LT4BKZ77.js} +1 -1
- package/dist/cdn/LZRGGTLJ.js +2 -0
- package/dist/cdn/{O7BFREIB.js → LZRUNHQB.js} +1 -1
- package/dist/cdn/{PFKFYB45.js → M4FJ2QZO.js} +1 -1
- package/dist/cdn/{JRWW665Q.js → MBFZ33SM.js} +1 -1
- package/dist/cdn/{CSOE3CJR.js → MJEQO4QJ.js} +1 -1
- package/dist/cdn/MLSILTYB.js +4 -0
- package/dist/cdn/MOOXNG3K.js +2 -0
- package/dist/cdn/MREXPRS4.js +2 -0
- package/dist/cdn/MUOYIJVV.js +2 -0
- package/dist/cdn/N5GIKXDL.js +2 -0
- package/dist/cdn/N7F4APVB.js +2 -0
- package/dist/cdn/{XUSE3II4.js → NIOQGKNW.js} +1 -1
- package/dist/cdn/O7YMPQUI.js +2 -0
- package/dist/cdn/{XJZLGVT6.js → PBNKEMBL.js} +1 -1
- package/dist/cdn/{6LA4PLL2.js → POYAO7CJ.js} +1 -1
- package/dist/cdn/QAASRSQZ.js +2 -0
- package/dist/cdn/{YM6QAFEQ.js → QGKI3OMJ.js} +1 -1
- package/dist/cdn/QO5UB5D4.js +2 -0
- package/dist/cdn/QXQDUUO7.js +2 -0
- package/dist/cdn/R7KZTTEV.js +2 -0
- package/dist/cdn/{QCDS2TXE.js → RF73TS72.js} +1 -1
- package/dist/cdn/{TTFCVVON.js → RMTFO2LM.js} +1 -1
- package/dist/cdn/{IZLDBAPA.js → S6DQQTW3.js} +1 -1
- package/dist/cdn/{YJHXVSEP.js → SFJW4TZX.js} +1 -1
- package/dist/cdn/{DYBHFMG7.js → SIAFDW7Y.js} +1 -1
- package/dist/cdn/SRXPPFYE.js +2 -0
- package/dist/cdn/{QULVDSNJ.js → SZD4HZMW.js} +1 -1
- package/dist/cdn/SZSMPM6E.js +2 -0
- package/dist/cdn/TOEE2LYN.js +2 -0
- package/dist/cdn/{BAMCFG7H.js → TZI723KV.js} +1 -1
- package/dist/cdn/U3EXF4ZG.js +2 -0
- package/dist/cdn/{E6EGKXUX.js → UDMEFBNA.js} +1 -1
- package/dist/cdn/UFURWY36.js +2 -0
- package/dist/cdn/UH5QPC23.js +2 -0
- package/dist/cdn/{L24DVRWE.js → UQ4U2WKO.js} +1 -1
- package/dist/cdn/URRCLJJL.js +2 -0
- package/dist/cdn/{BMRN6G4T.js → US2R5SI2.js} +1 -1
- package/dist/cdn/UZ6A3EVC.js +2 -0
- package/dist/cdn/V2R55PMZ.js +2 -0
- package/dist/cdn/VZDAEJEF.js +4 -0
- package/dist/cdn/{OPHJLVOH.js → W3AYPD7P.js} +1 -1
- package/dist/cdn/{RH6ZIP65.js → WGGFNK4Z.js} +1 -1
- package/dist/cdn/X3P7R4XF.js +2 -0
- package/dist/cdn/{3IHT5FIP.js → X7CHFMN5.js} +1 -1
- package/dist/cdn/XHP4ORWZ.js +2 -0
- package/dist/cdn/XLD2OUA2.js +2 -0
- package/dist/cdn/XM4MM6Q2.js +2 -0
- package/dist/cdn/{IJ7V345Q.js → XSAUQUSM.js} +1 -1
- package/dist/cdn/Y4RJBGTN.js +2 -0
- package/dist/cdn/{GGGN54CY.js → YK5IMHQT.js} +1 -1
- package/dist/cdn/YX2QYEVF.js +2 -0
- package/dist/cdn/Z3AYOD3V.js +2 -0
- package/dist/cdn/{C25ETLQX.js → ZHTE4PVO.js} +1 -1
- package/dist/cdn/{43FMFYKZ.js → ZJBIXCJU.js} +1 -1
- package/dist/cdn/ZLL3IOQH.js +2 -0
- package/dist/cdn/{I7BWPAOF.js → ZQRR6YTB.js} +1 -1
- package/dist/cdn/ZWHKM56M.js +2 -0
- package/dist/cdn/{7JGWCRII.js → ZX5NT7BW.js} +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/combobox/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/icon/arcgisQuickcapture16.json +1 -0
- package/dist/cdn/assets/icon/arcgisQuickcapture24.json +1 -0
- package/dist/cdn/assets/icon/arcgisQuickcapture32.json +1 -0
- package/dist/cdn/assets/icon/arcgisSurvey12316.json +1 -0
- package/dist/cdn/assets/icon/arcgisSurvey12324.json +1 -0
- package/dist/cdn/assets/icon/arcgisSurvey12332.json +1 -0
- package/dist/cdn/assets/icon/buttons16.json +1 -0
- package/dist/cdn/assets/icon/buttons24.json +1 -0
- package/dist/cdn/assets/icon/buttons32.json +1 -0
- package/dist/cdn/assets/icon/entityTypes16.json +1 -0
- package/dist/cdn/assets/icon/entityTypes24.json +1 -0
- package/dist/cdn/assets/icon/entityTypes32.json +1 -0
- package/dist/cdn/assets/icon/gpsReceiver16.json +1 -0
- package/dist/cdn/assets/icon/gpsReceiver24.json +1 -0
- package/dist/cdn/assets/icon/gpsReceiver32.json +1 -0
- package/dist/cdn/assets/icon/layerStreamSetting16.json +1 -0
- package/dist/cdn/assets/icon/layerStreamSetting24.json +1 -0
- package/dist/cdn/assets/icon/layerStreamSetting32.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose16.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose24.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryFullSuperimpose32.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose16.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose24.json +1 -0
- package/dist/cdn/assets/icon/orientedImageryHalfSuperimpose32.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly16.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly24.json +1 -0
- package/dist/cdn/assets/icon/orientedImagerySceneOnly32.json +1 -0
- package/dist/cdn/assets/icon/returnToDefault16.json +1 -0
- package/dist/cdn/assets/icon/returnToDefault24.json +1 -0
- package/dist/cdn/assets/icon/returnToDefault32.json +1 -0
- package/dist/cdn/assets/icon/reviewMap16.json +1 -0
- package/dist/cdn/assets/icon/reviewMap24.json +1 -0
- package/dist/cdn/assets/icon/reviewMap32.json +1 -0
- package/dist/cdn/assets/icon/totalStation16.json +1 -0
- package/dist/cdn/assets/icon/totalStation24.json +1 -0
- package/dist/cdn/assets/icon/totalStation32.json +1 -0
- package/dist/cdn/assets/icon/velocityServer16.json +1 -0
- package/dist/cdn/assets/icon/velocityServer24.json +1 -0
- package/dist/cdn/assets/icon/velocityServer32.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +2 -2
- package/dist/chunks/ClearButton.js +16 -0
- package/dist/chunks/ExpandToggle.js +2 -2
- package/dist/chunks/FloatingArrow.js +24 -0
- package/dist/chunks/Heading.js +3 -3
- package/dist/chunks/component.js +1 -1
- package/dist/chunks/dom.js +50 -29
- package/dist/chunks/floating-ui.js +1 -1
- package/dist/chunks/locale.js +29 -12
- package/dist/chunks/{useReferenceElement.js → manager.js} +114 -114
- package/dist/chunks/resources6.js +2 -0
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFocusTrap.js +70 -28
- package/dist/chunks/useForm.js +225 -44
- package/dist/chunks/useFormTrigger.js +25 -0
- package/dist/chunks/{sortableComponent.js → useSortable.js} +70 -44
- package/dist/chunks/utils.js +6 -6
- package/dist/chunks/utils3.js +18 -3
- package/dist/components/calcite-accordion-item/customElement.d.ts +6 -6
- package/dist/components/calcite-action/customElement.d.ts +20 -12
- package/dist/components/calcite-action/customElement.js +10 -15
- package/dist/components/calcite-action-bar/customElement.d.ts +4 -4
- package/dist/components/calcite-action-bar/customElement.js +12 -6
- package/dist/components/calcite-action-group/customElement.d.ts +12 -6
- package/dist/components/calcite-action-group/customElement.js +2 -1
- package/dist/components/calcite-action-menu/customElement.d.ts +2 -2
- package/dist/components/calcite-action-pad/customElement.d.ts +3 -3
- package/dist/components/calcite-action-pad/customElement.js +12 -7
- package/dist/components/calcite-alert/customElement.d.ts +2 -2
- package/dist/components/calcite-alert/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.d.ts +16 -13
- package/dist/components/calcite-autocomplete/customElement.js +21 -32
- package/dist/components/calcite-autocomplete-item/customElement.d.ts +6 -0
- package/dist/components/calcite-autocomplete-item/customElement.js +9 -4
- package/dist/components/calcite-block/customElement.d.ts +11 -7
- package/dist/components/calcite-block/customElement.js +1 -1
- package/dist/components/calcite-block-group/customElement.d.ts +1 -1
- package/dist/components/calcite-block-group/customElement.js +4 -11
- package/dist/components/calcite-block-group/interfaces.d.ts +2 -6
- package/dist/components/calcite-block-section/customElement.d.ts +1 -1
- package/dist/components/calcite-button/customElement.d.ts +6 -6
- package/dist/components/calcite-button/customElement.js +10 -22
- package/dist/components/calcite-card/customElement.d.ts +11 -5
- package/dist/components/calcite-card/customElement.js +5 -3
- package/dist/components/calcite-card-group/customElement.d.ts +9 -3
- package/dist/components/calcite-card-group/customElement.js +11 -1
- package/dist/components/calcite-carousel/customElement.d.ts +8 -2
- package/dist/components/calcite-carousel/customElement.js +11 -8
- package/dist/components/calcite-carousel/interfaces.d.ts +3 -1
- package/dist/components/calcite-checkbox/customElement.d.ts +4 -5
- package/dist/components/calcite-checkbox/customElement.js +2 -15
- package/dist/components/calcite-chip/customElement.d.ts +2 -2
- package/dist/components/calcite-chip/customElement.js +1 -1
- package/dist/components/calcite-chip-group/customElement.d.ts +1 -1
- package/dist/components/calcite-color-picker/customElement.d.ts +2 -2
- package/dist/components/calcite-color-picker/customElement.js +2 -2
- package/dist/components/calcite-color-picker-hex-input/customElement.d.ts +1 -1
- package/dist/components/calcite-color-picker-hex-input/customElement.js +1 -1
- package/dist/components/calcite-color-picker-swatch/customElement.d.ts +1 -1
- package/dist/components/calcite-combobox/customElement.d.ts +5 -5
- package/dist/components/calcite-combobox/customElement.js +57 -69
- package/dist/components/calcite-combobox/index.js +2 -1
- package/dist/components/calcite-combobox-item/customElement.d.ts +1 -1
- package/dist/components/calcite-combobox-item/customElement.js +1 -1
- package/dist/components/calcite-date-picker/customElement.d.ts +1 -1
- package/dist/components/calcite-date-picker/customElement.js +4 -14
- package/dist/components/calcite-date-picker-day/customElement.d.ts +1 -1
- package/dist/components/calcite-date-picker-day/customElement.js +1 -1
- package/dist/components/calcite-date-picker-month/customElement.js +2 -2
- package/dist/components/calcite-date-picker-month-header/customElement.js +1 -1
- package/dist/components/calcite-dialog/customElement.d.ts +7 -5
- package/dist/components/calcite-dialog/customElement.js +4 -2
- package/dist/components/calcite-dropdown/customElement.d.ts +15 -5
- package/dist/components/calcite-dropdown/customElement.js +166 -91
- package/dist/components/calcite-dropdown-item/customElement.d.ts +2 -2
- package/dist/components/calcite-dropdown-item/customElement.js +14 -32
- package/dist/components/calcite-fab/customElement.d.ts +1 -1
- package/dist/components/calcite-fab/customElement.js +2 -2
- package/dist/components/calcite-filter/customElement.d.ts +1 -1
- package/dist/components/calcite-flow/customElement.d.ts +1 -1
- package/dist/components/calcite-flow-item/customElement.d.ts +8 -5
- package/dist/components/calcite-flow-item/customElement.js +4 -2
- package/dist/components/calcite-focus-trap/customElement.d.ts +46 -0
- package/dist/components/calcite-focus-trap/customElement.js +56 -0
- package/dist/components/calcite-focus-trap/index.d.ts +1 -0
- package/dist/components/calcite-focus-trap/index.js +1 -0
- package/dist/components/calcite-graph/customElement.js +1 -1
- package/dist/components/calcite-handle/customElement.d.ts +1 -1
- package/dist/components/calcite-icon/customElement.d.ts +1 -1
- package/dist/components/calcite-inline-editable/customElement.d.ts +2 -2
- package/dist/components/calcite-inline-editable/customElement.js +1 -1
- package/dist/components/calcite-input/customElement.d.ts +17 -18
- package/dist/components/calcite-input/customElement.js +26 -49
- package/dist/components/calcite-input/index.js +1 -0
- package/dist/components/calcite-input-date-picker/customElement.d.ts +6 -7
- package/dist/components/calcite-input-date-picker/customElement.js +67 -76
- package/dist/components/calcite-input-message/customElement.d.ts +1 -1
- package/dist/components/calcite-input-number/customElement.d.ts +13 -14
- package/dist/components/calcite-input-number/customElement.js +22 -48
- package/dist/components/calcite-input-number/index.js +1 -0
- package/dist/components/calcite-input-text/customElement.d.ts +11 -12
- package/dist/components/calcite-input-text/customElement.js +6 -18
- package/dist/components/calcite-input-text/index.js +1 -0
- package/dist/components/calcite-input-time-picker/customElement.d.ts +6 -7
- package/dist/components/calcite-input-time-picker/customElement.js +11 -23
- package/dist/components/calcite-input-time-zone/customElement.d.ts +5 -6
- package/dist/components/calcite-input-time-zone/customElement.js +21 -19
- package/dist/components/calcite-label/customElement.js +1 -1
- package/dist/components/calcite-link/customElement.d.ts +9 -9
- package/dist/components/calcite-link/customElement.js +28 -23
- package/dist/components/calcite-list/customElement.d.ts +1 -1
- package/dist/components/calcite-list/customElement.js +18 -15
- package/dist/components/calcite-list/interfaces.d.ts +2 -6
- package/dist/components/calcite-list-item/customElement.d.ts +2 -2
- package/dist/components/calcite-list-item/customElement.js +7 -4
- package/dist/components/calcite-list-item-group/customElement.js +6 -0
- package/dist/components/calcite-loader/customElement.d.ts +1 -1
- package/dist/components/calcite-menu/customElement.d.ts +1 -1
- package/dist/components/calcite-menu/customElement.js +1 -1
- package/dist/components/calcite-menu-item/customElement.d.ts +3 -3
- package/dist/components/calcite-menu-item/customElement.js +1 -1
- package/dist/components/calcite-meter/customElement.js +4 -4
- package/dist/components/calcite-navigation/customElement.d.ts +9 -2
- package/dist/components/calcite-navigation/customElement.js +56 -3
- package/dist/components/calcite-navigation-logo/customElement.d.ts +3 -3
- package/dist/components/calcite-navigation-logo/customElement.js +4 -3
- package/dist/components/calcite-navigation-user/customElement.d.ts +2 -2
- package/dist/components/calcite-navigation-user/customElement.js +11 -6
- package/dist/components/calcite-notice/customElement.d.ts +3 -3
- package/dist/components/calcite-notice/customElement.js +1 -1
- package/dist/components/calcite-pagination/customElement.d.ts +1 -1
- package/dist/components/calcite-pagination/customElement.js +1 -1
- package/dist/components/calcite-panel/customElement.d.ts +7 -5
- package/dist/components/calcite-panel/customElement.js +20 -8
- package/dist/components/calcite-popover/customElement.d.ts +2 -2
- package/dist/components/calcite-popover/customElement.js +3 -2
- package/dist/components/calcite-radio-button/customElement.d.ts +30 -2
- package/dist/components/calcite-radio-button/customElement.js +12 -19
- package/dist/components/calcite-radio-button-group/customElement.d.ts +1 -1
- package/dist/components/calcite-radio-button-group/customElement.js +20 -1
- package/dist/components/calcite-rating/customElement.d.ts +3 -4
- package/dist/components/calcite-rating/customElement.js +12 -18
- package/dist/components/calcite-segmented-control/customElement.d.ts +3 -4
- package/dist/components/calcite-segmented-control/customElement.js +8 -19
- package/dist/components/calcite-segmented-control-item/customElement.d.ts +0 -1
- package/dist/components/calcite-segmented-control-item/customElement.js +1 -1
- package/dist/components/calcite-select/customElement.d.ts +3 -4
- package/dist/components/calcite-select/customElement.js +9 -20
- package/dist/components/calcite-sheet/customElement.d.ts +3 -3
- package/dist/components/calcite-sheet/customElement.js +3 -7
- package/dist/components/calcite-shell-panel/customElement.d.ts +4 -4
- package/dist/components/calcite-shell-panel/customElement.js +59 -30
- package/dist/components/calcite-slider/customElement.d.ts +3 -4
- package/dist/components/calcite-slider/customElement.js +12 -22
- package/dist/components/calcite-sort-handle/customElement.d.ts +4 -4
- package/dist/components/calcite-sort-handle/customElement.js +44 -17
- package/dist/components/calcite-sortable-list/customElement.d.ts +1 -1
- package/dist/components/calcite-sortable-list/customElement.js +3 -3
- package/dist/components/calcite-split-button/customElement.d.ts +8 -8
- package/dist/components/calcite-stepper/customElement.d.ts +2 -2
- package/dist/components/calcite-stepper/customElement.js +29 -42
- package/dist/components/calcite-stepper-item/customElement.d.ts +1 -1
- package/dist/components/calcite-stepper-item/customElement.js +2 -8
- package/dist/components/calcite-swatch/customElement.d.ts +1 -1
- package/dist/components/calcite-switch/customElement.d.ts +4 -4
- package/dist/components/calcite-switch/customElement.js +9 -8
- package/dist/components/calcite-tab/customElement.d.ts +1 -1
- package/dist/components/calcite-tab/customElement.js +1 -1
- package/dist/components/calcite-tab-nav/customElement.js +1 -1
- package/dist/components/calcite-tab-title/customElement.js +1 -1
- package/dist/components/calcite-table/customElement.js +1 -1
- package/dist/components/calcite-table-cell/customElement.d.ts +2 -2
- package/dist/components/calcite-table-header/customElement.d.ts +2 -2
- package/dist/components/calcite-table-row/customElement.d.ts +1 -1
- package/dist/components/calcite-tabs/customElement.js +2 -1
- package/dist/components/calcite-text-area/customElement.d.ts +13 -14
- package/dist/components/calcite-text-area/customElement.js +32 -37
- package/dist/components/calcite-tile/customElement.d.ts +1 -1
- package/dist/components/calcite-time-picker/customElement.d.ts +1 -1
- package/dist/components/calcite-time-picker/customElement.js +2 -2
- package/dist/components/calcite-tooltip/customElement.d.ts +15 -2
- package/dist/components/calcite-tooltip/customElement.js +16 -8
- package/dist/components/calcite-tree/customElement.js +1 -1
- package/dist/components/calcite-tree-item/customElement.js +2 -3
- package/dist/controllers/useSortable.d.ts +7 -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/translations.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/index.d.ts +10 -0
- package/dist/loader.js +27 -26
- package/dist/types/lumina.d.ts +16 -10
- package/dist/types/preact.d.ts +17 -10
- package/dist/types/react.d.ts +18 -10
- package/dist/types/stencil.d.ts +16 -10
- package/package.json +22 -23
- package/dist/cdn/24BVOJIY.js +0 -2
- package/dist/cdn/3O7NXGXJ.js +0 -3
- package/dist/cdn/43SP7K3P.js +0 -2
- package/dist/cdn/45Z5R6GR.js +0 -2
- package/dist/cdn/47RTCYTX.js +0 -2
- package/dist/cdn/4AQ3DQDN.js +0 -2
- package/dist/cdn/4DJKUEBQ.js +0 -2
- package/dist/cdn/4IBKGKIH.js +0 -2
- package/dist/cdn/4JVVYRDW.js +0 -2
- package/dist/cdn/4U633XVG.js +0 -2
- package/dist/cdn/55GOZN42.js +0 -2
- package/dist/cdn/575ZYV35.js +0 -2
- package/dist/cdn/5LUEFKD3.js +0 -2
- package/dist/cdn/5RDU2ZNH.js +0 -2
- package/dist/cdn/6OKASMD7.js +0 -2
- package/dist/cdn/7ECYZZBW.js +0 -2
- package/dist/cdn/7UOYXJ3K.js +0 -2
- package/dist/cdn/A6XPQQWN.js +0 -2
- package/dist/cdn/ANQRSTGE.js +0 -2
- package/dist/cdn/BDQCESE7.js +0 -2
- package/dist/cdn/CKMZY3H7.js +0 -2
- package/dist/cdn/DRQCOAQ4.js +0 -2
- package/dist/cdn/DTUD5FAT.js +0 -2
- package/dist/cdn/EQZPTVS3.js +0 -2
- package/dist/cdn/ESATITDD.js +0 -2
- package/dist/cdn/ETIO6SPJ.js +0 -2
- package/dist/cdn/EY7FPNVS.js +0 -2
- package/dist/cdn/FIEDEHAP.js +0 -2
- package/dist/cdn/FZ6ZUHKQ.js +0 -2
- package/dist/cdn/GH34TDLL.js +0 -2
- package/dist/cdn/HG2EYXWI.js +0 -2
- package/dist/cdn/I5G3H4D4.js +0 -2
- package/dist/cdn/IBQYZCFQ.js +0 -2
- package/dist/cdn/IQ4VNR4Q.js +0 -2
- package/dist/cdn/J2OGE3DI.js +0 -2
- package/dist/cdn/JPWQ44GC.js +0 -2
- package/dist/cdn/JRF656V5.js +0 -2
- package/dist/cdn/K2H2TINH.js +0 -2
- package/dist/cdn/KDZRPYFR.js +0 -2
- package/dist/cdn/KHIMNKVO.js +0 -2
- package/dist/cdn/KMOFSKZF.js +0 -2
- package/dist/cdn/KQNOWW4C.js +0 -2
- package/dist/cdn/KYKC2CK2.js +0 -2
- package/dist/cdn/L5LBH4FP.js +0 -2
- package/dist/cdn/LKRLVAVK.js +0 -2
- package/dist/cdn/M6MHKAA5.js +0 -2
- package/dist/cdn/MMEADS6E.js +0 -2
- package/dist/cdn/NGXAYCAR.js +0 -2
- package/dist/cdn/NVHH3XZJ.js +0 -2
- package/dist/cdn/NVSO6GLT.js +0 -2
- package/dist/cdn/NY7A5LKZ.js +0 -2
- package/dist/cdn/OLYLT2L5.js +0 -2
- package/dist/cdn/OXCJDMGQ.js +0 -2
- package/dist/cdn/P4JFMLKY.js +0 -2
- package/dist/cdn/PCTQTX5N.js +0 -2
- package/dist/cdn/PHGT3YNE.js +0 -2
- package/dist/cdn/QR4JRFEP.js +0 -4
- package/dist/cdn/QWALXRY6.js +0 -2
- package/dist/cdn/RCUNETDY.js +0 -2
- package/dist/cdn/SAQAAU52.js +0 -2
- package/dist/cdn/SG24GAXY.js +0 -2
- package/dist/cdn/SIMNCT4V.js +0 -2
- package/dist/cdn/SJSCENKK.js +0 -2
- package/dist/cdn/SLVFP6JA.js +0 -2
- package/dist/cdn/TMOOTRK4.js +0 -2
- package/dist/cdn/TXYWJHYI.js +0 -2
- package/dist/cdn/UHQ454NG.js +0 -2
- package/dist/cdn/UTQKB5CS.js +0 -2
- package/dist/cdn/V2EVNXUV.js +0 -2
- package/dist/cdn/WITGQRKF.js +0 -2
- package/dist/cdn/WJXZ7BPV.js +0 -2
- package/dist/cdn/WM4NZNNA.js +0 -2
- package/dist/cdn/YANXY6FO.js +0 -2
- package/dist/cdn/YMSZKTCN.js +0 -2
- package/dist/cdn/YYDYHAP7.js +0 -2
- package/dist/cdn/ZEASFJJQ.js +0 -2
- package/dist/cdn/ZGCRVGEK.js +0 -2
- package/dist/cdn/ZPZI63EH.js +0 -3
- package/dist/cdn/ZQLGBHLZ.js +0 -2
- package/dist/cdn/ZTV4V5SF.js +0 -2
- package/dist/chunks/form.js +0 -268
- package/dist/chunks/input.js +0 -40
- package/dist/controllers/useForm.d.ts +0 -3
- package/dist/utils/form.d.ts +0 -3
- package/dist/utils/sortableComponent.d.ts +0 -7
|
@@ -23,6 +23,7 @@ function defaultSetReturnFocus(hostEl, el) {
|
|
|
23
23
|
function createFocusTrapOptions(hostEl, options) {
|
|
24
24
|
const fallbackFocus = options?.fallbackFocus || hostEl;
|
|
25
25
|
const clickOutsideDeactivates = options?.clickOutsideDeactivates ?? true;
|
|
26
|
+
let abortController;
|
|
26
27
|
return {
|
|
27
28
|
fallbackFocus,
|
|
28
29
|
...options,
|
|
@@ -36,6 +37,30 @@ function createFocusTrapOptions(hostEl, options) {
|
|
|
36
37
|
}
|
|
37
38
|
return typeof clickOutsideDeactivates === "function" ? clickOutsideDeactivates(event) : clickOutsideDeactivates;
|
|
38
39
|
},
|
|
40
|
+
onActivate: (params) => {
|
|
41
|
+
if (options?.escapeDeactivates) {
|
|
42
|
+
abortController = new AbortController();
|
|
43
|
+
hostEl.addEventListener(
|
|
44
|
+
"keydown",
|
|
45
|
+
(event) => {
|
|
46
|
+
if (event.key === "Escape") {
|
|
47
|
+
const escapeDeactivates = options?.escapeDeactivates;
|
|
48
|
+
const deactivate = typeof escapeDeactivates === "function" ? escapeDeactivates(event) : escapeDeactivates ?? true;
|
|
49
|
+
if (deactivate) {
|
|
50
|
+
params.trap.deactivate();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{ signal: abortController.signal }
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
options?.onActivate?.(params);
|
|
58
|
+
},
|
|
59
|
+
onDeactivate: (params) => {
|
|
60
|
+
abortController?.abort();
|
|
61
|
+
abortController = void 0;
|
|
62
|
+
options?.onDeactivate?.(params);
|
|
63
|
+
},
|
|
39
64
|
onPostDeactivate: () => {
|
|
40
65
|
outsideClickDeactivated.delete(hostEl);
|
|
41
66
|
},
|
|
@@ -45,27 +70,56 @@ function createFocusTrapOptions(hostEl, options) {
|
|
|
45
70
|
}
|
|
46
71
|
};
|
|
47
72
|
}
|
|
48
|
-
const useFocusTrap = (options) => {
|
|
73
|
+
const useFocusTrap = (options = {}) => {
|
|
49
74
|
return makeGenericController((component, controller) => {
|
|
50
75
|
let focusTrap;
|
|
51
76
|
let focusTrapEl;
|
|
52
77
|
let effectiveContainers;
|
|
78
|
+
let requestedActive = false;
|
|
53
79
|
const internalFocusTrapOptions = options.focusTrapOptions;
|
|
80
|
+
const isTriggerActive = () => options.triggerProp ? Boolean(component[options.triggerProp]) : true;
|
|
81
|
+
const shouldAutoActivate = () => options.triggerProp ? isTriggerActive() : requestedActive;
|
|
82
|
+
const canActivateTrap = () => typeof component.focusTrapDisabledOverride === "function" ? !component.focusTrapDisabledOverride() : !component.focusTrapDisabled;
|
|
83
|
+
const activateTrap = () => {
|
|
84
|
+
const targetEl = focusTrapEl || component.el;
|
|
85
|
+
if (!targetEl.isConnected) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!focusTrap) {
|
|
89
|
+
effectiveContainers ||= getEffectiveContainerElements(targetEl, component);
|
|
90
|
+
focusTrap = createFocusTrap(
|
|
91
|
+
effectiveContainers,
|
|
92
|
+
createFocusTrapOptions(targetEl, {
|
|
93
|
+
...internalFocusTrapOptions,
|
|
94
|
+
...component.focusTrapOptions
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
if (canActivateTrap()) {
|
|
99
|
+
focusTrap.activate();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const deactivateTrap = () => {
|
|
103
|
+
focusTrap?.deactivate();
|
|
104
|
+
};
|
|
54
105
|
controller.onConnected(() => {
|
|
55
|
-
if (
|
|
56
|
-
|
|
106
|
+
if (focusTrap && shouldAutoActivate()) {
|
|
107
|
+
activateTrap();
|
|
57
108
|
}
|
|
58
109
|
});
|
|
59
110
|
controller.onUpdate((changes) => {
|
|
60
|
-
if (component.hasUpdated
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
111
|
+
if (!component.hasUpdated || !changes.has("focusTrapDisabled")) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
if (component.focusTrapDisabled || !isTriggerActive()) {
|
|
115
|
+
deactivateTrap();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (shouldAutoActivate()) {
|
|
119
|
+
activateTrap();
|
|
66
120
|
}
|
|
67
121
|
});
|
|
68
|
-
controller.onDisconnected(() =>
|
|
122
|
+
controller.onDisconnected(() => deactivateTrap());
|
|
69
123
|
const utils = {
|
|
70
124
|
get _instance() {
|
|
71
125
|
if (process.env.NODE_ENV === "test") {
|
|
@@ -74,25 +128,13 @@ const useFocusTrap = (options) => {
|
|
|
74
128
|
return void 0;
|
|
75
129
|
},
|
|
76
130
|
activate: () => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
focusTrap = createFocusTrap(
|
|
84
|
-
effectiveContainers,
|
|
85
|
-
createFocusTrapOptions(targetEl, {
|
|
86
|
-
...internalFocusTrapOptions,
|
|
87
|
-
...component.focusTrapOptions
|
|
88
|
-
})
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
if (typeof component.focusTrapDisabledOverride === "function" ? !component.focusTrapDisabledOverride() : !component.focusTrapDisabled) {
|
|
92
|
-
focusTrap.activate();
|
|
93
|
-
}
|
|
131
|
+
requestedActive = true;
|
|
132
|
+
activateTrap();
|
|
133
|
+
},
|
|
134
|
+
deactivate: () => {
|
|
135
|
+
requestedActive = false;
|
|
136
|
+
deactivateTrap();
|
|
94
137
|
},
|
|
95
|
-
deactivate: () => focusTrap?.deactivate(),
|
|
96
138
|
overrideFocusTrapEl: (el) => {
|
|
97
139
|
if (focusTrap) {
|
|
98
140
|
throw new Error("Focus trap already created");
|
package/dist/chunks/useForm.js
CHANGED
|
@@ -1,7 +1,115 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { makeGenericController } from "@arcgis/lumina/controllers";
|
|
2
|
+
import { makeGenericController, bypassReadOnly } from "@arcgis/lumina/controllers";
|
|
3
3
|
import { uncapitalize, kebabToPascal } from "@arcgis/toolkit/string";
|
|
4
|
-
import {
|
|
4
|
+
import { r as isCalciteFocusable } from "./dom.js";
|
|
5
|
+
import "lit";
|
|
6
|
+
const minMaxStepTypes = ["date", "datetime-local", "month", "number", "range", "time", "week"];
|
|
7
|
+
const patternTypes = ["email", "password", "search", "tel", "text", "url"];
|
|
8
|
+
const minMaxLengthTypes = ["email", "password", "search", "tel", "text", "textarea", "url"];
|
|
9
|
+
function updateConstraintValidation(inputComponent, input, propName, matchesType) {
|
|
10
|
+
const attributeName = propName.toLowerCase();
|
|
11
|
+
const value = inputComponent[propName];
|
|
12
|
+
if (matchesType && value != null) {
|
|
13
|
+
input.setAttribute(attributeName, `${value}`);
|
|
14
|
+
} else {
|
|
15
|
+
input.removeAttribute(attributeName);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function syncInputDelegate(type, inputComponent, input) {
|
|
19
|
+
input.type = type;
|
|
20
|
+
const isMinMaxStepType = minMaxStepTypes.includes(type);
|
|
21
|
+
const numericInputComponent = inputComponent;
|
|
22
|
+
updateConstraintValidation(numericInputComponent, input, "min", isMinMaxStepType);
|
|
23
|
+
updateConstraintValidation(numericInputComponent, input, "max", isMinMaxStepType);
|
|
24
|
+
updateConstraintValidation(numericInputComponent, input, "step", isMinMaxStepType);
|
|
25
|
+
const isMinMaxLengthType = minMaxLengthTypes.includes(type);
|
|
26
|
+
const textualInputComponent = inputComponent;
|
|
27
|
+
updateConstraintValidation(textualInputComponent, input, "minLength", isMinMaxLengthType);
|
|
28
|
+
updateConstraintValidation(textualInputComponent, input, "maxLength", isMinMaxLengthType);
|
|
29
|
+
const isPatternType = patternTypes.includes(type);
|
|
30
|
+
updateConstraintValidation(textualInputComponent, input, "pattern", isPatternType);
|
|
31
|
+
}
|
|
32
|
+
function isSupportedType(type) {
|
|
33
|
+
const effectiveType = type === "textarea" ? "text" : type;
|
|
34
|
+
return minMaxStepTypes.includes(effectiveType) || patternTypes.includes(effectiveType) || minMaxLengthTypes.includes(effectiveType);
|
|
35
|
+
}
|
|
36
|
+
const joinableValueTypes = ["text", "email", "search", "hidden", "tel", "url"];
|
|
37
|
+
const allValid = Object.freeze({ validity: {}, validationMessage: "" });
|
|
38
|
+
function validate({
|
|
39
|
+
component,
|
|
40
|
+
input,
|
|
41
|
+
value
|
|
42
|
+
}) {
|
|
43
|
+
if (!Array.isArray(value)) {
|
|
44
|
+
if (component && input.type === "radio") {
|
|
45
|
+
let group = component.elementInternals.form?.elements[component.name];
|
|
46
|
+
if (group?.length > 0) {
|
|
47
|
+
group = Array.from(group).filter(
|
|
48
|
+
(element) => element.tagName === component.el.tagName
|
|
49
|
+
);
|
|
50
|
+
const isRequired = group.some((radioTypeElement) => radioTypeElement.required);
|
|
51
|
+
const isChecked = group.some((radioTypeElement) => radioTypeElement.checked);
|
|
52
|
+
const others = group.filter((radioTypeElement) => radioTypeElement !== component.el);
|
|
53
|
+
const valueMissing = isRequired && !isChecked;
|
|
54
|
+
input.required = !!valueMissing;
|
|
55
|
+
const validity = getValidityFlags(input.validity);
|
|
56
|
+
const validationMessage = input.validationMessage;
|
|
57
|
+
if (others?.length > 0) {
|
|
58
|
+
others.forEach((other) => {
|
|
59
|
+
if (valueMissing !== other.validity?.valueMissing && other.setValidity) {
|
|
60
|
+
other.setValidity(validity, validationMessage);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (validateValue(input, value)) {
|
|
67
|
+
return allValid;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
validity: getValidityFlags(input.validity),
|
|
71
|
+
validationMessage: input.validationMessage
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (joinableValueTypes.includes(input.type)) {
|
|
75
|
+
if (validateValue(input, value.join(","))) {
|
|
76
|
+
return allValid;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
validity: getValidityFlags(input.validity),
|
|
80
|
+
validationMessage: input.validationMessage
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const mergedValidity = {};
|
|
84
|
+
const validationMessages = [];
|
|
85
|
+
for (const item of value) {
|
|
86
|
+
if (validateValue(input, item)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
Object.assign(mergedValidity, getValidityFlags(input.validity));
|
|
90
|
+
if (input.validationMessage) {
|
|
91
|
+
validationMessages.push(input.validationMessage);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
validity: mergedValidity,
|
|
96
|
+
validationMessage: validationMessages.join("; ")
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function validateValue(inputDelegate, valueToValidate) {
|
|
100
|
+
inputDelegate.value = // file will throw if non-empty string is provided
|
|
101
|
+
inputDelegate.type === "file" || valueToValidate == null ? "" : String(valueToValidate);
|
|
102
|
+
return inputDelegate.validity.valid;
|
|
103
|
+
}
|
|
104
|
+
function getValidityFlags(validityState) {
|
|
105
|
+
const validityFlags = {};
|
|
106
|
+
for (const key in validityState) {
|
|
107
|
+
if (key !== "valid" && validityState[key]) {
|
|
108
|
+
validityFlags[key] = true;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return validityFlags;
|
|
112
|
+
}
|
|
5
113
|
const componentsWithInputEvent = [
|
|
6
114
|
"calcite-input",
|
|
7
115
|
"calcite-input-number",
|
|
@@ -12,6 +120,9 @@ function getClearValidationEventName(componentTag) {
|
|
|
12
120
|
const componentTagCamelCase = uncapitalize(kebabToPascal(componentTag));
|
|
13
121
|
return `${componentTagCamelCase}${componentsWithInputEvent.includes(componentTag) ? "Input" : "Change"}`;
|
|
14
122
|
}
|
|
123
|
+
function isFormComponentEl(el) {
|
|
124
|
+
return "form" in el && "name" in el && isCalciteFocusable(el);
|
|
125
|
+
}
|
|
15
126
|
function displayValidationMessage(component, { status, message, icon }) {
|
|
16
127
|
if ("status" in component) {
|
|
17
128
|
component.status = status;
|
|
@@ -23,9 +134,21 @@ function displayValidationMessage(component, { status, message, icon }) {
|
|
|
23
134
|
component.validationMessage = message;
|
|
24
135
|
}
|
|
25
136
|
}
|
|
137
|
+
function clearValidationMessage(component, validationMessage) {
|
|
138
|
+
if ("status" in component) {
|
|
139
|
+
component.status = "idle";
|
|
140
|
+
}
|
|
141
|
+
if ("validationIcon" in component && (!component.validationIcon || component.validationIcon === true)) {
|
|
142
|
+
component.validationIcon = false;
|
|
143
|
+
}
|
|
144
|
+
if ("validationMessage" in component && component.validationMessage === validationMessage) {
|
|
145
|
+
component.validationMessage = "";
|
|
146
|
+
}
|
|
147
|
+
}
|
|
26
148
|
function syncInternalInput(component, input) {
|
|
27
|
-
const { disabled, required } = component;
|
|
149
|
+
const { disabled, name, required } = component;
|
|
28
150
|
input.disabled = disabled;
|
|
151
|
+
input.name = name || "";
|
|
29
152
|
input.required = !!required;
|
|
30
153
|
if (isCheckable(component)) {
|
|
31
154
|
input.checked = component.checked;
|
|
@@ -39,18 +162,36 @@ function isCheckable(component) {
|
|
|
39
162
|
function isInputComponent(component, input) {
|
|
40
163
|
return component && isSupportedType(input.type);
|
|
41
164
|
}
|
|
165
|
+
function focusFirstInvalidFormElement(form) {
|
|
166
|
+
const formElements = Array.from(form.elements);
|
|
167
|
+
requestAnimationFrame(() => {
|
|
168
|
+
const invalidEls = formElements.filter(
|
|
169
|
+
(el) => el.matches("[status=invalid]") && isFormComponentEl(el)
|
|
170
|
+
);
|
|
171
|
+
for (const el of invalidEls) {
|
|
172
|
+
if (el.validationMessage) {
|
|
173
|
+
el.setFocus();
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
}
|
|
42
179
|
const useForm = (options) => {
|
|
43
180
|
return makeGenericController((component, controller) => {
|
|
44
|
-
let
|
|
45
|
-
let defaultCheckedDirty = false;
|
|
181
|
+
let customValidityMessage = "";
|
|
46
182
|
let inputDelegate;
|
|
47
183
|
let lastAssociatedForm = null;
|
|
48
|
-
|
|
184
|
+
let effectiveInputType = options.inputType;
|
|
185
|
+
if (effectiveInputType) {
|
|
49
186
|
inputDelegate = document.createElement("input");
|
|
50
|
-
inputDelegate.type = options.inputType;
|
|
51
187
|
}
|
|
52
188
|
function invalidFormHandler(event) {
|
|
53
|
-
event
|
|
189
|
+
if (event.defaultPrevented) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
const form = event.currentTarget;
|
|
194
|
+
focusFirstInvalidFormElement(form);
|
|
54
195
|
}
|
|
55
196
|
function onFormReset() {
|
|
56
197
|
if ("status" in component) {
|
|
@@ -63,11 +204,9 @@ const useForm = (options) => {
|
|
|
63
204
|
component.validationMessage = "";
|
|
64
205
|
}
|
|
65
206
|
if (isCheckable(component)) {
|
|
66
|
-
component.checked =
|
|
207
|
+
component.checked = component.defaultChecked;
|
|
67
208
|
}
|
|
68
|
-
component.value =
|
|
69
|
-
defaultValueDirty = false;
|
|
70
|
-
defaultCheckedDirty = false;
|
|
209
|
+
component.value = component.defaultValue;
|
|
71
210
|
}
|
|
72
211
|
component.listen("luminaFormResetCallback", () => {
|
|
73
212
|
onFormReset();
|
|
@@ -81,28 +220,34 @@ const useForm = (options) => {
|
|
|
81
220
|
lastAssociatedForm = form;
|
|
82
221
|
});
|
|
83
222
|
function handleInvalidInput() {
|
|
84
|
-
const
|
|
85
|
-
component.el.dispatchEvent(
|
|
86
|
-
// allows users to set custom validation messages
|
|
87
|
-
new CustomEvent("calciteInvalid", { bubbles: true, composed: true })
|
|
88
|
-
);
|
|
223
|
+
const validationMessage = customValidityMessage || inputDelegate?.validationMessage || "";
|
|
89
224
|
displayValidationMessage(component, {
|
|
90
|
-
message:
|
|
225
|
+
message: validationMessage,
|
|
91
226
|
icon: true,
|
|
92
227
|
status: "invalid"
|
|
93
228
|
});
|
|
229
|
+
component.el.dispatchEvent(
|
|
230
|
+
// allows users to set custom validation messages
|
|
231
|
+
new CustomEvent("calciteInvalid", { bubbles: true, composed: true })
|
|
232
|
+
);
|
|
94
233
|
const clearValidationEvent = getClearValidationEventName(component.el.tagName.toLowerCase());
|
|
95
234
|
component.listen(
|
|
96
235
|
clearValidationEvent,
|
|
97
236
|
() => {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
237
|
+
clearValidationMessage(component, validationMessage);
|
|
238
|
+
if (inputDelegate?.type === "radio") {
|
|
239
|
+
let group = component.elementInternals.form?.elements[component.name];
|
|
240
|
+
if (group?.length > 0) {
|
|
241
|
+
group = Array.from(group).filter(
|
|
242
|
+
(element) => element.tagName === component.el.tagName
|
|
243
|
+
);
|
|
244
|
+
const others = group.filter((radioTypeElement) => radioTypeElement !== component.el);
|
|
245
|
+
if (others?.length > 0) {
|
|
246
|
+
others.forEach((other) => {
|
|
247
|
+
clearValidationMessage(other);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
106
251
|
}
|
|
107
252
|
},
|
|
108
253
|
{ once: true }
|
|
@@ -115,51 +260,87 @@ const useForm = (options) => {
|
|
|
115
260
|
component.el.removeEventListener("invalid", handleInvalidInput);
|
|
116
261
|
});
|
|
117
262
|
controller.onUpdate((changes) => {
|
|
118
|
-
if (
|
|
119
|
-
defaultValueDirty = true;
|
|
263
|
+
if (!component.hasUpdated) {
|
|
120
264
|
component.defaultValue = component.value;
|
|
265
|
+
if (isCheckable(component)) {
|
|
266
|
+
component.defaultChecked = component.checked;
|
|
267
|
+
}
|
|
121
268
|
}
|
|
122
|
-
if (isCheckable(component) && changes.has("checked")
|
|
123
|
-
defaultCheckedDirty = true;
|
|
124
|
-
component.defaultChecked = component.checked;
|
|
125
|
-
}
|
|
126
|
-
if (changes.has("value") || isCheckable(component) && changes.has("checked")) {
|
|
269
|
+
if (changes.has("name") || changes.has("value") || isCheckable(component) && changes.has("checked")) {
|
|
127
270
|
component.elementInternals.setFormValue(getFormValue());
|
|
128
271
|
}
|
|
272
|
+
if (component.hasUpdated) {
|
|
273
|
+
updateValidity();
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
controller.onLoaded(() => updateValidity());
|
|
277
|
+
function updateValidity() {
|
|
278
|
+
const { disabled, elementInternals } = component;
|
|
279
|
+
if (disabled) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
let validity = {};
|
|
283
|
+
let validationMessage = "";
|
|
129
284
|
if (inputDelegate) {
|
|
130
|
-
inputDelegate.
|
|
285
|
+
inputDelegate.type = effectiveInputType;
|
|
131
286
|
syncInternalInput(component, inputDelegate);
|
|
132
|
-
inputDelegate
|
|
133
|
-
component.elementInternals.setValidity(inputDelegate.validity, inputDelegate.validationMessage);
|
|
134
|
-
if ("validity" in component) {
|
|
135
|
-
component.validity = component.elementInternals.validity;
|
|
136
|
-
}
|
|
287
|
+
({ validity, validationMessage } = validate({ component, input: inputDelegate, value: getComponentValue() }));
|
|
137
288
|
}
|
|
138
|
-
|
|
289
|
+
if (customValidityMessage) {
|
|
290
|
+
validity = { ...validity, customError: true };
|
|
291
|
+
validationMessage = customValidityMessage;
|
|
292
|
+
}
|
|
293
|
+
elementInternals.setValidity(validity, validationMessage);
|
|
294
|
+
if ("validity" in component) {
|
|
295
|
+
bypassReadOnly(() => {
|
|
296
|
+
component.validity = elementInternals.validity;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function getComponentValue() {
|
|
301
|
+
if (options.getValue) {
|
|
302
|
+
return options.getValue();
|
|
303
|
+
}
|
|
304
|
+
return component.value;
|
|
305
|
+
}
|
|
139
306
|
function getFormValue() {
|
|
140
|
-
|
|
307
|
+
const value = getComponentValue();
|
|
308
|
+
if (Array.isArray(value)) {
|
|
141
309
|
const formData = new FormData();
|
|
142
|
-
|
|
310
|
+
value.forEach((value2) => formData.append(component.name, value2));
|
|
143
311
|
return formData;
|
|
144
312
|
}
|
|
145
313
|
if (isCheckable(component)) {
|
|
146
314
|
if (component.checked) {
|
|
147
|
-
return
|
|
315
|
+
return value || "on";
|
|
148
316
|
}
|
|
149
317
|
return null;
|
|
150
318
|
}
|
|
151
|
-
return
|
|
319
|
+
return value;
|
|
152
320
|
}
|
|
153
321
|
return {
|
|
154
322
|
get active() {
|
|
155
323
|
return !!component.elementInternals.form;
|
|
156
324
|
},
|
|
325
|
+
overrideDefaultValue: (value) => {
|
|
326
|
+
component.defaultValue = value;
|
|
327
|
+
},
|
|
328
|
+
overrideInputType: (type) => {
|
|
329
|
+
effectiveInputType = type;
|
|
330
|
+
updateValidity();
|
|
331
|
+
},
|
|
157
332
|
requestSubmit: () => {
|
|
158
333
|
component.elementInternals.form?.requestSubmit();
|
|
334
|
+
},
|
|
335
|
+
setCustomValidity: (message) => {
|
|
336
|
+
customValidityMessage = message;
|
|
337
|
+
updateValidity();
|
|
159
338
|
}
|
|
160
339
|
};
|
|
161
340
|
});
|
|
162
341
|
};
|
|
163
342
|
export {
|
|
343
|
+
clearValidationMessage as c,
|
|
344
|
+
displayValidationMessage as d,
|
|
164
345
|
useForm as u
|
|
165
346
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { makeGenericController } from "@arcgis/lumina/controllers";
|
|
3
|
+
const useFormTrigger = (options) => makeGenericController((component) => {
|
|
4
|
+
function clickHandler(event) {
|
|
5
|
+
const { form } = component.elementInternals;
|
|
6
|
+
if (event.defaultPrevented || component.disabled || options?.disabled?.() || !form || component.type === "button") {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (component.type === "submit") {
|
|
10
|
+
form.requestSubmit();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
form.reset();
|
|
14
|
+
}
|
|
15
|
+
component.listen("luminaFormAssociatedCallback", ({ detail: [form] }) => {
|
|
16
|
+
if (form) {
|
|
17
|
+
component.el.addEventListener("click", clickHandler);
|
|
18
|
+
} else {
|
|
19
|
+
component.el.removeEventListener("click", clickHandler);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
useFormTrigger as u
|
|
25
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { makeGenericController } from "@arcgis/lumina/controllers";
|
|
2
3
|
import Sortable from "sortablejs";
|
|
3
4
|
const sortableComponentSet = /* @__PURE__ */ new Set();
|
|
4
5
|
const CSS = {
|
|
@@ -7,15 +8,17 @@ const CSS = {
|
|
|
7
8
|
dragClass: "calcite-sortable--drag",
|
|
8
9
|
fallbackClass: "calcite-sortable--fallback"
|
|
9
10
|
};
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
function onGlobalDragStart() {
|
|
12
|
+
Array.from(sortableComponentSet).forEach((component) => component.onGlobalDragStart());
|
|
13
|
+
}
|
|
14
|
+
function onGlobalDragEnd() {
|
|
15
|
+
Array.from(sortableComponentSet).forEach((component) => component.onGlobalDragEnd());
|
|
16
|
+
}
|
|
17
|
+
const globalDragState = { active: false };
|
|
18
|
+
function createSortable(component) {
|
|
16
19
|
const dataIdAttr = "id";
|
|
17
|
-
const { group, handleSelector: handle, dragSelector: draggable, sortDisabled } = component;
|
|
18
|
-
|
|
20
|
+
const { el, group, handleSelector: handle, dragSelector: draggable, sortDisabled } = component;
|
|
21
|
+
return Sortable.create(el, {
|
|
19
22
|
dataIdAttr,
|
|
20
23
|
swapThreshold: 0.5,
|
|
21
24
|
...CSS,
|
|
@@ -25,22 +28,26 @@ function connectSortableComponent(component) {
|
|
|
25
28
|
group: {
|
|
26
29
|
name: group,
|
|
27
30
|
...!!component.canPull && {
|
|
28
|
-
pull: (to, from, dragEl, { newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
pull: (to, from, dragEl, { newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) => {
|
|
32
|
+
return component.canPull({
|
|
33
|
+
toEl: to.el,
|
|
34
|
+
fromEl: from.el,
|
|
35
|
+
dragEl,
|
|
36
|
+
newIndex,
|
|
37
|
+
oldIndex
|
|
38
|
+
});
|
|
39
|
+
}
|
|
35
40
|
},
|
|
36
41
|
...!!component.canPut && {
|
|
37
|
-
put: (to, from, dragEl, { newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
put: (to, from, dragEl, { newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) => {
|
|
43
|
+
return component.canPut({
|
|
44
|
+
toEl: to.el,
|
|
45
|
+
fromEl: from.el,
|
|
46
|
+
dragEl,
|
|
47
|
+
newIndex,
|
|
48
|
+
oldIndex
|
|
49
|
+
});
|
|
50
|
+
}
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
},
|
|
@@ -53,12 +60,12 @@ function connectSortableComponent(component) {
|
|
|
53
60
|
handle,
|
|
54
61
|
filter: `${handle}[disabled]`,
|
|
55
62
|
onStart: ({ from: fromEl, item: dragEl, to: toEl, newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) => {
|
|
56
|
-
|
|
63
|
+
globalDragState.active = true;
|
|
57
64
|
onGlobalDragStart();
|
|
58
65
|
component.onDragStart({ fromEl, dragEl, toEl, newIndex, oldIndex });
|
|
59
66
|
},
|
|
60
67
|
onEnd: ({ from: fromEl, item: dragEl, to: toEl, newDraggableIndex: newIndex, oldDraggableIndex: oldIndex }) => {
|
|
61
|
-
|
|
68
|
+
globalDragState.active = false;
|
|
62
69
|
onGlobalDragEnd();
|
|
63
70
|
component.onDragEnd({ fromEl, dragEl, toEl, newIndex, oldIndex });
|
|
64
71
|
},
|
|
@@ -67,25 +74,44 @@ function connectSortableComponent(component) {
|
|
|
67
74
|
}
|
|
68
75
|
});
|
|
69
76
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
77
|
+
const useSortable = () => {
|
|
78
|
+
return makeGenericController((component, controller) => {
|
|
79
|
+
let sortable;
|
|
80
|
+
function dragActive(component2) {
|
|
81
|
+
return component2.dragEnabled && globalDragState.active;
|
|
82
|
+
}
|
|
83
|
+
function setUpSortable(component2) {
|
|
84
|
+
if (dragActive(component2)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
tearDownSortable(component2);
|
|
88
|
+
if (!component2.dragEnabled) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
sortableComponentSet.add(component2);
|
|
92
|
+
sortable = createSortable(component2);
|
|
93
|
+
}
|
|
94
|
+
function tearDownSortable(component2) {
|
|
95
|
+
if (dragActive(component2)) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
sortableComponentSet.delete(component2);
|
|
99
|
+
sortable?.destroy();
|
|
100
|
+
sortable = void 0;
|
|
101
|
+
}
|
|
102
|
+
controller.onConnected(() => {
|
|
103
|
+
setUpSortable(component);
|
|
104
|
+
});
|
|
105
|
+
controller.onDisconnected(() => {
|
|
106
|
+
tearDownSortable(component);
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
reset: () => {
|
|
110
|
+
setUpSortable(component);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
};
|
|
88
115
|
export {
|
|
89
|
-
|
|
90
|
-
disconnectSortableComponent as d
|
|
116
|
+
useSortable as u
|
|
91
117
|
};
|