@esri/calcite-components 5.1.0-next.24 → 5.1.0-next.25
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/{M2MLAGF4.js → 25Y7MBNX.js} +1 -1
- package/dist/cdn/{DDJ7R667.js → 27U37MLJ.js} +1 -1
- package/dist/cdn/{ADF5GJVT.js → 2WTHD37G.js} +1 -1
- package/dist/cdn/{WXC33DHR.js → 35B6PRMK.js} +1 -1
- package/dist/cdn/{FVUFPRTZ.js → 3BXVECSN.js} +1 -1
- package/dist/cdn/{ZB3IIOBU.js → 3FTNGX3W.js} +1 -1
- package/dist/cdn/{LFRK6P2D.js → 3HAUWY4Q.js} +1 -1
- package/dist/cdn/{V72AGXGP.js → 3NP3FX5G.js} +1 -1
- package/dist/cdn/{2VVXMMOX.js → 43ILV2UA.js} +1 -1
- package/dist/cdn/{6OOV6EIP.js → 4AFV2RDV.js} +1 -1
- package/dist/cdn/{H3YVYZPV.js → 4DU3OLQM.js} +1 -1
- package/dist/cdn/4H3E7NF7.js +2 -0
- package/dist/cdn/4WCAWC2W.js +2 -0
- package/dist/cdn/{335WNYZK.js → 4ZMOC4CA.js} +1 -1
- package/dist/cdn/577BFHQJ.js +2 -0
- package/dist/cdn/{HRNHJL7M.js → 5AAKQUGR.js} +1 -1
- package/dist/cdn/{Z62ZQOFN.js → 5IEEZRVX.js} +1 -1
- package/dist/cdn/{BMSVTVRT.js → 5KJHD3XL.js} +1 -1
- package/dist/cdn/{BH7HJNVQ.js → 5LB4QUHD.js} +1 -1
- package/dist/cdn/{WTIDWDIV.js → 5P6Y44BI.js} +1 -1
- package/dist/cdn/{YXD2TKPQ.js → 67337RAS.js} +1 -1
- package/dist/cdn/{MJ7VTT7G.js → 6IYXEF5Q.js} +1 -1
- package/dist/cdn/{KPANVE7Y.js → 6MTDJPI4.js} +1 -1
- package/dist/cdn/{W4EQNTRQ.js → 6WY3IAXV.js} +1 -1
- package/dist/cdn/{N4JJVMZE.js → 7OPX2QTM.js} +1 -1
- package/dist/cdn/7PN6GY3K.js +2 -0
- package/dist/cdn/{OQBDHV3I.js → 7QJOA44W.js} +1 -1
- package/dist/cdn/{K7JT7AJ3.js → 7Y4MKWU4.js} +1 -1
- package/dist/cdn/7YDSLCQ7.js +2 -0
- package/dist/cdn/{QXROGUXE.js → 7YOIWELC.js} +1 -1
- package/dist/cdn/{BQB3G5CU.js → A75HLUMG.js} +1 -1
- package/dist/cdn/{3MNKCPKM.js → A7LUSEVG.js} +1 -1
- package/dist/cdn/{AXUCCIRH.js → ACEIJ36E.js} +1 -1
- package/dist/cdn/AHBLLAP4.js +2 -0
- package/dist/cdn/{LKWEQBCD.js → ARPOHR4M.js} +1 -1
- package/dist/cdn/AVSZOCPG.js +2 -0
- package/dist/cdn/{BJUVF75X.js → BKNFQ6RA.js} +1 -1
- package/dist/cdn/{TU3TE2NA.js → CC3VIJ62.js} +1 -1
- package/dist/cdn/{S5B7YG37.js → CPPQU2JT.js} +1 -1
- package/dist/cdn/{VQUXTHQG.js → CQWCAFVA.js} +1 -1
- package/dist/cdn/{D7OBXZA4.js → CZ2SSTBU.js} +1 -1
- package/dist/cdn/{HRLMDN6T.js → D6PGZUKV.js} +1 -1
- package/dist/cdn/{JG6RAMMT.js → DBESGPPF.js} +1 -1
- package/dist/cdn/{O3H5TYI3.js → DRFU5YEH.js} +1 -1
- package/dist/cdn/{E34NNTQ5.js → DSDZWWPD.js} +1 -1
- package/dist/cdn/{ZRUMOR65.js → DVAPKNWQ.js} +1 -1
- package/dist/cdn/{7TMAJS7Y.js → DYKZAL43.js} +1 -1
- package/dist/cdn/{BR3PTYFV.js → E5HFZKEM.js} +1 -1
- package/dist/cdn/{LXABSKOX.js → ECJOMBVP.js} +1 -1
- package/dist/cdn/{TSARCS44.js → EEB5YOG6.js} +1 -1
- package/dist/cdn/{R2N7UDBR.js → EKX7UIUS.js} +1 -1
- package/dist/cdn/{QFY7DQSD.js → ETP5IHZB.js} +1 -1
- package/dist/cdn/{6WZT4UHB.js → EUJPGQH5.js} +1 -1
- package/dist/cdn/{LKD6P5YN.js → FIQ3J5SW.js} +1 -1
- package/dist/cdn/{UWCX25CF.js → FRQDF7EU.js} +1 -1
- package/dist/cdn/{AM3UGITY.js → FRZSW2QQ.js} +1 -1
- package/dist/cdn/{52BHEJXM.js → G2PYJN42.js} +1 -1
- package/dist/cdn/{DGJMVWH6.js → G4Y3MFJY.js} +1 -1
- package/dist/cdn/{FYQ7F5FG.js → GPERYR4P.js} +1 -1
- package/dist/cdn/{TBJYLOUU.js → GWTFOVIM.js} +1 -1
- package/dist/cdn/{VZ5HKHDG.js → H3SXJY5G.js} +1 -1
- package/dist/cdn/{QSN4H5ZF.js → HFCHUSF7.js} +1 -1
- package/dist/cdn/{6AYF7R5N.js → HNNL7IUM.js} +1 -1
- package/dist/cdn/{OONKEETK.js → HOUKB4AY.js} +1 -1
- package/dist/cdn/{EFNUNWOY.js → HW3LISFQ.js} +1 -1
- package/dist/cdn/{I5534LUG.js → I7D6CNIT.js} +1 -1
- package/dist/cdn/{L4AKVA6J.js → IDQKV7W4.js} +1 -1
- package/dist/cdn/{EKCEBAA2.js → IHMX6KWN.js} +1 -1
- package/dist/cdn/{VDGHE2H6.js → IPDJIOSM.js} +1 -1
- package/dist/cdn/{Y4PGFRFZ.js → IR3ORN34.js} +1 -1
- package/dist/cdn/{C2YUFRVH.js → J5O7CVDX.js} +1 -1
- package/dist/cdn/{4CZC7KQY.js → JP7WZFLP.js} +1 -1
- package/dist/cdn/{PM2IMGBS.js → K4GUJREQ.js} +1 -1
- package/dist/cdn/{6YQEO3TU.js → KBKEPXPT.js} +1 -1
- package/dist/cdn/{UHWKDOKY.js → KRNJK2SE.js} +1 -1
- package/dist/cdn/{GNFWEGWN.js → KTGTAI63.js} +1 -1
- package/dist/cdn/{EQZ2R35U.js → LF73E7K2.js} +1 -1
- package/dist/cdn/{SWXDM2ED.js → LZ64DG4B.js} +1 -1
- package/dist/cdn/{73OOTHVT.js → LZFMVYHL.js} +1 -1
- package/dist/cdn/{M4SJWE6C.js → LZSNPBAN.js} +1 -1
- package/dist/cdn/{KYAGNB4G.js → MLOCEBTE.js} +1 -1
- package/dist/cdn/{H6EU56Z7.js → MWK7IIV3.js} +1 -1
- package/dist/cdn/{2X4WQJ6V.js → NJ5EIGGU.js} +1 -1
- package/dist/cdn/{WZMSRH42.js → NJDJIG2C.js} +1 -1
- package/dist/cdn/{LC6TRGG7.js → NJYUPJQW.js} +1 -1
- package/dist/cdn/{RTZMUTWS.js → NLKSDE46.js} +1 -1
- package/dist/cdn/{BV3MTUEH.js → NMU35ESN.js} +1 -1
- package/dist/cdn/OMXJRVXR.js +2 -0
- package/dist/cdn/OR66TG26.js +2 -0
- package/dist/cdn/PLBFOPEP.js +2 -0
- package/dist/cdn/{4JXQHRCB.js → PPITNY7V.js} +1 -1
- package/dist/cdn/{TJDQBBDE.js → PS6F5KSO.js} +1 -1
- package/dist/cdn/PUCSPFSE.js +2 -0
- package/dist/cdn/{NHCHXBNQ.js → PX46XX3S.js} +1 -1
- package/dist/cdn/{NJLLWKXS.js → PYI2DQHX.js} +1 -1
- package/dist/cdn/QFZZIOMD.js +2 -0
- package/dist/cdn/{HTG4U6IG.js → QJRRZDAQ.js} +1 -1
- package/dist/cdn/{HZH4MIUY.js → QL5VWWKQ.js} +1 -1
- package/dist/cdn/{G5F3EKOD.js → QWHNQJ3U.js} +1 -1
- package/dist/cdn/{TWOG3N6D.js → RINCAIWE.js} +1 -1
- package/dist/cdn/{5FJMWVWT.js → RTOHMI5T.js} +1 -1
- package/dist/cdn/RYA4YDJB.js +2 -0
- package/dist/cdn/{AUNOHC7O.js → SJJYYNDU.js} +1 -1
- package/dist/cdn/SYPGTFWL.js +2 -0
- package/dist/cdn/{PH6LS2IK.js → T34YET4S.js} +1 -1
- package/dist/cdn/{MS5MFEFA.js → T5BNZ27P.js} +1 -1
- package/dist/cdn/{H5R56TSG.js → TJY5G272.js} +1 -1
- package/dist/cdn/{C2L2O5EQ.js → TQTCPELB.js} +1 -1
- package/dist/cdn/{U4DLHQJE.js → TWE5YMJV.js} +1 -1
- package/dist/cdn/{3HMTHRWV.js → TYJTHC4B.js} +1 -1
- package/dist/cdn/{EMOACECT.js → TZFYJMOS.js} +1 -1
- package/dist/cdn/{ZM7QKH4L.js → UBGOLRVO.js} +1 -1
- package/dist/cdn/UFYSR4SD.js +2 -0
- package/dist/cdn/{CU2QH5Q4.js → UNXBOQC4.js} +1 -1
- package/dist/cdn/{DV75YW7X.js → USEKAAH6.js} +1 -1
- package/dist/cdn/{RJDE3YGW.js → V2VWVKOI.js} +1 -1
- package/dist/cdn/{ZH7KRORX.js → V7AE4QVT.js} +1 -1
- package/dist/cdn/{QSTEMUD6.js → V7W7KW6Z.js} +1 -1
- package/dist/cdn/{6PNUIAH7.js → VXSL3ABN.js} +1 -1
- package/dist/cdn/{VMIQAKYU.js → W4SY6HSR.js} +1 -1
- package/dist/cdn/{IQG4N535.js → WDAT575U.js} +1 -1
- package/dist/cdn/{IOC4JWCG.js → WEBKTCHR.js} +1 -1
- package/dist/cdn/{4ASYQP4D.js → WFIL5VUG.js} +1 -1
- package/dist/cdn/{37J4QHCP.js → WPOYI7P3.js} +1 -1
- package/dist/cdn/{XCSZRXTK.js → WRUQJTTU.js} +1 -1
- package/dist/cdn/{WNICNNQU.js → X6VC7UA2.js} +1 -1
- package/dist/cdn/{BOSJ366C.js → XC246WT5.js} +1 -1
- package/dist/cdn/{TFVEPZC4.js → XGNORHI6.js} +1 -1
- package/dist/cdn/{PQ2XMBCR.js → XHHLBCKY.js} +1 -1
- package/dist/cdn/{SLJCJN7J.js → XJ43C7FS.js} +1 -1
- package/dist/cdn/{E76CXK6W.js → XOOKV5M5.js} +1 -1
- package/dist/cdn/{C6S2WP47.js → XTFX7SON.js} +1 -1
- package/dist/cdn/{MSZ64UC4.js → XYWLBGJE.js} +1 -1
- package/dist/cdn/{ZCRYCMYT.js → YEL53KZI.js} +1 -1
- package/dist/cdn/YNX3P2QU.js +2 -0
- package/dist/cdn/{2QIN5FHX.js → YTZXSPVU.js} +1 -1
- package/dist/cdn/{GEEEQOVM.js → YUTLGO5O.js} +1 -1
- package/dist/cdn/{DQSR27R7.js → Z2ORUZGB.js} +1 -1
- package/dist/cdn/{FSADANOP.js → Z7B56FPG.js} +1 -1
- package/dist/cdn/{JLHHQUJF.js → ZIAI6P6F.js} +1 -1
- package/dist/cdn/{WZYUE4T7.js → ZKJ3XVJ4.js} +1 -1
- package/dist/cdn/{ROEQAS3A.js → ZW4Z3M67.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/FloatingArrow.js +24 -0
- package/dist/chunks/dom.js +4 -4
- package/dist/chunks/{useReferenceElement.js → manager.js} +108 -108
- package/dist/chunks/runtime.js +4 -4
- package/dist/chunks/useFormTrigger.js +25 -0
- package/dist/chunks/{sortableComponent.js → useSortable.js} +67 -44
- package/dist/components/calcite-action/customElement.d.ts +4 -4
- package/dist/components/calcite-action/customElement.js +7 -13
- package/dist/components/calcite-action-bar/customElement.d.ts +3 -3
- package/dist/components/calcite-action-bar/customElement.js +3 -2
- package/dist/components/calcite-action-group/customElement.d.ts +4 -4
- package/dist/components/calcite-action-pad/customElement.d.ts +2 -2
- package/dist/components/calcite-action-pad/customElement.js +1 -1
- package/dist/components/calcite-autocomplete/customElement.d.ts +1 -2
- package/dist/components/calcite-autocomplete/customElement.js +11 -27
- package/dist/components/calcite-block-group/customElement.js +3 -3
- package/dist/components/calcite-block-group/interfaces.d.ts +2 -6
- package/dist/components/calcite-button/customElement.js +6 -16
- package/dist/components/calcite-dropdown/customElement.d.ts +12 -2
- package/dist/components/calcite-dropdown/customElement.js +29 -12
- package/dist/components/calcite-list/customElement.js +3 -3
- package/dist/components/calcite-list/interfaces.d.ts +2 -6
- package/dist/components/calcite-list-item/customElement.js +1 -1
- package/dist/components/calcite-meter/customElement.js +1 -1
- package/dist/components/calcite-popover/customElement.js +2 -1
- package/dist/components/calcite-radio-button/customElement.js +170 -2
- package/dist/components/calcite-slider/customElement.js +1 -1
- 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-tooltip/customElement.js +2 -1
- 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/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +4 -4
- 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 +2 -2
- package/dist/cdn/2AWRANF5.js +0 -2
- package/dist/cdn/2XJOX5RG.js +0 -2
- package/dist/cdn/4Q2SKZQE.js +0 -2
- package/dist/cdn/4Z4GUZI3.js +0 -2
- package/dist/cdn/5UMQFD62.js +0 -2
- package/dist/cdn/A7BG2XIR.js +0 -2
- package/dist/cdn/H5VS33TX.js +0 -2
- package/dist/cdn/MTMLYT66.js +0 -2
- package/dist/cdn/NYTQT63Y.js +0 -2
- package/dist/cdn/R4W63P53.js +0 -2
- package/dist/cdn/RJYIXMGE.js +0 -2
- package/dist/cdn/TN3KZSGU.js +0 -2
- package/dist/cdn/VLOV4VWX.js +0 -2
- package/dist/cdn/WJXZ7BPV.js +0 -2
- package/dist/cdn/YOCPNRH2.js +0 -2
- package/dist/chunks/form.js +0 -267
- package/dist/utils/sortableComponent.d.ts +0 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
-
import type { FlipPlacement, LogicalPlacement, OverlayPositioning } from "../../utils/floating-ui.js";
|
|
3
|
+
import type { FlipPlacement, LogicalPlacement, OverlayPositioning, ReferenceElement } from "../../utils/floating-ui.js";
|
|
4
4
|
import type { Scale, Width } from "../interfaces.js";
|
|
5
5
|
import type { DropdownItem } from "../calcite-dropdown-item/customElement.js";
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ import type { DropdownItem } from "../calcite-dropdown-item/customElement.js";
|
|
|
8
8
|
* @cssproperty [--calcite-dropdown-width] - Specifies the width of the component's wrapper.
|
|
9
9
|
* @cssproperty [--calcite-dropdown-background-color] - Specifies the component's background color.
|
|
10
10
|
* @slot - A slot for adding `calcite-dropdown-group` elements. Every `calcite-dropdown-item` must have a parent `calcite-dropdown-group`, even if the `groupTitle` property is not set.
|
|
11
|
-
* @slot [trigger] - A slot for the element that triggers the component.
|
|
11
|
+
* @slot [trigger] - [deprecated] Use `referenceElement` property instead. A slot for the element that triggers the component.
|
|
12
12
|
*/
|
|
13
13
|
export abstract class Dropdown extends LitElement {
|
|
14
14
|
/**
|
|
@@ -68,6 +68,16 @@ export abstract class Dropdown extends LitElement {
|
|
|
68
68
|
* @default "bottom-start"
|
|
69
69
|
*/
|
|
70
70
|
accessor placement: LogicalPlacement;
|
|
71
|
+
/**
|
|
72
|
+
* The `referenceElement` is used to position the component according to its `placement` value.
|
|
73
|
+
*
|
|
74
|
+
* Setting the value to an `HTMLElement` is preferred so the component does not need to query the DOM.
|
|
75
|
+
*
|
|
76
|
+
* However, a string `id` of the reference element can also be used.
|
|
77
|
+
*
|
|
78
|
+
* The component should not be placed within its own `referenceElement` to avoid unintended behavior.
|
|
79
|
+
*/
|
|
80
|
+
accessor referenceElement: ReferenceElement | string | null;
|
|
71
81
|
/**
|
|
72
82
|
* Specifies the size of the component.
|
|
73
83
|
*
|
|
@@ -13,6 +13,7 @@ import { g as getDimensionClass } from "../../chunks/dynamicClasses.js";
|
|
|
13
13
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
14
14
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
15
15
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
16
|
+
import { u as useReferenceElement, r as referenceElementManager } from "../../chunks/manager.js";
|
|
16
17
|
const SLOTS = {
|
|
17
18
|
trigger: "trigger"
|
|
18
19
|
};
|
|
@@ -22,9 +23,11 @@ const CSS = {
|
|
|
22
23
|
triggerContainer: "trigger-container"
|
|
23
24
|
};
|
|
24
25
|
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{display:inline-block}.wrapper{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.wrapper{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .wrapper{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.wrapper[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.wrapper:popover-open{display:block}.wrapper .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.content{max-height:45vh;width:auto;overflow-y:auto;overflow-x:hidden;inline-size:var(--calcite-dropdown-width, var(--calcite-internal-dropdown-width));background-color:var(--calcite-dropdown-background-color, var(--calcite-color-foreground-1))}.trigger-container{position:relative;display:flex;height:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}.width-s{--calcite-internal-dropdown-width: 12rem}.width-m{--calcite-internal-dropdown-width: 14rem}.width-l{--calcite-internal-dropdown-width: 16rem}@media(forced-colors:active){:host([open]) .wrapper{border:var(--calcite-border-width-sm) solid canvasText}}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;
|
|
26
|
+
const manager = referenceElementManager({ click: true, hover: true });
|
|
25
27
|
class Dropdown extends LitElement {
|
|
26
28
|
constructor() {
|
|
27
29
|
super();
|
|
30
|
+
this.referenceElementController = useReferenceElement({ manager })(this);
|
|
28
31
|
this.direction = useDirection();
|
|
29
32
|
this.focusLastDropdownItem = false;
|
|
30
33
|
this.activeItemIndex = -1;
|
|
@@ -33,6 +36,7 @@ class Dropdown extends LitElement {
|
|
|
33
36
|
this.mutationObserver = createObserver("mutation", () => this.updateItems());
|
|
34
37
|
this.transitionProp = "opacity";
|
|
35
38
|
this.resizeObserver = createObserver("resize", (entries) => this.resizeObserverCallback(entries));
|
|
39
|
+
this.onReferenceElementKeyDown = (event) => this.keyDownHandler(event);
|
|
36
40
|
this.focusSetter = useSetFocus()(this);
|
|
37
41
|
this.interactiveContainer = useInteractive(this);
|
|
38
42
|
this.topLayer = useTopLayer({
|
|
@@ -62,7 +66,7 @@ class Dropdown extends LitElement {
|
|
|
62
66
|
this.listen("calciteInternalDropdownItemSelect", this.handleItemSelect);
|
|
63
67
|
}
|
|
64
68
|
static {
|
|
65
|
-
this.properties = { activeDescendantElement: [16, {}, { state: true }], closeOnSelectDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], flipPlacements: [0, {}, { attribute: false }], maxItems: [11, {}, { reflect: true, type: Number }], offsetDistance: [11, {}, { type: Number, reflect: true }], offsetSkidding: [11, {}, { reflect: true, type: Number }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placement: [3, {}, { reflect: true }], scale: [3, {}, { reflect: true }], selectedItems: [0, {}, { attribute: false }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], type: [3, {}, { reflect: true }], widthScale: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }] };
|
|
69
|
+
this.properties = { activeDescendantElement: [16, {}, { state: true }], referenceEl: [16, {}, { state: true }], closeOnSelectDisabled: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], flipPlacements: [0, {}, { attribute: false }], maxItems: [11, {}, { reflect: true, type: Number }], offsetDistance: [11, {}, { type: Number, reflect: true }], offsetSkidding: [11, {}, { reflect: true, type: Number }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], placement: [3, {}, { reflect: true }], referenceElement: 1, scale: [3, {}, { reflect: true }], selectedItems: [0, {}, { attribute: false }], topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], type: [3, {}, { reflect: true }], widthScale: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }] };
|
|
66
70
|
}
|
|
67
71
|
static {
|
|
68
72
|
this.shadowRootOptions = { mode: "open", delegatesFocus: true };
|
|
@@ -70,6 +74,9 @@ class Dropdown extends LitElement {
|
|
|
70
74
|
static {
|
|
71
75
|
this.styles = styles;
|
|
72
76
|
}
|
|
77
|
+
get referenceElementType() {
|
|
78
|
+
return this.referenceElement ? this.type : null;
|
|
79
|
+
}
|
|
73
80
|
async reposition(delayed = false) {
|
|
74
81
|
const { filteredFlipPlacements, floatingEl, offsetDistance, offsetSkidding, overlayPositioning, placement, referenceEl } = this;
|
|
75
82
|
return reposition(this, {
|
|
@@ -85,7 +92,7 @@ class Dropdown extends LitElement {
|
|
|
85
92
|
}, delayed);
|
|
86
93
|
}
|
|
87
94
|
async setFocus(options) {
|
|
88
|
-
return this.focusSetter(() => this.referenceEl, options);
|
|
95
|
+
return this.focusSetter(() => this.referenceEl instanceof HTMLElement ? this.referenceEl : this.floatingEl, options);
|
|
89
96
|
}
|
|
90
97
|
connectedCallback() {
|
|
91
98
|
super.connectedCallback();
|
|
@@ -113,6 +120,14 @@ class Dropdown extends LitElement {
|
|
|
113
120
|
if (changes.has("scale") && (this.hasUpdated || this.scale !== "m")) {
|
|
114
121
|
this.handlePropsChange();
|
|
115
122
|
}
|
|
123
|
+
if (changes.has("referenceElement") && !this.referenceElement && this.open) {
|
|
124
|
+
this.topLayer.hide();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
updated(changes) {
|
|
128
|
+
if (changes.has("referenceEl") && this.referenceElementType) {
|
|
129
|
+
connectFloatingUI(this);
|
|
130
|
+
}
|
|
116
131
|
}
|
|
117
132
|
loaded() {
|
|
118
133
|
this.updateSelectedItems();
|
|
@@ -145,25 +160,25 @@ class Dropdown extends LitElement {
|
|
|
145
160
|
this.updateGroupProps();
|
|
146
161
|
}
|
|
147
162
|
closeCalciteDropdownOnClick(event) {
|
|
148
|
-
if (this.disabled || !this.open || event.composedPath().includes(this.el)) {
|
|
163
|
+
if (this.referenceElementType || this.disabled || !this.open || event.composedPath().includes(this.el)) {
|
|
149
164
|
return;
|
|
150
165
|
}
|
|
151
166
|
this.closeCalciteDropdown();
|
|
152
167
|
}
|
|
153
168
|
closeCalciteDropdownOnOpenEvent(event) {
|
|
154
|
-
if (event.composedPath().includes(this.el)) {
|
|
169
|
+
if (this.referenceElementType || event.composedPath().includes(this.el)) {
|
|
155
170
|
return;
|
|
156
171
|
}
|
|
157
172
|
this.closeCalciteDropdown();
|
|
158
173
|
}
|
|
159
174
|
pointerEnterHandler() {
|
|
160
|
-
if (this.disabled || this.type !== "hover") {
|
|
175
|
+
if (this.referenceElementType || this.disabled || this.type !== "hover") {
|
|
161
176
|
return;
|
|
162
177
|
}
|
|
163
178
|
this.open = true;
|
|
164
179
|
}
|
|
165
180
|
pointerLeaveHandler() {
|
|
166
|
-
if (this.disabled || this.type !== "hover") {
|
|
181
|
+
if (this.referenceElementType || this.disabled || this.type !== "hover") {
|
|
167
182
|
return;
|
|
168
183
|
}
|
|
169
184
|
this.closeCalciteDropdown();
|
|
@@ -215,7 +230,7 @@ class Dropdown extends LitElement {
|
|
|
215
230
|
}
|
|
216
231
|
setDropdownWidth() {
|
|
217
232
|
const { referenceEl, scrollerEl } = this;
|
|
218
|
-
if (!scrollerEl || !referenceEl) {
|
|
233
|
+
if (!scrollerEl || !(referenceEl instanceof HTMLElement)) {
|
|
219
234
|
return;
|
|
220
235
|
}
|
|
221
236
|
scrollerEl.style.minWidth = `${referenceEl.clientWidth}px`;
|
|
@@ -251,7 +266,9 @@ class Dropdown extends LitElement {
|
|
|
251
266
|
this.topLayer.hide();
|
|
252
267
|
}
|
|
253
268
|
setReferenceEl(el) {
|
|
254
|
-
|
|
269
|
+
const previousReferenceEl = this.referenceEl instanceof HTMLElement ? this.referenceEl : null;
|
|
270
|
+
const nextReferenceEl = el instanceof HTMLElement ? el : null;
|
|
271
|
+
updateRefObserver(this.resizeObserver, previousReferenceEl, nextReferenceEl);
|
|
255
272
|
this.referenceEl = el;
|
|
256
273
|
connectFloatingUI(this);
|
|
257
274
|
}
|
|
@@ -260,7 +277,7 @@ class Dropdown extends LitElement {
|
|
|
260
277
|
connectFloatingUI(this);
|
|
261
278
|
}
|
|
262
279
|
keyDownHandler(event) {
|
|
263
|
-
if (!event.composedPath().includes(this.referenceEl)) {
|
|
280
|
+
if (!(this.referenceEl instanceof HTMLElement) || !event.composedPath().includes(this.referenceEl)) {
|
|
264
281
|
return;
|
|
265
282
|
}
|
|
266
283
|
const { defaultPrevented, key } = event;
|
|
@@ -413,7 +430,7 @@ class Dropdown extends LitElement {
|
|
|
413
430
|
return;
|
|
414
431
|
}
|
|
415
432
|
const relatedTarget = event.relatedTarget;
|
|
416
|
-
if (relatedTarget && (this.el.contains(relatedTarget) || this.referenceEl != null && this.referenceEl.contains(relatedTarget))) {
|
|
433
|
+
if (relatedTarget && (this.el.contains(relatedTarget) || this.referenceEl != null && this.referenceEl instanceof HTMLElement && this.referenceEl.contains(relatedTarget))) {
|
|
417
434
|
return;
|
|
418
435
|
}
|
|
419
436
|
this.closeCalciteDropdown();
|
|
@@ -426,10 +443,10 @@ class Dropdown extends LitElement {
|
|
|
426
443
|
}
|
|
427
444
|
render() {
|
|
428
445
|
const { open } = this;
|
|
429
|
-
return this.interactiveContainer({ disabled: this.disabled, children: html`<div class=${safeClassMap(CSS.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${ref(this.setReferenceEl)}><slot .ariaActiveDescendantElement=${this.activeDescendantElement ?? null} .ariaControlsElements=${this.scrollerEl ? [this.scrollerEl] : void 0} .ariaExpanded=${open} aria-haspopup=menu name=${SLOTS.trigger}></slot></div
|
|
446
|
+
return this.interactiveContainer({ disabled: this.disabled, children: html`${!this.referenceElementType ? html`<div class=${safeClassMap(CSS.triggerContainer)} @click=${this.toggleClickDropdown} @focusin=${this.openHoverDropdown} @focusout=${this.closeHoverDropdown} @keydown=${this.keyDownHandler} ${ref(this.setReferenceEl)}><slot .ariaActiveDescendantElement=${this.activeDescendantElement ?? null} .ariaControlsElements=${this.scrollerEl ? [this.scrollerEl] : void 0} .ariaExpanded=${open} aria-haspopup=menu name=${SLOTS.trigger}></slot></div>` : null}<div class=${safeClassMap({
|
|
430
447
|
[CSS.wrapper]: true,
|
|
431
448
|
[getDimensionClass("width", this.width, this.widthScale)]: !!(this.width || this.widthScale)
|
|
432
|
-
})} .inert=${!open} popover=manual ${ref(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl ? [this.referenceEl] : void 0} class=${safeClassMap({
|
|
449
|
+
})} .inert=${!open} popover=manual ${ref(this.setFloatingEl)}><div .ariaLabelledByElements=${this.referenceEl instanceof HTMLElement ? [this.referenceEl] : void 0} class=${safeClassMap({
|
|
433
450
|
[CSS.content]: true,
|
|
434
451
|
[FloatingCSS.animation]: true,
|
|
435
452
|
[FloatingCSS.animationActive]: open
|
|
@@ -8,7 +8,6 @@ import { LitElement, createEvent, safeClassMap, safeStyleMap } from "@arcgis/lum
|
|
|
8
8
|
import { m as slotChangeHasContent, s as slotChangeHasAssignedElement, e as getRootNode } from "../../chunks/dom.js";
|
|
9
9
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
10
10
|
import { l as listItemSelector, i as isListItem, a as listSelector, u as updateListItemChildren, b as listItemGroupSelector, e as expandedAncestors } from "../../chunks/utils4.js";
|
|
11
|
-
import { d as disconnectSortableComponent, c as connectSortableComponent } from "../../chunks/sortableComponent.js";
|
|
12
11
|
import { S as SLOTS$1 } from "../../chunks/resources8.js";
|
|
13
12
|
import { n as numberStringFormatter } from "../../chunks/locale.js";
|
|
14
13
|
import { g as guid } from "../../chunks/guid.js";
|
|
@@ -16,6 +15,7 @@ import { u as useT9n } from "../../chunks/useT9n.js";
|
|
|
16
15
|
import { u as useCancelable } from "../../chunks/useCancelable.js";
|
|
17
16
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
18
17
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
18
|
+
import { u as useSortable } from "../../chunks/useSortable.js";
|
|
19
19
|
const CSS = {
|
|
20
20
|
container: "container",
|
|
21
21
|
table: "table",
|
|
@@ -47,6 +47,7 @@ class List extends LitElement {
|
|
|
47
47
|
this.updateListItemsDebounced();
|
|
48
48
|
});
|
|
49
49
|
this.cancelable = useCancelable()(this);
|
|
50
|
+
this.sortable = useSortable()(this);
|
|
50
51
|
this.updateListItemsDebounced = debounce(this.updateListItems, DEBOUNCE.nextTick);
|
|
51
52
|
this.visibleItems = [];
|
|
52
53
|
this.willFilterEmit = false;
|
|
@@ -154,7 +155,6 @@ class List extends LitElement {
|
|
|
154
155
|
super.disconnectedCallback();
|
|
155
156
|
this.disconnectObserver();
|
|
156
157
|
this.unobserveFilterRow();
|
|
157
|
-
disconnectSortableComponent(this);
|
|
158
158
|
}
|
|
159
159
|
updateListItems() {
|
|
160
160
|
this.updateGroupItems();
|
|
@@ -342,7 +342,7 @@ class List extends LitElement {
|
|
|
342
342
|
if (defaultSlotEl) {
|
|
343
343
|
updateListItemChildren(defaultSlotEl);
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
this.sortable.reset();
|
|
346
346
|
}
|
|
347
347
|
onGlobalDragStart() {
|
|
348
348
|
this.disconnectObserver();
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { DragDetail } from "../../
|
|
1
|
+
import type { DragDetail } from "../../controllers/useSortable.js";
|
|
2
2
|
import type { ListItem } from "../calcite-list-item/customElement.js";
|
|
3
3
|
import type { List } from "./customElement.js";
|
|
4
4
|
|
|
5
5
|
export type ListDisplayMode = "flat" | "nested";
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
toEl: List;
|
|
9
|
-
fromEl: List;
|
|
10
|
-
dragEl: ListItem;
|
|
11
|
-
}
|
|
7
|
+
export type ListDragDetail = DragDetail<List, List, ListItem>;
|
|
@@ -5,7 +5,7 @@ import { css, html, nothing } from "lit";
|
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
7
7
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
|
-
import { s as slotChangeHasAssignedElement,
|
|
8
|
+
import { s as slotChangeHasAssignedElement, y as getFirstTabbable } from "../../chunks/dom.js";
|
|
9
9
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
10
10
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
11
11
|
import { l as logger } from "../../chunks/logger.js";
|
|
@@ -5,7 +5,7 @@ import { css, html } from "lit";
|
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import { LitElement, safeClassMap, safeStyleMap } from "@arcgis/lumina";
|
|
7
7
|
import { n as numberStringFormatter } from "../../chunks/locale.js";
|
|
8
|
-
import {
|
|
8
|
+
import { z as intersects } from "../../chunks/dom.js";
|
|
9
9
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
10
10
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
11
11
|
const CSS = {
|
|
@@ -9,11 +9,12 @@ import { e as defaultOffsetDistance, r as reposition, c as connectFloatingUI, a
|
|
|
9
9
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
10
10
|
import { H as Heading } from "../../chunks/Heading.js";
|
|
11
11
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
12
|
-
import {
|
|
12
|
+
import { F as FloatingArrow } from "../../chunks/FloatingArrow.js";
|
|
13
13
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
14
14
|
import { u as useFocusTrap } from "../../chunks/useFocusTrap.js";
|
|
15
15
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
16
16
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
17
|
+
import { u as useReferenceElement, r as referenceElementManager } from "../../chunks/manager.js";
|
|
17
18
|
const CSS = {
|
|
18
19
|
positionContainer: "position-container",
|
|
19
20
|
container: "container",
|
|
@@ -1,15 +1,183 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
2
|
import { c as customElement } from "../../chunks/runtime.js";
|
|
3
|
-
import { css, nothing
|
|
3
|
+
import { html, isServer, css, nothing } from "lit";
|
|
4
4
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
5
5
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
6
6
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
7
7
|
import { g as getRoundRobinIndex } from "../../chunks/array.js";
|
|
8
|
-
import {
|
|
8
|
+
import { q as queryElementRoots, c as closestElementCrossShadowBoundary } from "../../chunks/dom.js";
|
|
9
9
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
10
10
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
11
11
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
12
12
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
13
|
+
const hiddenFormInputSlotName = "hidden-form-input";
|
|
14
|
+
function isCheckable(component) {
|
|
15
|
+
return "checked" in component;
|
|
16
|
+
}
|
|
17
|
+
const onFormResetMap = /* @__PURE__ */ new WeakMap();
|
|
18
|
+
const formComponentSet = /* @__PURE__ */ new WeakSet();
|
|
19
|
+
function hasRegisteredFormComponentParent(form, formComponentEl) {
|
|
20
|
+
const hasParentComponentWithFormIdSet = closestElementCrossShadowBoundary(formComponentEl.parentElement, "[form]");
|
|
21
|
+
if (hasParentComponentWithFormIdSet) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
const formComponentRegisterEventName = "calciteInternalFormComponentRegister";
|
|
25
|
+
let hasRegisteredFormComponentParent2 = false;
|
|
26
|
+
form.addEventListener(formComponentRegisterEventName, (event) => {
|
|
27
|
+
hasRegisteredFormComponentParent2 = event.composedPath().some((element) => formComponentSet.has(element));
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
}, { once: true });
|
|
30
|
+
formComponentEl.dispatchEvent(new CustomEvent(formComponentRegisterEventName, {
|
|
31
|
+
bubbles: true,
|
|
32
|
+
composed: true
|
|
33
|
+
}));
|
|
34
|
+
return hasRegisteredFormComponentParent2;
|
|
35
|
+
}
|
|
36
|
+
function getValidationComponent(el) {
|
|
37
|
+
if (el.nodeName === "CALCITE-RADIO-BUTTON") {
|
|
38
|
+
return closestElementCrossShadowBoundary(el, "calcite-radio-button-group");
|
|
39
|
+
}
|
|
40
|
+
return el;
|
|
41
|
+
}
|
|
42
|
+
function connectForm(component) {
|
|
43
|
+
const { el, value } = component;
|
|
44
|
+
const associatedForm = findAssociatedForm(component);
|
|
45
|
+
if (!associatedForm || hasRegisteredFormComponentParent(associatedForm, el)) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
component.formEl = associatedForm;
|
|
49
|
+
component.defaultValue = value;
|
|
50
|
+
if (isCheckable(component)) {
|
|
51
|
+
component.defaultChecked = component.checked;
|
|
52
|
+
}
|
|
53
|
+
const boundOnFormReset = onFormReset.bind(component);
|
|
54
|
+
associatedForm.addEventListener("reset", boundOnFormReset);
|
|
55
|
+
onFormResetMap.set(component.el, boundOnFormReset);
|
|
56
|
+
formComponentSet.add(el);
|
|
57
|
+
}
|
|
58
|
+
function findAssociatedForm(component) {
|
|
59
|
+
const { el, form } = component;
|
|
60
|
+
return form ? queryElementRoots(el, { id: form }) : closestElementCrossShadowBoundary(el, "form");
|
|
61
|
+
}
|
|
62
|
+
function onFormReset() {
|
|
63
|
+
if ("status" in this) {
|
|
64
|
+
this.status = "idle";
|
|
65
|
+
}
|
|
66
|
+
if ("validationIcon" in this) {
|
|
67
|
+
this.validationIcon = false;
|
|
68
|
+
}
|
|
69
|
+
if ("validationMessage" in this) {
|
|
70
|
+
this.validationMessage = "";
|
|
71
|
+
}
|
|
72
|
+
if (isCheckable(this)) {
|
|
73
|
+
this.checked = this.defaultChecked;
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.value = this.defaultValue;
|
|
77
|
+
this.onFormReset?.();
|
|
78
|
+
}
|
|
79
|
+
function disconnectForm(component) {
|
|
80
|
+
const { el, formEl } = component;
|
|
81
|
+
if (!formEl) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const boundOnFormReset = onFormResetMap.get(el);
|
|
85
|
+
formEl.removeEventListener("reset", boundOnFormReset);
|
|
86
|
+
onFormResetMap.delete(el);
|
|
87
|
+
component.formEl = null;
|
|
88
|
+
formComponentSet.delete(el);
|
|
89
|
+
}
|
|
90
|
+
const internalHiddenInputInputEvent = "calciteInternalHiddenInputInput";
|
|
91
|
+
const hiddenInputInputHandler = (event) => {
|
|
92
|
+
event.target.dispatchEvent(new CustomEvent(internalHiddenInputInputEvent, { bubbles: true }));
|
|
93
|
+
};
|
|
94
|
+
const removeHiddenInputChangeEventListener = (input) => input.removeEventListener("input", hiddenInputInputHandler);
|
|
95
|
+
function syncHiddenFormInput(component) {
|
|
96
|
+
const { el, formEl, name, value } = component;
|
|
97
|
+
const { ownerDocument } = el;
|
|
98
|
+
if (isServer) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const inputs = el.querySelectorAll(`input[slot="${hiddenFormInputSlotName}"]`);
|
|
102
|
+
if (!formEl || !name) {
|
|
103
|
+
inputs.forEach((input) => {
|
|
104
|
+
removeHiddenInputChangeEventListener(input);
|
|
105
|
+
input.remove();
|
|
106
|
+
});
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const values = Array.isArray(value) ? value : [value];
|
|
110
|
+
const extra = [];
|
|
111
|
+
const seen = /* @__PURE__ */ new Set();
|
|
112
|
+
inputs.forEach((input) => {
|
|
113
|
+
const valueMatch = values.find((val) => (
|
|
114
|
+
/* intentional non-strict equality check */
|
|
115
|
+
val == input.value
|
|
116
|
+
));
|
|
117
|
+
if (valueMatch != null) {
|
|
118
|
+
seen.add(valueMatch);
|
|
119
|
+
defaultSyncHiddenFormInput(component, input, valueMatch);
|
|
120
|
+
} else {
|
|
121
|
+
extra.push(input);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
let docFrag;
|
|
125
|
+
values.forEach((value2) => {
|
|
126
|
+
if (seen.has(value2)) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
let input = extra.pop();
|
|
130
|
+
if (!input) {
|
|
131
|
+
input = ownerDocument.createElement("input");
|
|
132
|
+
input.ariaHidden = "true";
|
|
133
|
+
input.slot = hiddenFormInputSlotName;
|
|
134
|
+
}
|
|
135
|
+
if (!docFrag) {
|
|
136
|
+
docFrag = ownerDocument.createDocumentFragment();
|
|
137
|
+
}
|
|
138
|
+
docFrag.append(input);
|
|
139
|
+
input.addEventListener("input", hiddenInputInputHandler);
|
|
140
|
+
defaultSyncHiddenFormInput(component, input, value2);
|
|
141
|
+
});
|
|
142
|
+
if (docFrag) {
|
|
143
|
+
el.append(docFrag);
|
|
144
|
+
}
|
|
145
|
+
extra.forEach((input) => {
|
|
146
|
+
removeHiddenInputChangeEventListener(input);
|
|
147
|
+
input.remove();
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function defaultSyncHiddenFormInput(component, input, value) {
|
|
151
|
+
const { defaultValue, disabled, form, name, required } = component;
|
|
152
|
+
input.defaultValue = defaultValue;
|
|
153
|
+
input.disabled = disabled;
|
|
154
|
+
input.name = name;
|
|
155
|
+
input.required = required;
|
|
156
|
+
input.tabIndex = -1;
|
|
157
|
+
if (form) {
|
|
158
|
+
input.setAttribute("form", form);
|
|
159
|
+
} else {
|
|
160
|
+
input.removeAttribute("form");
|
|
161
|
+
}
|
|
162
|
+
if (isCheckable(component)) {
|
|
163
|
+
input.checked = component.checked;
|
|
164
|
+
input.defaultChecked = component.defaultChecked;
|
|
165
|
+
input.value = component.checked ? value || "on" : "";
|
|
166
|
+
} else {
|
|
167
|
+
input.value = value || "";
|
|
168
|
+
}
|
|
169
|
+
component.syncHiddenFormInput?.(input);
|
|
170
|
+
const validationComponent = getValidationComponent(component.el);
|
|
171
|
+
if (validationComponent && "validity" in validationComponent) {
|
|
172
|
+
for (const key in { ...input?.validity }) {
|
|
173
|
+
validationComponent.validity[key] = input.validity[key];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const HiddenFormInputSlot = ({ component }) => {
|
|
178
|
+
syncHiddenFormInput(component);
|
|
179
|
+
return html`<slot name=${hiddenFormInputSlotName}></slot>`;
|
|
180
|
+
};
|
|
13
181
|
const CSS = {
|
|
14
182
|
container: "container",
|
|
15
183
|
radio: "radio"
|
|
@@ -5,7 +5,7 @@ import { css, html, nothing } from "lit";
|
|
|
5
5
|
import { LitElement, createEvent, stringOrBoolean, setAttribute, safeClassMap, safeStyleMap } from "@arcgis/lumina";
|
|
6
6
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
7
7
|
import { g as guid } from "../../chunks/guid.js";
|
|
8
|
-
import { j as isPrimaryPointerButton,
|
|
8
|
+
import { j as isPrimaryPointerButton, z as intersects } from "../../chunks/dom.js";
|
|
9
9
|
import { I as InternalLabel } from "../../chunks/InternalLabel.js";
|
|
10
10
|
import { V as Validation } from "../../chunks/Validation.js";
|
|
11
11
|
import { i as isActivationKey } from "../../chunks/key.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="../../index.d.ts" />
|
|
2
2
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
3
|
import type { Layout } from "../interfaces.js";
|
|
4
|
-
import type { DragDetail } from "../../
|
|
4
|
+
import type { DragDetail } from "../../controllers/useSortable.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use the `calcite-block-group` component instead.
|
|
@@ -3,10 +3,10 @@ import { c as customElement } from "../../chunks/runtime.js";
|
|
|
3
3
|
import { css, html } from "lit";
|
|
4
4
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
5
5
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
6
|
-
import { d as disconnectSortableComponent, c as connectSortableComponent } from "../../chunks/sortableComponent.js";
|
|
7
6
|
import { i as focusElement } from "../../chunks/dom.js";
|
|
8
7
|
import { l as logger } from "../../chunks/logger.js";
|
|
9
8
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
9
|
+
import { u as useSortable } from "../../chunks/useSortable.js";
|
|
10
10
|
const CSS = {
|
|
11
11
|
container: "container",
|
|
12
12
|
containerHorizontal: "container--horizontal",
|
|
@@ -21,6 +21,7 @@ class SortableList extends LitElement {
|
|
|
21
21
|
this.mutationObserver = createObserver("mutation", () => {
|
|
22
22
|
this.setUpSorting();
|
|
23
23
|
});
|
|
24
|
+
this.sortable = useSortable()(this);
|
|
24
25
|
this.interactiveContainer = useInteractive(this);
|
|
25
26
|
this.disabled = false;
|
|
26
27
|
this.handleSelector = "calcite-handle";
|
|
@@ -50,7 +51,6 @@ class SortableList extends LitElement {
|
|
|
50
51
|
}
|
|
51
52
|
disconnectedCallback() {
|
|
52
53
|
super.disconnectedCallback();
|
|
53
|
-
disconnectSortableComponent(this);
|
|
54
54
|
this.endObserving();
|
|
55
55
|
}
|
|
56
56
|
calciteHandleNudgeNextHandler(event) {
|
|
@@ -110,7 +110,7 @@ class SortableList extends LitElement {
|
|
|
110
110
|
}
|
|
111
111
|
setUpSorting() {
|
|
112
112
|
this.items = Array.from(this.el.children);
|
|
113
|
-
|
|
113
|
+
this.sortable.reset();
|
|
114
114
|
}
|
|
115
115
|
beginObserving() {
|
|
116
116
|
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
@@ -7,8 +7,9 @@ import { createRef, ref } from "lit/directives/ref.js";
|
|
|
7
7
|
import { useDirection } from "@arcgis/lumina/controllers";
|
|
8
8
|
import { e as defaultOffsetDistance, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, h as hideFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
9
9
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
10
|
-
import {
|
|
10
|
+
import { F as FloatingArrow } from "../../chunks/FloatingArrow.js";
|
|
11
11
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
12
|
+
import { u as useReferenceElement, r as referenceElementManager } from "../../chunks/manager.js";
|
|
12
13
|
const CSS = {
|
|
13
14
|
positionContainer: "position-container",
|
|
14
15
|
container: "container"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SortableEvent } from "sortablejs";
|
|
2
|
+
|
|
3
|
+
export interface DragDetail<To extends HTMLElement = HTMLElement, From extends HTMLElement = HTMLElement, Drag extends HTMLElement = HTMLElement> extends Pick<SortableEvent, "newIndex" | "oldIndex"> {
|
|
4
|
+
toEl: To;
|
|
5
|
+
fromEl: From;
|
|
6
|
+
dragEl: Drag;
|
|
7
|
+
}
|