@arcgis/common-components 5.2.0-next.8 → 5.2.0-next.85
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/LICENSE.md +4 -2
- package/README.md +2 -2
- package/dist/cdn/27EUJ42B.js +2 -0
- package/dist/cdn/2DBEFZKU.js +2 -0
- package/dist/cdn/3AUZDTAO.js +2 -0
- package/dist/cdn/{YVCGEEMG.js → 3UQSJI42.js} +1 -1
- package/dist/cdn/55IHT3E4.js +2 -0
- package/dist/cdn/5E5MB2QP.js +2 -0
- package/dist/cdn/6U23ZLNL.js +2 -0
- package/dist/cdn/74HCCFF3.js +2 -0
- package/dist/cdn/7AR3O4ZS.js +2 -0
- package/dist/cdn/{232BH3SJ.js → 7EEEFB6L.js} +1 -1
- package/dist/cdn/7XQMQNCX.js +2 -0
- package/dist/cdn/A6RDL4CI.js +2 -0
- package/dist/cdn/AWYYBYBY.js +2 -0
- package/dist/cdn/B3226756.js +2 -0
- package/dist/cdn/D3CAYLG2.js +2 -0
- package/dist/cdn/DTKSHV5R.js +2 -0
- package/dist/cdn/EN4SF4GM.js +2 -0
- package/dist/cdn/ERX25SUU.js +2 -0
- package/dist/cdn/GKRQCQJX.js +2 -0
- package/dist/cdn/GKXJQ57E.js +2 -0
- package/dist/cdn/GNOGT5M3.js +2 -0
- package/dist/cdn/GTQ5JPAH.js +2 -0
- package/dist/cdn/{MINFRX4Y.js → IT7T37BP.js} +1 -1
- package/dist/cdn/KENOGFN5.js +2 -0
- package/dist/cdn/N2JKXWQD.js +2 -0
- package/dist/cdn/NQ3DXW4S.js +2 -0
- package/dist/cdn/NUND77X7.js +2 -0
- package/dist/cdn/PMV2N3L3.js +2 -0
- package/dist/cdn/{WJ3TYWP2.js → PYSJFWBZ.js} +1 -1
- package/dist/cdn/QAJVUVAJ.js +2 -0
- package/dist/cdn/QTEF27SV.js +2 -0
- package/dist/cdn/{OOBX2C2L.js → QX7C26ZB.js} +1 -1
- package/dist/cdn/TLLOXQDJ.js +2 -0
- package/dist/cdn/TUBHYRSA.js +2 -0
- package/dist/cdn/TWW63D32.js +2 -0
- package/dist/cdn/VCZLD7ZT.js +2 -0
- package/dist/cdn/VHD24C2I.js +2 -0
- package/dist/cdn/VOBBBIYC.js +2 -0
- package/dist/cdn/{YG4PY2H3.js → XO3QLFU5.js} +1 -1
- package/dist/cdn/{6XE5JNJ7.js → YSGNGGED.js} +3 -3
- package/dist/cdn/Z5QBBHLD.js +2 -0
- package/dist/cdn/assets/slider-field/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/value-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/value-picker-combobox/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/element-reference-controller.js +17 -0
- package/dist/chunks/layer-utils.js +52 -40
- package/dist/chunks/locale.js +14 -6
- package/dist/chunks/utils.js +69 -0
- package/dist/chunks/utils2.js +20 -0
- package/dist/chunks/utils3.js +7 -0
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +6 -1
- package/dist/components/arcgis-ckeditor5/customElement.js +2 -2
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
- package/dist/components/arcgis-color-input/customElement.d.ts +2 -1
- package/dist/components/arcgis-color-input/customElement.js +6 -6
- package/dist/components/arcgis-coordinate-system-picker/customElement.d.ts +6 -1
- package/dist/components/arcgis-coordinate-system-picker/customElement.js +1 -1
- package/dist/components/arcgis-field-info/customElement.js +251 -221
- package/dist/components/arcgis-field-info/index.js +1 -0
- package/dist/components/arcgis-field-info/utils/basic.d.ts +3 -1
- package/dist/components/arcgis-field-pick-list/customElement.js +54 -62
- package/dist/components/arcgis-field-pick-list/utils/types.d.ts +3 -1
- package/dist/components/arcgis-histogram/customElement.d.ts +30 -0
- package/dist/components/arcgis-histogram/customElement.js +105 -90
- package/dist/components/arcgis-picker-input/customElement.d.ts +6 -2
- package/dist/components/arcgis-picker-input/customElement.js +7 -7
- package/dist/components/arcgis-slider/customElement.d.ts +4 -3
- package/dist/components/arcgis-slider/customElement.js +302 -282
- package/dist/components/arcgis-slider-field/customElement.d.ts +298 -0
- package/dist/components/arcgis-slider-field/customElement.js +378 -0
- package/dist/components/arcgis-slider-field/index.d.ts +1 -0
- package/dist/components/arcgis-slider-field/index.js +2 -0
- package/dist/components/arcgis-ticks/customElement.js +100 -79
- package/dist/components/arcgis-toolbar/customElement.d.ts +47 -0
- package/dist/components/arcgis-toolbar/customElement.js +82 -0
- package/dist/components/arcgis-toolbar/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar/index.js +2 -0
- package/dist/components/arcgis-toolbar/types.d.ts +10 -0
- package/dist/components/arcgis-toolbar-action/customElement.d.ts +97 -0
- package/dist/components/arcgis-toolbar-action/customElement.js +57 -0
- package/dist/components/arcgis-toolbar-action/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-action/index.js +3 -0
- package/dist/components/arcgis-toolbar-group/customElement.d.ts +38 -0
- package/dist/components/arcgis-toolbar-group/customElement.js +47 -0
- package/dist/components/arcgis-toolbar-group/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-group/index.js +2 -0
- package/dist/components/arcgis-toolbar-item/customElement.d.ts +83 -0
- package/dist/components/arcgis-toolbar-item/customElement.js +42 -0
- package/dist/components/arcgis-toolbar-item/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-item/index.js +4 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.d.ts +52 -0
- package/dist/components/arcgis-toolbar-more-button/customElement.js +68 -0
- package/dist/components/arcgis-toolbar-more-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-more-button/index.js +6 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.d.ts +51 -0
- package/dist/components/arcgis-toolbar-split-button/customElement.js +66 -0
- package/dist/components/arcgis-toolbar-split-button/index.d.ts +1 -0
- package/dist/components/arcgis-toolbar-split-button/index.js +6 -0
- package/dist/components/arcgis-unique-values-list/customElement.js +115 -95
- package/dist/components/arcgis-value-picker/customElement.d.ts +377 -0
- package/dist/components/arcgis-value-picker/customElement.js +87 -0
- package/dist/components/arcgis-value-picker/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker/index.js +3 -0
- package/dist/components/arcgis-value-picker/types.d.ts +69 -0
- package/dist/components/arcgis-value-picker-collection/customElement.d.ts +113 -0
- package/dist/components/arcgis-value-picker-collection/customElement.js +43 -0
- package/dist/components/arcgis-value-picker-collection/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-collection/index.js +1 -0
- package/dist/components/arcgis-value-picker-combobox/customElement.d.ts +90 -0
- package/dist/components/arcgis-value-picker-combobox/customElement.js +55 -0
- package/dist/components/arcgis-value-picker-combobox/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-combobox/index.js +3 -0
- package/dist/components/arcgis-value-picker-label/customElement.d.ts +81 -0
- package/dist/components/arcgis-value-picker-label/customElement.js +51 -0
- package/dist/components/arcgis-value-picker-label/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-label/index.js +1 -0
- package/dist/components/arcgis-value-picker-slider/customElement.d.ts +173 -0
- package/dist/components/arcgis-value-picker-slider/customElement.js +60 -0
- package/dist/components/arcgis-value-picker-slider/index.d.ts +1 -0
- package/dist/components/arcgis-value-picker-slider/index.js +3 -0
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.css-custom-data.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +96 -0
- package/dist/loader.js +17 -5
- package/dist/types/lumina.d.ts +79 -1
- package/dist/types/preact.d.ts +91 -1
- package/dist/types/react.d.ts +103 -1
- package/dist/types/stencil.d.ts +81 -3
- package/package.json +5 -5
- package/dist/cdn/2MN6S2HH.js +0 -2
- package/dist/cdn/4BJYJUMR.js +0 -2
- package/dist/cdn/5I5ODGDD.js +0 -2
- package/dist/cdn/AGGCAE6P.js +0 -2
- package/dist/cdn/BDF4ZLUF.js +0 -2
- package/dist/cdn/F45Q3BRT.js +0 -2
- package/dist/cdn/GEWXC2ZR.js +0 -2
- package/dist/cdn/HWEOBUAY.js +0 -2
- package/dist/cdn/IRIB5DXG.js +0 -2
- package/dist/cdn/KPJCYYYQ.js +0 -2
- package/dist/cdn/NKMDS2IH.js +0 -2
- package/dist/cdn/ORSF6IOL.js +0 -2
- package/dist/cdn/QEW7H22O.js +0 -2
- package/dist/cdn/UMIMGOKS.js +0 -2
- package/dist/cdn/YSXFXVP6.js +0 -2
- package/dist/cdn/YVWFGK4M.js +0 -2
- package/dist/cdn/ZXBEGZZ3.js +0 -2
- package/dist/cdn/assets/coordinate-system-picker/t9n/messages.en-US.json +0 -1
- /package/dist/cdn/{ECNI2A4K.js → XEK22IDA.js} +0 -0
- /package/dist/chunks/{commonFunctions.js → general.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { formatNumber as
|
|
6
|
-
const
|
|
2
|
+
import { c as M } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as C, html as h } from "lit";
|
|
4
|
+
import { LitElement as F, createEvent as L, safeClassMap as o, nothing as y, safeStyleMap as m } from "@arcgis/lumina";
|
|
5
|
+
import { formatNumber as T } from "@arcgis/core/intl.js";
|
|
6
|
+
const c = {
|
|
7
7
|
container: "container",
|
|
8
8
|
ticksContainer: "ticks-container",
|
|
9
9
|
labelsContainer: "labels-container",
|
|
@@ -11,131 +11,152 @@ const n = {
|
|
|
11
11
|
tickMin: "tick--min",
|
|
12
12
|
tickMax: "tick--max",
|
|
13
13
|
tickLabel: "tick-label",
|
|
14
|
+
tickLabelFocused: "tick-label--focused",
|
|
15
|
+
tickLabelText: "tick-label-text",
|
|
14
16
|
baseline: "baseline"
|
|
15
|
-
},
|
|
16
|
-
class
|
|
17
|
+
}, z = C`:host{display:flex;--arcgis-ticks-font-size: var(--calcite-font-size--2);--arcgis-ticks-font-weight: var(--calcite-font-weight-medium);--arcgis-ticks-gap: 1em;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-transform: translateX(-50%);--arcgis-ticks-tick-width: .125rem}.container{align-items:stretch;display:flex;color:var(--calcite-color-text-2);flex:1;font-weight:var(--arcgis-ticks-font-weight);font-size:var(--arcgis-ticks-font-size);line-height:1em;position:relative;user-select:none;word-wrap:normal;word-break:normal}.baseline{background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick{position:absolute;background-color:var(--arcgis-ticks-tick-color, var(--calcite-color-border-input))}.tick-label{position:absolute;text-align:var(--arcgis-ticks-label-text-align, center);width:var(--arcgis-ticks-label-width, var(--labels-container-width, "auto"))}.tick-label-text:hover{text-decoration:underline}.tick-label-text{display:inline-block;line-height:1}.tick-label--focused .tick-label-text{outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:dir(rtl){.tick-label{direction:rtl}}:host([layout="horizontal"]){.ticks-container{height:var(--arcgis-ticks-tick-length)}.labels-container{height:var(--labels-container-height, "auto")}.tick{width:var(--arcgis-ticks-tick-width);height:var(--arcgis-ticks-tick-length);transform:var(--arcgis-ticks-tick-transform)}.tick-label{transform:translate(-50%)}.tick--min{transform:unset}.tick--max{transform:translate(-100%)}}:host([layout="vertical"]){.ticks-container{width:var(--arcgis-ticks-tick-length)}.labels-container{width:var(--labels-container-width)}.tick{width:var(--arcgis-ticks-tick-length);height:var(--arcgis-ticks-tick-width);transform:translateY(50%)}.tick-label{text-align:right;transform:translateY(50%)}.tick--min{transform:unset}.tick--max{transform:translateY(100%)}}:host([layout="horizontal"][mirrored]){.tick,.tick-label{transform:translate(50%)}.tick--min{transform:unset}.tick--max{transform:translate(100%)}}:host([layout="vertical"][mirrored]){.tick,.tick-label{transform:translateY(-50%)}.tick--min{transform:unset}.tick--max{transform:translateY(-100%)}}:host([layout="horizontal"][label-placement="start"]){.container{flex-direction:column;justify-content:flex-end}.labels-container{margin-bottom:var(--arcgis-ticks-gap)}}:host([layout="horizontal"][label-placement="end"]){.container{flex-direction:column-reverse;justify-content:flex-end}.labels-container{margin-top:var(--arcgis-ticks-gap)}}:host([layout="vertical"][label-placement="start"]){.container{flex-direction:row;justify-content:flex-end}:dir(ltr){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right}}:dir(rtl){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left;unicode-bidi:plaintext}}}:host([layout="vertical"][label-placement="end"]){.container{flex-direction:row-reverse;justify-content:flex-end}:dir(ltr){.labels-container{margin-left:var(--arcgis-ticks-gap)}.tick-label{text-align:left}}:dir(rtl){.labels-container{margin-right:var(--arcgis-ticks-gap)}.tick-label{text-align:right;unicode-bidi:plaintext}}}:host([interactive]){pointer-events:none;.tick,.tick-label{pointer-events:auto;cursor:pointer}.tick:focus{background-color:var(--calcite-color-brand);outline:2px solid var(--calcite-color-focus, var(--calcite-color-brand));outline-offset:calc(2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}}`;
|
|
18
|
+
class A extends F {
|
|
17
19
|
constructor() {
|
|
18
|
-
super(...arguments), this._formatValue = (
|
|
20
|
+
super(...arguments), this._formatValue = (t) => T(t, this._formatOptions), this._activeTick = null, this._formatOptions = {
|
|
19
21
|
style: "decimal",
|
|
20
22
|
useGrouping: !0,
|
|
21
23
|
minimumFractionDigits: 0,
|
|
22
24
|
maximumFractionDigits: 2
|
|
23
|
-
}, this.interactive = !1, this.interpolationExponent = 0, this.labelPlacement = "end", this.layout = "horizontal", this.max = 100, this.min = 0, this.mirrored = !1, this.mode = "count", this.showLabels = !1, this.showBaseline = !1, this.values = [], this.arcgisTickClick =
|
|
25
|
+
}, this.interactive = !1, this.interpolationExponent = 0, this.labelPlacement = "end", this.layout = "horizontal", this.max = 100, this.min = 0, this.mirrored = !1, this.mode = "count", this.showLabels = !1, this.showBaseline = !1, this.values = [], this.arcgisTickClick = L({ cancelable: !1 });
|
|
24
26
|
}
|
|
25
27
|
static {
|
|
26
|
-
this.properties = { _formatOptions: 16, interactive: 7, interpolationExponent: 9, labelFormatter: 0, labelPlacement: 3, layout: 3, max: 9, min: 9, mirrored: 7, mode: 1, showLabels: 5, showBaseline: 5, values: [9, { converter: {
|
|
27
|
-
fromAttribute(
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
28
|
+
this.properties = { _activeTick: 16, _formatOptions: 16, interactive: 7, interpolationExponent: 9, labelFormatter: 0, labelPlacement: 3, layout: 3, max: 9, min: 9, mirrored: 7, mode: 1, showLabels: 5, showBaseline: 5, values: [9, { converter: {
|
|
29
|
+
fromAttribute(t) {
|
|
30
|
+
if (t.includes(","))
|
|
31
|
+
return t.split(",").filter((e) => e.trim() !== "").map(parseFloat).filter((e) => Number.isFinite(e));
|
|
30
32
|
{
|
|
31
|
-
const
|
|
32
|
-
return Number.isFinite(
|
|
33
|
+
const e = parseFloat(t);
|
|
34
|
+
return Number.isFinite(e) ? [e] : [];
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
37
|
} }] };
|
|
36
38
|
}
|
|
37
39
|
static {
|
|
38
|
-
this.styles =
|
|
40
|
+
this.styles = z;
|
|
39
41
|
}
|
|
40
42
|
updated() {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const t = this.renderRoot.querySelector(`.${c.labelsContainer}`);
|
|
44
|
+
if (t) {
|
|
45
|
+
t.style.removeProperty("--labels-container-width"), t.style.removeProperty("--labels-container-height");
|
|
46
|
+
let e = 0, i = 0;
|
|
47
|
+
for (const a of this.renderRoot.querySelectorAll(`.${c.tickLabel}`)) {
|
|
48
|
+
const r = a.getBoundingClientRect();
|
|
49
|
+
e = Math.max(e, r.width), i = Math.max(i, r.height);
|
|
47
50
|
}
|
|
48
|
-
|
|
51
|
+
e = Math.ceil(e), i = Math.ceil(i), e && i && (t.style.setProperty("--labels-container-width", `${e}px`), t.style.setProperty("--labels-container-height", `${i}px`));
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
|
|
54
|
+
_handleBlur() {
|
|
55
|
+
this._activeTick = null;
|
|
56
|
+
}
|
|
57
|
+
_handleClick(t) {
|
|
52
58
|
if (!this.interactive)
|
|
53
59
|
return;
|
|
54
|
-
const i =
|
|
60
|
+
const i = t.currentTarget.dataset.value;
|
|
55
61
|
i && this.arcgisTickClick.emit({ value: Number(i) });
|
|
56
62
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
_handleFocus(t) {
|
|
64
|
+
this._activeTick = t.currentTarget.dataset.value ?? null;
|
|
65
|
+
}
|
|
66
|
+
_handleKeyDown(t) {
|
|
67
|
+
t.key === "Enter" && this._handleClick(t);
|
|
68
|
+
}
|
|
69
|
+
_handleMouseDown(t) {
|
|
70
|
+
this.interactive && t.preventDefault();
|
|
71
|
+
}
|
|
72
|
+
_internalLabelFormatter(t) {
|
|
73
|
+
const e = this.labelFormatter;
|
|
74
|
+
if (!e)
|
|
75
|
+
return this._formatValue(t);
|
|
76
|
+
const i = e(t, this._formatValue);
|
|
77
|
+
return i ?? this._formatValue(t);
|
|
63
78
|
}
|
|
64
79
|
render() {
|
|
65
|
-
return
|
|
80
|
+
return h`<div class=${o(c.container)} touch-action=none>${this._renderContent()}${this._renderBaseline()}</div>`;
|
|
66
81
|
}
|
|
67
82
|
_renderContent() {
|
|
68
|
-
const { interpolationExponent:
|
|
69
|
-
for (const [
|
|
70
|
-
const p = { [
|
|
71
|
-
[
|
|
72
|
-
[
|
|
73
|
-
[
|
|
83
|
+
const { interpolationExponent: t, max: e, min: i, mode: a, values: r, layout: n, mirrored: s, showLabels: w, interactive: k } = this, g = [], v = [];
|
|
84
|
+
for (const [f, d] of P(a, i, e, t, r)) {
|
|
85
|
+
const p = { [n === "horizontal" ? s ? "right" : "left" : s ? "top" : "bottom"]: `${f}%` }, $ = {
|
|
86
|
+
[c.tick]: !0,
|
|
87
|
+
[c.tickMin]: f === 0,
|
|
88
|
+
[c.tickMax]: f === 100
|
|
74
89
|
};
|
|
75
|
-
|
|
90
|
+
if (g.push(h`<div class=${o($)} .role=${k ? "button" : void 0} .ariaLabel=${k ? this._internalLabelFormatter(d) : void 0} style=${m(p)} data-value=${d ?? y} .tabIndex=${k ? 0 : -1} @blur=${this._handleBlur} @click=${this._handleClick} @focus=${this._handleFocus} @keydown=${this._handleKeyDown} @mousedown=${this._handleMouseDown}></div>`), w) {
|
|
91
|
+
const _ = {
|
|
92
|
+
[c.tickLabel]: !0,
|
|
93
|
+
[c.tickLabelFocused]: this._activeTick === String(d)
|
|
94
|
+
};
|
|
95
|
+
v.push(h`<div class=${o(_)} style=${m(p)} data-value=${d ?? y} @click=${this._handleClick}><span class=${o(c.tickLabelText)}>${this._internalLabelFormatter(d)}</span></div>`);
|
|
96
|
+
}
|
|
76
97
|
}
|
|
77
|
-
return [
|
|
98
|
+
return [h`<div class=${o(c.labelsContainer)}>${v}</div>`, h`<div class=${o(c.ticksContainer)}>${g}</div>`];
|
|
78
99
|
}
|
|
79
100
|
_renderBaseline() {
|
|
80
|
-
const { showBaseline:
|
|
81
|
-
return
|
|
82
|
-
[
|
|
83
|
-
[
|
|
101
|
+
const { showBaseline: t, layout: e } = this;
|
|
102
|
+
return t && h`<div class=${o(c.baseline)} style=${m({
|
|
103
|
+
[e === "horizontal" ? "width" : "height"]: "100%",
|
|
104
|
+
[e === "horizontal" ? "height" : "width"]: "0.125rem"
|
|
84
105
|
})}></div>` || "";
|
|
85
106
|
}
|
|
86
107
|
}
|
|
87
|
-
function*
|
|
88
|
-
switch (
|
|
108
|
+
function* P(l, t, e, i, a) {
|
|
109
|
+
switch (l) {
|
|
89
110
|
case "value": {
|
|
90
|
-
const
|
|
91
|
-
for (const
|
|
92
|
-
const
|
|
93
|
-
|
|
111
|
+
const r = Array.isArray(a) ? a : [a];
|
|
112
|
+
for (const n of r) {
|
|
113
|
+
const s = B(t, e, n, i) * 100;
|
|
114
|
+
s >= 0 && s <= 100 && (yield [s, n]);
|
|
94
115
|
}
|
|
95
116
|
break;
|
|
96
117
|
}
|
|
97
118
|
case "percent": {
|
|
98
|
-
if (Array.isArray(
|
|
99
|
-
for (const
|
|
100
|
-
|
|
101
|
-
else if (
|
|
102
|
-
for (let
|
|
103
|
-
yield [
|
|
119
|
+
if (Array.isArray(a))
|
|
120
|
+
for (const r of a)
|
|
121
|
+
r >= 0 && r <= 100 && (yield [r, u(t, e, r / 100, i)]);
|
|
122
|
+
else if (a > 0)
|
|
123
|
+
for (let r = 0; r <= 100; r += a)
|
|
124
|
+
yield [r, u(t, e, r / 100, i)];
|
|
104
125
|
break;
|
|
105
126
|
}
|
|
106
127
|
case "count": {
|
|
107
|
-
const
|
|
108
|
-
if (
|
|
109
|
-
yield [50,
|
|
128
|
+
const r = Array.isArray(a) ? a[0] : a;
|
|
129
|
+
if (r <= 1)
|
|
130
|
+
yield [50, u(t, e, 0.5, i)];
|
|
110
131
|
else
|
|
111
|
-
for (let
|
|
112
|
-
const
|
|
113
|
-
yield [
|
|
132
|
+
for (let n = 0; n < r; n++) {
|
|
133
|
+
const s = n * 100 / (r - 1);
|
|
134
|
+
yield [s, u(t, e, s / 100, i)];
|
|
114
135
|
}
|
|
115
136
|
break;
|
|
116
137
|
}
|
|
117
138
|
}
|
|
118
139
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
140
|
+
function b(l, t, e) {
|
|
141
|
+
return e < l ? l : e > t ? t : e;
|
|
121
142
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
143
|
+
function x(l, t, e) {
|
|
144
|
+
return l + (t - l) * e;
|
|
124
145
|
}
|
|
125
|
-
function
|
|
126
|
-
let
|
|
127
|
-
if (
|
|
128
|
-
return
|
|
129
|
-
const
|
|
130
|
-
return
|
|
146
|
+
function B(l, t, e, i = 0) {
|
|
147
|
+
let a = (e - l) / (t - l);
|
|
148
|
+
if (a = b(0, 1, a), Math.abs(i) < 1e-9)
|
|
149
|
+
return a;
|
|
150
|
+
const r = 1 + Math.expm1(i) * a;
|
|
151
|
+
return a = Math.log(r) / i, b(0, 1, a);
|
|
131
152
|
}
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
134
|
-
return
|
|
135
|
-
const
|
|
136
|
-
return
|
|
153
|
+
function u(l, t, e, i = 0) {
|
|
154
|
+
if (e = b(0, 1, e), Math.abs(i) < 1e-9)
|
|
155
|
+
return x(l, t, e);
|
|
156
|
+
const a = Math.expm1(i * e) / Math.expm1(i);
|
|
157
|
+
return x(l, t, a);
|
|
137
158
|
}
|
|
138
|
-
|
|
159
|
+
M("arcgis-ticks", A);
|
|
139
160
|
export {
|
|
140
|
-
|
|
161
|
+
A as ArcgisTicks
|
|
141
162
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
3
|
+
import type { ActionBar as ActionBar } from "@esri/calcite-components/components/calcite-action-bar";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Toolbar for action-based interfaces that need priority-aware collapsing.
|
|
7
|
+
*
|
|
8
|
+
* Measures the child elements then renders their content within its own shadow root.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export abstract class ArcgisToolbar extends LitElement {
|
|
13
|
+
get barElement(): ActionBar | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Toolbar orientation.
|
|
16
|
+
*
|
|
17
|
+
* @default "horizontal"
|
|
18
|
+
*/
|
|
19
|
+
accessor layout: "horizontal" | "vertical";
|
|
20
|
+
/**
|
|
21
|
+
* Relative position is used to control how popover element placement and directional arrows
|
|
22
|
+
* are chosen. This is used in conjunction with the layout property.
|
|
23
|
+
*
|
|
24
|
+
* This will affect how split buttons, overflow menus, and tooltips are displayed.
|
|
25
|
+
*
|
|
26
|
+
* @default "top-left"
|
|
27
|
+
*/
|
|
28
|
+
accessor relativePosition: "bottom-end" | "bottom-left" | "bottom-right" | "bottom-start" | "top-end" | "top-left" | "top-right" | "top-start";
|
|
29
|
+
/**
|
|
30
|
+
* Action scale, will be applied to all rendered actions.
|
|
31
|
+
*
|
|
32
|
+
* @default "m"
|
|
33
|
+
*/
|
|
34
|
+
accessor scale: "l" | "m" | "s";
|
|
35
|
+
/**
|
|
36
|
+
* Toolbar visual treatment.
|
|
37
|
+
*
|
|
38
|
+
* @default "floating"
|
|
39
|
+
*/
|
|
40
|
+
accessor toolbarKind: "docked" | "floating";
|
|
41
|
+
/**
|
|
42
|
+
* Controls whether individual actions render native tooltips or Calcite tooltips.
|
|
43
|
+
*
|
|
44
|
+
* @default "native"
|
|
45
|
+
*/
|
|
46
|
+
accessor tooltipAppearance: "calcite-dark" | "calcite" | "native";
|
|
47
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as i } from "lit/directives/ref.js";
|
|
4
|
+
import { css as r, html as l } from "lit";
|
|
5
|
+
import { LitElement as s } from "@arcgis/lumina";
|
|
6
|
+
import { useDirection as d } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { i as h, a as p } from "../../chunks/utils.js";
|
|
8
|
+
const u = r`:host{--arcgis-internal-toolbar-action-kind-color: var(--calcite-action-text-color);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-action-text-color-press);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-action-text-color-press);--arcgis-internal-toolbar-action-kind-foreground-color: var(--calcite-color-text-inverse);--arcgis-internal-toolbar-action-transparent-background-color: var(--calcite-color-transparent);--arcgis-internal-toolbar-action-transparent-background-color-hover: var(--calcite-color-transparent-hover);--arcgis-internal-toolbar-action-transparent-background-color-press: var(--calcite-color-transparent-press)}calcite-action{--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);--calcite-color-focus: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-indicator-color: var(--arcgis-internal-toolbar-action-kind-color)}calcite-action:is([data-appearance=solid]){--calcite-offset-invert-focus: 1}calcite-action[data-appearance=outline]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-transparent-background-color);--calcite-action-background-color-hover: var(--arcgis-internal-toolbar-action-transparent-background-color-hover);--calcite-action-background-color-press: var(--arcgis-internal-toolbar-action-transparent-background-color-press);--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color)}calcite-action[data-appearance=outline]:hover{box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color-hover)}calcite-action[data-appearance=outline]:active,calcite-action[data-appearance=outline][active]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-transparent-background-color-press);box-shadow:inset 0 0 0 var(--calcite-border-width-sm, 1px) var(--arcgis-internal-toolbar-action-kind-color-press)}calcite-action[data-appearance=solid]{--calcite-action-background-color: var(--arcgis-internal-toolbar-action-kind-color);--calcite-action-background-color-hover: var(--arcgis-internal-toolbar-action-kind-color-hover);--calcite-action-background-color-press: var(--arcgis-internal-toolbar-action-kind-color-press);--calcite-action-text-color: var(--arcgis-internal-toolbar-action-kind-foreground-color);--calcite-action-text-color-press: var(--arcgis-internal-toolbar-action-kind-foreground-color);--calcite-action-indicator-color: var(--arcgis-internal-toolbar-action-kind-foreground-color)}calcite-action:is([data-appearance=outline],[data-appearance=solid]):not([data-kind]){--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-inverse);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-inverse-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-inverse-press)}calcite-action:not([data-kind]){--calcite-action-indicator-color: var(--calcite-color-brand)}calcite-action[data-kind=brand]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-brand);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-brand-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-brand-press);--calcite-action-indicator-color: var(--calcite-color-text-1);&[data-appearance=solid]{--calcite-action-indicator-color: var(--calcite-color-text-inverse)}}calcite-action[data-kind=danger]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-danger);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-danger-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-danger-press)}calcite-action[data-kind=info]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-info);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-info-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-info-press)}calcite-action[data-kind=success]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-success);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-success-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-success-press)}calcite-action[data-kind=warning]{--arcgis-internal-toolbar-action-kind-color: var(--calcite-color-status-warning);--arcgis-internal-toolbar-action-kind-color-hover: var(--calcite-color-status-warning-hover);--arcgis-internal-toolbar-action-kind-color-press: var(--calcite-color-status-warning-press)}`, b = r`:host([layout="horizontal"]){calcite-action.split-anchor{min-width:24px;max-width:24px;&[scale=m]{--calcite-internal-action-spacing: .25rem}&[scale=l]{--calcite-internal-action-spacing: 0rem}}}:host([layout="vertical"]){calcite-action.split-anchor{--calcite-internal-action-min-height: unset;min-height:24px;max-height:24px}}.split-host{display:contents;cursor:pointer;calcite-action:has(~.split-menu[open]),calcite-action:has(~.split-menu:hover),calcite-action:has(~.split-menu:focus-within),calcite-action:hover~.split-menu calcite-action[slot=trigger],.split-menu[open] calcite-action[slot=trigger],.split-menu:hover calcite-action[slot=trigger],.split-menu:focus-within calcite-action[slot=trigger]{background-color:var(--calcite-action-background-color-hover, var(--calcite-color-transparent-hover))}}:host([layout="horizontal"]){.split-host{calcite-action:has(+.split-menu){border-radius:var(--calcite-action-corner-radius, 2px);border-top-right-radius:0;border-bottom-right-radius:0}calcite-action[slot=trigger]{border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-left-radius:0;border-top-left-radius:0}calcite-action:dir(rtl):has(+.split-menu){border-radius:var(--calcite-action-corner-radius, 2px);border-top-left-radius:0;border-bottom-left-radius:0}calcite-action:dir(rtl)[slot=trigger]{border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-right-radius:0;border-top-right-radius:0}.split-menu:dir(ltr){margin-left:calc(0px - var(--calcite-internal-action-bar-gap))}.split-menu:dir(rtl){margin-right:calc(0px - var(--calcite-internal-action-bar-gap))}}}:host([layout="vertical"]){.split-host{calcite-action:has(+.split-menu){border-radius:var(--calcite-action-corner-radius, 2px);border-bottom-left-radius:0;border-bottom-right-radius:0}calcite-action[slot=trigger]{border-radius:var(--calcite-action-corner-radius, 2px);border-top-right-radius:0;border-top-left-radius:0}.split-menu{margin-top:calc(0px - var(--calcite-internal-action-bar-gap))}}}`, g = r`:host{display:flex;max-inline-size:100%;max-block-size:100%;--arcgis-toolbar-tooltip-dark-background-color: #212121;--arcgis-toolbar-tooltip-dark-border-color: #404040;--arcgis-toolbar-tooltip-dark-text-color: #fff}:host([toolbar-kind="floating"]){display:inline-flex;.ruler{opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:min(100cqw - 32px,100vw - 32px);height:min(100cqh - 32px,100vh - 32px)}}:host([toolbar-kind="docked"]){.ruler{visibility:hidden;height:0;display:block;position:absolute;top:0;left:0;right:0;width:100%;height:100%}}:host([toolbar-kind="docked"][layout="horizontal"]){calcite-action-bar{min-width:100%}}:host([toolbar-kind="docked"][layout="vertical"]){min-height:100%;calcite-action-bar{min-height:100%}}:host([toolbar-kind="floating"][layout="horizontal"]){inline-size:max-content;overflow-x:auto}:host([toolbar-kind="floating"][layout="vertical"]){block-size:max-content;overflow-y:auto}calcite-tooltip.calcite-mode-dark{--calcite-tooltip-background-color: var(--arcgis-toolbar-tooltip-dark-background-color);--calcite-tooltip-border-color: var(--arcgis-toolbar-tooltip-dark-border-color);--calcite-tooltip-text-color: var(--arcgis-toolbar-tooltip-dark-text-color)}`;
|
|
9
|
+
class v extends s {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#a = new MutationObserver(() => this._syncGroups()), this.#i = d(), this._setRenderedBar = (t) => {
|
|
12
|
+
t == null && (this._renderedBar = void 0, this._hydratedRenderedBar = void 0), !(t === this._renderedBar || t === this._hydratedRenderedBar) && (this._renderedBar = t, this._hydratedRenderedBar = void 0, t && t.componentOnReady().then(() => {
|
|
13
|
+
!this.isConnected || this._renderedBar !== t || (this._hydratedRenderedBar = t);
|
|
14
|
+
}));
|
|
15
|
+
}, this._availableLength = 0, this.layout = "horizontal", this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating";
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.properties = { _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, barElement: 32, effectiveRelativeDirection: 16 };
|
|
19
|
+
}
|
|
20
|
+
static {
|
|
21
|
+
this.styles = [g, u, b];
|
|
22
|
+
}
|
|
23
|
+
#t;
|
|
24
|
+
#a;
|
|
25
|
+
#r;
|
|
26
|
+
#i;
|
|
27
|
+
#o;
|
|
28
|
+
get barElement() {
|
|
29
|
+
return this._hydratedRenderedBar;
|
|
30
|
+
}
|
|
31
|
+
get effectiveRelativeDirection() {
|
|
32
|
+
const [t, o] = this.relativePosition.split("-"), a = this.#i;
|
|
33
|
+
switch (o) {
|
|
34
|
+
case "left":
|
|
35
|
+
case "right":
|
|
36
|
+
return `${t}-${o}`;
|
|
37
|
+
case "end":
|
|
38
|
+
return `${t}-${a === "ltr" ? "right" : "left"}`;
|
|
39
|
+
case "start":
|
|
40
|
+
return `${t}-${a === "ltr" ? "left" : "right"}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
connectedCallback() {
|
|
44
|
+
super.connectedCallback(), this._connectMeasurement(this.#o), this.#a.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
this.#t.disconnect(), this.#a.disconnect(), super.disconnectedCallback();
|
|
48
|
+
}
|
|
49
|
+
_setRulerEl(t) {
|
|
50
|
+
this.#o !== t && (this.#o = t, this.isConnected && this._connectMeasurement(t));
|
|
51
|
+
}
|
|
52
|
+
_connectMeasurement(t) {
|
|
53
|
+
this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
|
|
54
|
+
}
|
|
55
|
+
_updateMeasurement(t) {
|
|
56
|
+
const o = t?.at(0)?.contentRect ?? this.#o?.getBoundingClientRect();
|
|
57
|
+
o && (this._availableLength = this.layout === "horizontal" ? o.width : o.height);
|
|
58
|
+
}
|
|
59
|
+
_syncGroups() {
|
|
60
|
+
this.#r?.abort();
|
|
61
|
+
const t = Array.from(this.el.children).filter(h), o = new AbortController();
|
|
62
|
+
this.#r = o, Promise.all(t.map((a) => a.componentOnReady())).then(() => {
|
|
63
|
+
!this.isConnected || o.signal.aborted || (this._groups = t);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
const t = this._groups;
|
|
68
|
+
if (!t?.length)
|
|
69
|
+
return;
|
|
70
|
+
const o = {
|
|
71
|
+
layout: this.layout,
|
|
72
|
+
relativePosition: this.effectiveRelativeDirection,
|
|
73
|
+
scale: this.scale,
|
|
74
|
+
tooltipAppearance: this.tooltipAppearance
|
|
75
|
+
}, a = p(t, o, this._availableLength);
|
|
76
|
+
return l`<div class="ruler" ${i(this._setRulerEl)}></div><calcite-action-bar expand-disabled .floating=${this.toolbarKind === "floating"} .layout=${this.layout} overflow-actions-disabled .scale=${this.scale} ${i(this._setRenderedBar)}>${a.map(({ group: c, budget: e }) => c.proxiedRender(o, e))}</calcite-action-bar>`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
n("arcgis-toolbar", v);
|
|
80
|
+
export {
|
|
81
|
+
v as ArcgisToolbar
|
|
82
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type MeasurementContext = {
|
|
2
|
+
layout: "horizontal" | "vertical";
|
|
3
|
+
scale: "l" | "m" | "s";
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type RenderContext = MeasurementContext
|
|
7
|
+
& {
|
|
8
|
+
relativePosition: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
9
|
+
tooltipAppearance: "calcite-dark" | "calcite" | "native";
|
|
10
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement, JsxNode } from "@arcgis/lumina";
|
|
3
|
+
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
4
|
+
import type { MeasurementContext, RenderContext } from "../arcgis-toolbar/types.js";
|
|
5
|
+
import type { Action as Action } from "@esri/calcite-components/components/calcite-action";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A configuration for an `arcgis-toolbar` action.
|
|
9
|
+
*
|
|
10
|
+
* This is a non-rendering element; it will have no effect unless used
|
|
11
|
+
* correctly within an `arcgis-toolbar`.
|
|
12
|
+
*
|
|
13
|
+
* Notes:
|
|
14
|
+
*
|
|
15
|
+
* - there is no `scale` for this element; rendered scale is controlled
|
|
16
|
+
* exclusively by the host `arcgis-toolbar`
|
|
17
|
+
*
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
export abstract class ArcgisToolbarAction extends LitElement {
|
|
21
|
+
get actionElement(): Action | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Whether or not this action is shown in an 'active'/selected state.
|
|
24
|
+
*
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
accessor active: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Determines how the color scheme determined by `brand` is presented.
|
|
30
|
+
*
|
|
31
|
+
* @default "transparent"
|
|
32
|
+
*/
|
|
33
|
+
accessor appearance: "outline" | "solid" | "transparent";
|
|
34
|
+
/**
|
|
35
|
+
* Determines if the action should be rendered in a disabled state.
|
|
36
|
+
*
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
accessor disabled: boolean;
|
|
40
|
+
/** The icon to show in the rendered action; should not be ommitted for best user experience. */
|
|
41
|
+
accessor icon: Icon["icon"] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Determines if the icon will be flipped when direction is RTL.
|
|
44
|
+
*
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
accessor iconFlipRtl: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Determines if the action is rendered with a "notification-style" indicator dot.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
accessor indicator: boolean;
|
|
54
|
+
/** Determines the color scheme for the action. */
|
|
55
|
+
accessor kind: "brand" | "danger" | "info" | "success" | "warning" | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Text to show in the primary label field; do not depend on this ever being visible to the user.
|
|
58
|
+
* It is only shown if textEnabled is true.
|
|
59
|
+
*
|
|
60
|
+
* @default ""
|
|
61
|
+
*/
|
|
62
|
+
accessor labelText: string;
|
|
63
|
+
/**
|
|
64
|
+
* Determines if the action is rendered with a loading spinner.
|
|
65
|
+
*
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
68
|
+
accessor loading: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Determines if the action is rendered with text visible.
|
|
71
|
+
*
|
|
72
|
+
* @default false
|
|
73
|
+
*/
|
|
74
|
+
accessor textEnabled: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Text to show in the tooltip for the action.
|
|
77
|
+
*
|
|
78
|
+
* @default ""
|
|
79
|
+
*/
|
|
80
|
+
accessor tooltipText: string;
|
|
81
|
+
/**
|
|
82
|
+
* @param parameter0
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
measure(parameter0: MeasurementContext): number[];
|
|
86
|
+
/**
|
|
87
|
+
* @param context
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
proxiedRender(context: RenderContext): JsxNode;
|
|
91
|
+
readonly arcgisRenderedActionChanged: import("@arcgis/lumina").TargetedEvent<this, { element?: Action; }>;
|
|
92
|
+
readonly arcgisToolbarItemSelected: import("@arcgis/lumina").TargetedEvent<this, { element?: Action; }>;
|
|
93
|
+
readonly "@eventTypes": {
|
|
94
|
+
arcgisRenderedActionChanged: ArcgisToolbarAction["arcgisRenderedActionChanged"]["detail"];
|
|
95
|
+
arcgisToolbarItemSelected: ArcgisToolbarAction["arcgisToolbarItemSelected"]["detail"];
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import { c as p } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as u } from "lit/directives/ref.js";
|
|
4
|
+
import { css as g, html as c } from "lit";
|
|
5
|
+
import { LitElement as f, createEvent as l, nothing as n, safeClassMap as _ } from "@arcgis/lumina";
|
|
6
|
+
import { W as r } from "../../chunks/utils.js";
|
|
7
|
+
import { g as b } from "../../chunks/utils2.js";
|
|
8
|
+
const v = g`:host([text-enabled][data-layout="vertical"]){.interaction-container>button{flex-direction:column;>.text-container{writing-mode:vertical-lr}}}`;
|
|
9
|
+
class $ extends f {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments), this.#e = (t) => {
|
|
12
|
+
if (t !== this._element) {
|
|
13
|
+
if (this.#t?.disconnect(), this._element = t, this._hydratedElement = void 0, this.isConnected && this.arcgisRenderedActionChanged.emit({ element: t }), !t) {
|
|
14
|
+
this._measuredWidth = 0, this._measuredHeight = 0;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
this._measureAction(), this.#t ??= new ResizeObserver((e) => {
|
|
18
|
+
!this.textEnabled || !this._element || this._measureAction(e);
|
|
19
|
+
}), this.#t.observe(t), t.componentOnReady().then(() => {
|
|
20
|
+
!this.isConnected || this._element !== t || (this._hydratedElement = t, t.shadowRoot?.adoptedStyleSheets.push(v.styleSheet));
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}, this._measuredWidth = 0, this._measuredHeight = 0, this.active = !1, this.tooltipText = "", this.labelText = "", this.disabled = !1, this.loading = !1, this.indicator = !1, this.textEnabled = !1, this.appearance = "transparent", this.iconFlipRtl = !1, this.arcgisRenderedActionChanged = l(), this.arcgisToolbarItemSelected = l();
|
|
24
|
+
}
|
|
25
|
+
static {
|
|
26
|
+
this.properties = { _element: 16, _hydratedElement: 16, _measuredWidth: 16, _measuredHeight: 16, icon: 1, active: 7, tooltipText: 1, labelText: 1, disabled: 5, loading: 5, indicator: 5, textEnabled: 5, kind: 3, appearance: 3, iconFlipRtl: 5, actionElement: 32 };
|
|
27
|
+
}
|
|
28
|
+
#t;
|
|
29
|
+
#e;
|
|
30
|
+
get actionElement() {
|
|
31
|
+
return this._element;
|
|
32
|
+
}
|
|
33
|
+
measure({ layout: t, scale: e }) {
|
|
34
|
+
const a = r.actionPadding[e], i = r.action[e], s = t === "horizontal" ? this._measuredWidth : this._measuredHeight;
|
|
35
|
+
return [Math.max(i, s) + a];
|
|
36
|
+
}
|
|
37
|
+
proxiedRender(t) {
|
|
38
|
+
const { tooltipAppearance: e, scale: a } = t, i = this.tooltipText || this.labelText, s = this._hydratedElement, o = e !== "native" && !!i && s, d = e === "calcite-dark" ? "calcite-mode-dark" : void 0, h = b(t);
|
|
39
|
+
return c`<calcite-action .active=${this.active} data-appearance=${this.appearance ?? n} data-kind=${this.kind ?? n} data-layout=${t.layout ?? n} .disabled=${this.disabled} .icon=${this.icon} .iconFlipRtl=${this.iconFlipRtl} .indicator=${this.indicator} .label=${i} .loading=${this.loading} @click=${(m) => this._handleActionClick(m)} .scale=${a} .text=${this.labelText} .textEnabled=${this.textEnabled} title=${(e === "native" ? i : void 0) ?? n} ${u(this.#e)}></calcite-action>${o ? c`<calcite-tooltip class=${_(d)} overlay-positioning=fixed .placement=${h} .referenceElement=${s} .scale=${a}><span>${i}</span></calcite-tooltip>` : void 0}`;
|
|
40
|
+
}
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
this.#t?.disconnect(), super.disconnectedCallback();
|
|
43
|
+
}
|
|
44
|
+
_handleActionClick(t) {
|
|
45
|
+
this.arcgisToolbarItemSelected?.emit({
|
|
46
|
+
element: t.currentTarget
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
_measureAction(t) {
|
|
50
|
+
const e = t?.at(0)?.contentRect ?? this._element?.getBoundingClientRect();
|
|
51
|
+
e && (this._measuredWidth = Math.round(e.width), this._measuredHeight = Math.round(e.height));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
p("arcgis-toolbar-action", $);
|
|
55
|
+
export {
|
|
56
|
+
$ as ArcgisToolbarAction
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type { PublicLitElement as LitElement, JsxNode } from "@arcgis/lumina";
|
|
3
|
+
import type { MeasurementContext, RenderContext } from "../arcgis-toolbar/types.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A configuration for an `arcgis-toolbar` group.
|
|
7
|
+
*
|
|
8
|
+
* The group element sets up a <calcite-action-group> around its child elements. This is generally
|
|
9
|
+
* used for visual separation, but can also be used to place content in a particular slot within
|
|
10
|
+
* the toolbar.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export abstract class ArcgisToolbarGroup extends LitElement {
|
|
15
|
+
/**
|
|
16
|
+
* If true, will try to place the group in an appropriate 'actions-end' slot depending on toolbar appearance.
|
|
17
|
+
*
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
accessor preferEndSlot: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Controls layout priority, which determines space allocation and overflow behavior.
|
|
23
|
+
*
|
|
24
|
+
* @default 1
|
|
25
|
+
*/
|
|
26
|
+
accessor priority: number;
|
|
27
|
+
/**
|
|
28
|
+
* @param context
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
measure(context: MeasurementContext): number[];
|
|
32
|
+
/**
|
|
33
|
+
* @param context
|
|
34
|
+
* @param budget
|
|
35
|
+
* @internal
|
|
36
|
+
*/
|
|
37
|
+
proxiedRender(context: RenderContext, budget: number): JsxNode;
|
|
38
|
+
}
|