@arcgis/common-components 5.2.0-next.52 → 5.2.0-next.53

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.
@@ -0,0 +1,292 @@
1
+ /// <reference path="../../index.d.ts" />
2
+ import type Field from "@arcgis/core/layers/support/Field.js";
3
+ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
4
+ import type { ArcgisSlider } from "../arcgis-slider/customElement.js";
5
+ import type { T9nMeta } from "@arcgis/lumina/controllers";
6
+
7
+ /**
8
+ * The Field Slider component wraps [arcgis-slider](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/) and adapts input/output formatting based on the configured
9
+ * [fieldType](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#fieldType).
10
+ *
11
+ * Use this component when slider values must be represented in ArcGIS field formats, such as numeric timestamps for `date`,
12
+ * `YYYY-MM-DD` for `date-only`, or `HH:mm:ss` for `time-only`.
13
+ *
14
+ * @slot [content-start] - A slot for elements before the track.
15
+ * @slot [content-end] - A slot for elements after the track.
16
+ * @slot [popover] - A slot for custom content to be rendered in the popover.
17
+ * @example
18
+ * ```html
19
+ * <!-- Numeric field (double) -->
20
+ * <arcgis-slider-field field-type="double" min="0" max="100" values="20.5,75.25"></arcgis-slider-field>
21
+ * ```
22
+ * @example
23
+ * ```html
24
+ * <!-- Date field -->
25
+ * <arcgis-slider-field
26
+ * field-type="date"
27
+ * min="1704067200000"
28
+ * max="1735689599000"
29
+ * values="1710028800000,1726617600000"
30
+ * ></arcgis-slider-field>
31
+ * ```
32
+ * @example
33
+ * ```html
34
+ * <!-- Timestamp offset field -->
35
+ * <arcgis-slider-field
36
+ * field-type="timestamp-offset"
37
+ * min="2024-01-01T00:00:00-05:00"
38
+ * max="2024-12-31T23:59:59-05:00"
39
+ * values="2024-03-10T08:00:00-05:00,2024-09-18T18:30:00-05:00"
40
+ * ></arcgis-slider-field>
41
+ * ```
42
+ * @internal
43
+ */
44
+ export abstract class ArcgisSliderField extends LitElement {
45
+ /**
46
+ * The active value of the component, based on which thumb or range (segment) is active. This returns the stored value for the active thumb,
47
+ * so it may reflect the thumb’s last set position.
48
+ *
49
+ *
50
+ * It returns:
51
+ * - `undefined` when no value is active
52
+ * - a serialized string when a single value is active
53
+ * - `"all"` when the range (segment) is active
54
+ *
55
+ * Listen to [@arcgisActiveValueChange](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#event-arcgisActiveValueChange) to be notified when a value becomes active or inactive.
56
+ *
57
+ * @see [@arcgisActiveValueChange](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#event-arcgisActiveValueChange)
58
+ */
59
+ get activeValue(): string | undefined;
60
+ /**
61
+ * Indicates whether the slider is disabled.
62
+ *
63
+ * @default false
64
+ */
65
+ accessor disabled: boolean;
66
+ /**
67
+ * Defines the ArcGIS field type used to parse, format, and serialize slider values.
68
+ *
69
+ * Supported values:
70
+ * - Numeric: `small-integer`, `integer`, `big-integer`, `single`, `double`, `long`, `oid`
71
+ * - Temporal: `date`, `date-only`, `time-only`, `timestamp-offset`
72
+ *
73
+ * @default "double"
74
+ * @see [Field.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type)
75
+ */
76
+ accessor fieldType: FieldSliderType;
77
+ /**
78
+ * Controls where the filled segment is displayed on the track for single-thumb sliders.
79
+ * Range sliders always display the fill between the min and max thumbs.
80
+ *
81
+ * @default "start"
82
+ * @see [arcgis-slider.fillPlacement](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#fillPlacement)
83
+ */
84
+ accessor fillPlacement: ArcgisSlider["fillPlacement"];
85
+ /** The component's default label. */
86
+ accessor label: string | undefined;
87
+ /**
88
+ * Determines the layout/orientation of the slider.
89
+ *
90
+ * @default "horizontal"
91
+ * @see [mirrored](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#mirrored)
92
+ * @see [arcgis-slider.layout](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#layout)
93
+ */
94
+ accessor layout: ArcgisSlider["layout"];
95
+ /**
96
+ * The upper bound of the slider range, expressed using the format of the current
97
+ * [fieldType](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#fieldType).
98
+ *
99
+ * If omitted or invalid, a field-type specific default is used.
100
+ *
101
+ * Examples:
102
+ * - `double`: `"100.5"`
103
+ * - `date`: `"1710028800000"`
104
+ * - `date-only`: `"2024-12-31"`
105
+ *
106
+ * @default ""
107
+ * @see [arcgis-slider.max](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#max)
108
+ */
109
+ accessor max: string;
110
+ /**
111
+ * Replace localized message strings with your own strings.
112
+ *
113
+ * _**Note**: Individual message keys may change between releases._
114
+ */
115
+ accessor messageOverrides: { componentLabel?: string | undefined; };
116
+ /** @internal */
117
+ protected messages: Partial<{ componentLabel: string; }> & T9nMeta<{ componentLabel: string; }>;
118
+ /**
119
+ * The lower bound of the slider range, expressed using the format of the current
120
+ * [fieldType](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#fieldType).
121
+ *
122
+ * If omitted or invalid, a field-type specific default is used.
123
+ *
124
+ * Examples:
125
+ * - `double`: `"0"`
126
+ * - `date`: `"1704067200000"`
127
+ * - `time-only`: `"00:00:00"`
128
+ *
129
+ * @default ""
130
+ * @see [arcgis-slider.min](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#min)
131
+ */
132
+ accessor min: string;
133
+ /**
134
+ * When `true`, the slider displays values from high to low.
135
+ *
136
+ * @default false
137
+ * @see [layout](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#layout)
138
+ * @see [arcgis-slider.mirrored](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#mirrored)
139
+ */
140
+ accessor mirrored: boolean;
141
+ /**
142
+ * The accessible label for the popover. This label is used by assistive technologies
143
+ * and does not affect visible UI.
144
+ *
145
+ * @default ""
146
+ * @see [arcgis-slider.popoverLabel](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#popoverLabel)
147
+ */
148
+ accessor popoverLabel: ArcgisSlider["popoverLabel"];
149
+ /**
150
+ * When `true`, allows editing the min/max range labels with keyboard input.
151
+ *
152
+ * Applies only to: `small-integer`, `integer`, `big-integer`, `single`, `double`, `long`, `oid`.
153
+ *
154
+ * @default false
155
+ * @see [arcgis-slider.rangeLabelsEditingEnabled](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#rangeLabelsEditingEnabled)
156
+ */
157
+ accessor rangeLabelsEditingEnabled: boolean;
158
+ /**
159
+ * Controls where min/max range labels are positioned relative to the track.
160
+ *
161
+ * @default "center"
162
+ * @see [showRangeLabels](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#showRangeLabels)
163
+ * @see [arcgis-slider.rangeLabelsPlacement](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#rangeLabelsPlacement)
164
+ */
165
+ accessor rangeLabelsPlacement: ArcgisSlider["rangeLabelsPlacement"];
166
+ /**
167
+ * Indicates whether min/max range labels are visible on the slider.
168
+ *
169
+ * @default false
170
+ * @see [arcgis-slider.showRangeLabels](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#showRangeLabels)
171
+ */
172
+ accessor showRangeLabels: boolean;
173
+ /**
174
+ * Controls when thumb value labels are displayed.
175
+ *
176
+ * - `"always"`: Always show labels.
177
+ * - `"auto"`: Show labels only during interaction.
178
+ * - `"hidden"`: Never show labels.
179
+ *
180
+ * @default "always"
181
+ * @see [arcgis-slider.valueLabelsDisplay](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#valueLabelsDisplay)
182
+ */
183
+ accessor valueLabelsDisplay: ArcgisSlider["valueLabelsDisplay"];
184
+ /**
185
+ * When `true`, allows editing value labels with keyboard input.
186
+ *
187
+ * Applies only to: `small-integer`, `integer`, `big-integer`, `single`, `double`, `long`, `oid`.
188
+ *
189
+ * @default false
190
+ * @see [arcgis-slider.valueLabelsEditingEnabled](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#valueLabelsEditingEnabled)
191
+ */
192
+ accessor valueLabelsEditingEnabled: boolean;
193
+ /**
194
+ * Determines whether value labels are placed before or after the track.
195
+ *
196
+ * @default "start"
197
+ * @see [arcgis-slider.valueLabelsPlacement](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#valueLabelsPlacement)
198
+ */
199
+ accessor valueLabelsPlacement: ArcgisSlider["valueLabelsPlacement"];
200
+ /**
201
+ * Comma-delimited slider values, expressed using the format of the current
202
+ * [fieldType](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#fieldType).
203
+ *
204
+ * Examples:
205
+ * - `integer`: `"2,20,50"`
206
+ * - `date`: `"1710028800000,1726617600000"`
207
+ * - `date-only`: `"2024-03-10,2024-09-18"`
208
+ * - `timestamp-offset`: `"2024-03-10T08:00:00-05:00,2024-09-18T18:30:00-05:00"`
209
+ *
210
+ * @default ""
211
+ * @see [arcgis-slider.values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#values)
212
+ */
213
+ accessor values: string;
214
+ /**
215
+ * Returns the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#values) property converted into an array of dates (YYYY-MM-DD). Attempting to access this property
216
+ * on a slider with incompatible data, such as number or time only values, will result in the property returning an array of null values. Note that when
217
+ * this property is accessed, the time of day information that may be present on the slider is stripped away.
218
+ */
219
+ get valuesAsDateOnly(): (string | null)[];
220
+ /**
221
+ * Returns the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#values) property converted into an array of values that match the native type of the property.
222
+ * For time-only, date-only or timestamp-offset sliders, this property will return an array of strings, and for numeric or date sliders, this property
223
+ * will return an array of numbers.
224
+ */
225
+ get valuesAsFieldType(): (number | string)[];
226
+ /**
227
+ * Returns the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#values) property converted into an array of numbers. When this property is accessed on
228
+ * a slider with temporal data, the resulting array will be formatted as milliseconds since the Unix epoch when the date is available. If only
229
+ * the time is available, the array will be formatted as ms since midnight. Values that cannot be parsed will become NaN.
230
+ */
231
+ get valuesAsNumbers(): number[];
232
+ /**
233
+ * Returns the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#values) property converted into an array of times (HH:mm:ss). Attempting to access this property
234
+ * on a slider with incompatible data, such as number or date only values, will result in the property returning an array of null values. Note that
235
+ * when this property is accessed, the time is extracted in UTC and the date is stripped away, so an ISO 8601 value of `2024-03-10T08:00:00-05:00` would
236
+ * simply become `13:00:00`.
237
+ */
238
+ get valuesAsTimeOnly(): (string | null)[];
239
+ /**
240
+ * Returns the [values](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#values) property converted into an array of UTC timestamps formatted according to the
241
+ * ISO 8601 standard. Attempting to access this property on a slider with incompatible data, such as number or time only values,
242
+ * will result in the property returning an array of null values.
243
+ */
244
+ get valuesAsTimestampOffset(): (string | null)[];
245
+ /**
246
+ * Fires when the active value changes.
247
+ *
248
+ * @see [arcgis-slider.@arcgisActiveValueChange](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#event-arcgisActiveValueChange)
249
+ */
250
+ readonly arcgisActiveValueChange: import("@arcgis/lumina").TargetedEvent<this, void>;
251
+ /**
252
+ * Fires when user interaction is committed (for example, on thumb release).
253
+ *
254
+ * Use [@arcgisInput](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/#event-arcgisInput) for continuous updates while dragging.
255
+ *
256
+ * @see [arcgis-slider.@arcgisChange](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#event-arcgisChange)
257
+ */
258
+ readonly arcgisChange: import("@arcgis/lumina").TargetedEvent<this, void>;
259
+ /**
260
+ * Fires continuously while the slider thumb or range is being dragged.
261
+ * This event can fire frequently; debounce or throttle expensive work if needed.
262
+ *
263
+ * @see [arcgis-slider.@arcgisInput](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#event-arcgisInput)
264
+ */
265
+ readonly arcgisInput: import("@arcgis/lumina").TargetedEvent<this, void>;
266
+ /**
267
+ * Fires when the slider range changes.
268
+ *
269
+ * @see [arcgis-slider.@arcgisRangeChange](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider/#event-arcgisRangeChange)
270
+ */
271
+ readonly arcgisRangeChange: import("@arcgis/lumina").TargetedEvent<this, void>;
272
+ readonly "@eventTypes": {
273
+ arcgisActiveValueChange: ArcgisSliderField["arcgisActiveValueChange"]["detail"];
274
+ arcgisChange: ArcgisSliderField["arcgisChange"]["detail"];
275
+ arcgisInput: ArcgisSliderField["arcgisInput"]["detail"];
276
+ arcgisRangeChange: ArcgisSliderField["arcgisRangeChange"]["detail"];
277
+ };
278
+ }
279
+
280
+ /**
281
+ * Supported ArcGIS field types for [arcgis-slider-field](https://developers.arcgis.com/javascript/latest/references/common-components/components/arcgis-slider-field/).
282
+ *
283
+ * This type is derived from `Field["type"]` and constrained to the field types
284
+ * currently supported by the component.
285
+ *
286
+ * - Numeric: `small-integer`, `integer`, `big-integer`, `single`, `double`, `long`, `oid`
287
+ * - Temporal: `date`, `date-only`, `time-only`, `timestamp-offset`
288
+ *
289
+ * @see [Field.type](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Field.html#type)
290
+ * @internal
291
+ */
292
+ export type FieldSliderType = Extract<Field["type"], "big-integer" | "date-only" | "date" | "double" | "integer" | "long" | "oid" | "single" | "small-integer" | "time-only" | "timestamp-offset">;
@@ -0,0 +1,375 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import { c as O } from "../../chunks/runtime.js";
3
+ import { LitElement as F, createEvent as c } from "@arcgis/lumina";
4
+ import { css as w, html as D } from "lit";
5
+ import { u as L } from "../../chunks/useT9n.js";
6
+ import { a as d } from "../../chunks/locale.js";
7
+ import { createRef as $, ref as M } from "lit/directives/ref.js";
8
+ const E = w`:host{display:block;width:100%;height:100%}`, o = 1440 * 60 * 1e3, N = /^(\d{4})-(\d{2})-(\d{2})$/u, R = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/u;
9
+ class h {
10
+ constructor({
11
+ type: e,
12
+ editable: t,
13
+ precision: s,
14
+ steps: i
15
+ }) {
16
+ this.type = e, this.editable = t, this.precision = s, this.steps = i;
17
+ }
18
+ toDateOnly(e) {
19
+ return null;
20
+ }
21
+ toTimeOnly(e) {
22
+ return null;
23
+ }
24
+ toTimestampOffset(e) {
25
+ return null;
26
+ }
27
+ toFieldType(e) {
28
+ return e;
29
+ }
30
+ }
31
+ class m extends h {
32
+ constructor({ type: e, precision: t, integer: s = !1, minimum: i, maximum: a }) {
33
+ super({
34
+ type: e,
35
+ editable: !0,
36
+ precision: t
37
+ }), this._integer = s, this._minimum = i, this._maximum = a;
38
+ }
39
+ resolveRange(e, t, s) {
40
+ return {
41
+ min: t ?? Math.min(0, ...e),
42
+ max: s ?? Math.max(100, ...e)
43
+ };
44
+ }
45
+ parse(e) {
46
+ const t = Number.parseFloat(e.trim());
47
+ if (!Number.isFinite(t))
48
+ return;
49
+ const s = this._integer ? Math.trunc(t) : t;
50
+ return Math.min(this._maximum, Math.max(this._minimum, s));
51
+ }
52
+ serialize(e) {
53
+ return this._integer ? `${Math.trunc(e)}` : `${e}`;
54
+ }
55
+ format(e, t, s, i) {
56
+ return i(t);
57
+ }
58
+ }
59
+ class I extends h {
60
+ constructor() {
61
+ super({
62
+ type: "date",
63
+ editable: !1,
64
+ precision: 0,
65
+ steps: 1e3
66
+ }), this._dateTimeFormatOptions = {
67
+ dateStyle: "short"
68
+ };
69
+ }
70
+ resolveRange(e, t, s) {
71
+ return p(e, t, s, Date.now());
72
+ }
73
+ parse(e) {
74
+ const t = Number.parseFloat(e.trim());
75
+ return Number.isFinite(t) ? Math.trunc(t) : void 0;
76
+ }
77
+ serialize(e) {
78
+ return `${Math.trunc(e)}`;
79
+ }
80
+ toDateOnly(e) {
81
+ return new Date(e).toISOString().slice(0, 10);
82
+ }
83
+ toTimeOnly(e) {
84
+ return new Date(e).toISOString().slice(11, 19);
85
+ }
86
+ toTimestampOffset(e) {
87
+ return new Date(e).toISOString();
88
+ }
89
+ format(e, t) {
90
+ return d(e, this._dateTimeFormatOptions).format(new Date(t));
91
+ }
92
+ }
93
+ class z extends h {
94
+ constructor() {
95
+ super({
96
+ type: "timestamp-offset",
97
+ editable: !1,
98
+ precision: 0,
99
+ steps: 1e3
100
+ }), this._dateTimeFormatOptions = {
101
+ dateStyle: "short"
102
+ };
103
+ }
104
+ resolveRange(e, t, s) {
105
+ return p(e, t, s, Date.now());
106
+ }
107
+ parse(e) {
108
+ const t = Date.parse(e.trim());
109
+ return Number.isFinite(t) ? t : void 0;
110
+ }
111
+ serialize(e) {
112
+ return new Date(e).toISOString();
113
+ }
114
+ toDateOnly(e) {
115
+ return new Date(e).toISOString().slice(0, 10);
116
+ }
117
+ toTimeOnly(e) {
118
+ return new Date(e).toISOString().slice(11, 19);
119
+ }
120
+ toTimestampOffset(e) {
121
+ return new Date(e).toISOString();
122
+ }
123
+ toFieldType(e) {
124
+ return this.serialize(e);
125
+ }
126
+ format(e, t) {
127
+ return d(e, this._dateTimeFormatOptions).format(new Date(t));
128
+ }
129
+ }
130
+ class A extends h {
131
+ constructor() {
132
+ super({
133
+ type: "date-only",
134
+ editable: !1,
135
+ precision: 0,
136
+ steps: o
137
+ }), this._dateFormatOptions = {
138
+ dateStyle: "short",
139
+ timeZone: "UTC"
140
+ };
141
+ }
142
+ resolveRange(e, t, s) {
143
+ return p(e, t, s, Math.trunc(Date.now() / o) * o);
144
+ }
145
+ parse(e) {
146
+ const t = N.exec(e.trim());
147
+ if (!t)
148
+ return;
149
+ const s = Number.parseInt(t[1], 10), i = Number.parseInt(t[2], 10), a = Number.parseInt(t[3], 10), r = Date.UTC(s, i - 1, a), l = new Date(r);
150
+ if (!(l.getUTCFullYear() !== s || l.getUTCMonth() !== i - 1 || l.getUTCDate() !== a))
151
+ return r;
152
+ }
153
+ serialize(e) {
154
+ return new Date(e).toISOString().slice(0, 10);
155
+ }
156
+ toDateOnly(e) {
157
+ return this.serialize(e);
158
+ }
159
+ toTimestampOffset(e) {
160
+ return new Date(e).toISOString();
161
+ }
162
+ toFieldType(e) {
163
+ return this.serialize(e);
164
+ }
165
+ format(e, t) {
166
+ return d(e, this._dateFormatOptions).format(new Date(t));
167
+ }
168
+ }
169
+ class C extends h {
170
+ constructor() {
171
+ super({
172
+ type: "time-only",
173
+ editable: !1,
174
+ precision: 0,
175
+ steps: 1e3
176
+ }), this._timeFormatOptions = {
177
+ timeStyle: "medium",
178
+ timeZone: "UTC"
179
+ };
180
+ }
181
+ resolveRange(e, t, s) {
182
+ return { min: t ?? 0, max: s ?? o - 1 };
183
+ }
184
+ parse(e) {
185
+ const t = R.exec(e.trim());
186
+ if (!t)
187
+ return;
188
+ const s = Number.parseInt(t[1], 10), i = Number.parseInt(t[2], 10), a = t[3] ? Number.parseInt(t[3], 10) : 0, r = t[4] ? Number.parseInt(t[4].padEnd(3, "0").slice(0, 3), 10) : 0;
189
+ if (!(s > 23 || i > 59 || a > 59))
190
+ return ((s * 60 + i) * 60 + a) * 1e3 + r;
191
+ }
192
+ serialize(e) {
193
+ const t = Math.max(0, Math.min(o - 1, Math.floor(e))), s = Math.floor(t / 36e5), i = Math.floor(t % 36e5 / 6e4), a = Math.floor(t % 6e4 / 1e3), r = t % 1e3, l = `${g(s)}:${g(i)}:${g(a)}`;
194
+ return r > 0 ? `${l}.${r.toString().padStart(3, "0")}` : l;
195
+ }
196
+ toTimeOnly(e) {
197
+ return this.serialize(e);
198
+ }
199
+ toFieldType(e) {
200
+ return this.serialize(e);
201
+ }
202
+ format(e, t) {
203
+ return d(e, this._timeFormatOptions).format(new Date(t));
204
+ }
205
+ }
206
+ function g(n) {
207
+ return n.toString().padStart(2, "0");
208
+ }
209
+ function p(n, e, t, s) {
210
+ const i = t ?? (n.length > 0 ? Math.max(...n) : s);
211
+ return {
212
+ min: e ?? Math.min(i - 30 * o, ...n),
213
+ max: i
214
+ };
215
+ }
216
+ const y = {
217
+ min: -32768,
218
+ max: 32767
219
+ }, u = {
220
+ min: -2147483648,
221
+ max: 2147483647
222
+ }, f = {
223
+ min: -Number.MAX_SAFE_INTEGER,
224
+ max: Number.MAX_SAFE_INTEGER
225
+ }, b = (2 - 2 ** -23) * 2 ** 127, v = {
226
+ min: -b,
227
+ max: b
228
+ }, x = {
229
+ min: -Number.MAX_VALUE,
230
+ max: Number.MAX_VALUE
231
+ }, S = {
232
+ min: 0,
233
+ max: u.max
234
+ }, V = {
235
+ "small-integer": () => new m({
236
+ type: "small-integer",
237
+ precision: 0,
238
+ integer: !0,
239
+ minimum: y.min,
240
+ maximum: y.max
241
+ }),
242
+ integer: () => new m({
243
+ type: "integer",
244
+ precision: 0,
245
+ integer: !0,
246
+ minimum: u.min,
247
+ maximum: u.max
248
+ }),
249
+ "big-integer": () => new m({
250
+ type: "big-integer",
251
+ precision: 0,
252
+ integer: !0,
253
+ minimum: f.min,
254
+ maximum: f.max
255
+ }),
256
+ single: () => new m({
257
+ type: "single",
258
+ precision: 4,
259
+ minimum: v.min,
260
+ maximum: v.max
261
+ }),
262
+ double: () => new m({
263
+ type: "double",
264
+ precision: 4,
265
+ minimum: x.min,
266
+ maximum: x.max
267
+ }),
268
+ long: () => new m({
269
+ type: "long",
270
+ precision: 0,
271
+ integer: !0,
272
+ minimum: u.min,
273
+ maximum: u.max
274
+ }),
275
+ oid: () => new m({
276
+ type: "oid",
277
+ precision: 0,
278
+ integer: !0,
279
+ minimum: S.min,
280
+ maximum: S.max
281
+ }),
282
+ date: () => new I(),
283
+ "date-only": () => new A(),
284
+ "time-only": () => new C(),
285
+ "timestamp-offset": () => new z()
286
+ };
287
+ function _(n) {
288
+ return V[n]();
289
+ }
290
+ const T = "double";
291
+ class P extends F {
292
+ constructor() {
293
+ super(...arguments), this.#t = $(), this.#s = void 0, this.messages = L({}), this._strategy = _(T), this.disabled = !1, this.fieldType = T, this.fillPlacement = "start", this.layout = "horizontal", this.max = "", this.min = "", this.mirrored = !1, this.popoverLabel = "", this.rangeLabelsEditingEnabled = !1, this.rangeLabelsPlacement = "center", this.showRangeLabels = !1, this.values = "", this.valueLabelsEditingEnabled = !1, this.valueLabelsDisplay = "always", this.valueLabelsPlacement = "start", this.arcgisChange = c({ cancelable: !1 }), this.arcgisInput = c({ cancelable: !1 }), this.arcgisRangeChange = c({ cancelable: !1 }), this.arcgisActiveValueChange = c({ cancelable: !1 });
294
+ }
295
+ static {
296
+ this.properties = { _strategy: 16, activeValue: 32, disabled: 5, fieldType: 1, fillPlacement: 1, label: 1, layout: 1, max: 1, messageOverrides: 0, min: 1, mirrored: 5, popoverLabel: 1, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 1, showRangeLabels: 5, values: 1, valueLabelsEditingEnabled: 5, valueLabelsDisplay: 1, valueLabelsPlacement: 1, valuesAsNumbers: 32, valuesAsDateOnly: 32, valuesAsTimeOnly: 32, valuesAsTimestampOffset: 32, valuesAsFieldType: 32 };
297
+ }
298
+ static {
299
+ this.styles = E;
300
+ }
301
+ #t;
302
+ #s;
303
+ get activeValue() {
304
+ const e = this.#t.value?.activeValue;
305
+ return typeof e == "number" ? this._strategy.serialize(e) : e;
306
+ }
307
+ get valuesAsNumbers() {
308
+ return this.#e(this.values).map((e) => e ?? NaN);
309
+ }
310
+ get valuesAsDateOnly() {
311
+ return this.#e(this.values).map((e) => e === void 0 ? null : this._strategy.toDateOnly(e));
312
+ }
313
+ get valuesAsTimeOnly() {
314
+ return this.#e(this.values).map((e) => e === void 0 ? null : this._strategy.toTimeOnly(e));
315
+ }
316
+ get valuesAsTimestampOffset() {
317
+ return this.#e(this.values).map((e) => e === void 0 ? null : this._strategy.toTimestampOffset(e));
318
+ }
319
+ get valuesAsFieldType() {
320
+ return this.#e(this.values).map((e) => e === void 0 ? NaN : this._strategy.toFieldType(e));
321
+ }
322
+ willUpdate(e) {
323
+ super.willUpdate(e), e.has("fieldType") && (this._strategy = _(this.fieldType)), (e.has("messages") || e.has("fieldType")) && (this.#s = this.#u(this.messages._lang)), (e.has("values") || e.has("min") || e.has("max") || e.has("fieldType")) && this.#c();
324
+ }
325
+ #n(e) {
326
+ e.stopPropagation(), this.#i(e.currentTarget.values), this.arcgisInput.emit();
327
+ }
328
+ #l(e) {
329
+ e.stopPropagation(), this.#i(e.currentTarget.values), this.arcgisChange.emit();
330
+ }
331
+ #m(e) {
332
+ e.stopPropagation(), this.arcgisActiveValueChange.emit();
333
+ }
334
+ #o(e) {
335
+ e.stopPropagation();
336
+ const t = e.currentTarget;
337
+ this.min = this._strategy.serialize(t.min), this.max = this._strategy.serialize(t.max), this.#i(t.values), this.arcgisRangeChange.emit();
338
+ }
339
+ #u(e) {
340
+ return this._strategy.format.bind(this._strategy, e);
341
+ }
342
+ #i(e) {
343
+ this.values = e.map((t) => this._strategy.serialize(t)).join(",");
344
+ }
345
+ #e(e) {
346
+ return e.split(",").map((t) => t.trim()).filter((t) => t.length > 0).map((t) => this._strategy.parse(t));
347
+ }
348
+ #a(e) {
349
+ return this.#e(e).filter((t) => Number.isFinite(t));
350
+ }
351
+ #r(e) {
352
+ const t = this._strategy, s = t.parse(this.min), i = t.parse(this.max);
353
+ let a = Number.isFinite(s) ? s : void 0, r = Number.isFinite(i) ? i : void 0;
354
+ a != null && r != null && a >= r && (a = void 0, r = void 0);
355
+ const l = t.resolveRange(e, a, r);
356
+ return l.min >= l.max ? t.resolveRange(e, void 0, void 0) : l;
357
+ }
358
+ #h(e, t, s) {
359
+ return e.map((i) => Math.min(s, Math.max(t, i))).sort((i, a) => i - a);
360
+ }
361
+ #c() {
362
+ const e = this.#a(this.values), t = this.#r(e), s = this._strategy.serialize(t.min), i = this._strategy.serialize(t.max);
363
+ s !== this.min && (this.min = s), i !== this.max && (this.max = i);
364
+ const r = this.#h(e, t.min, t.max).map((l) => this._strategy.serialize(l)).join(",");
365
+ r !== this.values && (this.values = r);
366
+ }
367
+ render() {
368
+ const e = this.#a(this.values), t = this.#r(e), s = this._strategy.editable, i = this._strategy.steps;
369
+ return D`<arcgis-slider .ariaLabel=${this.label} .disabled=${this.disabled} .labelFormatter=${this.#s} .layout=${this.layout} .max=${t.max} .min=${t.min} .mirrored=${this.mirrored} .popoverLabel=${this.popoverLabel} .precision=${this._strategy.precision} .fillPlacement=${this.fillPlacement} .steps=${i} .rangeLabelsEditingEnabled=${s && this.rangeLabelsEditingEnabled} .rangeLabelsPlacement=${this.rangeLabelsPlacement} .showRangeLabels=${this.showRangeLabels} .valueLabelsDisplay=${this.valueLabelsDisplay} .valueLabelsEditingEnabled=${s && this.valueLabelsEditingEnabled} .valueLabelsPlacement=${this.valueLabelsPlacement} .values=${e} @arcgisChange=${this.#l} @arcgisInput=${this.#n} @arcgisActiveValueChange=${this.#m} @arcgisRangeChange=${this.#o} ${M(this.#t)}><slot name=content-start slot=content-start></slot><slot name=content-end slot=content-end></slot><slot name=popover slot=popover></slot></arcgis-slider>`;
370
+ }
371
+ }
372
+ O("arcgis-slider-field", P);
373
+ export {
374
+ P as ArcgisSliderField
375
+ };
@@ -0,0 +1 @@
1
+ export * from "./customElement.js";
@@ -0,0 +1,2 @@
1
+ import "../arcgis-slider/index.js";
2
+ export * from "./customElement.js";