@arcgis/map-components 5.1.0-next.84 → 5.1.0-next.86
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/{3M7YKCX7.js → DXXSS4ND.js} +1 -1
- package/dist/cdn/EIVHDZFM.js +2 -0
- package/dist/cdn/GUYOWFTW.js +2 -0
- package/dist/cdn/HN5OI754.js +2 -0
- package/dist/cdn/JCBEUV6E.js +2 -0
- package/dist/cdn/RVLC2U3T.js +2 -0
- package/dist/cdn/TNFV5TYG.js +2 -0
- package/dist/cdn/UKBIRZVQ.js +2 -0
- package/dist/cdn/assets/layer-list-new/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/sketch-tooltip-controls/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/time-slider/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/time-slider/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/layer-list-item-indicator.js +41 -19
- package/dist/components/arcgis-aggregated-features/customElement.js +27 -23
- package/dist/components/arcgis-features/customElement.js +99 -84
- package/dist/components/arcgis-labeled-switch/customElement.js +4 -4
- package/dist/components/arcgis-layer-list-item-indicator/customElement.js +3 -2
- package/dist/components/arcgis-layer-list-item-indicator/index.js +1 -0
- package/dist/components/arcgis-layer-list-new/customElement.d.ts +18 -0
- package/dist/components/arcgis-layer-list-new/layer-list-item/customElement.js +20 -20
- package/dist/components/arcgis-sketch-tooltip-controls/customElement.d.ts +91 -0
- package/dist/components/arcgis-sketch-tooltip-controls/customElement.js +71 -0
- package/dist/components/arcgis-sketch-tooltip-controls/index.d.ts +1 -0
- package/dist/components/arcgis-sketch-tooltip-controls/index.js +7 -0
- package/dist/components/arcgis-time-of-day-slider/customElement.js +74 -46
- 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/index.d.ts +10 -0
- package/dist/loader.js +2 -1
- package/dist/types/lumina.d.ts +6 -0
- package/dist/types/preact.d.ts +7 -0
- package/dist/types/react.d.ts +8 -0
- package/dist/types/stencil.d.ts +6 -0
- package/package.json +4 -4
- package/dist/cdn/2NY3SFXY.js +0 -2
- package/dist/cdn/HV3Q65XH.js +0 -2
- package/dist/cdn/K6DM6L64.js +0 -2
- package/dist/cdn/LLRYOV3A.js +0 -2
- package/dist/cdn/O53VUY2U.js +0 -2
- package/dist/cdn/YHD6DZQT.js +0 -2
|
@@ -19,45 +19,45 @@ function ee(i, e) {
|
|
|
19
19
|
function we(i, e) {
|
|
20
20
|
i.panel.open = !i.panel.open, i.panel.open && e();
|
|
21
21
|
}
|
|
22
|
-
function Pe(i, e,
|
|
23
|
-
i &&
|
|
22
|
+
function Pe(i, e, a, u) {
|
|
23
|
+
i && a === e.layer?.uid && (ke(i), u?.(null));
|
|
24
24
|
}
|
|
25
|
-
function De(i, e,
|
|
26
|
-
|
|
25
|
+
function De(i, e, a) {
|
|
26
|
+
a.type === "toggle" && (a.value = !a.value), i(a, e);
|
|
27
27
|
}
|
|
28
28
|
function Fe(i) {
|
|
29
|
-
return i.actionsSections.map((e) => e.filter((
|
|
29
|
+
return i.actionsSections.map((e) => e.filter((a) => a.visible));
|
|
30
30
|
}
|
|
31
31
|
function le(i, e) {
|
|
32
|
-
const { icon:
|
|
33
|
-
if (
|
|
32
|
+
const { icon: a } = e;
|
|
33
|
+
if (a)
|
|
34
34
|
return null;
|
|
35
35
|
const u = "image" in e ? e.image : void 0;
|
|
36
36
|
return u ? c`<span aria-hidden=true class=${d(P(i.itemActionIcon, { [i.itemActionImage]: !!u }))} style=${Ie(Ce(u))}></span>` : null;
|
|
37
37
|
}
|
|
38
|
-
function te(i, e,
|
|
38
|
+
function te(i, e, a) {
|
|
39
39
|
const { item: u, css: l, handleAction: y } = i, { active: A, disabled: f, title: g, type: C, indicator: v } = e, T = ie(e);
|
|
40
|
-
return c`<calcite-action .active=${C === "toggle" ? e.value : !1} data-action-id=${e.id ?? r} .disabled=${f} .icon=${T} .indicator=${v} .loading=${A} @click=${() => De(y, u, e)} scale=s slot=${(
|
|
40
|
+
return c`<calcite-action .active=${C === "toggle" ? e.value : !1} data-action-id=${e.id ?? r} .disabled=${f} .icon=${T} .indicator=${v} .loading=${A} @click=${() => De(y, u, e)} scale=s slot=${(a ? void 0 : "actions-end") ?? r} .text=${g ?? ""} .textEnabled=${a} title=${g ?? void 0 ?? r}>${le(l, e)}</calcite-action>`;
|
|
41
41
|
}
|
|
42
42
|
function Oe(i) {
|
|
43
|
-
const { item: e, parent:
|
|
43
|
+
const { item: e, parent: a, hideStatusIndicators: u, css: l, visibilityAppearance: y, hideCatalogLayerList: A, dragEnabled: f = !1, rootGroupUid: g, listModeDisabled: C = !1, selectionMode: v, displayMode: T, layerTablesEnabled: S, showErrors: ne, parentTitles: F, selectedItems: ae, activeItem: ce, handleCatalogOpen: oe, handleTablesOpen: se, selectedDragItemLayerUid: re, handleSelectedDragItemLayerUidChange: de, handlePanelOpen: ue, messages: n, setCurrentActiveItem: O, clearActiveItem: R } = i, b = X(), M = X(), p = e.title || ("untitledTable" in n ? n.untitledTable : n.untitledLayer ?? "");
|
|
44
44
|
let V = null;
|
|
45
|
-
u || (V = Ae(c`<arcgis-layer-list-item-indicator .item=${e} .parent=${
|
|
45
|
+
u || (V = Ae(c`<arcgis-layer-list-item-indicator .messages=${n} .item=${e} .parent=${a} slot=content-end></arcgis-layer-list-item-indicator>`));
|
|
46
46
|
let G = null;
|
|
47
47
|
{
|
|
48
48
|
const { layer: t } = e, o = t && "persistenceEnabled" in t && (he(t) || !t.persistenceEnabled);
|
|
49
|
-
(i.showTemporaryLayerIndicators || i.showTemporaryTableIndicators) && o && (G = c`<calcite-icon class=${d(l.itemTemporaryIcon)} icon=temporary scale=s slot=content-start title=${
|
|
49
|
+
(i.showTemporaryLayerIndicators || i.showTemporaryTableIndicators) && o && (G = c`<calcite-icon class=${d(l.itemTemporaryIcon)} icon=temporary scale=s slot=content-start title=${n.temporary ?? r}></calcite-icon>`);
|
|
50
50
|
}
|
|
51
51
|
let H = null;
|
|
52
52
|
if ("visible" in e && "visibleToggle" in l && y) {
|
|
53
|
-
const t = D(
|
|
53
|
+
const t = D(a);
|
|
54
54
|
if (t !== "inherited") {
|
|
55
55
|
const o = Te({
|
|
56
56
|
visible: e.visible,
|
|
57
57
|
exclusive: t === "exclusive",
|
|
58
58
|
visibilityAppearance: y
|
|
59
|
-
}), s = y === "checkbox", m =
|
|
60
|
-
H = c`<calcite-action class=${d(l.visibleToggle)} .icon=${s ? o : void 0} @click=${() => ee(e,
|
|
59
|
+
}), s = y === "checkbox", m = n.layerVisibility;
|
|
60
|
+
H = c`<calcite-action class=${d(l.visibleToggle)} .icon=${s ? o : void 0} @click=${() => ee(e, a)} .slot=${s ? "actions-start" : "actions-end"} .text=${m ?? ""} title=${m ?? r}>${s ? null : c`<calcite-icon class=${d(P({
|
|
61
61
|
[l.visibleIcon]: t !== "exclusive" && e.visible
|
|
62
62
|
}))} .icon=${o} scale=s></calcite-icon>`}</calcite-action>`;
|
|
63
63
|
}
|
|
@@ -103,7 +103,7 @@ function Oe(i) {
|
|
|
103
103
|
x = S.includes(t.type) && "subtables" in t && !!t.subtables?.length;
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
106
|
-
"itemTableIcon" in l && "visible" in e && "tables" in
|
|
106
|
+
"itemTableIcon" in l && "visible" in e && "tables" in n && x && (j = W(`${e.uid}-tables`, c`<calcite-list-item class=${d(l.item)} data-layer-id=${t?.id ?? r} drag-disabled .label=${n.tables} title=${n.tables ?? r} @calciteListItemSelect=${() => se?.(e)} .value=${e}><calcite-icon class=${d(l.itemTableIcon)} icon=table scale=s slot=content-start></calcite-icon><calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon></calcite-list-item>`));
|
|
107
107
|
}
|
|
108
108
|
let z = null;
|
|
109
109
|
if ("children" in e) {
|
|
@@ -111,15 +111,15 @@ function Oe(i) {
|
|
|
111
111
|
(m || ye) && (z = c`<calcite-list .canPull=${($) => i.canMove ? i.canMove($, "pull") : !1} .canPut=${($) => i.canMove ? i.canMove($, "put") : !1} data-item=${e.uid ?? r} data-layer-type=${g ?? r} .displayMode=${T} .dragEnabled=${ve} .group=${I ? g : `${g}-${s?.uid}`} .label=${e.title} selection-appearance=highlight .selectionMode=${v}>${fe}${j}</calcite-list>`);
|
|
112
112
|
}
|
|
113
113
|
let L = null;
|
|
114
|
-
e.error ? L = c`<div class=${d(l.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s width=full><div slot=message>${"tableError" in
|
|
114
|
+
e.error ? L = c`<div class=${d(l.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s width=full><div slot=message>${"tableError" in n ? n.tableError : n.layerError}</div></calcite-notice></div>` : "incompatible" in e && e.incompatible && "layerIncompatible" in n && (L = c`<div class=${d(l.itemMessage)} slot=content-bottom><calcite-notice icon=exclamation-mark-triangle kind=warning open scale=s tabindex=0 width=full ${Y(M)}><div slot=message>${n.layerIncompatible}</div></calcite-notice></div>`);
|
|
115
115
|
const J = Fe(e), E = e.actionsSections.reduce((t, o) => t + o.length, 0), K = Le(J), me = J.toArray().map((t) => c`<calcite-action-group>${t.toArray().map((o) => te(i, o, !0))}</calcite-action-group>`), $e = (t) => {
|
|
116
116
|
e.actionsOpen = t.currentTarget.open;
|
|
117
117
|
};
|
|
118
118
|
let Q = null;
|
|
119
|
-
E > 1 && (Q = c`<calcite-action-menu appearance=transparent .label=${
|
|
119
|
+
E > 1 && (Q = c`<calcite-action-menu appearance=transparent .label=${n.menu ?? ""} .open=${e.actionsOpen} overlay-positioning=fixed placement=bottom-end slot=actions-end @calciteActionMenuOpen=${$e}><calcite-action icon=ellipsis scale=s slot=trigger .text=${n.options ?? ""} title=${n.options ?? r}></calcite-action>${me}</calcite-action-menu>`);
|
|
120
120
|
let k = null;
|
|
121
121
|
E === 1 && K ? k = te(i, K, !1) : E > 1 && (k = Q);
|
|
122
|
-
const be = "visibleAtCurrentTimeExtent" in e && "layerInvisibleAtTime" in
|
|
122
|
+
const be = "visibleAtCurrentTimeExtent" in e && "layerInvisibleAtTime" in n && !e.visibleAtCurrentTimeExtent ? `${p} (${n.layerInvisibleAtTime})` : "visibleAtCurrentScale" in e && "layerInvisibleAtScale" in n && !e.visibleAtCurrentScale ? `${p} (${n.layerInvisibleAtScale})` : p, ge = "parent" in e && e.parent?.layer?.type === "catalog", h = e.layer, pe = "visibleAtCurrentScale" in e && !e.visibleAtCurrentScale || "visibleAtCurrentTimeExtent" in e && !e.visibleAtCurrentTimeExtent;
|
|
123
123
|
return queueMicrotask(() => {
|
|
124
124
|
Pe(b.value ?? null, e, re, de), M.value && (i.handleTooltipReferenceChange?.(h?.uid, M.value), queueMicrotask(() => i.handleTooltipReferenceChange?.(h?.uid, null))), e.panel && (e.panel.container = b.value);
|
|
125
125
|
}), W(e.uid, c`<calcite-list-item class=${d(P(l.item, "itemActive" in l && { [l.itemActive]: ce?.uid === e.uid }))} data-item=${e.uid ?? r} data-layer-id=${h?.id ?? r} .dragDisabled=${!("sortable" in e && e.sortable) || ge} id=${h?.uid ?? r} .label=${p} .metadata=${{ parentTitles: F ?? [], _title: p }} .expanded=${"open" in e && e.open} .selected=${v !== "none" ? ae.includes(e) : !1} title=${be ?? r} .unavailable=${pe} .value=${e} @focusin=${() => {
|
|
@@ -130,7 +130,7 @@ function Oe(i) {
|
|
|
130
130
|
O?.(e), b.value?.classList.add(l.itemActive);
|
|
131
131
|
}} @mouseleave=${() => {
|
|
132
132
|
R?.(), b.value?.classList.remove(l.itemActive);
|
|
133
|
-
}} @calciteListItemSelect=${(t) => "visible" in e && Ee(t.currentTarget, i.operationalItems) === e && v === "none" && D(
|
|
133
|
+
}} @calciteListItemSelect=${(t) => "visible" in e && Ee(t.currentTarget, i.operationalItems) === e && v === "none" && D(a) !== "inherited" && ee(e, a)} @calciteListItemToggle=${(t) => {
|
|
134
134
|
"open" in e && (t.stopPropagation(), e.open = t.target.expanded);
|
|
135
135
|
}} ${Y(b)}>${B}${N}${V}${H}${_}${G}${z}${L}${U}${q}${k}</calcite-list-item>`);
|
|
136
136
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import type SketchOptions from "@arcgis/core/views/interactive/sketch/SketchOptions.js";
|
|
3
|
+
import type { TooltipDirectionMode } from "@arcgis/core/views/interactive/tooltip/types.js";
|
|
4
|
+
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
5
|
+
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
6
|
+
|
|
7
|
+
export abstract class ArcgisSketchTooltipControls extends LitElement {
|
|
8
|
+
/**
|
|
9
|
+
* private
|
|
10
|
+
*
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
get _hasContent(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Indicates whether the direction (deflection) of the segment being drawn
|
|
16
|
+
* is measured relative to the previous segment or from the main axis of the map
|
|
17
|
+
* (usually north). See [SketchTooltipOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchTooltipOptions/) and [SketchValueOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/sketch/SketchValueOptions/#directionMode).
|
|
18
|
+
*/
|
|
19
|
+
accessor directionMode: TooltipDirectionMode;
|
|
20
|
+
/**
|
|
21
|
+
* Controls whether the labels toggle is shown for this component.
|
|
22
|
+
*
|
|
23
|
+
* > **Note:** If this component is contained in another component, the parent
|
|
24
|
+
* component is responsible for setting this property based on any
|
|
25
|
+
* known limitations, including properties on the view. Specifically,
|
|
26
|
+
* as of 5.1, if the view is a 2d video or linkchart instead of a map,
|
|
27
|
+
* the parent component should set this property to `true`.
|
|
28
|
+
*
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
accessor hideLabelsToggle: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Controls whether the tooltips toggle is shown for this component.
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
accessor hideTooltipsToggle: boolean;
|
|
38
|
+
/** The component's default label. */
|
|
39
|
+
accessor label: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates whether labels are shown next to each segment of the graphic being sketched.
|
|
42
|
+
*
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
accessor labelsEnabled: boolean;
|
|
46
|
+
/** @internal */
|
|
47
|
+
protected messages: {
|
|
48
|
+
componentLabel: string;
|
|
49
|
+
directionModePicker: string;
|
|
50
|
+
directionModeAbsolute: string;
|
|
51
|
+
directionModeRelative: string;
|
|
52
|
+
tooltipsToggle: string;
|
|
53
|
+
tooltipsToggleHint: string;
|
|
54
|
+
labelsToggle: string;
|
|
55
|
+
labelsToggleHint: string;
|
|
56
|
+
} & T9nMeta<{
|
|
57
|
+
componentLabel: string;
|
|
58
|
+
directionModePicker: string;
|
|
59
|
+
directionModeAbsolute: string;
|
|
60
|
+
directionModeRelative: string;
|
|
61
|
+
tooltipsToggle: string;
|
|
62
|
+
tooltipsToggleHint: string;
|
|
63
|
+
labelsToggle: string;
|
|
64
|
+
labelsToggleHint: string;
|
|
65
|
+
}>;
|
|
66
|
+
/**
|
|
67
|
+
* Controls whether the direction mode picker is shown for this component.
|
|
68
|
+
*
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
accessor showDirectionModePicker: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Controls whether a header is shown for this component.
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
accessor showHeader: boolean;
|
|
78
|
+
/** Controls the sketch labels, tooltips, and values options. */
|
|
79
|
+
accessor sketchOptions: SketchOptions;
|
|
80
|
+
/**
|
|
81
|
+
* Indicates whether tooltips are shown while sketching and editing.
|
|
82
|
+
*
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
accessor tooltipsEnabled: boolean;
|
|
86
|
+
/** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
|
|
87
|
+
readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "tooltipsEnabled" | "labelsEnabled" | "directionMode"; }>;
|
|
88
|
+
readonly "@eventTypes": {
|
|
89
|
+
arcgisPropertyChange: ArcgisSketchTooltipControls["arcgisPropertyChange"]["detail"];
|
|
90
|
+
};
|
|
91
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { c as l } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as a, html as i } from "lit";
|
|
4
|
+
import n from "@arcgis/core/views/interactive/sketch/SketchOptions.js";
|
|
5
|
+
import { LitElement as c, nothing as r } from "@arcgis/lumina";
|
|
6
|
+
import { usePropertyChange as d } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { u as h } from "../../chunks/useT9n.js";
|
|
8
|
+
import { V as s } from "../../chunks/visible-element.js";
|
|
9
|
+
const b = a`.root{display:flex;flex-flow:column wrap;min-width:100%;& calcite-label:last-child{--calcite-label-margin-bottom: 0}}.block{border-block-end:none;margin:0}.block-content{display:flex;flex-direction:column;gap:var(--calcite-spacing-xs, 6px)}.radio-button-label-wrapper{align-items:center;display:flex;gap:var(--calcite-space-base, 2px)}`;
|
|
10
|
+
class p extends c {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.messages = h({ blocking: !0 }), this.showHeader = !1, this.hideTooltipsToggle = !1, this.hideLabelsToggle = !1, this.showDirectionModePicker = !1, this.sketchOptions = new n(), this.arcgisPropertyChange = d()("tooltipsEnabled", "labelsEnabled", "directionMode");
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.properties = { _hasContent: 32, showHeader: 5, label: 1, hideTooltipsToggle: 5, hideLabelsToggle: 5, showDirectionModePicker: 5, sketchOptions: 0, tooltipsEnabled: 5, labelsEnabled: 5, directionMode: 1 };
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = b;
|
|
19
|
+
}
|
|
20
|
+
get _hasContent() {
|
|
21
|
+
return !this.hideTooltipsToggle || !this.hideLabelsToggle || this.showDirectionModePicker;
|
|
22
|
+
}
|
|
23
|
+
get tooltipsEnabled() {
|
|
24
|
+
return this.sketchOptions.tooltips.enabled;
|
|
25
|
+
}
|
|
26
|
+
set tooltipsEnabled(e) {
|
|
27
|
+
this.sketchOptions.tooltips.enabled = e;
|
|
28
|
+
}
|
|
29
|
+
get labelsEnabled() {
|
|
30
|
+
return this.sketchOptions.labels.enabled;
|
|
31
|
+
}
|
|
32
|
+
set labelsEnabled(e) {
|
|
33
|
+
this.sketchOptions.labels.enabled = e;
|
|
34
|
+
}
|
|
35
|
+
get directionMode() {
|
|
36
|
+
return this.sketchOptions.values.directionMode;
|
|
37
|
+
}
|
|
38
|
+
set directionMode(e) {
|
|
39
|
+
this.sketchOptions.values.directionMode = e;
|
|
40
|
+
}
|
|
41
|
+
_onDirectionModeChange(e) {
|
|
42
|
+
this.sketchOptions.values.directionMode = e.currentTarget.selectedItem.value;
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
const { label: e, messages: t } = this, o = e ?? t.componentLabel;
|
|
46
|
+
return i`<div aria-label=${o ?? r} class="root">${this._hasContent ? i`<calcite-block class="block" expanded .heading=${this.showHeader ? e : ""} .label=${o ?? ""}><div class="block-content">${s({ hidden: this.hideTooltipsToggle, children: this._renderTooltipsToggle() })}${s({ hidden: this.hideLabelsToggle, children: this._renderLabelsToggle() })}${s({ hidden: !this.showDirectionModePicker, children: this._renderDirectionModePicker() })}</div></calcite-block>` : void 0}</div>`;
|
|
47
|
+
}
|
|
48
|
+
_renderTooltipsToggle() {
|
|
49
|
+
const { messages: e } = this;
|
|
50
|
+
return i`<arcgis-labeled-switch .checked=${this.sketchOptions.tooltips.effectiveEnabled} .hint=${e.tooltipsToggleHint} .label=${e.tooltipsToggle} @arcgisCheckedChanged=${(t) => {
|
|
51
|
+
this.sketchOptions.tooltips.enabled = t.detail;
|
|
52
|
+
}} .disabled=${this.sketchOptions.tooltips.forceEnabled}></arcgis-labeled-switch>`;
|
|
53
|
+
}
|
|
54
|
+
_renderLabelsToggle() {
|
|
55
|
+
const { messages: e } = this;
|
|
56
|
+
return i`<arcgis-labeled-switch .checked=${this.sketchOptions.labels.enabled} .hint=${e.labelsToggleHint} .label=${e.labelsToggle} @arcgisCheckedChanged=${(t) => {
|
|
57
|
+
this.sketchOptions.labels.enabled = t.detail;
|
|
58
|
+
}}></arcgis-labeled-switch>`;
|
|
59
|
+
}
|
|
60
|
+
_renderDirectionModePicker() {
|
|
61
|
+
const { messages: e } = this, { directionMode: t } = this.sketchOptions.values;
|
|
62
|
+
return i`<calcite-label layout=default scale=s>${e.directionModePicker}<calcite-radio-button-group name=direction-mode layout=horizontal scale=s @calciteRadioButtonGroupChange=${this._onDirectionModeChange}>${this._renderDirectionModeOption("relative", t, e.directionModeRelative)}${this._renderDirectionModeOption("absolute", t, e.directionModeAbsolute)}</calcite-radio-button-group></calcite-label>`;
|
|
63
|
+
}
|
|
64
|
+
_renderDirectionModeOption(e, t, o) {
|
|
65
|
+
return i`<calcite-label layout=inline scale=s><calcite-radio-button .checked=${e === t} scale=s .value=${e}></calcite-radio-button><div class="radio-button-label-wrapper"><calcite-icon .icon=${`${e}-direction`} scale=s></calcite-icon>${o}</div></calcite-label>`;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
l("arcgis-sketch-tooltip-controls", p);
|
|
69
|
+
export {
|
|
70
|
+
p as ArcgisSketchTooltipControls
|
|
71
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-block";
|
|
2
|
+
import "../arcgis-labeled-switch/index.js";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-label";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-radio-button-group";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-radio-button";
|
|
6
|
+
import "@esri/calcite-components/components/calcite-icon";
|
|
7
|
+
export * from "./customElement.js";
|
|
@@ -1,76 +1,104 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { keyed as
|
|
4
|
-
import { substitute as
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { useDirection as
|
|
7
|
-
import { css as
|
|
8
|
-
import { u as
|
|
2
|
+
import { c as k } from "../../chunks/runtime.js";
|
|
3
|
+
import { keyed as f } from "lit/directives/keyed.js";
|
|
4
|
+
import { substitute as T } from "@arcgis/core/intl.js";
|
|
5
|
+
import { LitElement as v, createEvent as _, safeClassMap as L } from "@arcgis/lumina";
|
|
6
|
+
import { useDirection as w } from "@arcgis/lumina/controllers";
|
|
7
|
+
import { css as F, html as d } from "lit";
|
|
8
|
+
import { u as y } from "../../chunks/useT9n.js";
|
|
9
9
|
import { c as i } from "../../chunks/time-utils.js";
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const p = "compact", b = /* @__PURE__ */ new Map([
|
|
11
|
+
["fr", "full"],
|
|
12
|
+
["he", "full"],
|
|
13
|
+
["ja", "full"],
|
|
14
|
+
["ko", "compact-wrap"],
|
|
15
|
+
["zh-CN", "full"],
|
|
16
|
+
["zh-HK", "full-wrap"],
|
|
17
|
+
["zh-TW", "full-wrap"]
|
|
18
|
+
]), z = /* @__PURE__ */ new Set(["compact-wrap", "full-wrap"]), m = {
|
|
19
|
+
hour: "numeric",
|
|
20
|
+
minute: "numeric",
|
|
21
|
+
timeZone: "UTC"
|
|
22
|
+
}, $ = {
|
|
23
|
+
hour: "numeric",
|
|
24
|
+
timeZone: "UTC"
|
|
25
|
+
}, h = (t) => "";
|
|
26
|
+
function x(t) {
|
|
27
|
+
const e = new Intl.DateTimeFormat(t, m), a = new Intl.DateTimeFormat(t, {
|
|
28
|
+
...m,
|
|
29
|
+
hourCycle: "h24"
|
|
30
|
+
}), r = e.resolvedOptions().hour12 === !1;
|
|
31
|
+
return (o) => {
|
|
32
|
+
const l = i(o, "minutes", "milliseconds"), s = new Date(l);
|
|
33
|
+
return l !== 0 && s.getUTCHours() === 0 && s.getUTCMinutes() === 0 && r ? a.format(s) : e.format(s);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function C(t) {
|
|
37
|
+
const e = new Intl.DateTimeFormat(t, m), a = new Intl.DateTimeFormat(t, $), r = b.get(t) ?? p;
|
|
38
|
+
return (o) => {
|
|
39
|
+
const l = Math.round(i(o, "minutes", "hours")), s = i(l, "hours", "milliseconds"), c = new Date(s);
|
|
40
|
+
switch (r) {
|
|
41
|
+
case "full":
|
|
42
|
+
case "full-wrap":
|
|
43
|
+
return e.format(c);
|
|
44
|
+
case "compact-wrap":
|
|
45
|
+
return u(a.format(c), " ");
|
|
46
|
+
default:
|
|
47
|
+
return u(a.format(c), " ");
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function S(t) {
|
|
52
|
+
return z.has(b.get(t) ?? p);
|
|
53
|
+
}
|
|
54
|
+
function u(t, e) {
|
|
55
|
+
return t.replace(/\S+/gu, D).replace(/\s+/gu, e);
|
|
56
|
+
}
|
|
57
|
+
function D(t) {
|
|
58
|
+
return Array.from(t).join("");
|
|
59
|
+
}
|
|
60
|
+
const W = F`:host{display:block}arcgis-slider{--arcgis-slider-handle-size: .875rem;--ticks-font-size: .625rem;--label-font-size: .75rem;--label-padding-block-start: 3px;--label-padding-block-end: var(--calcite-spacing-lg);--calcite-font-size-sm: var(--label-font-size);display:block;margin-block-start:var(--padding-block-start, -.5rem);padding-block-end:var(--padding-block-end, .3rem);&.wrap-labels{padding-block-end:var(--wrapped-padding, .875rem)}}:host([visual-scale="s"]) arcgis-slider{--arcgis-slider-handle-size: .625rem;--ticks-font-size: .625rem;--label-font-size: .625rem;--label-padding-block-end: 1rem;--padding-block-end: .5rem;--wrapped-padding: 1.1rem}:host([visual-scale="l"]) arcgis-slider{--arcgis-slider-handle-size: 1rem;--ticks-font-size: .75rem;--label-font-size: .875rem;--label-padding-block-end: .94rem;--padding-block-end: .4rem;--wrapped-padding: 1.1rem}.ticks-container{width:100%;position:relative}.time-range-label{position:relative;width:100%;padding-block-start:var(--label-padding-block-start);padding-block-end:var(--label-padding-block-end);font-size:var(--label-font-size);font-variant-numeric:tabular-nums;line-height:1em;text-align:center}.main-ticks,.secondary-ticks{position:absolute;inset:0;--arcgis-ticks-outline-color: var(--calcite-color-foreground-1)}.main-ticks{--arcgis-ticks-gap: var(--calcite-space-md);--arcgis-ticks-tick-length: calc(var(--calcite-size-fixed-xxxs) * 2);--arcgis-ticks-label-width: min-content;--arcgis-ticks-label-text-align: center;--arcgis-ticks-font-size: var(--ticks-font-size);white-space:nowrap;word-break:auto-phrase;font-variant-numeric:tabular-nums}.wrap-labels .main-ticks{white-space:normal}.secondary-ticks{--arcgis-ticks-tick-length: var(--calcite-size-fixed-xxxs)}`;
|
|
61
|
+
class I extends v {
|
|
12
62
|
constructor() {
|
|
13
|
-
super(...arguments), this.messages =
|
|
63
|
+
super(...arguments), this.messages = y({ blocking: !0 }), this._direction = w(), this._shouldWrapLabels = !1, this._sliderLabelFormatter = h, this._tickLabelFormatter = h, this.disabled = !1, this.mode = "range", this.startTime = 0, this.endTime = 0, this.visualScale = "m", this.arcgisTimeChange = _();
|
|
14
64
|
}
|
|
15
65
|
static {
|
|
16
66
|
this.properties = { _shouldWrapLabels: 16, _values: 16, _sliderLabelFormatter: 16, _tickLabelFormatter: 16, disabled: 7, mode: 3, startTime: 9, endTime: 9, label: 1, steps: 9, visualScale: 3 };
|
|
17
67
|
}
|
|
18
68
|
static {
|
|
19
|
-
this.styles =
|
|
69
|
+
this.styles = W;
|
|
20
70
|
}
|
|
21
71
|
willUpdate(e) {
|
|
22
72
|
(e.has("mode") || e.has("startTime") || e.has("endTime")) && (this._values = this.mode === "single" ? [this.startTime] : [this.startTime, this.endTime]), e.has("messages") && this._updateLabelFormatters();
|
|
23
73
|
}
|
|
24
|
-
_getSliderLabelFormatter(e) {
|
|
25
|
-
const t = new Intl.DateTimeFormat(e, g);
|
|
26
|
-
return (a) => {
|
|
27
|
-
const n = i(a, "minutes", "milliseconds"), m = new Date(n);
|
|
28
|
-
let r = t.format(m);
|
|
29
|
-
return n !== 0 && r === "00:00" && (r = "24:00"), r;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
_getTickLabelFormatter(e) {
|
|
33
|
-
const t = new Intl.DateTimeFormat(e, g), a = new Intl.DateTimeFormat(e, y);
|
|
34
|
-
return (n) => {
|
|
35
|
-
const m = Math.round(i(n, "minutes", "hours")), r = i(m, "hours", "milliseconds"), c = new Date(r), d = t.formatToParts(c);
|
|
36
|
-
return d.some((s) => s.type === "literal" && /\s/u.test(s.value)) ? a.format(c).replace(/\S+/gu, (s) => Array.from(s).join("")) : d.map((s) => s.value).join("");
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
74
|
_setStartTime(e) {
|
|
40
75
|
this.startTime = e, this.arcgisTimeChange.emit();
|
|
41
76
|
}
|
|
42
|
-
_setRange(e,
|
|
43
|
-
this.startTime = e, this.endTime =
|
|
77
|
+
_setRange(e, a) {
|
|
78
|
+
this.startTime = e, this.endTime = a, this.arcgisTimeChange.emit();
|
|
44
79
|
}
|
|
45
80
|
_updateLabelFormatters() {
|
|
46
81
|
const e = this.messages._lang;
|
|
47
|
-
this._sliderLabelFormatter =
|
|
82
|
+
this._sliderLabelFormatter = x(e), this._tickLabelFormatter = C(e), this._shouldWrapLabels = S(e);
|
|
48
83
|
}
|
|
49
84
|
_isolateTimeLabel(e) {
|
|
50
85
|
return this._direction === "rtl" ? `${e}` : e;
|
|
51
86
|
}
|
|
52
87
|
render() {
|
|
53
88
|
const e = this.mode === "single" && !this.disabled;
|
|
54
|
-
return
|
|
55
|
-
this.mode === "single" ? this._setStartTime(
|
|
56
|
-
}}>${this.mode === "range" ? this._renderTimeRange() : void 0}<div class="ticks-container" slot=content-end><arcgis-ticks class="main-ticks" .interactive=${e} .labelFormatter=${this._tickLabelFormatter} layout=horizontal min=0 .max=${
|
|
89
|
+
return f(this.messages._lang, d`<arcgis-slider .ariaLabel=${this.label} class=${L({ "wrap-labels": this._shouldWrapLabels })} .disabled=${this.disabled} fill-placement=none .labelFormatter=${this._sliderLabelFormatter} layout=horizontal min=0 .max=${n} .steps=${this.steps ?? 1} .valueLabelsDisplay=${this.mode === "range" ? "hidden" : "always"} value-labels-placement=start .values=${this._values} @arcgisInput=${({ currentTarget: { values: a } }) => {
|
|
90
|
+
this.mode === "single" ? this._setStartTime(a[0]) : this._setRange(a[0], a[1]);
|
|
91
|
+
}}>${this.mode === "range" ? this._renderTimeRange() : void 0}<div class="ticks-container" slot=content-end><arcgis-ticks class="main-ticks" .interactive=${e} .labelFormatter=${this._tickLabelFormatter} layout=horizontal min=0 .max=${n} mode=value show-labels .values=${g} @arcgisTickClick=${(a) => this._setStartTime(a.detail.value)}></arcgis-ticks><arcgis-ticks class="secondary-ticks" layout=horizontal min=0 .max=${n} mode=value .values=${O} @arcgisTickClick=${(a) => this._setStartTime(a.detail.value)}></arcgis-ticks></div></arcgis-slider>`);
|
|
57
92
|
}
|
|
58
93
|
_renderTimeRange() {
|
|
59
|
-
const e = this._isolateTimeLabel(this._sliderLabelFormatter(this.startTime)),
|
|
60
|
-
return
|
|
94
|
+
const e = this._isolateTimeLabel(this._sliderLabelFormatter(this.startTime)), a = this._isolateTimeLabel(this._sliderLabelFormatter(this.endTime)), r = this.messages?.timeRange;
|
|
95
|
+
return d`<div class="time-range-label" aria-live=polite slot=content-start>${T(r ?? "{start} — {end}", { start: e, end: a })}</div>`;
|
|
61
96
|
}
|
|
62
97
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
minute: "numeric",
|
|
68
|
-
timeZone: "UTC"
|
|
69
|
-
}, y = {
|
|
70
|
-
hour: "numeric",
|
|
71
|
-
timeZone: "UTC"
|
|
72
|
-
};
|
|
73
|
-
u("arcgis-time-of-day-slider", z);
|
|
98
|
+
const n = i(24, "hours", "minutes") - 1, g = [0, 6, 12, 18].map((t) => i(t, "hours", "minutes"));
|
|
99
|
+
g.push(n);
|
|
100
|
+
const O = [2, 4, 8, 10, 14, 16, 20, 22].map((t) => i(t, "hours", "minutes"));
|
|
101
|
+
k("arcgis-time-of-day-slider", I);
|
|
74
102
|
export {
|
|
75
|
-
|
|
103
|
+
I as ArcgisTimeOfDaySlider
|
|
76
104
|
};
|