@arcgis/common-components 5.0.1 → 5.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{3XYPFJBC.js → 3H5RPV6D.js} +1 -1
- package/dist/cdn/{EMYYIXXR.js → 4F7RKZ7N.js} +1 -1
- package/dist/cdn/55QLRV5A.js +2 -0
- package/dist/cdn/BEMLS2Z7.js +2 -0
- package/dist/cdn/{WDFTTLXV.js → BTCP6NVI.js} +1 -1
- package/dist/cdn/{XSPU52DX.js → C5WKPUD7.js} +1 -1
- package/dist/cdn/{4TRNIAH2.js → CUUDXOC3.js} +1 -1
- package/dist/cdn/{R234ISCQ.js → H4YY7OKH.js} +1 -1
- package/dist/cdn/{IUPWCNMU.js → HLIP2K35.js} +1 -1
- package/dist/cdn/{F76YWCWI.js → MRLNU755.js} +1 -1
- package/dist/cdn/{4PYPHJHX.js → NWZY4QZ3.js} +1 -1
- package/dist/cdn/{E2XPYXL5.js → PW56Z566.js} +1 -1
- package/dist/cdn/{V7O7ZG2T.js → T7AUCAWH.js} +1 -1
- package/dist/cdn/{473IN5EZ.js → UFHW6COA.js} +1 -1
- package/dist/cdn/{67SKCWTH.js → VN5ISGOK.js} +1 -1
- package/dist/cdn/{2IYZDTOU.js → VZQKZG25.js} +1 -1
- package/dist/cdn/{T27OBKBB.js → W2BGPPXV.js} +1 -1
- package/dist/cdn/{76O2GA6L.js → XBHEGQV2.js} +1 -1
- package/dist/cdn/{W3IJC5YU.js → ZQU3D2MH.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/components/arcgis-histogram/customElement.js +0 -2
- package/dist/components/arcgis-histogram/types.d.ts +1 -3
- package/dist/components/arcgis-label-input/customElement.d.ts +1 -2
- package/dist/components/arcgis-label-input/customElement.js +22 -17
- package/dist/components/arcgis-slider/customElement.d.ts +1 -2
- package/dist/components/arcgis-slider/customElement.js +16 -16
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +3 -3
- package/dist/cdn/FGWLBSOK.js +0 -2
- package/dist/cdn/POPS56TY.js +0 -2
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
|
-
|
|
3
1
|
export type DataLine = {
|
|
4
2
|
value: number;
|
|
5
|
-
label?:
|
|
3
|
+
label?: number | string | null;
|
|
6
4
|
};
|
|
7
5
|
|
|
8
6
|
export type HistogramColorStops = HistogramClassedColorStop[] | HistogramContinuousColorStop[];
|
|
@@ -1,5 +1,4 @@
|
|
|
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";
|
|
4
3
|
import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
|
|
5
4
|
import type { InputNumber as InputNumber } from "@esri/calcite-components/components/calcite-input-number";
|
|
@@ -22,7 +21,7 @@ export abstract class ArcgisLabelInput extends LitElement {
|
|
|
22
21
|
*/
|
|
23
22
|
get editing(): boolean;
|
|
24
23
|
/** A function used to format the value. */
|
|
25
|
-
accessor labelFormatter: (
|
|
24
|
+
accessor labelFormatter: (value: number, defaultFormatter: (value: number) => string) => string | null | undefined;
|
|
26
25
|
/**
|
|
27
26
|
* Indicates whether the component is in read-only mode.
|
|
28
27
|
*
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { formatNumber as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { createRef as
|
|
6
|
-
import { css as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
+
import { formatNumber as u } from "@arcgis/core/intl.js";
|
|
4
|
+
import { LitElement as c, createEvent as h, safeClassMap as d } from "@arcgis/lumina";
|
|
5
|
+
import { createRef as s, ref as l } from "lit/directives/ref.js";
|
|
6
|
+
import { css as p, html as n } from "lit";
|
|
7
|
+
const m = p`:host{display:block}:host([hidden]){display:none}.content{display:flex;flex-direction:column}.readOnlyLabel{display:block;font-size:var(--calcite-font-size-sm);font-variant-numeric:tabular-nums;line-height:var(--calcite-font-line-height-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:.5rem;padding-block:3px;border-color:var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px);color:var(--calcite-color-text-1)}:host(:not([read-only])) .readOnlyLabel{position:absolute;opacity:0}:host([alignment="start"]){.content{align-items:start}.readOnlyLabel{text-align:start}}:host([alignment="end"]){.content{align-items:end}.readOnlyLabel{text-align:end}}:host([alignment="center"]){.content{align-items:center}.readOnlyLabel{text-align:center}}calcite-button{inline-size:100%;--calcite-offset-invert-focus: 1;--calcite-internal-animation-timing-fast: 0}calcite-input-number{inline-size:100%;--calcite-internal-animation-timing-fast: 0}`;
|
|
8
|
+
class f extends c {
|
|
9
9
|
constructor() {
|
|
10
|
-
super(...arguments), this._buttonRef =
|
|
10
|
+
super(...arguments), this._buttonRef = s(), this._inputRef = s(), this._labelRef = s(), this._formatOptions = {
|
|
11
11
|
style: "decimal",
|
|
12
12
|
useGrouping: !0,
|
|
13
13
|
minimumFractionDigits: 0,
|
|
14
14
|
maximumFractionDigits: 2
|
|
15
|
-
}, this._formatValue = (t) =>
|
|
15
|
+
}, this._formatValue = (t) => u(t, this._formatOptions), this._pointerDownPosition = null, this._displayedValue = "", this._editing = !1, this.alignment = "center", this.readOnly = !1, this.value = 0, this.arcgisChange = h({ cancelable: !1 });
|
|
16
16
|
}
|
|
17
17
|
static {
|
|
18
18
|
this.properties = { _displayedValue: 16, _editing: 16, alignment: 3, editing: 39, labelFormatter: 0, readOnly: 7, value: 11 };
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
|
-
this.styles =
|
|
21
|
+
this.styles = m;
|
|
22
22
|
}
|
|
23
23
|
static {
|
|
24
24
|
this.shadowRootOptions = { mode: "open", delegatesFocus: !0 };
|
|
@@ -39,8 +39,11 @@ class d extends o {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
updated(t) {
|
|
42
|
-
const e = this._inputRef.value, i = this.renderRoot.querySelector(".readOnlyLabel");
|
|
43
|
-
e && i &&
|
|
42
|
+
const e = this._inputRef.value, i = this._buttonRef.value, a = this.renderRoot.querySelector(".readOnlyLabel");
|
|
43
|
+
if (e && i && a) {
|
|
44
|
+
const r = a.offsetWidth;
|
|
45
|
+
i.style.width = `${r}px`, e.style.width = `${r}px`;
|
|
46
|
+
}
|
|
44
47
|
}
|
|
45
48
|
_enterEdit() {
|
|
46
49
|
this._editing || this.readOnly || (this._editing = !0, this.requestUpdate("editing", !1), this.updateComplete.then(async () => {
|
|
@@ -49,7 +52,7 @@ class d extends o {
|
|
|
49
52
|
}));
|
|
50
53
|
}
|
|
51
54
|
_exitEdit(t, e = !1) {
|
|
52
|
-
this._editing && (t
|
|
55
|
+
this._editing && (t && this._commitValue(this._inputRef.value), this._displayedValue = this._internalLabelFormatter(this.value), this._inputRef.value && (this._inputRef.value.value = `${this.value}`), this._editing = !1, this.requestUpdate("editing", !0), e || this.updateComplete.then(async () => {
|
|
53
56
|
await this._buttonRef.value?.setFocus();
|
|
54
57
|
}));
|
|
55
58
|
}
|
|
@@ -100,12 +103,14 @@ class d extends o {
|
|
|
100
103
|
}
|
|
101
104
|
render() {
|
|
102
105
|
const { alignment: t, _displayedValue: e } = this, i = [
|
|
103
|
-
|
|
106
|
+
n`<span class="readOnlyLabel"><span ${l(this._labelRef)}>${e}</span></span>`
|
|
104
107
|
];
|
|
105
|
-
return this.readOnly || i.push(
|
|
108
|
+
return this.readOnly || i.push(n`<calcite-button .alignment=${t} appearance=transparent .hidden=${this._editing} kind=neutral @pointerdown=${this._onPointerDown} @click=${this._onClick} scale=s width=full ${l(this._buttonRef)}>${e}</calcite-button>`, n`<calcite-input-number .alignment=${t} group-separator .hidden=${!this._editing} number-button-type=none @calciteInputNumberChange=${this._onValueChange} @keydown=${this._onKeyDown} @blur=${this._onBlur} @input=${this._onInput} scale=s status=idle .value=${`${this.value}`} ${l(this._inputRef)}></calcite-input-number>`), n`<div class=${d({
|
|
109
|
+
content: !0
|
|
110
|
+
})}>${i}</div>`;
|
|
106
111
|
}
|
|
107
112
|
}
|
|
108
|
-
|
|
113
|
+
o("arcgis-label-input", f);
|
|
109
114
|
export {
|
|
110
|
-
|
|
115
|
+
f as ArcgisLabelInput
|
|
111
116
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
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";
|
|
4
3
|
import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
5
4
|
import type { Popover as Popover } from "@esri/calcite-components/components/calcite-popover";
|
|
@@ -150,7 +149,7 @@ export abstract class ArcgisSlider extends LitElement {
|
|
|
150
149
|
* };
|
|
151
150
|
* ```
|
|
152
151
|
*/
|
|
153
|
-
accessor labelFormatter: (
|
|
152
|
+
accessor labelFormatter: (value: number, type: "max" | "min" | "value", defaultFormatter: (value: number) => string) => string | null | undefined;
|
|
154
153
|
/**
|
|
155
154
|
* Determines the layout/orientation of the Slider component. By default, the slider will render horizontally with the min value on the left side
|
|
156
155
|
* of the track.
|
|
@@ -75,7 +75,7 @@ let x = class extends ie {
|
|
|
75
75
|
startup() {
|
|
76
76
|
const { precision: n } = this;
|
|
77
77
|
let { min: e, max: t, values: a } = this;
|
|
78
|
-
t = b(t, n), e = b(e, n), a = a?.map((r) =>
|
|
78
|
+
t = b(t, n), e = b(e, n), a = a?.map((r) => P(b(r, n), e, t)), this._set("min", e), this._set("max", t), this._set("values", a);
|
|
79
79
|
const i = new Map(a?.map((r) => [B(), r]));
|
|
80
80
|
this._entries = i, O(
|
|
81
81
|
() => this.min,
|
|
@@ -131,7 +131,7 @@ let x = class extends ie {
|
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
const e = this._get("values");
|
|
134
|
-
if (n = n?.map((a) =>
|
|
134
|
+
if (n = n?.map((a) => P(b(a, this.precision), this.min, this.max)).sort((a, i) => a - i), e && n && e.length === n.length && e.every((a, i) => a === n[i]))
|
|
135
135
|
return;
|
|
136
136
|
const t = new Map(n?.map((a) => [B(), a]));
|
|
137
137
|
this._entries = t, this._set("values", n);
|
|
@@ -154,7 +154,7 @@ let x = class extends ie {
|
|
|
154
154
|
setValue(n, e) {
|
|
155
155
|
if (this.values == null)
|
|
156
156
|
return !1;
|
|
157
|
-
const { min: t, max: a } = this, i = this._entries.get(n), r =
|
|
157
|
+
const { min: t, max: a } = this, i = this._entries.get(n), r = P(b(e, this.precision), t, a);
|
|
158
158
|
return i === r ? !1 : (this._entries.set(n, r), this._updatesValues(), !0);
|
|
159
159
|
}
|
|
160
160
|
setValues(n) {
|
|
@@ -163,7 +163,7 @@ let x = class extends ie {
|
|
|
163
163
|
let e = !1;
|
|
164
164
|
const { min: t, max: a } = this;
|
|
165
165
|
for (const [i, r] of n) {
|
|
166
|
-
const l = this._entries.get(i), s =
|
|
166
|
+
const l = this._entries.get(i), s = P(b(r, this.precision), t, a);
|
|
167
167
|
l !== s && (e = !0, this._entries.set(i, s));
|
|
168
168
|
}
|
|
169
169
|
return e ? (this._updatesValues(), !0) : !1;
|
|
@@ -186,7 +186,7 @@ w([
|
|
|
186
186
|
k()
|
|
187
187
|
], x.prototype, "min", 1);
|
|
188
188
|
w([
|
|
189
|
-
k({ cast: (n) =>
|
|
189
|
+
k({ cast: (n) => P(n, 0, 20) })
|
|
190
190
|
], x.prototype, "precision", 2);
|
|
191
191
|
w([
|
|
192
192
|
k({ readOnly: !0 })
|
|
@@ -197,7 +197,7 @@ w([
|
|
|
197
197
|
x = w([
|
|
198
198
|
se("esri.widgets.Slider.SliderData")
|
|
199
199
|
], x);
|
|
200
|
-
function
|
|
200
|
+
function P(n, e, t) {
|
|
201
201
|
return Math.min(Math.max(n, e), t);
|
|
202
202
|
}
|
|
203
203
|
function b(n, e) {
|
|
@@ -324,8 +324,8 @@ function A(n, e, t, a) {
|
|
|
324
324
|
if (i)
|
|
325
325
|
return g;
|
|
326
326
|
const y = /* @__PURE__ */ new Set();
|
|
327
|
-
for (const [
|
|
328
|
-
|
|
327
|
+
for (const [$, C] of e)
|
|
328
|
+
$ !== t && y.add(C);
|
|
329
329
|
for (; y.has(g) && g <= o && g >= s; )
|
|
330
330
|
g = E(g + a * l, s, o);
|
|
331
331
|
return y.has(g) || g > o || g < s ? c : g;
|
|
@@ -428,7 +428,7 @@ function E(n, e, t) {
|
|
|
428
428
|
const Ie = Q(x);
|
|
429
429
|
class Ee extends Y {
|
|
430
430
|
constructor() {
|
|
431
|
-
super(...arguments), this._popoverElement = H(), this._trackElement = H(), this.messages = ne({}), this._onPointerMoveDragUpdate = (e) => {
|
|
431
|
+
super(...arguments), this._stepsProvider = null, this._popoverElement = H(), this._trackElement = H(), this.messages = ne({}), this._onPointerMoveDragUpdate = (e) => {
|
|
432
432
|
this._updateDrag(this._mapEventToRange(e));
|
|
433
433
|
}, this._onPointerUpDragEnd = (e) => {
|
|
434
434
|
M(e) && this._endDrag();
|
|
@@ -442,7 +442,7 @@ class Ee extends Y {
|
|
|
442
442
|
return l ?? i.format(a);
|
|
443
443
|
}, this._numberFormatOptions = {}, this._createFormatter = (e, t) => this._formatLabel.bind(this, e, t), this._minFormatter = this._createFormatter("min", this._numberFormatOptions), this._maxFormatter = this._createFormatter("max", this._numberFormatOptions), this._valueFormatter = this._createFormatter("value", this._numberFormatOptions), this._resizeObserver = new ResizeObserver(() => {
|
|
444
444
|
this._layoutLabelInputs();
|
|
445
|
-
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._sliderData = Ie(this), this.allowValuesOverlap = !1, this.autoDestroyDisabled = !1, this.disabled = !1, this.fillPlacement = "start", this.layout = "horizontal", this.max = this._sliderData.max, this.min = this._sliderData.min, this.mirrored = !1, this.popoverLabel = "", this.popoverPlacement = "start", this.precision = this._sliderData.precision, this.rangeLabelsEditingEnabled = !1, this.rangeLabelsPlacement = "center", this.segmentsDraggingDisabled = !1, this.showRangeLabels = !1, this.valueLabelsDisplay = "hidden", this.valueLabelsPlacement = "start", this.valueLabelsEditingEnabled = !1, this.keyboardLargeStep = 10, this.values = this._sliderData.values, this.arcgisActiveValueChange = T({ cancelable: !1 }), this.arcgisChange = T({ cancelable: !1 }), this.arcgisInput = T({ cancelable: !1 }), this.arcgisRangeChange = T({ cancelable: !1 });
|
|
445
|
+
}), this._labelInputsUpdateComplete = null, this._dragInfo = null, this._hasPopoverContent = !1, this._hasContentStart = !1, this._hasContentEnd = !1, this._activePart = null, this._sliderData = Ie(this), this.allowValuesOverlap = !1, this.autoDestroyDisabled = !1, this.disabled = !1, this.fillPlacement = "start", this.layout = "horizontal", this.max = this._sliderData.max, this.min = this._sliderData.min, this.mirrored = !1, this.popoverLabel = "", this.popoverPlacement = "start", this.precision = this._sliderData.precision, this.rangeLabelsEditingEnabled = !1, this.rangeLabelsPlacement = "center", this.segmentsDraggingDisabled = !1, this.showRangeLabels = !1, this.valueLabelsDisplay = "hidden", this.valueLabelsPlacement = "start", this.valueLabelsEditingEnabled = !1, this.keyboardLargeStep = 10, this.values = this._sliderData.values, this.arcgisActiveValueChange = T({ cancelable: !1 }), this.arcgisChange = T({ cancelable: !1 }), this.arcgisInput = T({ cancelable: !1 }), this.arcgisRangeChange = T({ cancelable: !1 });
|
|
446
446
|
}
|
|
447
447
|
static {
|
|
448
448
|
this.properties = { _dragInfo: 16, _hasPopoverContent: 16, _hasContentStart: 16, _hasContentEnd: 16, _activePart: 16, _sliderData: 16, activeValue: 32, allowValuesOverlap: 5, autoDestroyDisabled: 5, disabled: 7, fullRangeMax: 11, fullRangeMin: 11, fillPlacement: 1, labelFormatter: 0, layout: 3, max: 11, min: 11, mirrored: 7, popoverLabel: 1, popoverPlacement: 3, precision: 11, rangeLabelsEditingEnabled: 5, rangeLabelsPlacement: 3, segmentsDraggingDisabled: 5, showRangeLabels: 7, steps: [9, { converter: {
|
|
@@ -543,8 +543,8 @@ class Ee extends Y {
|
|
|
543
543
|
continue;
|
|
544
544
|
const d = o.getBoundingClientRect(), u = c.getBoundingClientRect(), h = c.getLabelBoundingClientRect(), f = d.width / 2, p = Math.round(d.left + f), v = Math.round(h.width / 2);
|
|
545
545
|
let D = u.width / 2;
|
|
546
|
-
const g = i.left - f, y = i.right + f,
|
|
547
|
-
|
|
546
|
+
const g = i.left - f, y = i.right + f, $ = p - v, C = p + v;
|
|
547
|
+
$ < g ? D += $ - g : C > y && (D += C - y), c.style.transform = `translateX(${-Math.round(D)}px)`;
|
|
548
548
|
}
|
|
549
549
|
}
|
|
550
550
|
}
|
|
@@ -630,7 +630,7 @@ class Ee extends Y {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
_focusEntry(e) {
|
|
633
|
-
e &&
|
|
633
|
+
e && $e(this, e)?.focus();
|
|
634
634
|
}
|
|
635
635
|
_addDragListeners() {
|
|
636
636
|
document.addEventListener("pointerup", this._onPointerUpDragEnd), document.addEventListener("pointermove", this._onPointerMoveDragUpdate), document.addEventListener("pointercancel", this._onPointerCancelDragEnd);
|
|
@@ -754,7 +754,7 @@ class Ee extends Y {
|
|
|
754
754
|
})} @pointerdown=${this._onPointerDown}>${this._renderContentStart()}${this._renderContentEnd()}${this._renderRangeLabel("min")}${this._renderTrackRange()}${this._renderRangeLabel("max")}${this._renderPopover()}</div>`;
|
|
755
755
|
}
|
|
756
756
|
_renderPopover() {
|
|
757
|
-
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: l } = this, s = e ?
|
|
757
|
+
const { _activePart: e, layout: t, popoverPlacement: a, valueLabelsPlacement: i, valueLabelsDisplay: r, popoverLabel: l } = this, s = e ? Pe(e) ? e : "track-range" : "", o = this._hasPopoverContent && !!s, c = t === "horizontal" ? a === "start" ? "top" : "bottom" : a === "start" ? "left" : "right";
|
|
758
758
|
let d = 14;
|
|
759
759
|
return r !== "hidden" && a === i && (d += 24), _`<calcite-popover flip-disabled focus-trap-disabled .label=${l} .open=${o} .offsetDistance=${d} .placement=${c} pointer-disabled .referenceElement=${s} scale=s trigger-disabled ${R(this._popoverElement)}><slot name=popover @slotchange=${this._popoverSlotChange}></slot></calcite-popover>`;
|
|
760
760
|
}
|
|
@@ -848,10 +848,10 @@ function V(n) {
|
|
|
848
848
|
const e = ee(n, "[data-entry]");
|
|
849
849
|
return e && "dataset" in e ? e.dataset.entry : null;
|
|
850
850
|
}
|
|
851
|
-
function
|
|
851
|
+
function Pe(n) {
|
|
852
852
|
return typeof n != null && n !== "range";
|
|
853
853
|
}
|
|
854
|
-
function
|
|
854
|
+
function $e(n, e) {
|
|
855
855
|
return e ? n.renderRoot.querySelector(`div[data-entry="${e}"]`) : null;
|
|
856
856
|
}
|
|
857
857
|
function Ce(n, e) {
|