@esri/calcite-components 5.1.0-next.24 → 5.1.0-next.26
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/24UVSZOE.js +2 -0
- package/dist/cdn/{HRLMDN6T.js → 265A6AOM.js} +1 -1
- package/dist/cdn/{FYQ7F5FG.js → 266QPYGH.js} +1 -1
- package/dist/cdn/{H3YVYZPV.js → 2COONMVV.js} +1 -1
- package/dist/cdn/{LC6TRGG7.js → 2DPUDJQI.js} +1 -1
- package/dist/cdn/{4CZC7KQY.js → 2JM24U42.js} +1 -1
- package/dist/cdn/{LXABSKOX.js → 2N2EIOZQ.js} +1 -1
- package/dist/cdn/{VZ5HKHDG.js → 2ZJL6VLF.js} +1 -1
- package/dist/cdn/{M2MLAGF4.js → 32SZ6MKP.js} +1 -1
- package/dist/cdn/{ZM7QKH4L.js → 34RZGOUB.js} +1 -1
- package/dist/cdn/{HRNHJL7M.js → 35A2JWYN.js} +1 -1
- package/dist/cdn/{RJDE3YGW.js → 3EFK33T5.js} +1 -1
- package/dist/cdn/3SWWI6IT.js +2 -0
- package/dist/cdn/{AXUCCIRH.js → 3WIYPWAH.js} +1 -1
- package/dist/cdn/3Z6IQA5N.js +2 -0
- package/dist/cdn/{YXD2TKPQ.js → 4DBLFLPE.js} +1 -1
- package/dist/cdn/{I5534LUG.js → 4UTZIEIH.js} +1 -1
- package/dist/cdn/{C6S2WP47.js → 53ZCK7UM.js} +1 -1
- package/dist/cdn/5G5VTRTL.js +2 -0
- package/dist/cdn/{NHCHXBNQ.js → 5KJCBGYY.js} +1 -1
- package/dist/cdn/{Z62ZQOFN.js → 5YNF2CQY.js} +1 -1
- package/dist/cdn/{G5F3EKOD.js → 65XPD5PJ.js} +1 -1
- package/dist/cdn/{BH7HJNVQ.js → 6DMT6SBE.js} +1 -1
- package/dist/cdn/{SWXDM2ED.js → 6ISWKJVP.js} +1 -1
- package/dist/cdn/{CU2QH5Q4.js → 74MAIRJS.js} +1 -1
- package/dist/cdn/{DQSR27R7.js → 7GXPYZ67.js} +1 -1
- package/dist/cdn/7TFLXBND.js +2 -0
- package/dist/cdn/{GNFWEGWN.js → AE3UBVD4.js} +1 -1
- package/dist/cdn/{EKCEBAA2.js → AM3KA6XI.js} +1 -1
- package/dist/cdn/{2VVXMMOX.js → BGQMFO4B.js} +1 -1
- package/dist/cdn/{PQ2XMBCR.js → BKVED5K4.js} +1 -1
- package/dist/cdn/{DV75YW7X.js → BNBJDKHP.js} +1 -1
- package/dist/cdn/{C2YUFRVH.js → C4ZX7VYR.js} +1 -1
- package/dist/cdn/{V72AGXGP.js → CZGH2P5R.js} +1 -1
- package/dist/cdn/{TBJYLOUU.js → D26KXFR4.js} +1 -1
- package/dist/cdn/{OQBDHV3I.js → D7Q3AXKP.js} +1 -1
- package/dist/cdn/{3HMTHRWV.js → DCQRXTMY.js} +1 -1
- package/dist/cdn/{EHIAXJAL.js → DCWL5FUH.js} +1 -1
- package/dist/cdn/{M4SJWE6C.js → DHPVZMKK.js} +1 -1
- package/dist/cdn/{OONKEETK.js → DNXGXZPK.js} +1 -1
- package/dist/cdn/{EMOACECT.js → DPPYTPUN.js} +1 -1
- package/dist/cdn/{K7JT7AJ3.js → EPC7QGCY.js} +1 -1
- package/dist/cdn/{JG6RAMMT.js → ESIG7SRN.js} +1 -1
- package/dist/cdn/{KPANVE7Y.js → EVSREOVQ.js} +1 -1
- package/dist/cdn/{2X4WQJ6V.js → EWMBDFVU.js} +1 -1
- package/dist/cdn/{E76CXK6W.js → EWTR65YA.js} +1 -1
- package/dist/cdn/F2QZDZIO.js +2 -0
- package/dist/cdn/{NJLLWKXS.js → F4GCWY3F.js} +1 -1
- package/dist/cdn/{BV3MTUEH.js → F7QQUXJL.js} +1 -1
- package/dist/cdn/{ZRUMOR65.js → FG5FW5ZE.js} +1 -1
- package/dist/cdn/{WZMSRH42.js → FIBHCK3H.js} +1 -1
- package/dist/cdn/FMP6OQ7D.js +2 -0
- package/dist/cdn/{W4EQNTRQ.js → FULAAFER.js} +1 -1
- package/dist/cdn/{335WNYZK.js → G3EBHETV.js} +1 -1
- package/dist/cdn/{PH6LS2IK.js → GAR2IMZ3.js} +1 -1
- package/dist/cdn/{ROEQAS3A.js → GRDNG5EU.js} +1 -1
- package/dist/cdn/GTLHPFUV.js +2 -0
- package/dist/cdn/GU4S3ZKG.js +2 -0
- package/dist/cdn/{ZH7KRORX.js → GUOSNPAU.js} +1 -1
- package/dist/cdn/{UHWKDOKY.js → H5BLSEZ3.js} +1 -1
- package/dist/cdn/HCNEPLF5.js +2 -0
- package/dist/cdn/HGBMCFOD.js +2 -0
- package/dist/cdn/{LKD6P5YN.js → HGGO3AHT.js} +1 -1
- package/dist/cdn/{MJ7VTT7G.js → HMOQULJD.js} +1 -1
- package/dist/cdn/{EFNUNWOY.js → HUQJ333U.js} +1 -1
- package/dist/cdn/{D7OBXZA4.js → I2PT3UPN.js} +1 -1
- package/dist/cdn/I3D4XCLD.js +2 -0
- package/dist/cdn/{L4AKVA6J.js → IGZX5AHV.js} +1 -1
- package/dist/cdn/{Y4PGFRFZ.js → IJ3XVWSG.js} +1 -1
- package/dist/cdn/{FVUFPRTZ.js → IPPVAW62.js} +1 -1
- package/dist/cdn/IQZVCTFW.js +2 -0
- package/dist/cdn/{37J4QHCP.js → IRWU2TR6.js} +1 -1
- package/dist/cdn/{IOC4JWCG.js → JAWBEMIK.js} +1 -1
- package/dist/cdn/{ZCRYCMYT.js → JHT4F2RJ.js} +1 -1
- package/dist/cdn/{WXC33DHR.js → JVKSFUKV.js} +1 -1
- package/dist/cdn/{N4JJVMZE.js → JZIOWDZS.js} +1 -1
- package/dist/cdn/{4JXQHRCB.js → KDWR7M23.js} +1 -1
- package/dist/cdn/{BJUVF75X.js → KOW5NTJQ.js} +1 -1
- package/dist/cdn/{MSZ64UC4.js → KPREHL4V.js} +1 -1
- package/dist/cdn/{HTG4U6IG.js → KPT5PXJP.js} +1 -1
- package/dist/cdn/{ADF5GJVT.js → KR5QASPF.js} +1 -1
- package/dist/cdn/{BQB3G5CU.js → L3QXLZZH.js} +1 -1
- package/dist/cdn/{QXROGUXE.js → L6WB4227.js} +1 -1
- package/dist/cdn/{GEEEQOVM.js → LEBRWA4E.js} +1 -1
- package/dist/cdn/LGATM33J.js +2 -0
- package/dist/cdn/{HZH4MIUY.js → LHBACKJ5.js} +1 -1
- package/dist/cdn/{AUNOHC7O.js → M5WQDFOK.js} +1 -1
- package/dist/cdn/{R2N7UDBR.js → MCUIYFPY.js} +1 -1
- package/dist/cdn/{WTIDWDIV.js → MEQVQ22B.js} +1 -1
- package/dist/cdn/{EQZ2R35U.js → MOQRGDBX.js} +1 -1
- package/dist/cdn/{FSADANOP.js → MTU6D47Y.js} +1 -1
- package/dist/cdn/{LFRK6P2D.js → MW7AGGL3.js} +1 -1
- package/dist/cdn/{6WZT4UHB.js → NAP62AX7.js} +1 -1
- package/dist/cdn/NDSQ4CFN.js +2 -0
- package/dist/cdn/NK6ELXJB.js +2 -0
- package/dist/cdn/{5FJMWVWT.js → NSPEKGY3.js} +1 -1
- package/dist/cdn/{6PNUIAH7.js → P54SS6QP.js} +1 -1
- package/dist/cdn/{4ASYQP4D.js → PDBGWRDU.js} +1 -1
- package/dist/cdn/{MS5MFEFA.js → PGRW53WB.js} +1 -1
- package/dist/cdn/{H6EU56Z7.js → PS3Y5JIN.js} +1 -1
- package/dist/cdn/{6AYF7R5N.js → PYG7GNQ7.js} +1 -1
- package/dist/cdn/{BR3PTYFV.js → QH4IVVZX.js} +1 -1
- package/dist/cdn/{DDJ7R667.js → QHG4UVN7.js} +1 -1
- package/dist/cdn/{BOSJ366C.js → QMHN63LJ.js} +1 -1
- package/dist/cdn/{QSN4H5ZF.js → QN5DWY5J.js} +1 -1
- package/dist/cdn/{BMSVTVRT.js → QNLMV3T5.js} +1 -1
- package/dist/cdn/{E34NNTQ5.js → QVE3GWZX.js} +1 -1
- package/dist/cdn/{3MNKCPKM.js → R2VQNT5E.js} +1 -1
- package/dist/cdn/{WNICNNQU.js → RYLTUWGS.js} +1 -1
- package/dist/cdn/{AM3UGITY.js → S2N3EAWR.js} +1 -1
- package/dist/cdn/{6OOV6EIP.js → S4QXLRJT.js} +1 -1
- package/dist/cdn/{IQG4N535.js → S5D4KC2T.js} +1 -1
- package/dist/cdn/{TJDQBBDE.js → SAG5PN6V.js} +1 -1
- package/dist/cdn/{H5R56TSG.js → SGYKV7MJ.js} +1 -1
- package/dist/cdn/SMKTVIG3.js +2 -0
- package/dist/cdn/{U4DLHQJE.js → SR2U4UYC.js} +1 -1
- package/dist/cdn/{TWOG3N6D.js → T2DDJ3UZ.js} +1 -1
- package/dist/cdn/{SLJCJN7J.js → T53FCHAR.js} +1 -1
- package/dist/cdn/{6YQEO3TU.js → TQRVWHPS.js} +1 -1
- package/dist/cdn/{JLHHQUJF.js → UFRNO43Y.js} +1 -1
- package/dist/cdn/{VDGHE2H6.js → UIUDRBYG.js} +1 -1
- package/dist/cdn/ULHLMMN4.js +2 -0
- package/dist/cdn/UM7ABEPP.js +2 -0
- package/dist/cdn/UWDGNSRK.js +2 -0
- package/dist/cdn/{C2L2O5EQ.js → V2MNT2SI.js} +1 -1
- package/dist/cdn/{O3H5TYI3.js → VL5W6R2P.js} +1 -1
- package/dist/cdn/{XCSZRXTK.js → W7Y7PLEA.js} +1 -1
- package/dist/cdn/{52BHEJXM.js → WAX64AMV.js} +1 -1
- package/dist/cdn/{RTZMUTWS.js → WPHKI6II.js} +1 -1
- package/dist/cdn/{VMIQAKYU.js → WTUALX4S.js} +1 -1
- package/dist/cdn/{S5B7YG37.js → WZF7PAWT.js} +1 -1
- package/dist/cdn/{PM2IMGBS.js → X5FERJLS.js} +1 -1
- package/dist/cdn/{DGJMVWH6.js → XFUK6FWO.js} +1 -1
- package/dist/cdn/{VQUXTHQG.js → XG3KX423.js} +1 -1
- package/dist/cdn/{TSARCS44.js → XJHIIAS4.js} +1 -1
- package/dist/cdn/{QFY7DQSD.js → XLYUKQVS.js} +1 -1
- package/dist/cdn/XUCO6AFQ.js +2 -0
- package/dist/cdn/XWQOS7OO.js +2 -0
- package/dist/cdn/{UWCX25CF.js → Y7XT2XH3.js} +1 -1
- package/dist/cdn/{WZYUE4T7.js → YJF4NBEX.js} +1 -1
- package/dist/cdn/{TU3TE2NA.js → YQ2FBYJF.js} +1 -1
- package/dist/cdn/{TFVEPZC4.js → ZAXSD5VD.js} +1 -1
- package/dist/cdn/{QSTEMUD6.js → ZTSGKD2X.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/FloatingArrow.js +24 -0
- package/dist/chunks/Heading.js +3 -3
- package/dist/chunks/dom.js +8 -7
- package/dist/chunks/{useReferenceElement.js → manager.js} +108 -108
- package/dist/chunks/resources6.js +2 -0
- 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-dialog/customElement.d.ts +2 -0
- package/dist/components/calcite-dialog/customElement.js +3 -1
- package/dist/components/calcite-dropdown/customElement.d.ts +12 -2
- package/dist/components/calcite-dropdown/customElement.js +29 -12
- package/dist/components/calcite-flow-item/customElement.d.ts +2 -0
- package/dist/components/calcite-flow-item/customElement.js +3 -1
- 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-panel/customElement.d.ts +2 -0
- package/dist/components/calcite-panel/customElement.js +20 -8
- package/dist/components/calcite-popover/customElement.js +2 -1
- package/dist/components/calcite-radio-button/customElement.js +170 -2
- package/dist/components/calcite-sheet/customElement.js +1 -1
- 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-tab-nav/customElement.js +1 -1
- package/dist/components/calcite-tabs/customElement.js +1 -1
- package/dist/components/calcite-tooltip/customElement.js +2 -1
- package/dist/components/calcite-tree-item/customElement.js +1 -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/2QIN5FHX.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/73OOTHVT.js +0 -2
- package/dist/cdn/7TMAJS7Y.js +0 -2
- package/dist/cdn/A7BG2XIR.js +0 -2
- package/dist/cdn/H5VS33TX.js +0 -2
- package/dist/cdn/KYAGNB4G.js +0 -2
- package/dist/cdn/LKWEQBCD.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/cdn/ZB3IIOBU.js +0 -2
- package/dist/chunks/form.js +0 -267
- package/dist/utils/sortableComponent.d.ts +0 -7
|
@@ -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,41 @@ 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
|
+
async function setUpSortable(component2) {
|
|
84
|
+
if (dragActive(component2)) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
tearDownSortable(component2);
|
|
88
|
+
sortableComponentSet.add(component2);
|
|
89
|
+
sortable = createSortable(component2);
|
|
90
|
+
}
|
|
91
|
+
function tearDownSortable(component2) {
|
|
92
|
+
if (dragActive(component2)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
sortableComponentSet.delete(component2);
|
|
96
|
+
sortable?.destroy();
|
|
97
|
+
sortable = void 0;
|
|
98
|
+
}
|
|
99
|
+
controller.onConnected(() => {
|
|
100
|
+
setUpSortable(component);
|
|
101
|
+
});
|
|
102
|
+
controller.onDisconnected(() => {
|
|
103
|
+
tearDownSortable(component);
|
|
104
|
+
});
|
|
105
|
+
return {
|
|
106
|
+
reset: () => {
|
|
107
|
+
setUpSortable(component);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
});
|
|
111
|
+
};
|
|
88
112
|
export {
|
|
89
|
-
|
|
90
|
-
disconnectSortableComponent as d
|
|
113
|
+
useSortable as u
|
|
91
114
|
};
|
|
@@ -27,7 +27,7 @@ export abstract class Action extends LitElement {
|
|
|
27
27
|
*/
|
|
28
28
|
accessor active: boolean;
|
|
29
29
|
/** Specifies the horizontal alignment of button elements with text content. */
|
|
30
|
-
accessor alignment: Alignment;
|
|
30
|
+
accessor alignment: Alignment | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Specifies the appearance of the component.
|
|
33
33
|
*
|
|
@@ -55,9 +55,9 @@ export abstract class Action extends LitElement {
|
|
|
55
55
|
*
|
|
56
56
|
* When not set, the component is associated with its ancestor form element, if one exists.
|
|
57
57
|
*/
|
|
58
|
-
accessor form: string;
|
|
58
|
+
accessor form: string | undefined;
|
|
59
59
|
/** Specifies an icon to display. */
|
|
60
|
-
accessor icon: IconName;
|
|
60
|
+
accessor icon: IconName | undefined;
|
|
61
61
|
/**
|
|
62
62
|
* When `true`, the icon will be flipped when the element direction is right-to-left (`"rtl"`).
|
|
63
63
|
*
|
|
@@ -71,7 +71,7 @@ export abstract class Action extends LitElement {
|
|
|
71
71
|
*/
|
|
72
72
|
accessor indicator: boolean;
|
|
73
73
|
/** Specifies an accessible label for the component. If no label is provided, the label inherits what's provided for the `text` prop. */
|
|
74
|
-
accessor label: string;
|
|
74
|
+
accessor label: string | undefined;
|
|
75
75
|
/**
|
|
76
76
|
* When `true`, a busy indicator is displayed.
|
|
77
77
|
*
|
|
@@ -9,8 +9,8 @@ import { c as createObserver } from "../../chunks/observers.js";
|
|
|
9
9
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
10
10
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
11
11
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
12
|
-
import { f as findAssociatedForm, s as submitForm, r as resetForm } from "../../chunks/form.js";
|
|
13
12
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
13
|
+
import { u as useFormTrigger } from "../../chunks/useFormTrigger.js";
|
|
14
14
|
import { I as IDS, C as CSS } from "../../chunks/resources.js";
|
|
15
15
|
const styles = css`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}: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([scale=s]){--calcite-internal-action-font-size: var(--calcite-font-size--2);--calcite-internal-action-height: var(--calcite-size-sm);--calcite-internal-action-line-height: 1rem;--calcite-internal-action-spacing: var(--calcite-spacing-xxs)}:host([scale=m]){--calcite-internal-action-font-size: var(--calcite-font-size--1);--calcite-internal-action-height: var(--calcite-size-md);--calcite-internal-action-line-height: 1rem;--calcite-internal-action-spacing: var(--calcite-spacing-sm)}:host([scale=l]){--calcite-internal-action-font-size: var(--calcite-font-size-0);--calcite-internal-action-height: var(--calcite-size-lg);--calcite-internal-action-line-height: 1.25rem;--calcite-internal-action-spacing: var(--calcite-spacing-sm-plus)}:host{display:flex;cursor:pointer;background-color:transparent;--calcite-internal-action-text-color: var(--calcite-color-text-3);border-radius:var(--calcite-action-corner-radius, var(--calcite-action-corner-radius-start-start, var(--calcite-corner-radius-xs)) var(--calcite-action-corner-radius-start-end, var(--calcite-corner-radius-xs)) var(--calcite-action-corner-radius-end-end, var(--calcite-corner-radius-xs)) var(--calcite-action-corner-radius-end-start, var(--calcite-corner-radius-xs)))}.interaction-container{border-radius:inherit}:host([width=full]){flex:1 0 auto}:host([width=full]) .button{justify-content:center}:host([width=full]) .button .text-container--visible{flex:none}:host([drag-handle]){cursor:move;--calcite-internal-action-text-color: var(--calcite-color-border-input);--calcite-internal-action-padding-inline: var(--calcite-spacing-xxs)}.button{position:relative;margin:0;display:flex;inline-size:auto;align-items:center;justify-content:flex-start;border-style:none;outline-color:transparent;background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1));border-radius:inherit;color:var(--calcite-action-text-color, var(--calcite-internal-action-text-color));cursor:inherit;flex:1 0 auto;font-family:inherit;font-size:var(--calcite-internal-action-font-size);font-weight:var(--calcite-font-weight-normal);line-height:var(--calcite-internal-action-line-height);min-block-size:var(--calcite-internal-action-height);padding-block:var(--calcite-internal-action-padding-block, var(--calcite-internal-action-spacing));padding-inline:var(--calcite-internal-action-padding-inline, var(--calcite-internal-action-spacing));text-align:start}.button:hover{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-foreground-2));color:var(--calcite-action-text-color-press, var(--calcite-action-text-color-pressed, var(--calcite-color-text-1)))}.button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}.button:active{background-color:var(--calcite-action-background-color-press, var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3)))}.button--text-visible{gap:var(--calcite-internal-action-spacing);inline-size:100%}.icon-container{pointer-events:none;margin:0;display:flex;align-items:center;justify-content:center}.text-container{margin:0;inline-size:0px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:0;transition-property:opacity;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1);transition-property:inline-size}.text-container--visible{inline-size:auto;flex:1 1 auto;opacity:1}:host([active]) .button{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-3));color:var(--calcite-action-text-color-press, var(--calcite-action-text-color-pressed, var(--calcite-color-text-1)))}:host([active]) .button:hover{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-foreground-3))}:host([active]) .button:active{background-color:var(--calcite-action-background-color-press, var(--calcite-action-background-color-pressed, var(--calcite-color-foreground-3)))}:host([loading]) .button:hover,:host([loading]) .button:focus{background-color:var(--calcite-action-background-color, var(--calcite-color-foreground-1))}:host([loading]) calcite-loader[inline]{margin-inline-end:0px}:host([appearance=transparent]):host([active]) .button{background-color:var(--calcite-action-background-color-press, var(--calcite-action-background-color-pressed, var(--calcite-color-transparent-press)))}:host([appearance=transparent]) .button{transition-property:box-shadow;transition-duration:var(--calcite-animation-timing);transition-timing-function:cubic-bezier(.4,0,.2,1);background-color:var(--calcite-action-background-color, var(--calcite-color-transparent))}:host([appearance=transparent]) .button:hover{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-transparent-hover))}:host([appearance=transparent]) .button:active{background-color:var(--calcite-action-background-color-press, var(--calcite-action-background-color-pressed, var(--calcite-color-transparent-press)))}:host([selection-appearance=highlight]):host([active]) .button{background-color:var(--calcite-color-surface-highlight);color:var(--calcite-color-text-highlight)}:host([active-descendant]) .button{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline-offset:calc(calc(-1 * var(--calcite-spacing-base)) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host([alignment=center]) .button{justify-content:center}:host([alignment=end]) .button{justify-content:flex-end}:host([alignment=center]) .button .text-container--visible,:host([alignment=end]) .button .text-container--visible{flex:0 1 auto}:host([scale=s][compact]) .button,:host([scale=m][compact]) .button,:host([scale=l][compact]) .button{padding-inline:0px}.slot-container{display:flex}.slot-container--hidden{display:none}.indicator-with-icon{position:relative}.indicator-with-icon:after{content:"";position:absolute;block-size:.5rem;inline-size:.5rem;border-radius:9999px;inset-block-end:-.275rem;inset-inline-end:-.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}.indicator-without-icon{margin-inline:.25rem;inline-size:1rem;position:relative}.indicator-without-icon:after{content:"";position:absolute;block-size:.5rem;inline-size:.5rem;border-radius:9999px;inset-block-end:-.275rem;inset-inline-end:-.275rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand))}:host([scale=s]) .indicator-with-icon{position:relative}:host([scale=s]) .indicator-with-icon:after{content:"";position:absolute;block-size:.5rem;inline-size:.5rem;border-radius:9999px;inset-block-end:-.125rem;inset-inline-end:-.125rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand));block-size:.375rem;inline-size:.375rem}:host([scale=s]) .indicator-without-icon{position:relative}:host([scale=s]) .indicator-without-icon:after{content:"";position:absolute;block-size:.5rem;inline-size:.5rem;border-radius:9999px;inset-block-end:-.175rem;inset-inline-end:-.175rem;background-color:var(--calcite-action-indicator-color, var(--calcite-color-brand));block-size:.375rem;inline-size:.375rem}.indicator-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}`;
|
|
16
16
|
class Action extends LitElement {
|
|
@@ -24,6 +24,7 @@ class Action extends LitElement {
|
|
|
24
24
|
this.focusSetter = useSetFocus()(this);
|
|
25
25
|
this.indicatorRef = createRef();
|
|
26
26
|
this.interactiveContainer = useInteractive(this);
|
|
27
|
+
this.formTrigger = useFormTrigger()(this);
|
|
27
28
|
this.active = false;
|
|
28
29
|
this.activeDescendant = false;
|
|
29
30
|
this.appearance = "transparent";
|
|
@@ -41,6 +42,9 @@ class Action extends LitElement {
|
|
|
41
42
|
static {
|
|
42
43
|
this.properties = { aria: [0, {}, { attribute: false }], active: [7, {}, { reflect: true, type: Boolean }], activeDescendant: [7, {}, { reflect: true, type: Boolean }], alignment: [3, {}, { reflect: true }], appearance: [3, {}, { reflect: true }], compact: [7, {}, { reflect: true, type: Boolean }], disabled: [7, {}, { reflect: true, type: Boolean }], dragHandle: [7, {}, { reflect: true, type: Boolean }], form: [3, {}, { reflect: true }], icon: [3, { type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], indicator: [7, {}, { reflect: true, type: Boolean }], label: 1, loading: [7, {}, { reflect: true, type: Boolean }], messageOverrides: [0, {}, { attribute: false }], scale: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }], text: 1, textEnabled: [7, {}, { reflect: true, type: Boolean }], type: [3, {}, { reflect: true }], selectionAppearance: [3, {}, { reflect: true }] };
|
|
43
44
|
}
|
|
45
|
+
static {
|
|
46
|
+
this.formAssociated = true;
|
|
47
|
+
}
|
|
44
48
|
static {
|
|
45
49
|
this.styles = styles;
|
|
46
50
|
}
|
|
@@ -49,22 +53,12 @@ class Action extends LitElement {
|
|
|
49
53
|
}
|
|
50
54
|
connectedCallback() {
|
|
51
55
|
super.connectedCallback();
|
|
52
|
-
this.formEl = findAssociatedForm(this);
|
|
53
56
|
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
54
57
|
}
|
|
55
58
|
disconnectedCallback() {
|
|
56
59
|
super.disconnectedCallback();
|
|
57
|
-
this.formEl = null;
|
|
58
60
|
this.mutationObserver?.disconnect();
|
|
59
61
|
}
|
|
60
|
-
handleClick() {
|
|
61
|
-
const { type } = this;
|
|
62
|
-
if (type === "submit") {
|
|
63
|
-
submitForm(this);
|
|
64
|
-
} else if (type === "reset") {
|
|
65
|
-
resetForm(this);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
62
|
renderTextContainer() {
|
|
69
63
|
const { text, textEnabled } = this;
|
|
70
64
|
const textContainerClasses = {
|
|
@@ -106,9 +100,9 @@ class Action extends LitElement {
|
|
|
106
100
|
...internalControlsElements
|
|
107
101
|
];
|
|
108
102
|
if (this.dragHandle) {
|
|
109
|
-
return html`<span .ariaBusy=${loading} .ariaControlsElements=${ariaControlsElements} .ariaDescribedByElements=${this.aria?.describedByElements} .ariaExpanded=${this.aria?.expanded} .ariaHasPopup=${this.aria?.hasPopup} .ariaLabel=${ariaLabel} .ariaLabelledByElements=${this.aria?.labelledByElements} .ariaOwnsElements=${this.aria?.ownsElements} .ariaPressed=${this.aria?.pressed} class=${safeClassMap(buttonClasses)} id=${buttonId ?? nothing} role=button tabindex=${(this.disabled ?
|
|
103
|
+
return html`<span .ariaBusy=${loading} .ariaControlsElements=${ariaControlsElements} .ariaDescribedByElements=${this.aria?.describedByElements} .ariaExpanded=${this.aria?.expanded} .ariaHasPopup=${this.aria?.hasPopup} .ariaLabel=${ariaLabel} .ariaLabelledByElements=${this.aria?.labelledByElements} .ariaOwnsElements=${this.aria?.ownsElements} .ariaPressed=${this.aria?.pressed} class=${safeClassMap(buttonClasses)} id=${buttonId ?? nothing} role=button tabindex=${(this.disabled ? void 0 : 0) ?? nothing} ${ref(this.buttonRef)}>${buttonContent}</span>`;
|
|
110
104
|
}
|
|
111
|
-
return html`<button .ariaBusy=${loading} .ariaChecked=${this.aria?.checked} .ariaControlsElements=${ariaControlsElements} .ariaDescribedByElements=${this.aria?.describedByElements} .ariaExpanded=${this.aria?.expanded} .ariaHasPopup=${this.aria?.hasPopup} .ariaLabel=${ariaLabel} .ariaLabelledByElements=${this.aria?.labelledByElements} .ariaOwnsElements=${this.aria?.ownsElements} .ariaPressed=${this.aria?.pressed} class=${safeClassMap(buttonClasses)} .disabled=${disabled} id=${buttonId ?? nothing}
|
|
105
|
+
return html`<button .ariaBusy=${loading} .ariaChecked=${this.aria?.checked} .ariaControlsElements=${ariaControlsElements} .ariaDescribedByElements=${this.aria?.describedByElements} .ariaExpanded=${this.aria?.expanded} .ariaHasPopup=${this.aria?.hasPopup} .ariaLabel=${ariaLabel} .ariaLabelledByElements=${this.aria?.labelledByElements} .ariaOwnsElements=${this.aria?.ownsElements} .ariaPressed=${this.aria?.pressed} class=${safeClassMap(buttonClasses)} .disabled=${disabled} id=${buttonId ?? nothing} .role=${this.aria?.role} ${ref(this.buttonRef)}>${buttonContent}</button>`;
|
|
112
106
|
}
|
|
113
107
|
render() {
|
|
114
108
|
return this.interactiveContainer({ disabled: this.disabled, children: html`${this.renderButton()}${this.renderIndicatorText()}` });
|
|
@@ -16,9 +16,9 @@ import type { OverlayPositioning } from "../../utils/floating-ui.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export abstract class ActionBar extends LitElement {
|
|
18
18
|
/** Specifies an accessible name for the last `calcite-action-group`. */
|
|
19
|
-
accessor actionsEndGroupLabel: string;
|
|
19
|
+
accessor actionsEndGroupLabel: string | undefined;
|
|
20
20
|
/** Specifies an accessible name for the first `calcite-action-group`. */
|
|
21
|
-
accessor actionsStartGroupLabel: string;
|
|
21
|
+
accessor actionsStartGroupLabel: string | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* When `true`, the expand-toggling behavior is disabled.
|
|
24
24
|
*
|
|
@@ -81,7 +81,7 @@ export abstract class ActionBar extends LitElement {
|
|
|
81
81
|
*
|
|
82
82
|
* When `expanded` is `true`, the chevron direction is reversed.
|
|
83
83
|
*/
|
|
84
|
-
accessor position: Extract<"start" | "end", Position
|
|
84
|
+
accessor position: Extract<"start" | "end", Position> | undefined;
|
|
85
85
|
/**
|
|
86
86
|
* Specifies the size of the expand `calcite-action`.
|
|
87
87
|
*
|
|
@@ -55,11 +55,12 @@ class ActionBar extends LitElement {
|
|
|
55
55
|
this.actions = [];
|
|
56
56
|
this.containerRef = createRef();
|
|
57
57
|
this.direction = useDirection();
|
|
58
|
+
this.actionGroups = [];
|
|
58
59
|
this.mutationObserver = createObserver("mutation", () => this.mutationObserverHandler());
|
|
59
60
|
this.cancelable = useCancelable()(this);
|
|
60
61
|
this.resize = debounce(({ width, height }) => {
|
|
61
62
|
const { expanded, expandDisabled, layout, overflowActionsDisabled, expandPosition } = this;
|
|
62
|
-
if (overflowActionsDisabled || layout === "vertical" && !height || layout === "horizontal" && !width) {
|
|
63
|
+
if (overflowActionsDisabled || layout === "vertical" && !height || layout === "horizontal" && !width || !this.containerRef.value) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
66
|
this.updateGroups();
|
|
@@ -108,7 +109,7 @@ class ActionBar extends LitElement {
|
|
|
108
109
|
this.expanded = !this.expanded;
|
|
109
110
|
this.calciteActionBarToggle.emit();
|
|
110
111
|
};
|
|
111
|
-
this.messages = useT9n();
|
|
112
|
+
this.messages = useT9n({ blocking: true });
|
|
112
113
|
this.focusSetter = useSetFocus()(this);
|
|
113
114
|
this.setExpandToggleEl = (el) => {
|
|
114
115
|
this.expandToggleEl = el;
|
|
@@ -16,7 +16,7 @@ import type { Columns } from "./interfaces.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export abstract class ActionGroup extends LitElement {
|
|
18
18
|
/** Specifies the number of columns. */
|
|
19
|
-
accessor columns: Columns;
|
|
19
|
+
accessor columns: Columns | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* When `true`, expands the component and its contents.
|
|
22
22
|
*
|
|
@@ -24,7 +24,7 @@ export abstract class ActionGroup extends LitElement {
|
|
|
24
24
|
*/
|
|
25
25
|
accessor expanded: boolean;
|
|
26
26
|
/** Specifies an accessible label for the component. */
|
|
27
|
-
accessor label: string;
|
|
27
|
+
accessor label: string | undefined;
|
|
28
28
|
/**
|
|
29
29
|
* Indicates the layout of the component.
|
|
30
30
|
*
|
|
@@ -33,7 +33,7 @@ export abstract class ActionGroup extends LitElement {
|
|
|
33
33
|
*/
|
|
34
34
|
accessor layout: Extract<"horizontal" | "vertical" | "grid", Layout>;
|
|
35
35
|
/** Specifies the component's fallback `menuPlacement` when it's initial or specified `menuPlacement` has insufficient space available. */
|
|
36
|
-
accessor menuFlipPlacements: FlipPlacement[];
|
|
36
|
+
accessor menuFlipPlacements: FlipPlacement[] | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* When `true`, the `calcite-action-menu` is open.
|
|
39
39
|
*
|
|
@@ -41,7 +41,7 @@ export abstract class ActionGroup extends LitElement {
|
|
|
41
41
|
*/
|
|
42
42
|
accessor menuOpen: boolean;
|
|
43
43
|
/** Specifies the position of the action menu. */
|
|
44
|
-
accessor menuPlacement: LogicalPlacement;
|
|
44
|
+
accessor menuPlacement: LogicalPlacement | undefined;
|
|
45
45
|
/** Overrides individual strings used by the component. */
|
|
46
46
|
accessor messageOverrides: { more?: string; };
|
|
47
47
|
/**
|
|
@@ -13,7 +13,7 @@ import type { OverlayPositioning } from "../../utils/floating-ui.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export abstract class ActionPad extends LitElement {
|
|
15
15
|
/** Specifies the accessible label for the last `calcite-action-group`. */
|
|
16
|
-
accessor actionsEndGroupLabel: string;
|
|
16
|
+
accessor actionsEndGroupLabel: string | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* When `true`, the expand-toggling behavior is disabled.
|
|
19
19
|
*
|
|
@@ -50,7 +50,7 @@ export abstract class ActionPad extends LitElement {
|
|
|
50
50
|
*/
|
|
51
51
|
accessor overlayPositioning: OverlayPositioning;
|
|
52
52
|
/** Specifies the position of the component depending on the element's `dir` property. */
|
|
53
|
-
accessor position: Extract<"start" | "end", Position
|
|
53
|
+
accessor position: Extract<"start" | "end", Position> | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* Specifies the size of the expand `calcite-action`.
|
|
56
56
|
*
|
|
@@ -28,7 +28,7 @@ class ActionPad extends LitElement {
|
|
|
28
28
|
this.expanded = !this.expanded;
|
|
29
29
|
this.calciteActionPadToggle.emit();
|
|
30
30
|
};
|
|
31
|
-
this.messages = useT9n();
|
|
31
|
+
this.messages = useT9n({ blocking: true });
|
|
32
32
|
this.focusSetter = useSetFocus()(this);
|
|
33
33
|
this.expandDisabled = false;
|
|
34
34
|
this.expanded = false;
|
|
@@ -3,7 +3,6 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
3
3
|
import type { FlipPlacement, MenuPlacement, OverlayPositioning } from "../../utils/floating-ui.js";
|
|
4
4
|
import type { Alignment, Scale, Status } from "../interfaces.js";
|
|
5
5
|
import type { IconName } from "../calcite-icon/interfaces.js";
|
|
6
|
-
import type { MutableValidityState } from "../../utils/form.js";
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* @cssproperty [--calcite-autocomplete-background-color] - Specifies the component's background color.
|
|
@@ -194,7 +193,7 @@ export abstract class Autocomplete extends LitElement {
|
|
|
194
193
|
*
|
|
195
194
|
* @mdn [ValidityState](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState)
|
|
196
195
|
*/
|
|
197
|
-
get validity():
|
|
196
|
+
get validity(): ValidityState;
|
|
198
197
|
/**
|
|
199
198
|
* Specifies the selected `autocomplete-item`. When the component resides in a form, the `value` is submitted with the form.
|
|
200
199
|
*
|
|
@@ -9,7 +9,6 @@ import { escapeRegExp } from "es-toolkit/compat";
|
|
|
9
9
|
import { createRef, ref } from "lit/directives/ref.js";
|
|
10
10
|
import { d as defaultMenuPlacement, r as reposition, c as connectFloatingUI, a as disconnectFloatingUI, F as FloatingCSS } from "../../chunks/floating-ui.js";
|
|
11
11
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
12
|
-
import { c as connectForm, a as afterConnectDefaultValueSet, d as disconnectForm, s as submitForm, H as HiddenFormInputSlot } from "../../chunks/form.js";
|
|
13
12
|
import { s as slotChangeHasAssignedElement } from "../../chunks/dom.js";
|
|
14
13
|
import { g as guid } from "../../chunks/guid.js";
|
|
15
14
|
import { u as useT9n } from "../../chunks/useT9n.js";
|
|
@@ -21,6 +20,7 @@ import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
|
21
20
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
22
21
|
import { t as toggleOpenClose } from "../../chunks/openCloseComponent.js";
|
|
23
22
|
import { u as useTopLayer } from "../../chunks/useTopLayer.js";
|
|
23
|
+
import { u as useForm } from "../../chunks/useForm.js";
|
|
24
24
|
const styles = css`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:block}.input-container{position:relative;display:flex;flex:1 1 auto;flex-wrap:nowrap}.input{width:100%;--calcite-input-prefix-size: var(--calcite-autocomplete-input-prefix-size);--calcite-input-suffix-size: var(--calcite-autocomplete-input-suffix-size);--calcite-input-background-color: var(--calcite-autocomplete-input-background-color);--calcite-input-border-color: var(--calcite-autocomplete-input-border-color);--calcite-input-corner-radius: var(--calcite-autocomplete-input-corner-radius);--calcite-input-shadow: var(--calcite-autocomplete-input-shadow);--calcite-input-icon-color: var(--calcite-autocomplete-input-icon-color);--calcite-input-text-color: var(--calcite-autocomplete-input-text-color);--calcite-input-placeholder-text-color: var(--calcite-autocomplete-input-placeholder-text-color);--calcite-input-actions-background-color: var(--calcite-autocomplete-input-actions-background-color);--calcite-input-actions-background-color-hover: var(--calcite-autocomplete-input-actions-background-color-hover);--calcite-input-actions-background-color-press: var(--calcite-autocomplete-input-actions-background-color-press);--calcite-input-actions-icon-color: var(--calcite-autocomplete-input-actions-icon-color);--calcite-input-actions-icon-color-hover: var(--calcite-autocomplete-input-actions-icon-color-hover);--calcite-input-actions-icon-color-press: var(--calcite-autocomplete-input-actions-icon-color-press);--calcite-input-loading-background-color: var(--calcite-autocomplete-input-loading-background-color);--calcite-input-loading-fill-color: var(--calcite-autocomplete-input-loading-fill-color);--calcite-input-prefix-text-color: var(--calcite-autocomplete-input-prefix-text-color);--calcite-input-suffix-text-color: var(--calcite-autocomplete-input-suffix-text-color)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.content-container{box-sizing:border-box;width:100%}.floating-ui-container{inline-size:max-content;display:none;max-inline-size:100vw;max-block-size:100vh;inset-block-start:0;left:0;z-index:var(--calcite-floating-ui-z-index)}@starting-style{.floating-ui-container{opacity:0;inset-block-start:0;left:0}}:host([top-layer-disabled]) .floating-ui-container{--calcite-floating-ui-z-index: var(--calcite-z-index-dropdown)}.floating-ui-container[popover]{padding:0;margin:0;border:none;background-color:transparent;overflow:visible;display:none}.floating-ui-container:popover-open{display:block}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition-duration:var(--calcite-floating-ui-transition);transition-property:inset-block-start,left,opacity,display;transition-behavior:allow-discrete;opacity:0;box-shadow:0 0 16px #00000029;z-index:var(--calcite-z-index);border-radius:.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block-start:0;left:0}@starting-style{.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:0}}.content-container .calcite-floating-ui-anim{width:100%;overflow-y:auto;max-block-size:var(--calcite-autocomplete-menu-max-size-y, 45vh);color:var(--calcite-autocomplete-text-color, var(--calcite-color-text-1));background-color:var(--calcite-autocomplete-background-color, var(--calcite-color-foreground-1));border-radius:var(--calcite-autocomplete-corner-radius, var(--calcite-corner-radius-round))}.content--hidden{display:none}@media(forced-colors:active){.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.internal-label-alignment--center{align-items:center}.internal-label-alignment--end{align-items:end}.internal-label--container{display:flex;justify-content:space-between;color:var(--calcite-color-text-1)}.internal-label-required--indicator{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-status-danger);padding-inline:var(--calcite-spacing-base)}.internal-label-required--indicator:hover{cursor:help}.internal-label--text{line-height:1}:host([scale=s]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-xxs)}:host([scale=s]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=s]) .internal-label--text{font-size:var(--calcite-font-size--2)}:host([scale=m]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .internal-label--text{font-size:var(--calcite-font-size--1)}:host([scale=l]) .internal-label-spacing--bottom{margin-block-end:var(--calcite-spacing-sm)}:host([scale=l]) .internal-label-spacing-inline--end{margin-inline-end:var(--calcite-spacing-md)}:host([scale=l]) .internal-label-spacing-inline--start{margin-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .internal-label--text{font-size:var(--calcite-font-size-0)}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:.5rem}:host([scale=s]) .validation-container{padding-block-start:.25rem}::slotted(input[slot=hidden-form-input]){margin:0!important;opacity:0!important;outline:none!important;padding:0!important;position:absolute!important;inset:0!important;transform:none!important;-webkit-appearance:none!important;z-index:-1!important}:host([hidden]){display:none}[hidden]{display:none}`;
|
|
25
25
|
const SLOTS = {
|
|
26
26
|
contentBottom: "content-bottom",
|
|
@@ -51,6 +51,9 @@ class Autocomplete extends LitElement {
|
|
|
51
51
|
this.guid = guid();
|
|
52
52
|
this.attributeWatch = useWatchAttributes(["autofocus", "enterkeyhint", "inputmode"], this.handleGlobalAttributesChanged);
|
|
53
53
|
this.direction = useDirection();
|
|
54
|
+
this.formSupport = useForm({
|
|
55
|
+
inputType: "text"
|
|
56
|
+
})(this);
|
|
54
57
|
this.inputId = IDS.input(this.guid);
|
|
55
58
|
this.listId = IDS.list(this.guid);
|
|
56
59
|
this.messages = useT9n();
|
|
@@ -85,19 +88,6 @@ class Autocomplete extends LitElement {
|
|
|
85
88
|
this.scale = "m";
|
|
86
89
|
this.status = "idle";
|
|
87
90
|
this.topLayerDisabled = false;
|
|
88
|
-
this.validity = {
|
|
89
|
-
valid: false,
|
|
90
|
-
badInput: false,
|
|
91
|
-
customError: false,
|
|
92
|
-
patternMismatch: false,
|
|
93
|
-
rangeOverflow: false,
|
|
94
|
-
rangeUnderflow: false,
|
|
95
|
-
stepMismatch: false,
|
|
96
|
-
tooLong: false,
|
|
97
|
-
tooShort: false,
|
|
98
|
-
typeMismatch: false,
|
|
99
|
-
valueMissing: false
|
|
100
|
-
};
|
|
101
91
|
this.value = "";
|
|
102
92
|
this.calciteAutocompleteBeforeClose = createEvent({ cancelable: false });
|
|
103
93
|
this.calciteAutocompleteBeforeOpen = createEvent({ cancelable: false });
|
|
@@ -112,6 +102,9 @@ class Autocomplete extends LitElement {
|
|
|
112
102
|
static {
|
|
113
103
|
this.properties = { activeDescendant: [16, {}, { state: true }], activeIndex: [16, {}, { state: true }], hasContentBottom: [16, {}, { state: true }], hasContentTop: [16, {}, { state: true }], items: [16, {}, { state: true }], groups: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], autocomplete: 1, disabled: [7, {}, { reflect: true, type: Boolean }], flipPlacements: [0, {}, { attribute: false }], form: [3, {}, { reflect: true }], icon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], iconFlipRtl: [7, {}, { reflect: true, type: Boolean }], inputValue: 1, label: 1, labelText: 1, loading: [7, {}, { reflect: true, type: Boolean }], maxLength: [11, {}, { reflect: true, type: Number }], messageOverrides: [0, {}, { attribute: false }], minLength: [11, {}, { reflect: true, type: Number }], name: [3, {}, { reflect: true }], open: [7, {}, { reflect: true, type: Boolean }], overlayPositioning: [3, {}, { reflect: true }], pattern: 1, placeholder: 1, placement: [3, {}, { reflect: true }], prefixText: 1, readOnly: [7, {}, { reflect: true, type: Boolean }], required: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], status: [3, {}, { reflect: true }], suffixText: 1, topLayerDisabled: [7, {}, { reflect: true, type: Boolean }], validationIcon: [3, { converter: stringOrBoolean, type: String }, { reflect: true }], validationMessage: 1, validity: [0, {}, { attribute: false }], value: 1 };
|
|
114
104
|
}
|
|
105
|
+
static {
|
|
106
|
+
this.formAssociated = true;
|
|
107
|
+
}
|
|
115
108
|
static {
|
|
116
109
|
this.styles = styles;
|
|
117
110
|
}
|
|
@@ -151,8 +144,6 @@ class Autocomplete extends LitElement {
|
|
|
151
144
|
subtree: true
|
|
152
145
|
});
|
|
153
146
|
connectLabel(this);
|
|
154
|
-
connectForm(this);
|
|
155
|
-
this.defaultInputValue = this.inputValue || "";
|
|
156
147
|
this.getAllItemsDebounced();
|
|
157
148
|
connectFloatingUI(this);
|
|
158
149
|
this.cancelable.add(this.getAllItemsDebounced);
|
|
@@ -187,8 +178,6 @@ class Autocomplete extends LitElement {
|
|
|
187
178
|
}
|
|
188
179
|
}
|
|
189
180
|
loaded() {
|
|
190
|
-
afterConnectDefaultValueSet(this, this.value || "");
|
|
191
|
-
this.defaultInputValue = this.inputValue || "";
|
|
192
181
|
connectFloatingUI(this);
|
|
193
182
|
}
|
|
194
183
|
disconnectedCallback() {
|
|
@@ -196,7 +185,6 @@ class Autocomplete extends LitElement {
|
|
|
196
185
|
this.mutationObserver?.disconnect();
|
|
197
186
|
this.resizeObserver?.disconnect();
|
|
198
187
|
disconnectLabel(this);
|
|
199
|
-
disconnectForm(this);
|
|
200
188
|
disconnectFloatingUI(this);
|
|
201
189
|
}
|
|
202
190
|
setFloatingElSize() {
|
|
@@ -241,9 +229,6 @@ class Autocomplete extends LitElement {
|
|
|
241
229
|
onLabelClick() {
|
|
242
230
|
this.setFocus();
|
|
243
231
|
}
|
|
244
|
-
onFormReset() {
|
|
245
|
-
this.inputValue = this.defaultInputValue;
|
|
246
|
-
}
|
|
247
232
|
onBeforeOpen() {
|
|
248
233
|
this.calciteAutocompleteBeforeOpen.emit();
|
|
249
234
|
this.topLayer.show();
|
|
@@ -333,10 +318,9 @@ class Autocomplete extends LitElement {
|
|
|
333
318
|
activeItem.toggleSelection();
|
|
334
319
|
this.open = false;
|
|
335
320
|
event.preventDefault();
|
|
336
|
-
} else if (!event.defaultPrevented) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
321
|
+
} else if (!event.defaultPrevented && this.formSupport.active) {
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
this.formSupport.requestSubmit();
|
|
340
324
|
}
|
|
341
325
|
break;
|
|
342
326
|
case "ArrowDown":
|
|
@@ -410,7 +394,7 @@ class Autocomplete extends LitElement {
|
|
|
410
394
|
[CSS.contentAnimation]: true,
|
|
411
395
|
[FloatingCSS.animation]: true,
|
|
412
396
|
[FloatingCSS.animationActive]: isOpen
|
|
413
|
-
})} ${ref(this.transitionRef)}><div class=${safeClassMap({ [CSS.content]: true, [CSS.contentHidden]: !isOpen })}><slot name=${SLOTS.contentTop} @slotchange=${this.handleContentTopSlotChange}></slot><slot aria-hidden=true></slot><slot name=${SLOTS.contentBottom} @slotchange=${this.handleContentBottomSlotChange}></slot></div></div></div></div>${
|
|
397
|
+
})} ${ref(this.transitionRef)}><div class=${safeClassMap({ [CSS.content]: true, [CSS.contentHidden]: !isOpen })}><slot name=${SLOTS.contentTop} @slotchange=${this.handleContentTopSlotChange}></slot><slot aria-hidden=true></slot><slot name=${SLOTS.contentBottom} @slotchange=${this.handleContentBottomSlotChange}></slot></div></div></div></div>${this.validationMessage && this.status === "invalid" ? Validation({ icon: this.validationIcon, id: IDS.validationMessage, message: this.validationMessage, scale: this.scale, status: this.status }) : null}` });
|
|
414
398
|
}
|
|
415
399
|
renderListBox() {
|
|
416
400
|
return html`<ul aria-labelledby=${this.inputId ?? nothing} aria-live=polite class=${safeClassMap(CSS.screenReadersOnly)} id=${this.listId ?? nothing} role=listbox tabindex=-1>${this.renderListBoxOptions()}</ul>`;
|
|
@@ -4,12 +4,12 @@ import { debounce } from "es-toolkit";
|
|
|
4
4
|
import { css, html } from "lit";
|
|
5
5
|
import { LitElement, createEvent, safeClassMap } from "@arcgis/lumina";
|
|
6
6
|
import { c as createObserver } from "../../chunks/observers.js";
|
|
7
|
-
import { d as disconnectSortableComponent, c as connectSortableComponent } from "../../chunks/sortableComponent.js";
|
|
8
7
|
import { e as getRootNode, a as slotChangeGetAssignedElements } from "../../chunks/dom.js";
|
|
9
8
|
import { g as guid } from "../../chunks/guid.js";
|
|
10
9
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
11
10
|
import { u as useCancelable } from "../../chunks/useCancelable.js";
|
|
12
11
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
12
|
+
import { u as useSortable } from "../../chunks/useSortable.js";
|
|
13
13
|
function isBlock(element) {
|
|
14
14
|
return element.tagName === "CALCITE-BLOCK";
|
|
15
15
|
}
|
|
@@ -39,6 +39,7 @@ class BlockGroup extends LitElement {
|
|
|
39
39
|
this.blockAndGroups = [];
|
|
40
40
|
this.cancelable = useCancelable()(this);
|
|
41
41
|
this.focusSetter = useSetFocus()(this);
|
|
42
|
+
this.sortable = useSortable()(this);
|
|
42
43
|
this.updateBlockItemsDebounced = debounce(this.updateBlockItems, DEBOUNCE.nextTick);
|
|
43
44
|
this.interactiveContainer = useInteractive(this);
|
|
44
45
|
this.sortHandleMenuItems = [];
|
|
@@ -88,7 +89,6 @@ class BlockGroup extends LitElement {
|
|
|
88
89
|
disconnectedCallback() {
|
|
89
90
|
super.disconnectedCallback();
|
|
90
91
|
this.disconnectObserver();
|
|
91
|
-
disconnectSortableComponent(this);
|
|
92
92
|
}
|
|
93
93
|
updateBlockItems() {
|
|
94
94
|
this.updateGroupItems();
|
|
@@ -166,7 +166,7 @@ class BlockGroup extends LitElement {
|
|
|
166
166
|
if (!dragEnabled) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
this.sortable.reset();
|
|
170
170
|
}
|
|
171
171
|
onGlobalDragStart() {
|
|
172
172
|
this.disconnectObserver();
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type { DragDetail } from "../../
|
|
1
|
+
import type { DragDetail } from "../../controllers/useSortable.js";
|
|
2
2
|
import type { Block } from "../calcite-block/customElement.js";
|
|
3
3
|
import type { BlockGroup } from "./customElement.js";
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
toEl: BlockGroup;
|
|
7
|
-
fromEl: BlockGroup;
|
|
8
|
-
dragEl: Block;
|
|
9
|
-
}
|
|
5
|
+
export type BlockDragDetail = DragDetail<BlockGroup, BlockGroup, Block>;
|
|
@@ -5,7 +5,6 @@ import { createRef, ref } from "lit/directives/ref.js";
|
|
|
5
5
|
import { literal, html as html$1 } from "lit/static-html.js";
|
|
6
6
|
import { LitElement, stringOrBoolean, safeClassMap, nothing } from "@arcgis/lumina";
|
|
7
7
|
import { useWatchAttributes } from "@arcgis/lumina/controllers";
|
|
8
|
-
import { f as findAssociatedForm, s as submitForm, r as resetForm } from "../../chunks/form.js";
|
|
9
8
|
import { c as connectLabel, d as disconnectLabel, g as getLabelText } from "../../chunks/label.js";
|
|
10
9
|
import { c as createObserver, u as updateRefObserver } from "../../chunks/observers.js";
|
|
11
10
|
import { g as getIconScale } from "../../chunks/component.js";
|
|
@@ -13,6 +12,7 @@ import { u as useT9n } from "../../chunks/useT9n.js";
|
|
|
13
12
|
import { h as hasVisibleContent } from "../../chunks/dom.js";
|
|
14
13
|
import { u as useSetFocus } from "../../chunks/useSetFocus.js";
|
|
15
14
|
import { u as useInteractive } from "../../chunks/useInteractive.js";
|
|
15
|
+
import { u as useFormTrigger } from "../../chunks/useFormTrigger.js";
|
|
16
16
|
const CSS = {
|
|
17
17
|
buttonLoader: "calcite-button--loader",
|
|
18
18
|
content: "content",
|
|
@@ -33,6 +33,7 @@ class Button extends LitElement {
|
|
|
33
33
|
super(...arguments);
|
|
34
34
|
this.attributeWatch = useWatchAttributes(["aria-expanded"], this.handleGlobalAttributesChanged);
|
|
35
35
|
this.contentRef = createRef();
|
|
36
|
+
this.formTrigger = useFormTrigger({ disabled: () => !!this.href })(this);
|
|
36
37
|
this.mutationObserver = createObserver("mutation", () => this.updateHasContent());
|
|
37
38
|
this.resizeObserver = createObserver("resize", () => this.setTooltipText());
|
|
38
39
|
this.focusSetter = useSetFocus()(this);
|
|
@@ -54,6 +55,9 @@ class Button extends LitElement {
|
|
|
54
55
|
static {
|
|
55
56
|
this.properties = { hasContent: [16, {}, { state: true }], tooltipText: [16, {}, { state: true }], alignment: [3, {}, { reflect: true }], appearance: [3, {}, { reflect: true }], disabled: [7, {}, { reflect: true, type: Boolean }], download: [3, { converter: stringOrBoolean }, { reflect: true }], form: [3, {}, { reflect: true }], href: [3, {}, { reflect: true }], iconEnd: [3, { type: String }, { reflect: true }], iconFlipRtl: [3, {}, { reflect: true }], iconStart: [3, { type: String }, { reflect: true }], kind: [3, {}, { reflect: true }], label: 1, loading: [7, {}, { reflect: true, type: Boolean }], messageOverrides: [0, {}, { attribute: false }], name: [3, {}, { reflect: true }], rel: [3, {}, { reflect: true }], round: [7, {}, { reflect: true, type: Boolean }], scale: [3, {}, { reflect: true }], splitChild: [3, {}, { reflect: true }], target: [3, {}, { reflect: true }], type: [3, {}, { reflect: true }], width: [3, {}, { reflect: true }] };
|
|
56
57
|
}
|
|
58
|
+
static {
|
|
59
|
+
this.formAssociated = true;
|
|
60
|
+
}
|
|
57
61
|
static {
|
|
58
62
|
this.styles = styles;
|
|
59
63
|
}
|
|
@@ -64,7 +68,6 @@ class Button extends LitElement {
|
|
|
64
68
|
super.connectedCallback();
|
|
65
69
|
this.setupTextContentObserver();
|
|
66
70
|
connectLabel(this);
|
|
67
|
-
this.formEl = findAssociatedForm(this);
|
|
68
71
|
}
|
|
69
72
|
async load() {
|
|
70
73
|
this.updateHasContent();
|
|
@@ -77,7 +80,6 @@ class Button extends LitElement {
|
|
|
77
80
|
this.mutationObserver?.disconnect();
|
|
78
81
|
disconnectLabel(this);
|
|
79
82
|
this.resizeObserver?.disconnect();
|
|
80
|
-
this.formEl = null;
|
|
81
83
|
}
|
|
82
84
|
handleGlobalAttributesChanged() {
|
|
83
85
|
this.requestUpdate();
|
|
@@ -89,20 +91,8 @@ class Button extends LitElement {
|
|
|
89
91
|
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
|
|
90
92
|
}
|
|
91
93
|
onLabelClick() {
|
|
92
|
-
this.handleClick();
|
|
93
94
|
this.setFocus();
|
|
94
95
|
}
|
|
95
|
-
handleClick() {
|
|
96
|
-
const { type } = this;
|
|
97
|
-
if (this.href) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
if (type === "submit") {
|
|
101
|
-
submitForm(this);
|
|
102
|
-
} else if (type === "reset") {
|
|
103
|
-
resetForm(this);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
96
|
setTooltipText() {
|
|
107
97
|
const { contentRef: { value: contentEl } } = this;
|
|
108
98
|
if (contentEl) {
|
|
@@ -127,7 +117,7 @@ class Button extends LitElement {
|
|
|
127
117
|
[CSS.contentSlotted]: this.hasContent,
|
|
128
118
|
[CSS.iconStartEmpty]: !this.iconStart,
|
|
129
119
|
[CSS.iconEndEmpty]: !this.iconEnd
|
|
130
|
-
})} .disabled=${childElType === "button" ? this.disabled : null} download=${(childElType === "a" ? this.download === true || this.download === "" ? "" : this.download || null : null) ?? nothing} href=${(childElType === "a" && this.href) ?? nothing} name=${(childElType === "button" && this.name) ?? nothing}
|
|
120
|
+
})} .disabled=${childElType === "button" ? this.disabled : null} download=${(childElType === "a" ? this.download === true || this.download === "" ? "" : this.download || null : null) ?? nothing} href=${(childElType === "a" && this.href) ?? nothing} name=${(childElType === "button" && this.name) ?? nothing} rel=${(childElType === "a" && this.rel) ?? nothing} tabindex=${(this.disabled ? -1 : null) ?? nothing} target=${(childElType === "a" && this.target) ?? nothing} title=${this.tooltipText ?? nothing} type=${(childElType === "button" ? this.type : null) ?? nothing} ${ref(this.setChildEl)}>${loaderNode}${this.iconStart ? iconStartEl : null}${this.hasContent ? contentEl : null}${this.iconEnd ? iconEndEl : null}</${DynamicHtmlTag}>` });
|
|
131
121
|
}
|
|
132
122
|
}
|
|
133
123
|
customElement("calcite-button", Button);
|