@arcgis/map-components 5.1.0-next.112 → 5.1.0-next.113

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.
Files changed (68) hide show
  1. package/dist/cdn/{DXJGJIPP.js → 6OHXFH4A.js} +1 -1
  2. package/dist/cdn/A5EVICJ5.js +2 -0
  3. package/dist/cdn/CHCD2OBT.js +2 -0
  4. package/dist/cdn/DC3AKQM4.js +2 -0
  5. package/dist/cdn/GQJFJL7W.js +2 -0
  6. package/dist/cdn/IHM2BEQ6.js +2 -0
  7. package/dist/cdn/JV3MKZ3R.js +2 -0
  8. package/dist/cdn/KHXBLOZ3.js +2 -0
  9. package/dist/cdn/NKGIMPY4.js +2 -0
  10. package/dist/cdn/{TFFF4SV3.js → T5S7VN6B.js} +1 -1
  11. package/dist/cdn/{6FNGCBCG.js → UXIPFY72.js} +1 -1
  12. package/dist/cdn/W4TMIOKN.js +2 -0
  13. package/dist/cdn/YPOCQLIU.js +2 -0
  14. package/dist/cdn/assets/paste/t9n/messages.en.json +1 -1
  15. package/dist/cdn/assets/print/t9n/messages.en.json +1 -1
  16. package/dist/cdn/assets/value-picker/t9n/messages.en.json +1 -0
  17. package/dist/cdn/assets/value-picker-combobox/t9n/messages.en.json +1 -0
  18. package/dist/cdn/index.js +1 -1
  19. package/dist/cdn/main.css +1 -1
  20. package/dist/chunks/print-exports-panel-item-popover.js +39 -0
  21. package/dist/components/arcgis-coordinate-conversion/customElement.js +10 -10
  22. package/dist/components/arcgis-directions/customElement.js +30 -29
  23. package/dist/components/arcgis-oriented-imagery-viewer/customElement.js +12 -11
  24. package/dist/components/arcgis-paste/commands/PasteCommand.d.ts +4 -0
  25. package/dist/components/arcgis-paste/commands/PasteCustomCommand.d.ts +2 -0
  26. package/dist/components/arcgis-paste/customElement.d.ts +2 -0
  27. package/dist/components/arcgis-paste/customElement.js +1 -1
  28. package/dist/components/arcgis-print/customElement.d.ts +6 -0
  29. package/dist/components/arcgis-print-exports-panel/customElement.js +21 -38
  30. package/dist/components/arcgis-print-exports-panel/index.js +1 -1
  31. package/dist/components/arcgis-print-exports-panel-item-popover/customElement.js +10 -0
  32. package/dist/components/arcgis-print-exports-panel-item-popover/index.js +5 -0
  33. package/dist/components/arcgis-print-scale-section/customElement.js +1 -1
  34. package/dist/components/arcgis-value-picker/customElement.d.ts +383 -0
  35. package/dist/components/arcgis-value-picker/customElement.js +82 -0
  36. package/dist/components/arcgis-value-picker/index.d.ts +1 -0
  37. package/dist/components/arcgis-value-picker/index.js +3 -0
  38. package/dist/components/arcgis-value-picker/types.d.ts +65 -0
  39. package/dist/components/arcgis-value-picker-collection/customElement.d.ts +113 -0
  40. package/dist/components/arcgis-value-picker-collection/customElement.js +43 -0
  41. package/dist/components/arcgis-value-picker-collection/index.d.ts +1 -0
  42. package/dist/components/arcgis-value-picker-collection/index.js +1 -0
  43. package/dist/components/arcgis-value-picker-combobox/customElement.d.ts +90 -0
  44. package/dist/components/arcgis-value-picker-combobox/customElement.js +55 -0
  45. package/dist/components/arcgis-value-picker-combobox/index.d.ts +1 -0
  46. package/dist/components/arcgis-value-picker-combobox/index.js +3 -0
  47. package/dist/components/arcgis-value-picker-label/customElement.d.ts +81 -0
  48. package/dist/components/arcgis-value-picker-label/customElement.js +51 -0
  49. package/dist/components/arcgis-value-picker-label/index.d.ts +1 -0
  50. package/dist/components/arcgis-value-picker-label/index.js +1 -0
  51. package/dist/components/arcgis-value-picker-slider/customElement.d.ts +173 -0
  52. package/dist/components/arcgis-value-picker-slider/customElement.js +60 -0
  53. package/dist/components/arcgis-value-picker-slider/index.d.ts +1 -0
  54. package/dist/components/arcgis-value-picker-slider/index.js +3 -0
  55. package/dist/docs/api.json +1 -1
  56. package/dist/docs/docs.json +1 -1
  57. package/dist/docs/vscode.html-custom-data.json +1 -1
  58. package/dist/docs/web-types.json +1 -1
  59. package/dist/index.d.ts +50 -0
  60. package/dist/loader.js +6 -0
  61. package/dist/types/lumina.d.ts +36 -0
  62. package/dist/types/preact.d.ts +41 -0
  63. package/dist/types/react.d.ts +46 -0
  64. package/dist/types/stencil.d.ts +36 -0
  65. package/package.json +4 -4
  66. package/dist/cdn/6KMHCO4F.js +0 -2
  67. package/dist/cdn/BRX2TSCS.js +0 -2
  68. package/dist/cdn/JRO53TBV.js +0 -2
@@ -0,0 +1,43 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as s } from "../../chunks/runtime.js";
3
+ import { LitElement as i } from "@arcgis/lumina";
4
+ import { usePropertyChange as a } from "@arcgis/lumina/controllers";
5
+ class r extends i {
6
+ constructor() {
7
+ super(...arguments), this.autoDestroyDisabled = !1, this.canNext = !1, this.canPlay = !1, this.canPrevious = !1, this.arcgisPropertyChange = a()("canNext", "canPlay", "canPrevious", "currentValue");
8
+ }
9
+ static {
10
+ this.properties = { autoDestroyDisabled: 5, items: 0, currentValue: 0, canNext: 5, canPlay: 5, canPrevious: 5 };
11
+ }
12
+ async destroy() {
13
+ await this.manager.destroy();
14
+ }
15
+ reset() {
16
+ this.currentValue = this.items?.at(0);
17
+ }
18
+ step(t) {
19
+ if (!this.items || !this.currentValue)
20
+ return;
21
+ const e = this.items.indexOf(this.currentValue) + (t === "next" ? 1 : -1);
22
+ e >= this.items.length || e < 0 || (this.currentValue = this.items.at(e), this._checkState());
23
+ }
24
+ connectedCallback() {
25
+ super.connectedCallback(), this.el.hidden = !0;
26
+ }
27
+ willUpdate(t) {
28
+ (t.has("currentValue") || t.has("items")) && this.items?.length && (this.currentValue ??= this.items.at(0)), this._checkState();
29
+ }
30
+ _checkState() {
31
+ if (!this.items?.length) {
32
+ this.canPlay = !1, this.canNext = !1, this.canPrevious = !1;
33
+ return;
34
+ }
35
+ this.canPlay = !0;
36
+ const t = this.items.indexOf(this.currentValue);
37
+ this.canNext = t >= 0 && t < this.items.length - 1, this.canPrevious = t > 0;
38
+ }
39
+ }
40
+ s("arcgis-value-picker-collection", r);
41
+ export {
42
+ r as ArcgisValuePickerCollection
43
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,90 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { ComboboxItem } from "../arcgis-value-picker/types.js";
4
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
5
+
6
+ export abstract class ArcgisValuePickerCombobox extends LitElement {
7
+ /**
8
+ * If true, the component will not be destroyed automatically when it is
9
+ * disconnected from the document. This is useful when you want to move the
10
+ * component to a different place on the page, or temporarily hide it. If this
11
+ * is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-combobox/#destroy) method when you are done to
12
+ * prevent memory leaks.
13
+ *
14
+ * @default false
15
+ */
16
+ accessor autoDestroyDisabled: boolean;
17
+ /**
18
+ * Determines whether the user can interact with the next button.
19
+ * This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-combobox/#currentValue) matches the last index of
20
+ * [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-combobox/#items).
21
+ *
22
+ * @default false
23
+ * @example
24
+ * ```js
25
+ * const valuePicker = document.querySelector("arcgis-value-picker");
26
+ * const valuePickerCombobox = document.querySelector("arcgis-value-picker-combobox");
27
+ *
28
+ * valuePickerCombobox.items = [
29
+ * { value: "ind", label: "Industrial" },
30
+ * { value: "res", label: "Residential" },
31
+ * { value: "com", label: "Commercial" }
32
+ * ];
33
+ * valuePickerCombobox.currentValue = valuePickerCombobox.items[0];
34
+ * if (valuePickerCombobox.canNext === true) {
35
+ * valuePicker.next();
36
+ * console.log(valuePickerCombobox.currentValue.label); // "Residential"
37
+ * }
38
+ * ```
39
+ */
40
+ accessor canNext: boolean;
41
+ /**
42
+ * Determines whether the user can interact with the play/pause button.
43
+ *
44
+ * @default false
45
+ */
46
+ accessor canPlay: boolean;
47
+ /**
48
+ * Determines whether the user can interact with the previous button.
49
+ * This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-combobox/#currentValue) matches the first index of
50
+ * [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-combobox/#items).
51
+ *
52
+ * @default false
53
+ * @example
54
+ * ```js
55
+ * const valuePicker = document.querySelector("arcgis-value-picker");
56
+ * const valuePickerCombobox = document.querySelector("arcgis-value-picker-combobox");
57
+ *
58
+ * valuePickerCombobox.items = [
59
+ * { value: "ind", label: "Industrial" },
60
+ * { value: "res", label: "Residential" },
61
+ * { value: "com", label: "Commercial" }
62
+ * ];
63
+ * valuePickerCombobox.currentValue = valuePickerCombobox.items[1];
64
+ * if (valuePickerCombobox.canPrevious === true) {
65
+ * valuePicker.previous();
66
+ * console.log(valuePickerCombobox.currentValue.label); // "Industrial"
67
+ * }
68
+ * ```
69
+ */
70
+ accessor canPrevious: boolean;
71
+ /** The currently selected combobox item rendered by the component. */
72
+ accessor currentValue: ComboboxItem | undefined;
73
+ /**
74
+ * When true, the component is visually withdrawn and cannot receive user interaction.
75
+ *
76
+ * @default false
77
+ */
78
+ accessor disabled: boolean;
79
+ /** The array of combobox items that [arcgis-value-picker](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/) can iterate over. */
80
+ accessor items: ComboboxItem[] | undefined;
81
+ /** @internal */
82
+ protected messages: { comboboxLabel: string; } & T9nMeta<{ comboboxLabel: string; }>;
83
+ /** Permanently destroy the component. */
84
+ destroy(): Promise<void>;
85
+ /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
86
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }>;
87
+ readonly "@eventTypes": {
88
+ arcgisPropertyChange: ArcgisValuePickerCombobox["arcgisPropertyChange"]["detail"];
89
+ };
90
+ }
@@ -0,0 +1,55 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as l } from "../../chunks/runtime.js";
3
+ import { LitElement as r } from "@arcgis/lumina";
4
+ import { css as n, html as a } from "lit";
5
+ import { usePropertyChange as o } from "@arcgis/lumina/controllers";
6
+ import { u as h } from "../../chunks/useT9n.js";
7
+ const u = n`:host{align-items:center;display:flex;flex:auto;min-width:300px;padding-inline:var(--calcite-space-sm);--calcite-color-border-input: var(--calcite-color-border-3)}calcite-combobox{flex:auto;width:var(--calcite-space-none)}`;
8
+ class m extends r {
9
+ constructor() {
10
+ super(...arguments), this.messages = h({ blocking: !0 }), this.autoDestroyDisabled = !1, this.disabled = !1, this.canNext = !1, this.canPlay = !1, this.canPrevious = !1, this.arcgisPropertyChange = o()("canNext", "canPlay", "canPrevious", "currentValue");
11
+ }
12
+ static {
13
+ this.properties = { autoDestroyDisabled: 5, disabled: 5, items: 0, currentValue: 0, canNext: 5, canPlay: 5, canPrevious: 5 };
14
+ }
15
+ static {
16
+ this.styles = u;
17
+ }
18
+ async destroy() {
19
+ await this.manager.destroy();
20
+ }
21
+ reset() {
22
+ this.currentValue = this.items?.[0];
23
+ }
24
+ step(e) {
25
+ if (!this.items || !this.currentValue)
26
+ return;
27
+ const s = this.items.findIndex(({ value: c }) => c === this.currentValue?.value) + (e === "next" ? 1 : -1);
28
+ s >= this.items.length || s < 0 || (this.currentValue = this.items[s], this._checkState());
29
+ }
30
+ connectedCallback() {
31
+ super.connectedCallback(), this.el.hidden = !0;
32
+ }
33
+ willUpdate(e) {
34
+ (e.has("currentValue") || e.has("items")) && this.items?.length && (this.currentValue ??= this.items[0]), this.el.hidden = !this.items?.length, this._checkState();
35
+ }
36
+ _checkState() {
37
+ if (!this.items?.length) {
38
+ this.canPlay = !1, this.canNext = !1, this.canPrevious = !1;
39
+ return;
40
+ }
41
+ this.canPlay = !0;
42
+ const e = this.items.findIndex(({ value: t }) => t === this.currentValue?.value);
43
+ this.canNext = e < this.items.length - 1, this.canPrevious = e > 0;
44
+ }
45
+ render() {
46
+ return a`<calcite-combobox .disabled=${this.disabled} selection-mode=single .label=${this.messages.comboboxLabel} @calciteComboboxChange=${({ currentTarget: e }) => {
47
+ const t = e.selectedItems[0]?.value;
48
+ this.currentValue = this.items?.find(({ value: i }) => i === t), this._checkState();
49
+ }}>${this.items?.map((e) => a`<calcite-combobox-item .value=${e.value} .heading=${e.label} .selected=${e.value === this.currentValue?.value}></calcite-combobox-item>`)}</calcite-combobox>`;
50
+ }
51
+ }
52
+ l("arcgis-value-picker-combobox", m);
53
+ export {
54
+ m as ArcgisValuePickerCombobox
55
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-combobox";
2
+ import "@esri/calcite-components/components/calcite-combobox-item";
3
+ export * from "./customElement.js";
@@ -0,0 +1,81 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { LabelItem } from "../arcgis-value-picker/types.js";
4
+
5
+ export abstract class ArcgisValuePickerLabel extends LitElement {
6
+ /**
7
+ * If true, the component will not be destroyed automatically when it is
8
+ * disconnected from the document. This is useful when you want to move the
9
+ * component to a different place on the page, or temporarily hide it. If this
10
+ * is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#destroy) method when you are done to
11
+ * prevent memory leaks.
12
+ *
13
+ * @default false
14
+ */
15
+ accessor autoDestroyDisabled: boolean;
16
+ /**
17
+ * Determines whether the user can interact with the next button.
18
+ * This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#currentValue) matches the last index of
19
+ * [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#items).
20
+ *
21
+ * @default false
22
+ * @example
23
+ * ```js
24
+ * const valuePicker = document.querySelector("arcgis-value-picker");
25
+ * const valuePickerLabel = document.querySelector("arcgis-value-picker-label");
26
+ *
27
+ * valuePickerLabel.items = [
28
+ * { value: "90606", label: "Whittier, CA (90606)" },
29
+ * { value: "76001", label: "Arlington, TX (76001)" },
30
+ * { value: "92335", label: "Fontana, CA (92335)" }
31
+ * ];
32
+ * valuePickerLabel.currentValue = valuePickerLabel.items[0];
33
+ * if (valuePickerLabel.canNext === true) {
34
+ * valuePicker.next();
35
+ * console.log(valuePickerLabel.currentValue.label); // "Arlington, TX (76001)"
36
+ * }
37
+ * ```
38
+ */
39
+ accessor canNext: boolean;
40
+ /**
41
+ * Determines whether the user can interact with the play/pause button.
42
+ *
43
+ * @default false
44
+ */
45
+ accessor canPlay: boolean;
46
+ /**
47
+ * Determines whether the user can interact with the previous button.
48
+ * This property is automatically set to `false` when [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#currentValue) matches the first index of
49
+ * [items](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-label/#items).
50
+ *
51
+ * @default false
52
+ * @example
53
+ * ```js
54
+ * const valuePicker = document.querySelector("arcgis-value-picker");
55
+ * const valuePickerLabel = document.querySelector("arcgis-value-picker-label");
56
+ *
57
+ * valuePickerLabel.items = [
58
+ * { value: "90606", label: "Whittier, CA (90606)" },
59
+ * { value: "76001", label: "Arlington, TX (76001)" },
60
+ * { value: "92335", label: "Fontana, CA (92335)" }
61
+ * ];
62
+ * valuePickerLabel.currentValue = valuePickerLabel.items[1];
63
+ * if (valuePickerLabel.canPrevious === true) {
64
+ * valuePicker.previous();
65
+ * console.log(valuePickerLabel.currentValue.label); // "Whittier, CA (90606)"
66
+ * }
67
+ * ```
68
+ */
69
+ accessor canPrevious: boolean;
70
+ /** The currently selected label item rendered by the component. */
71
+ accessor currentValue: LabelItem | undefined;
72
+ /** The array of label items that [arcgis-value-picker](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/) can iterate over. */
73
+ accessor items: LabelItem[] | undefined;
74
+ /** Permanently destroy the component. */
75
+ destroy(): Promise<void>;
76
+ /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
77
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }>;
78
+ readonly "@eventTypes": {
79
+ arcgisPropertyChange: ArcgisValuePickerLabel["arcgisPropertyChange"]["detail"];
80
+ };
81
+ }
@@ -0,0 +1,51 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as a } from "../../chunks/runtime.js";
3
+ import { LitElement as r } from "@arcgis/lumina";
4
+ import { css as n, html as c } from "lit";
5
+ import { usePropertyChange as l } from "@arcgis/lumina/controllers";
6
+ const o = n`:host{display:flex;flex:auto;min-width:300px;padding:var(--calcite-space-sm)}.container{align-items:center;border:solid 1px var(--calcite-color-border-3);display:flex;flex:auto;padding-inline:var(--calcite-space-sm)}.text{color:var(--calcite-color-text-1);flex:auto;font-family:inherit;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-normal);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:var(--calcite-space-none)}`;
7
+ class h extends r {
8
+ constructor() {
9
+ super(...arguments), this.autoDestroyDisabled = !1, this.canNext = !1, this.canPlay = !1, this.canPrevious = !1, this.arcgisPropertyChange = l()("canNext", "canPlay", "canPrevious", "currentValue");
10
+ }
11
+ static {
12
+ this.properties = { autoDestroyDisabled: 5, items: 0, currentValue: 0, canNext: 5, canPlay: 5, canPrevious: 5 };
13
+ }
14
+ static {
15
+ this.styles = o;
16
+ }
17
+ async destroy() {
18
+ await this.manager.destroy();
19
+ }
20
+ reset() {
21
+ this.currentValue = this.items?.[0];
22
+ }
23
+ step(e) {
24
+ if (!this.items || !this.currentValue)
25
+ return;
26
+ const t = this.items.findIndex(({ value: s }) => s === this.currentValue?.value) + (e === "next" ? 1 : -1);
27
+ t >= this.items.length || t < 0 || (this.currentValue = this.items[t], this._checkState());
28
+ }
29
+ connectedCallback() {
30
+ super.connectedCallback(), this.el.hidden = !0;
31
+ }
32
+ willUpdate(e) {
33
+ (e.has("currentValue") || e.has("items")) && this.items?.length && !this.currentValue && (this.currentValue = this.items[0]), this.el.hidden = !this.items?.length, this._checkState();
34
+ }
35
+ _checkState() {
36
+ if (!this.items?.length) {
37
+ this.canPlay = !1, this.canNext = !1, this.canPrevious = !1;
38
+ return;
39
+ }
40
+ this.canPlay = !0;
41
+ const e = this.items.findIndex(({ value: i }) => i === this.currentValue?.value);
42
+ this.canNext = e < this.items.length - 1, this.canPrevious = e > 0;
43
+ }
44
+ render() {
45
+ return c`<div class="container"><div class="text">${this.currentValue?.label}</div></div>`;
46
+ }
47
+ }
48
+ a("arcgis-value-picker-label", h);
49
+ export {
50
+ h as ArcgisValuePickerLabel
51
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,173 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { Layout } from "../arcgis-value-picker/types.js";
4
+
5
+ export abstract class ArcgisValuePickerSlider extends LitElement {
6
+ /**
7
+ * If true, the component will not be destroyed automatically when it is
8
+ * disconnected from the document. This is useful when you want to move the
9
+ * component to a different place on the page, or temporarily hide it. If this
10
+ * is set, make sure to call the [destroy()](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#destroy) method when you are done to
11
+ * prevent memory leaks.
12
+ *
13
+ * @default false
14
+ */
15
+ accessor autoDestroyDisabled: boolean;
16
+ /**
17
+ * Determines whether the user can interact with the next button.
18
+ * This property is automatically set to `false` when the index of [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#currentValue) matches the last index of
19
+ * [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps). Regardless of the [layout](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#layout) property's value, the slider thumb will
20
+ * move in the direction that the next button is pointing. This means that when the slider is visually flipped
21
+ * (`layout` is `"horizontal"` and `mirrored` is `true`, or `layout` is `"vertical"` and `mirrored` is `false`), this property becomes `false`
22
+ * when `currentValue` is equal to the first index of `steps` rather than the last.
23
+ *
24
+ * @default false
25
+ * @example
26
+ * ```js
27
+ * const valuePicker = document.querySelector("arcgis-value-picker");
28
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
29
+ *
30
+ * valuePickerSlider.steps = [1, 2, 3];
31
+ * valuePickerSlider.currentValue = 3;
32
+ *
33
+ * if (valuePickerSlider.canNext) {
34
+ * valuePicker.next();
35
+ * } else {
36
+ * console.log("Cannot step forward."); // this line will execute
37
+ * }
38
+ * ```
39
+ */
40
+ accessor canNext: boolean;
41
+ /**
42
+ * Determines whether the user can interact with the play/pause button.
43
+ *
44
+ * @default false
45
+ */
46
+ accessor canPlay: boolean;
47
+ /**
48
+ * Determines whether the user can interact with the previous button.
49
+ * This property is automatically set to `false` when the index of [currentValue](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#currentValue) matches the first index of
50
+ * [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps). Regardless of the [layout](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#layout) property's value, the slider thumb will
51
+ * move in the direction that the previous button is pointing. This means that when the slider is visually flipped
52
+ * (`layout` is `"horizontal"` and `mirrored` is `true`, or `layout` is `"vertical"` and `mirrored` is `false`), this property becomes `false`
53
+ * when `currentValue` is equal to the last index of `steps` rather than the first.
54
+ *
55
+ * @default false
56
+ * @example
57
+ * ```js
58
+ * const valuePicker = document.querySelector("arcgis-value-picker");
59
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
60
+ *
61
+ * // `steps` will be rendered on a vertical track where "3" is the topmost value.
62
+ * // The previous button (pointing upwards) will fail to increment the index of `steps` by 1.
63
+ *
64
+ * valuePickerSlider.steps = [1, 2, 3];
65
+ * valuePickerSlider.currentValue = 1;
66
+ * valuePickerSlider.mirrored = false;
67
+ * valuePicker.layout = "vertical";
68
+ *
69
+ * if (valuePickerSlider.canPrevious) {
70
+ * valuePicker.previous(); // this line will execute
71
+ * } else {
72
+ * console.log("Cannot step upward.");
73
+ * }
74
+ * ```
75
+ */
76
+ accessor canPrevious: boolean;
77
+ /**
78
+ * The value of the currently selected index in the slider's [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps). If this property is not assigned by the
79
+ * user, it will default to the last index of `steps`.
80
+ */
81
+ accessor currentValue: number | undefined;
82
+ /**
83
+ * When set to `true`, the user may not interact with the slider.
84
+ * Note that if the ValuePicker's [arcgis-value-picker.disabled](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/#disabled) property is mutated, this property will update to match it.
85
+ *
86
+ * @default false
87
+ */
88
+ accessor disabled: boolean;
89
+ /**
90
+ * A function used to format labels. Overrides the default label formatter.
91
+ *
92
+ * @example
93
+ * ```js
94
+ * // Display a label at every step formatted as a percentage.
95
+ *
96
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
97
+ * valuePickerSlider.steps = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
98
+ * valuePickerSlider.labels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
99
+ * valuePickerSlider.labelFormatter = (value) => `${value}%`;
100
+ * ```
101
+ */
102
+ accessor labelFormatter: (value: number, defaultFormatter: (value: number) => string) => string | null | undefined;
103
+ /**
104
+ * Determines where along the slider track labels should be placed. Labels will be formatted by the [labelFormatter](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#labelFormatter) property.
105
+ *
106
+ * @example
107
+ * ```js
108
+ * // Display a label at every other step
109
+ *
110
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
111
+ * valuePickerSlider.steps = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
112
+ * valuePickerSlider.labels = [0, 20, 40, 60, 80, 100];
113
+ * ```
114
+ */
115
+ accessor labels: number[] | undefined;
116
+ /**
117
+ * Determines whether the slider should be oriented horizontally or vertically. Note that if [arcgis-value-picker.layout](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/#layout) on the Value Picker component
118
+ * is mutated, this property will update to match it. The UI will behave as if the indices of [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps) will ascend left to right, or bottom
119
+ * to top on a horizontal or vertical layout, respectively. If you wish for the slider to be visually mirrored, set the [mirrored](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#mirrored)
120
+ * property to true. This will also make the 'next' button responsible for stepping backwards to the previous index of `steps`, and
121
+ * 'previous' responsible for advancing to the next index of `steps`.
122
+ *
123
+ * @default "horizontal"
124
+ * @example
125
+ * ```js
126
+ * // Display a vertical slider with `steps` ascending bottom to top. In this instance, the 'next'
127
+ * // button (pointing downwards) will bring `currentValue` closer to 0 to match the slider's appearance.
128
+ *
129
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
130
+ * valuePickerSlider.steps = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
131
+ * valuePickerSlider.currentValue = 100;
132
+ * valuePickerSlider.layout = "vertical";
133
+ *
134
+ * // Display a horizontal slider with `steps` ascending right to left. Since `mirrored` is true,
135
+ * // the slider will show `currentValue` decreasing from 100 to 0 as the 'next' button (pointing to the right) is pressed.
136
+ *
137
+ * const valuePickerSlider = document.querySelector("arcgis-value-picker-slider");
138
+ * valuePickerSlider.steps = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
139
+ * valuePickerSlider.currentValue = 100;
140
+ * valuePickerSlider.layout = "horizontal";
141
+ * valuePickerSlider.mirrored = true;
142
+ * ```
143
+ * @see [arcgis-value-picker.layout](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker/#layout)
144
+ */
145
+ accessor layout: Layout | undefined;
146
+ /** Positions along the slider track rendered as long tick marks under the track. */
147
+ accessor majorTicks: number[] | undefined;
148
+ /** The greatest possible value on the slider track. If this property is not set, it will be inferred from the last index of [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps). */
149
+ accessor max: number | undefined;
150
+ /** The smallest possible value on the slider track. If this property is not set, it will be inferred from the first index of [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps). */
151
+ accessor min: number | undefined;
152
+ /** Positions along the slider track rendered as short tick marks under the track. */
153
+ accessor minorTicks: number[] | undefined;
154
+ /**
155
+ * When `true`, the slider will display its [steps](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#steps) from right to left, or top to bottom,
156
+ * depending on the value of [layout](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#layout). This inverts the direction of the slider.
157
+ *
158
+ * @default false
159
+ */
160
+ accessor mirrored: boolean;
161
+ /**
162
+ * Positions along the slider track between [min](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#min) and [max](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-value-picker-slider/#max) that
163
+ * the slider thumb will snap to when interacted with.
164
+ */
165
+ accessor steps: number[] | undefined;
166
+ /** Permanently destroy the component. */
167
+ destroy(): Promise<void>;
168
+ /** Emitted when the value of a property is changed. Use this to listen to changes to properties. */
169
+ readonly arcgisPropertyChange: import("@arcgis/lumina").TargetedEvent<this, { name: "canNext" | "canPlay" | "canPrevious" | "currentValue"; }>;
170
+ readonly "@eventTypes": {
171
+ arcgisPropertyChange: ArcgisValuePickerSlider["arcgisPropertyChange"]["detail"];
172
+ };
173
+ }
@@ -0,0 +1,60 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as r } from "../../chunks/runtime.js";
3
+ import { LitElement as c } from "@arcgis/lumina";
4
+ import { css as l, html as s } from "lit";
5
+ import { usePropertyChange as n } from "@arcgis/lumina/controllers";
6
+ const h = l`:host{display:flex;flex:auto;padding-inline:var(--calcite-space-sm)}arcgis-slider{flex:auto}arcgis-ticks{--arcgis-ticks-font-size: var(--calcite-font-size--3);--arcgis-ticks-gap: var(--calcite-space-base)}.content-end-stack{display:flex;flex-direction:column;flex:1}.ticks-stack{height:var(--calcite-space-sm);position:relative}.ticks-stack arcgis-ticks{inset:var(--calcite-space-none);position:absolute}.label-ticks{--arcgis-ticks-tick-length: var(--calcite-space-2xs);--arcgis-ticks-tick-color: transparent}.minor-ticks{--arcgis-ticks-tick-length: var(--calcite-space-2xs)}.major-ticks{--arcgis-ticks-tick-length: var(--calcite-space-sm)}:host([layout="vertical"]){padding-inline:var(--calcite-space-none);width:var(--calcite-size-xl);arcgis-ticks{--arcgis-ticks-gap: var(--calcite-space-sm)}.content-end-stack{position:relative}.ticks-stack{height:100%}.label-ticks{inset:var(--calcite-space-none);position:absolute}}`;
7
+ class o extends c {
8
+ constructor() {
9
+ super(...arguments), this.autoDestroyDisabled = !1, this.canNext = !1, this.canPlay = !1, this.canPrevious = !1, this.disabled = !1, this.layout = "horizontal", this.mirrored = !1, this.arcgisPropertyChange = n()("canNext", "canPlay", "canPrevious", "currentValue");
10
+ }
11
+ static {
12
+ this.properties = { autoDestroyDisabled: 5, canNext: 5, canPlay: 5, canPrevious: 5, currentValue: 9, disabled: 5, labelFormatter: 0, labels: 0, layout: 3, max: 9, min: 9, mirrored: 5, steps: 0, majorTicks: 0, minorTicks: 0 };
13
+ }
14
+ static {
15
+ this.styles = h;
16
+ }
17
+ get _ascending() {
18
+ return this.layout === "horizontal" && !this.mirrored || this.layout === "vertical" && this.mirrored;
19
+ }
20
+ async destroy() {
21
+ await this.manager.destroy();
22
+ }
23
+ reset() {
24
+ this.currentValue = this._ascending ? this.steps?.at(0) : this.steps?.at(-1);
25
+ }
26
+ step(t) {
27
+ if (!this.steps || this.currentValue === void 0)
28
+ return;
29
+ const e = t === "next" === this._ascending ? 1 : -1, a = this.steps.indexOf(this.currentValue) + e;
30
+ a >= this.steps.length || a < 0 || (this.currentValue = this.steps[a], this._checkState());
31
+ }
32
+ connectedCallback() {
33
+ super.connectedCallback(), this.el.hidden = !0;
34
+ }
35
+ willUpdate(t) {
36
+ t.has("steps") && this.steps?.length && (this.min ??= this.steps[0], this.max ??= this.steps.at(-1)), (t.has("currentValue") || t.has("max")) && this.max !== void 0 && (this.currentValue ??= this.max), this.el.hidden = this.min === void 0 || this.max === void 0 || this.currentValue === void 0, this._checkState();
37
+ }
38
+ _checkState() {
39
+ if (!this.steps?.length) {
40
+ this.canPlay = !1, this.canNext = !1, this.canPrevious = !1;
41
+ return;
42
+ }
43
+ this.canPlay = !0;
44
+ const t = this.steps.findIndex((e) => e === this.currentValue), i = this.steps.length - 1;
45
+ this.canNext = this._ascending ? t < i : t > 0, this.canPrevious = this._ascending ? t > 0 : t < i;
46
+ }
47
+ _handleSliderChange(t) {
48
+ this.currentValue = t.currentTarget.values[0], this._checkState();
49
+ }
50
+ _handleSliderInput(t) {
51
+ this.currentValue = t.currentTarget.values[0], this._checkState();
52
+ }
53
+ render() {
54
+ return this.currentValue === void 0 ? null : s`<arcgis-slider .disabled=${this.disabled} .layout=${this.layout} .min=${this.min} .max=${this.max} .steps=${this.steps} .mirrored=${this.mirrored} .values=${[this.currentValue]} @arcgisInput=${(t) => this._handleSliderInput(t)} @arcgisChange=${(t) => this._handleSliderChange(t)}>${(this.majorTicks?.length || this.minorTicks?.length || this.labels?.length) && s`<div slot=content-end class="content-end-stack">${(this.majorTicks?.length || this.minorTicks?.length) && s`<div class="ticks-stack">${this.majorTicks?.length && s`<arcgis-ticks .layout=${this.layout} class="major-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.majorTicks} mode=value></arcgis-ticks>` || ""}${this.minorTicks?.length && s`<arcgis-ticks .layout=${this.layout} class="minor-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.minorTicks} mode=value></arcgis-ticks>` || ""}</div>` || ""}${this.labels?.length && s`<arcgis-ticks .layout=${this.layout} class="label-ticks" .min=${this.min} .max=${this.max} .mirrored=${this.mirrored} .values=${this.labels} mode=value show-labels label-placement=end .labelFormatter=${this.labelFormatter}></arcgis-ticks>` || ""}</div>` || ""}</arcgis-slider>`;
55
+ }
56
+ }
57
+ r("arcgis-value-picker-slider", o);
58
+ export {
59
+ o as ArcgisValuePickerSlider
60
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@arcgis/common-components/components/arcgis-slider";
2
+ import "@arcgis/common-components/components/arcgis-ticks";
3
+ export * from "./customElement.js";