@arcgis/common-components 5.1.0-next.1 → 5.1.0-next.100

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 (132) hide show
  1. package/README.md +24 -1
  2. package/dist/cdn/3Y4H3CAQ.js +2 -0
  3. package/dist/cdn/{S7T3XQPB.js → 43KGVFBF.js} +1 -1
  4. package/dist/cdn/B43M633Q.js +2 -0
  5. package/dist/cdn/DDJDHAHT.js +2 -0
  6. package/dist/cdn/GFUGR2W7.js +2 -0
  7. package/dist/cdn/{7Y42J3JI.js → GPVWNUMW.js} +1 -1
  8. package/dist/cdn/GSNPEBGQ.js +4 -0
  9. package/dist/cdn/{C6JAR4IN.js → H74W6KYI.js} +1 -1
  10. package/dist/cdn/{7CI55VCH.js → HYLC5GEB.js} +1 -1
  11. package/dist/cdn/{AXTSUI2Q.js → JJZBCHU4.js} +3 -3
  12. package/dist/cdn/{7PB2GGQH.js → JRF33N6C.js} +1 -1
  13. package/dist/cdn/LVSH5I3Q.js +2 -0
  14. package/dist/cdn/MHJWVKG5.js +2 -0
  15. package/dist/cdn/{6NYYZIHB.js → MNN3QF54.js} +1 -1
  16. package/dist/cdn/{GQLKGVRX.js → O3CBCQNL.js} +1 -1
  17. package/dist/cdn/O6ZASYX6.js +2 -0
  18. package/dist/cdn/{YVSTPEPS.js → OQF4LYVE.js} +1 -1
  19. package/dist/cdn/{ZOWIFVL3.js → P4CF7V4U.js} +1 -1
  20. package/dist/cdn/QEPJM6XG.js +2 -0
  21. package/dist/cdn/{J5X5TNVW.js → TTV4Z2RR.js} +1 -1
  22. package/dist/cdn/WG5GA6QX.js +2 -0
  23. package/dist/cdn/{7HQMPKZO.js → YZGTCNEQ.js} +1 -1
  24. package/dist/cdn/assets/field-pick-list/t9n/messages.no.json +1 -1
  25. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ar.json +1 -0
  26. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.bg.json +1 -0
  27. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.bs.json +1 -0
  28. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ca.json +1 -0
  29. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.cs.json +1 -0
  30. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.da.json +1 -0
  31. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.de.json +1 -0
  32. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.el.json +1 -0
  33. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.en-US.json +1 -0
  34. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.en.json +1 -0
  35. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.es.json +1 -0
  36. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.et.json +1 -0
  37. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.fi.json +1 -0
  38. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.fr.json +1 -0
  39. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.he.json +1 -0
  40. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.hr.json +1 -0
  41. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.hu.json +1 -0
  42. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.id.json +1 -0
  43. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.it.json +1 -0
  44. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ja.json +1 -0
  45. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ko.json +1 -0
  46. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.lt.json +1 -0
  47. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.lv.json +1 -0
  48. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.nl.json +1 -0
  49. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.no.json +1 -0
  50. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pl.json +1 -0
  51. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pt-BR.json +1 -0
  52. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.pt-PT.json +1 -0
  53. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ro.json +1 -0
  54. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.ru.json +1 -0
  55. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sk.json +1 -0
  56. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sl.json +1 -0
  57. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sr.json +1 -0
  58. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.sv.json +1 -0
  59. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.th.json +1 -0
  60. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.tr.json +1 -0
  61. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.uk.json +1 -0
  62. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.vi.json +1 -0
  63. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-CN.json +1 -0
  64. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-HK.json +1 -0
  65. package/dist/cdn/assets/spatial-reference-picker/t9n/messages.zh-TW.json +1 -0
  66. package/dist/cdn/index.js +1 -1
  67. package/dist/cdn/main.css +1 -1
  68. package/dist/chunks/commonFunctions.js +5 -11
  69. package/dist/components/arcgis-ckeditor5/customElement.d.ts +1 -0
  70. package/dist/components/arcgis-ckeditor5/customElement.js +12 -12
  71. package/dist/components/arcgis-ckeditor5/types.d.ts +9 -0
  72. package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +1 -0
  73. package/dist/components/arcgis-ckeditor5-popover/customElement.js +1 -1
  74. package/dist/components/arcgis-color-input/customElement.d.ts +3 -2
  75. package/dist/components/arcgis-field-info/customElement.d.ts +3 -2
  76. package/dist/components/arcgis-field-info/customElement.js +16 -18
  77. package/dist/components/arcgis-field-info/utils/basic.d.ts +21 -2
  78. package/dist/components/arcgis-field-pick-list/customElement.d.ts +14 -10
  79. package/dist/components/arcgis-field-pick-list/customElement.js +2 -2
  80. package/dist/components/arcgis-field-pick-list/utils/types.d.ts +25 -3
  81. package/dist/components/arcgis-histogram/customElement.d.ts +46 -28
  82. package/dist/components/arcgis-histogram/customElement.js +81 -90
  83. package/dist/components/arcgis-histogram/types.d.ts +1 -3
  84. package/dist/components/arcgis-label-input/customElement.d.ts +6 -6
  85. package/dist/components/arcgis-label-input/customElement.js +22 -17
  86. package/dist/components/arcgis-picker-input/customElement.d.ts +3 -2
  87. package/dist/components/arcgis-picker-input/customElement.js +11 -11
  88. package/dist/components/arcgis-ramp-color/customElement.d.ts +2 -0
  89. package/dist/components/arcgis-ramp-color-break/customElement.d.ts +2 -0
  90. package/dist/components/arcgis-ramp-opacity/customElement.d.ts +1 -0
  91. package/dist/components/arcgis-slider/customElement.d.ts +282 -83
  92. package/dist/components/arcgis-slider/customElement.js +434 -360
  93. package/dist/components/arcgis-slider-input/customElement.d.ts +7 -0
  94. package/dist/components/arcgis-slider-input/customElement.js +12 -12
  95. package/dist/components/arcgis-spatial-reference-picker/customElement.d.ts +327 -0
  96. package/dist/components/arcgis-spatial-reference-picker/customElement.js +7702 -0
  97. package/dist/components/arcgis-spatial-reference-picker/index.d.ts +1 -0
  98. package/dist/components/arcgis-spatial-reference-picker/index.js +3 -0
  99. package/dist/components/arcgis-spatial-reference-picker-tree/customElement.d.ts +35 -0
  100. package/dist/components/arcgis-spatial-reference-picker-tree/customElement.js +77 -0
  101. package/dist/components/arcgis-spatial-reference-picker-tree/index.d.ts +1 -0
  102. package/dist/components/arcgis-spatial-reference-picker-tree/index.js +3 -0
  103. package/dist/components/arcgis-ticks/customElement.d.ts +110 -20
  104. package/dist/components/arcgis-ticks/customElement.js +30 -30
  105. package/dist/components/arcgis-ticks/types.d.ts +23 -0
  106. package/dist/components/arcgis-unique-values-list/customElement.d.ts +14 -5
  107. package/dist/components/arcgis-unique-values-list/customElement.js +158 -151
  108. package/dist/components/arcgis-unique-values-list/utils/basic.d.ts +14 -2
  109. package/dist/docs/api.json +1 -1
  110. package/dist/docs/docs.json +1 -1
  111. package/dist/docs/vscode.html-custom-data.json +1 -1
  112. package/dist/docs/web-types.json +1 -1
  113. package/dist/index.d.ts +39 -1
  114. package/dist/loader.js +5 -3
  115. package/dist/types/lumina.d.ts +15 -3
  116. package/dist/types/preact.d.ts +17 -3
  117. package/dist/types/react.d.ts +19 -3
  118. package/dist/types/stencil.d.ts +15 -3
  119. package/dist/utils/internal-types.d.ts +1 -0
  120. package/dist/utils/spatial-references.d.ts +1 -0
  121. package/dist/utils/types.d.ts +39 -22
  122. package/package.json +8 -6
  123. package/dist/cdn/6DQVLQL6.js +0 -2
  124. package/dist/cdn/6MGBOM6S.js +0 -2
  125. package/dist/cdn/BAVGT3I5.js +0 -2
  126. package/dist/cdn/P45VPBNI.js +0 -2
  127. package/dist/cdn/UTXWKXMT.js +0 -4
  128. package/dist/cdn/XEB2RUND.js +0 -2
  129. package/dist/cdn/ZL3E4ZGE.js +0 -2
  130. package/dist/cdn/ZP76EPVI.js +0 -2
  131. /package/dist/cdn/{CSDKXC4T.js → TJNYRK5P.js} +0 -0
  132. /package/dist/chunks/{types.js → internal-types.js} +0 -0
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-input";
2
+ import "../arcgis-spatial-reference-picker-tree/index.js";
3
+ export * from "./customElement.js";
@@ -0,0 +1,35 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { NestedObject } from "../../utils/spatial-references.js";
4
+
5
+ /** @internal */
6
+ export abstract class ArcgisSpatialReferencePickerTree extends LitElement {
7
+ /**
8
+ * The data to display in the tree. Supports nested data.
9
+ *
10
+ * @example
11
+ * data = {
12
+ * "parent item": {
13
+ * "child item": "child item value",
14
+ * "sub-parent child item": {
15
+ * "child item of nested parent key": "child item of nested parent value"
16
+ * },
17
+ * "child item 2 key": "child item 2 value"
18
+ * },
19
+ * "item 2": "item 2 value",
20
+ * ...
21
+ * };
22
+ * Keys of parent items are displayed as the item's label.
23
+ * Values of elements without children are displayed as the item's label.
24
+ * In this case, "sub-parent child item" is displayed as the label for that item and
25
+ * "child item of nested parent value" is displayed as the label for it's child.
26
+ */
27
+ accessor data: NestedObject;
28
+ /** The key of the selected item. (Wkid when used as spatial reference selection) */
29
+ accessor value: string | undefined;
30
+ /** Emitted when the selected value of the tree changes. */
31
+ readonly arcgisChange: import("@arcgis/lumina").TargetedEvent<this, void>;
32
+ readonly "@eventTypes": {
33
+ arcgisChange: ArcgisSpatialReferencePickerTree["arcgisChange"]["detail"];
34
+ };
35
+ }
@@ -0,0 +1,77 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { c as h } from "../../chunks/runtime.js";
3
+ import { keyed as n } from "lit/directives/keyed.js";
4
+ import { LitElement as d, createEvent as l, nothing as p } from "@arcgis/lumina";
5
+ import { css as m, html as a } from "lit";
6
+ const u = m`:host{overflow-y:auto;overflow-x:hidden;scroll-behavior:smooth;height:100%;width:100%}`;
7
+ class v extends d {
8
+ constructor() {
9
+ super(...arguments), this.treeItemsOpen = /* @__PURE__ */ new Set(), this.handleMutations = (e) => {
10
+ e.forEach((s) => {
11
+ if (s.type === "attributes" && s.attributeName === "expanded") {
12
+ const t = s.target;
13
+ "key" in t.dataset && t.dataset.key !== void 0 && this.treeItemsOpen.has(t.dataset.key) !== t.expanded && this.toggleTreeItem(t.dataset.key);
14
+ }
15
+ });
16
+ }, this.renderedTree = [], this.data = {}, this.arcgisChange = l();
17
+ }
18
+ static {
19
+ this.properties = { renderedTree: 16, data: 0, value: 1 };
20
+ }
21
+ static {
22
+ this.styles = u;
23
+ }
24
+ load() {
25
+ this.setupComponent();
26
+ }
27
+ willUpdate(e) {
28
+ e.has("data") && (this.hasUpdated || Object.keys(this.data ?? {}).length > 0) && this.setupComponent();
29
+ }
30
+ loaded() {
31
+ this.manager.onLifecycle(() => {
32
+ this.observer = new MutationObserver(this.handleMutations);
33
+ const e = this.el.shadowRoot ?? this.el;
34
+ return this.observer.observe(e, {
35
+ attributes: !0,
36
+ subtree: !0,
37
+ attributeFilter: ["expanded"]
38
+ }), () => {
39
+ this.observer?.disconnect(), this.observer = void 0;
40
+ };
41
+ });
42
+ }
43
+ setupComponent() {
44
+ this.treeItemsOpen.clear(), this.buildJSXTree();
45
+ }
46
+ buildJSXTree() {
47
+ const e = (s) => {
48
+ const t = [];
49
+ for (const r of Object.keys(s)) {
50
+ const i = s[r];
51
+ let o;
52
+ typeof i == "object" && (o = this.treeItemsOpen.has(r) ? e(i) : []);
53
+ const c = typeof i == "object" ? r : i;
54
+ t.push(this.createTreeItem(r, c, o));
55
+ }
56
+ return t;
57
+ };
58
+ this.renderedTree = e(this.data);
59
+ }
60
+ toggleTreeItem(e) {
61
+ this.treeItemsOpen.has(e) ? this.treeItemsOpen.delete(e) : this.treeItemsOpen.add(e), this.buildJSXTree();
62
+ }
63
+ createTreeItem(e, s, t) {
64
+ return a`<calcite-tree-item data-key=${e ?? p} .selected=${this.value === e} .expanded=${this.treeItemsOpen.has(e)}>${s}${t !== void 0 && n(`${e}-child-tree`, a`<calcite-tree slot=children>${t}</calcite-tree>`) || ""}</calcite-tree-item>`;
65
+ }
66
+ handleTreeSelect(e) {
67
+ const t = e.currentTarget?.selectedItems[0]?.dataset.key;
68
+ t !== void 0 && (this.value = t, this.arcgisChange.emit());
69
+ }
70
+ render() {
71
+ return n("base-tree", a`<calcite-tree scale=s @calciteTreeSelect=${this.handleTreeSelect}>${this.renderedTree}</calcite-tree>`);
72
+ }
73
+ }
74
+ h("arcgis-spatial-reference-picker-tree", v);
75
+ export {
76
+ v as ArcgisSpatialReferencePickerTree
77
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,3 @@
1
+ import "@esri/calcite-components/components/calcite-tree-item";
2
+ import "@esri/calcite-components/components/calcite-tree";
3
+ export * from "./customElement.js";
@@ -1,17 +1,43 @@
1
1
  /// <reference path="../../index.d.ts" />
2
- /// <reference types="@arcgis/core/interfaces.d.ts" />
3
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
+ import type { Layout, TickMode, TickValues } from "./types.js";
4
4
 
5
5
  /**
6
+ * The ticks component displays visual markers along a line to indicate scale, intervals, or specific values. It is often used in conjunction with the
7
+ * [Slider component](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/). Ticks help users understand the
8
+ * slider’s range and make more precise selections.
9
+ *
10
+ * Tick placement is controlled by the [mode](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#mode), which defines how the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) are parsed and translated into positions along the
11
+ * line. Tick positions are derived from the component’s [min](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#min) and [max](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#max) range, with optional non-linear scaling via
12
+ * [interpolationExponent](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interpolationExponent). Ticks can be displayed in vertical or horizontal [layout](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#layout), with optional [showLabels](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#showLabels) and a [showBaseline](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#showBaseline).
13
+ * The component can also be made [interactive](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interactive) to respond to user clicks on individual ticks. The [labelFormatter](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#labelFormatter) property allows customization of tick label formatting.
14
+ *
6
15
  * @cssproperty [--arcgis-ticks-tick-length] - Specifies the length of the ticks.
7
16
  * @cssproperty [--arcgis-ticks-tick-color] - Specifies the color of the ticks.
8
17
  * @cssproperty [--arcgis-ticks-gap] - Specifies the gap between the ticks and labels.
18
+ * @since 5.0
19
+ * @example
20
+ * The following example creates a vertical slider with ticks.
21
+ * The ticks are positioned at the end of the slider and displayed every 10 units from 0 to 100.
22
+ * ```html
23
+ * <arcgis-slider id="sliderComponent" min="0" max="100" show-range-labels values="50" layout="vertical">
24
+ * <arcgis-ticks slot="content-end" style="flex:1;"
25
+ * min="0" max="100"
26
+ * mode="value"
27
+ * show-labels
28
+ * label-placement="end"
29
+ * values="0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100"
30
+ * layout="vertical">
31
+ * </arcgis-ticks>
32
+ * </arcgis-slider>
33
+ * ```
9
34
  */
10
35
  export abstract class ArcgisTicks extends LitElement {
11
36
  /**
12
- * When `true`, the component will allow clicking on ticks.
37
+ * When `true`, ticks are clickable and the component emits [@arcgisTickClick](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#event-arcgisTickClick) when the user selects a tick.
13
38
  *
14
39
  * @default false
40
+ * @see [@arcgisTickClick](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#event-arcgisTickClick)
15
41
  */
16
42
  accessor interactive: boolean;
17
43
  /**
@@ -27,16 +53,28 @@ export abstract class ArcgisTicks extends LitElement {
27
53
  * @default 0
28
54
  */
29
55
  accessor interpolationExponent: number;
30
- /** A function used to format each tick's label. */
31
- accessor labelFormatter: ((value: number, defaultFormatter: (value: number) => string) => nullish | string) | undefined;
56
+ /**
57
+ * Allows customizing how tick labels are formatted based on their numeric value.
58
+ *
59
+ * @example
60
+ * The following example formats tick labels as percentages.
61
+ * ```js
62
+ * const ticks = document.querySelector("arcgis-ticks");
63
+ * ticks.labelFormatter = (value, defaultFormatter) => {
64
+ * return value + "%";
65
+ * };
66
+ * ```
67
+ */
68
+ accessor labelFormatter: (value: number, defaultFormatter: (value: number) => string) => string | null | undefined;
32
69
  /**
33
70
  * Determines whether the labels are placed before or after the ticks.
34
71
  *
35
- * @default "trailing"
72
+ * @default "end"
36
73
  */
37
- accessor labelPlacement: "leading" | "trailing";
74
+ accessor labelPlacement: "end" | "start";
38
75
  /**
39
- * Determines the layout/orientation of the component.
76
+ * Determines the layout/orientation of the ticks component. By default, the ticks will render horizontally.
77
+ * When set to `vertical`, the ticks will render vertically.
40
78
  *
41
79
  * @default "horizontal"
42
80
  */
@@ -60,12 +98,56 @@ export abstract class ArcgisTicks extends LitElement {
60
98
  */
61
99
  accessor mirrored: boolean;
62
100
  /**
63
- * The mode or method of positioning ticks along the component. It drives how [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted.
64
- * - `count`: Places a fixed number of ticks (provided in the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) property) at equal distances from each other.
65
- * - `percent`: [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted as percentage. If [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is a number, it indicates the interval between ticks. If it is an array, it indicates the percentage values at which to place the ticks.
66
- * - `value`: Indicates that ticks will only be placed at the values specified in the property.
101
+ * The manner in which ticks are positioned along the component. It determines how [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted.
102
+ *
103
+ * - `count`: Places a fixed number of ticks (specified in [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values)) at equal intervals.
104
+ * - `percent`: Interprets [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) as percentages. If it's a single number, that number is the interval between ticks; if it's an array, the array specifies the percentage positions for ticks.
105
+ * - `value`: Places ticks only at the values listed in [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values).
67
106
  *
68
107
  * @default "count"
108
+ * @example
109
+ * ```html
110
+ * <!-- Place ticks at each value listed in `values` -->
111
+ * <arcgis-slider min="0" max="100" show-range-labels values="20, 50">
112
+ * <arcgis-ticks
113
+ * slot="content-end" style="flex:1;"
114
+ * min="0" max="100"
115
+ * show-labels label-placement="end"
116
+ * mode="value"
117
+ * values="0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100">
118
+ * </arcgis-ticks>
119
+ * </arcgis-slider>
120
+ * ```
121
+ * @example
122
+ * In count mode, the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) property specifies the number of ticks to render (not a list of tick values).
123
+ * For example, use `11` ticks to show 0–100 in intervals of 10 (0, 10, 20, ..., 100).
124
+ * ```html
125
+ * <!-- 11 ticks from 0 to 100 -->
126
+ * <arcgis-slider min="0" max="100" show-range-labels values="20, 50">
127
+ * <arcgis-ticks
128
+ * slot="content-end" style="flex:1;"
129
+ * min="0" max="100"
130
+ * show-labels label-placement="end"
131
+ * mode="count"
132
+ * values="11">
133
+ * </arcgis-ticks>
134
+ * </arcgis-slider>
135
+ * ```
136
+ * @example
137
+ * In percent mode, values are percentages along the track.
138
+ * Use an array to place ticks at specific percentages, or a single number as a repeating interval.
139
+ * ```html
140
+ * <!-- Ticks at 0%, 25%, 50%, 75%, and 100% -->
141
+ * <arcgis-slider min="0" max="200" show-range-labels values="50, 150">
142
+ * <arcgis-ticks
143
+ * slot="content-end" style="flex:1;"
144
+ * min="0" max="200"
145
+ * show-labels label-placement="end"
146
+ * mode="percent"
147
+ * values="0, 25, 50, 75, 100">
148
+ * </arcgis-ticks>
149
+ * </arcgis-slider>
150
+ * ```
69
151
  * @see [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values)
70
152
  */
71
153
  accessor mode: TickMode;
@@ -82,21 +164,29 @@ export abstract class ArcgisTicks extends LitElement {
82
164
  */
83
165
  accessor showLabels: boolean;
84
166
  /**
85
- * Indicates where ticks will be rendered along the component.
167
+ * Indicates where ticks are rendered along the component. This can be set as comma-separated
168
+ * numbers in the attribute (e.g., `<arcgis-ticks values="10, 20, 30"></arcgis-ticks>`) or programmatically as
169
+ * either a single number or an array of numbers (e.g., `ticks.values = 10`, `ticks.values = [10, 20, 30]`).
86
170
  * See the description for [mode](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#mode) for more information about how this property is interpreted by each mode.
87
171
  *
88
172
  * @see [mode](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#mode)
89
173
  */
90
174
  accessor values: TickValues;
91
- /** Fires when the user clicks on one of the ticks. */
175
+ /**
176
+ * Fires when the user clicks on one of the ticks. This event is only emitted when the [interactive](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interactive) property is set to `true`.
177
+ *
178
+ * @see [interactive](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#interactive)
179
+ * @example
180
+ * The following example listens for the `arcgisTickClick` event and logs the clicked tick's value.
181
+ * ```js
182
+ * const ticks = document.querySelector("arcgis-ticks");
183
+ * ticks.addEventListener("arcgisTickClick", (event) => {
184
+ * console.log("Clicked tick value:", event.detail.value);
185
+ * });
186
+ * ```
187
+ */
92
188
  readonly arcgisTickClick: import("@arcgis/lumina").TargetedEvent<this, { value: number; }>;
93
189
  readonly "@eventTypes": {
94
190
  arcgisTickClick: ArcgisTicks["arcgisTickClick"]["detail"];
95
191
  };
96
- }
97
-
98
- export type Layout = "horizontal" | "vertical";
99
-
100
- export type TickMode = "count" | "percent" | "value";
101
-
102
- export type TickValues = number[] | number;
192
+ }
@@ -1,9 +1,9 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
2
  import { c as $ } from "../../chunks/runtime.js";
3
3
  import { css as M, html as c } from "lit";
4
- import { LitElement as _, createEvent as C, safeClassMap as h, safeStyleMap as u, nothing as v } from "@arcgis/lumina";
4
+ import { LitElement as _, createEvent as C, safeClassMap as h, nothing as v, safeStyleMap as u } from "@arcgis/lumina";
5
5
  import { formatNumber as z } from "@arcgis/core/intl.js";
6
- const s = {
6
+ const n = {
7
7
  container: "container",
8
8
  ticksContainer: "ticks-container",
9
9
  labelsContainer: "labels-container",
@@ -12,7 +12,7 @@ const s = {
12
12
  tickMax: "tick--max",
13
13
  tickLabel: "tick-label",
14
14
  baseline: "baseline"
15
- }, A = M`:host{display:flex;--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-gap: 1em;--arcgis-ticks-font-size: var(--calcite-font-size--2)}.container{align-items:stretch;display:flex;color:var(--calcite-color-text-2);flex:1;font-weight:var(--calcite-font-weight-medium);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"))}:host([layout="horizontal"]){.ticks-container{height:var(--arcgis-ticks-tick-length)}.labels-container{height:var(--labels-container-height, "auto")}.tick{width:.125rem;height:var(--arcgis-ticks-tick-length);transform:translate(-50%)}.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:.125rem;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="leading"]){.container{flex-direction:column;justify-content:flex-end}.labels-container{margin-bottom:var(--arcgis-ticks-gap)}}:host([layout="horizontal"][label-placement="trailing"]){.container{flex-direction:column-reverse;justify-content:flex-end}.labels-container{margin-top:var(--arcgis-ticks-gap)}}:host([layout="vertical"][label-placement="leading"]){.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="trailing"]){.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-label:hover{text-decoration:underline}}`;
15
+ }, A = M`:host{display:flex;--arcgis-ticks-tick-length: .5rem;--arcgis-ticks-tick-color: var(--calcite-color-border-input);--arcgis-ticks-gap: 1em;--arcgis-ticks-font-size: var(--calcite-font-size--2)}.container{align-items:stretch;display:flex;color:var(--calcite-color-text-2);flex:1;font-weight:var(--calcite-font-weight-medium);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"))}: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:.125rem;height:var(--arcgis-ticks-tick-length);transform:translate(-50%)}.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:.125rem;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-label:hover{text-decoration:underline}}`;
16
16
  class F extends _ {
17
17
  constructor() {
18
18
  super(...arguments), this._formatValue = (e) => z(e, this._formatOptions), this._formatOptions = {
@@ -20,7 +20,7 @@ class F extends _ {
20
20
  useGrouping: !0,
21
21
  minimumFractionDigits: 0,
22
22
  maximumFractionDigits: 2
23
- }, this.interactive = !1, this.interpolationExponent = 0, this.labelPlacement = "trailing", 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 = C({ cancelable: !1 });
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 = C({ cancelable: !1 });
24
24
  }
25
25
  static {
26
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: {
@@ -38,10 +38,10 @@ class F extends _ {
38
38
  this.styles = A;
39
39
  }
40
40
  updated() {
41
- const e = this.renderRoot.querySelector(`.${s.labelsContainer}`);
41
+ const e = this.renderRoot.querySelector(`.${n.labelsContainer}`);
42
42
  if (e) {
43
43
  let t = 0, i = 0;
44
- for (const r of this.renderRoot.querySelectorAll(`.${s.tickLabel}`)) {
44
+ for (const r of this.renderRoot.querySelectorAll(`.${n.tickLabel}`)) {
45
45
  const a = r.getBoundingClientRect();
46
46
  t = Math.max(t, a.width), i = Math.max(i, a.height);
47
47
  }
@@ -62,30 +62,30 @@ class F extends _ {
62
62
  return i ?? this._formatValue(e);
63
63
  }
64
64
  render() {
65
- return c`<div class=${h(s.container)} touch-action=none @click=${this._handleClick}>${this._renderContent()}${this._renderBaseline()}</div>`;
65
+ return c`<div class=${h(n.container)} touch-action=none @click=${this._handleClick}>${this._renderContent()}${this._renderBaseline()}</div>`;
66
66
  }
67
67
  _renderContent() {
68
- const { interpolationExponent: e, max: t, min: i, mode: r, values: a, layout: o, mirrored: l, showLabels: x } = this, k = [], b = [];
69
- for (const [f, d] of L(r, i, t, e, a)) {
70
- const p = { [o === "horizontal" ? l ? "right" : "left" : l ? "top" : "bottom"]: `${f}%` }, w = {
71
- [s.tick]: !0,
72
- [s.tickMin]: f === 0,
73
- [s.tickMax]: f === 100
68
+ const { interpolationExponent: e, max: t, min: i, mode: r, values: a, layout: o, mirrored: l, showLabels: x } = this, g = [], b = [];
69
+ for (const [d, f] of L(r, i, t, e, a)) {
70
+ const p = { [o === "horizontal" ? l ? "right" : "left" : l ? "top" : "bottom"]: `${d}%` }, w = {
71
+ [n.tick]: !0,
72
+ [n.tickMin]: d === 0,
73
+ [n.tickMax]: d === 100
74
74
  };
75
- k.push(c`<div class=${h(w)} style=${u(p)} data-value=${d ?? v}></div>`), x && b.push(c`<div class=${h(s.tickLabel)} style=${u(p)} data-value=${d ?? v}>${this._internalLabelFormatter(d)}</div>`);
75
+ g.push(c`<div class=${h(w)} style=${u(p)} data-value=${f ?? v}></div>`), x && b.push(c`<div class=${h(n.tickLabel)} style=${u(p)} data-value=${f ?? v}>${this._internalLabelFormatter(f)}</div>`);
76
76
  }
77
- return [c`<div class=${h(s.labelsContainer)}>${b}</div>`, c`<div class=${h(s.ticksContainer)}>${k}</div>`];
77
+ return [c`<div class=${h(n.labelsContainer)}>${b}</div>`, c`<div class=${h(n.ticksContainer)}>${g}</div>`];
78
78
  }
79
79
  _renderBaseline() {
80
80
  const { showBaseline: e, layout: t } = this;
81
- return e && c`<div class=${h(s.baseline)} style=${u({
81
+ return e && c`<div class=${h(n.baseline)} style=${u({
82
82
  [t === "horizontal" ? "width" : "height"]: "100%",
83
83
  [t === "horizontal" ? "height" : "width"]: "0.125rem"
84
84
  })}></div>` || "";
85
85
  }
86
86
  }
87
- function* L(n, e, t, i, r) {
88
- switch (n) {
87
+ function* L(s, e, t, i, r) {
88
+ switch (s) {
89
89
  case "value": {
90
90
  const a = Array.isArray(r) ? r : [r];
91
91
  for (const o of a) {
@@ -116,24 +116,24 @@ function* L(n, e, t, i, r) {
116
116
  }
117
117
  }
118
118
  }
119
- function g(n, e, t) {
120
- return t < n ? n : t > e ? e : t;
119
+ function k(s, e, t) {
120
+ return t < s ? s : t > e ? e : t;
121
121
  }
122
- function y(n, e, t) {
123
- return n + (e - n) * t;
122
+ function y(s, e, t) {
123
+ return s + (e - s) * t;
124
124
  }
125
- function P(n, e, t, i = 0) {
126
- let r = (t - n) / (e - n);
127
- if (r = g(0, 1, r), Math.abs(i) < 1e-9)
125
+ function P(s, e, t, i = 0) {
126
+ let r = (t - s) / (e - s);
127
+ if (r = k(0, 1, r), Math.abs(i) < 1e-9)
128
128
  return r;
129
129
  const a = 1 + Math.expm1(i) * r;
130
- return r = Math.log(a) / i, g(0, 1, r);
130
+ return r = Math.log(a) / i, k(0, 1, r);
131
131
  }
132
- function m(n, e, t, i = 0) {
133
- if (t = g(0, 1, t), Math.abs(i) < 1e-9)
134
- return y(n, e, t);
132
+ function m(s, e, t, i = 0) {
133
+ if (t = k(0, 1, t), Math.abs(i) < 1e-9)
134
+ return y(s, e, t);
135
135
  const r = Math.expm1(i * t) / Math.expm1(i);
136
- return y(n, e, r);
136
+ return y(s, e, r);
137
137
  }
138
138
  $("arcgis-ticks", F);
139
139
  export {
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The layout of the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component, which determines the orientation of the ticks.
3
+ *
4
+ * @since 5.0
5
+ */
6
+ export type Layout = "horizontal" | "vertical";
7
+
8
+ /**
9
+ * The mode of positioning ticks along the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component. It drives how [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted.
10
+ * - `count`: Places a fixed number of ticks (provided in the [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) property) at equal distances from each other.
11
+ * - `percent`: [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is interpreted as percentage. If [arcgis-ticks.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/#values) is a number, it indicates the interval between ticks. If it is an array, it indicates the percentage values at which to place the ticks.
12
+ * - `value`: Indicates that ticks will only be placed at the values specified in the property.
13
+ *
14
+ * @since 5.0
15
+ */
16
+ export type TickMode = "count" | "percent" | "value";
17
+
18
+ /**
19
+ * Indicates where ticks will be rendered along the [arcgis-ticks](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-ticks/) component.
20
+ *
21
+ * @since 5.0
22
+ */
23
+ export type TickValues = number[] | number;
@@ -1,10 +1,17 @@
1
1
  /// <reference path="../../index.d.ts" />
2
- /// <reference types="@arcgis/core/interfaces.d.ts" />
2
+ import type SceneView from "@arcgis/core/views/SceneView.js";
3
+ import type MapView from "@arcgis/core/views/MapView.js";
3
4
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
5
+ import type { UniqueValueCountInfo } from "@arcgis/core/smartMapping/statistics/types.js";
4
6
  import type { SupportedLayer } from "./utils/basic.js";
7
+ import type { VisualizationSource } from "../../utils/internal-types.js";
5
8
  import type { T9nMeta } from "@arcgis/lumina/controllers";
6
9
 
7
- /** Displays a list of unique values taking into account field type formatting and field domains. */
10
+ /**
11
+ * Displays a list of unique values taking into account field type formatting and field domains.
12
+ *
13
+ * @internal
14
+ */
8
15
  export abstract class ArcgisUniqueValuesList extends LitElement {
9
16
  /** @internal */
10
17
  protected _messages: {
@@ -81,15 +88,17 @@ export abstract class ArcgisUniqueValuesList extends LitElement {
81
88
  * List of all unique values. If not provided component will get the unique values from the layer.
82
89
  * An empty list would mean that there are no unique values for this field on the layer. The component renders nothing then.
83
90
  */
84
- accessor uniqueValues: __esri.UniqueValuesResultUniqueValueInfos[] | undefined;
91
+ accessor uniqueValues: UniqueValueCountInfo[] | undefined;
85
92
  /** MapView instance, required if uniqueValues is not provided and/or to display dates in the correct timezone */
86
- accessor view: __esri.MapView | __esri.SceneView | undefined;
93
+ accessor view: MapView | SceneView | undefined;
94
+ /** Optional, specify visualization source other than the layer itself. */
95
+ accessor visualizationSource: VisualizationSource | undefined;
87
96
  /**
88
97
  * Get all unique values.
89
98
  * E.g. to be used to limit how often these unique values need to be requested from the layer.
90
99
  */
91
100
  getUniqueValues(): Promise<{
92
- uniqueValues: __esri.UniqueValuesResultUniqueValueInfos[];
101
+ uniqueValues: UniqueValueCountInfo[];
93
102
  partialUniqueValues: boolean;
94
103
  } | undefined>;
95
104
  /** Sets focus on component */