@arcgis/common-components 6.0.0-next.33 → 6.0.0-next.35
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/2K4XK5CC.js +2 -0
- package/dist/cdn/32JRESCI.js +2 -0
- package/dist/cdn/{7WN227WZ.js → 4L362IQJ.js} +24 -24
- package/dist/cdn/5TNOGXJJ.js +2 -0
- package/dist/cdn/{5GVJKVEV.js → BUPRL52I.js} +1 -1
- package/dist/cdn/D4JWM5PW.js +2 -0
- package/dist/cdn/E5VIZW6M.js +2 -0
- package/dist/cdn/{W7CWMG2O.js → HWVDNUPX.js} +1 -1
- package/dist/cdn/RYVWIAKZ.js +2 -0
- package/dist/cdn/UFSM3GRY.js +2 -0
- package/dist/cdn/WIOMW22N.js +2 -0
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/intrinsic-sizing.js +18 -0
- package/dist/components/arcgis-ckeditor5/customElement.d.ts +0 -9
- package/dist/components/arcgis-ckeditor5/customElement.js +1207 -1207
- package/dist/components/arcgis-ckeditor5-popover/customElement.d.ts +0 -6
- package/dist/components/arcgis-ckeditor5-popover/customElement.js +14 -17
- package/dist/components/arcgis-color-input/customElement.d.ts +0 -20
- package/dist/components/arcgis-color-input/customElement.js +18 -18
- package/dist/components/arcgis-field-info/customElement.d.ts +0 -3
- package/dist/components/arcgis-field-info/customElement.js +41 -41
- package/dist/components/arcgis-field-pick-list/customElement.d.ts +0 -28
- package/dist/components/arcgis-field-pick-list/customElement.js +114 -127
- package/dist/components/arcgis-slider-input/customElement.d.ts +0 -3
- package/dist/components/arcgis-slider-input/customElement.js +13 -13
- package/dist/components/arcgis-toolbar/customElement.d.ts +20 -0
- package/dist/components/arcgis-toolbar/customElement.js +40 -37
- package/dist/components/arcgis-toolbar-stack/customElement.d.ts +9 -2
- package/dist/components/arcgis-toolbar-stack/customElement.js +49 -51
- package/dist/components/arcgis-value-picker/customElement.js +12 -16
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +0 -20
- package/dist/loader.js +4 -4
- package/dist/types/lumina.d.ts +4 -30
- package/dist/types/preact.d.ts +4 -30
- package/dist/types/react.d.ts +4 -30
- package/dist/types/stencil.d.ts +4 -30
- package/dist/utils/types.d.ts +0 -12
- package/package.json +7 -7
- package/dist/cdn/2S4SSY4K.js +0 -2
- package/dist/cdn/3UAY23XT.js +0 -2
- package/dist/cdn/BMR5AH6W.js +0 -2
- package/dist/cdn/GZVXOCN5.js +0 -2
- package/dist/cdn/KEQPWVA6.js +0 -2
- package/dist/cdn/OUPGMHLD.js +0 -2
- package/dist/cdn/U6OGOB7D.js +0 -2
- package/dist/cdn/VNC7X43V.js +0 -2
- package/dist/chunks/toolbar.js +0 -9
- /package/dist/cdn/{DAAON2UO.js → UOXUUCE7.js} +0 -0
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as
|
|
4
|
-
import { html as
|
|
5
|
-
import { keyed as
|
|
6
|
-
import { LitElement as
|
|
2
|
+
import { c as g } from "../../chunks/runtime.js";
|
|
3
|
+
import { ref as m } from "lit/directives/ref.js";
|
|
4
|
+
import { html as h } from "lit";
|
|
5
|
+
import { keyed as b } from "lit/directives/keyed.js";
|
|
6
|
+
import { LitElement as f, createEvent as v, safeStyleMap as c } from "@arcgis/lumina";
|
|
7
7
|
import { useDirection as y } from "@arcgis/lumina/controllers";
|
|
8
|
-
import { s as
|
|
8
|
+
import { s as _, a as $, b as R, c as z, r as B } from "../../chunks/intrinsic-sizing.js";
|
|
9
9
|
import { a as l } from "../../chunks/utils.js";
|
|
10
|
-
import { i as
|
|
11
|
-
class w extends
|
|
10
|
+
import { i as L } from "../../chunks/types.js";
|
|
11
|
+
class w extends f {
|
|
12
12
|
constructor() {
|
|
13
|
-
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#
|
|
13
|
+
super(), this.#t = new ResizeObserver((t) => this._updateMeasurement(t)), this.#e = new MutationObserver(() => this._syncGroups()), this.#i = y(), this._layout = "horizontal", this._setRenderedBar = (t) => {
|
|
14
14
|
t == null && (this._renderedBar = void 0, this._hydratedRenderedBar = void 0), !(t === this._renderedBar || t === this._hydratedRenderedBar) && (this._renderedBar = t, this._hydratedRenderedBar = void 0, t && t.componentOnReady().then(() => {
|
|
15
15
|
!this.isConnected || this._renderedBar !== t || (this._hydratedRenderedBar = t);
|
|
16
16
|
}));
|
|
17
|
-
}, this.
|
|
17
|
+
}, this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.arcgisInternalLayoutUpdate = v(), this.listen("arcgisInternalLayoutUpdate", (t) => {
|
|
18
18
|
t.target !== this.el && this.requestUpdate(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && t.stopPropagation();
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
this.properties = { _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, barElement: 32, effectiveRelativeDirection: 16 };
|
|
22
|
+
this.properties = { _observedSize: 16, _availableLength: 16, _groups: 16, _renderedBar: 16, _hydratedRenderedBar: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, allocatedLength: 11, barElement: 32, effectiveRelativeDirection: 16 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles = [
|
|
25
|
+
this.styles = [_, $, R, z];
|
|
26
26
|
}
|
|
27
27
|
#t;
|
|
28
|
+
#e;
|
|
28
29
|
#r;
|
|
29
30
|
#i;
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
get _availableLength() {
|
|
32
|
+
return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
|
|
33
|
+
}
|
|
32
34
|
get layout() {
|
|
33
35
|
return this._layout;
|
|
34
36
|
}
|
|
35
37
|
set layout(t) {
|
|
36
|
-
t !== this._layout && (this._layout = t
|
|
38
|
+
t !== this._layout && (this._layout = t);
|
|
37
39
|
}
|
|
38
40
|
get barElement() {
|
|
39
41
|
return this._hydratedRenderedBar;
|
|
40
42
|
}
|
|
41
43
|
get effectiveRelativeDirection() {
|
|
42
|
-
const [t, e] = this.relativePosition.split("-"), r = this.#
|
|
44
|
+
const [t, e] = this.relativePosition.split("-"), r = this.#i;
|
|
43
45
|
switch (e) {
|
|
44
46
|
case "left":
|
|
45
47
|
case "right":
|
|
@@ -54,39 +56,36 @@ class w extends b {
|
|
|
54
56
|
const e = this._groups;
|
|
55
57
|
if (!e?.length)
|
|
56
58
|
return [0];
|
|
57
|
-
const
|
|
58
|
-
return Array.from(new Set(
|
|
59
|
+
const s = e.map((i) => i.measure(t)).reduce((i, a) => i.flatMap((o) => a.map((n) => o + n)), [0]).map((i) => l(e, t, i).reduce((a, { budget: o }) => a + o, 0));
|
|
60
|
+
return Array.from(new Set(s)).sort((i, a) => i - a);
|
|
61
|
+
}
|
|
62
|
+
measureIntrinsicSize(t) {
|
|
63
|
+
const e = this._groups ?? [], r = (s) => l(e, t, s).reduce((i, { budget: a }) => i + a, 0);
|
|
64
|
+
return { minimum: r(0), maximum: r(1 / 0) };
|
|
59
65
|
}
|
|
60
66
|
allocate(t, e) {
|
|
61
67
|
const r = this._groups;
|
|
62
68
|
return r?.length ? l(r, t, e) : [];
|
|
63
69
|
}
|
|
64
|
-
proxiedRender(t, e, r = this.toolbarKind,
|
|
70
|
+
proxiedRender(t, e, r = this.toolbarKind, s = e) {
|
|
65
71
|
if (!this._groups?.length)
|
|
66
72
|
return;
|
|
67
|
-
const
|
|
68
|
-
return
|
|
73
|
+
const a = this.allocate(t, e), [o, n] = t.relativePosition.split("-"), d = t.layout === "horizontal" ? { maxWidth: `${s}px` } : { maxHeight: `${s}px` };
|
|
74
|
+
return b(this, h`<div class=${`toolbar-grid-wrapper ${n} ${o}`} style=${c(d)}><div class="toolbar-shadow-wrapper" style=${c(d)}><calcite-action-bar expand-toggle-disabled .floating=${r === "floating"} .layout=${t.layout} overflow-mode=none .scale=${t.scale} ${m(this._setRenderedBar)}>${a.map(({ group: u, budget: p }) => u.proxiedRender(t, p))}</calcite-action-bar></div></div>`);
|
|
69
75
|
}
|
|
70
76
|
connectedCallback() {
|
|
71
|
-
super.connectedCallback(), this.
|
|
77
|
+
super.connectedCallback(), this.el.parentElement?.localName !== "arcgis-toolbar-stack" && this.#t.observe(this.el), this.#e.observe(this.el, { childList: !0 }), this._syncGroups();
|
|
72
78
|
}
|
|
73
79
|
disconnectedCallback() {
|
|
74
|
-
this.#t.disconnect(), this.#
|
|
75
|
-
}
|
|
76
|
-
_setRulerEl(t) {
|
|
77
|
-
this.#e !== t && (this.#e = t, this.isConnected && this._connectMeasurement(t));
|
|
78
|
-
}
|
|
79
|
-
_connectMeasurement(t) {
|
|
80
|
-
this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
|
|
80
|
+
this.#t.disconnect(), this.#e.disconnect(), super.disconnectedCallback();
|
|
81
81
|
}
|
|
82
82
|
_updateMeasurement(t) {
|
|
83
|
-
|
|
84
|
-
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
83
|
+
this._observedSize = t?.at(0)?.contentRect;
|
|
85
84
|
}
|
|
86
85
|
_syncGroups() {
|
|
87
|
-
this.#
|
|
88
|
-
const t = Array.from(this.el.children).filter(
|
|
89
|
-
this.#
|
|
86
|
+
this.#r?.abort();
|
|
87
|
+
const t = Array.from(this.el.children).filter(L), e = new AbortController();
|
|
88
|
+
this.#r = e, Promise.all(t.map((r) => r.componentOnReady())).then(() => {
|
|
90
89
|
!this.isConnected || e.signal.aborted || (this._groups = t, this.arcgisInternalLayoutUpdate.emit());
|
|
91
90
|
});
|
|
92
91
|
}
|
|
@@ -99,11 +98,15 @@ class w extends b {
|
|
|
99
98
|
scale: this.scale,
|
|
100
99
|
tooltipAppearance: this.tooltipAppearance,
|
|
101
100
|
toolbarKind: this.toolbarKind
|
|
102
|
-
},
|
|
103
|
-
|
|
101
|
+
}, r = this.allocate(e, this._availableLength).reduce((s, { budget: i }) => s + i, 0);
|
|
102
|
+
if (this.allocatedLength === void 0) {
|
|
103
|
+
const { minimum: s, maximum: i } = this.measureIntrinsicSize(e);
|
|
104
|
+
return h`<div class="intrinsic-sizing-container">${B(s, i, this.layout)}${this.proxiedRender(e, r, this.toolbarKind, this._availableLength)}</div>`;
|
|
105
|
+
}
|
|
106
|
+
return this.proxiedRender(e, r, this.toolbarKind, this._availableLength);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
|
|
109
|
+
g("arcgis-toolbar", w);
|
|
107
110
|
export {
|
|
108
111
|
w as ArcgisToolbar
|
|
109
112
|
};
|
|
@@ -7,8 +7,8 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
7
7
|
* This is intended to be relatively simple; toolbars are 'stacked' vertically and horizontally
|
|
8
8
|
* according to layout, docking behavior, and available space.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* The stack observes its own content box or accepts an external allocation, so every
|
|
11
|
+
* toolbar receives the same available length regardless of its position within the stack.
|
|
12
12
|
*
|
|
13
13
|
* The general rule is the input order of the toolbar elements determines the semantic priority. Based on that priority,
|
|
14
14
|
* higher priority elements are stuck to the outside, with smaller/lower priority elements flowing towards the center.
|
|
@@ -16,6 +16,13 @@ import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
|
16
16
|
* @internal
|
|
17
17
|
*/
|
|
18
18
|
export abstract class ArcgisToolbarStack extends LitElement {
|
|
19
|
+
/**
|
|
20
|
+
* Main-axis budget in pixels. Undefined (the default) enables intrinsic sizing:
|
|
21
|
+
* CSS determines the stack's size, and its observed content box supplies the budget.
|
|
22
|
+
* Specifying a value, including zero, disables intrinsic sizing and directly controls
|
|
23
|
+
* the budget used to arrange and collapse toolbars. CSS can still constrain the host.
|
|
24
|
+
*/
|
|
25
|
+
accessor allocatedLength: number | undefined;
|
|
19
26
|
/** Toolbar orientation */
|
|
20
27
|
accessor layout: "horizontal" | "vertical";
|
|
21
28
|
/**
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { ref as v } from "lit/directives/ref.js";
|
|
2
|
+
import { c as v } from "../../chunks/runtime.js";
|
|
4
3
|
import { css as f, html as b } from "lit";
|
|
5
|
-
import { LitElement as y, nothing as
|
|
6
|
-
import { useDirection as
|
|
7
|
-
import { s as
|
|
8
|
-
import { S as
|
|
9
|
-
const T = f`:host{--calcite-internal-animation-timing-slow: 0}.stack{block-size:100%}.toolbar-stack{display:flex;gap:8px}:host([toolbar-kind="docked"]) .toolbar-stack{gap:0}.line{display:flex;gap:8px}:host([layout="vertical"]) .line{block-size:100%;flex-direction:column}:host([layout="vertical"]) .line[data-alignment=bottom]{align-self:end}.line[data-alignment=left]{justify-content:left}.line[data-alignment=right]{justify-content:right}:host([layout="vertical"]) .toolbar-stack{block-size:100%}:host([layout="horizontal"]) .toolbar-stack{flex-direction:column}:host([toolbar-kind="docked"][layout="horizontal"]) .toolbar-stack{min-inline-size:100%}:host([toolbar-kind="docked"][layout="vertical"]) .toolbar-stack{min-block-size:100%}`,
|
|
10
|
-
class
|
|
4
|
+
import { LitElement as y, nothing as k } from "@arcgis/lumina";
|
|
5
|
+
import { useDirection as z } from "@arcgis/lumina/controllers";
|
|
6
|
+
import { s as _, a as L, b as C, c as $, r as x } from "../../chunks/intrinsic-sizing.js";
|
|
7
|
+
import { S as A, s as S } from "../../chunks/sharedCacheDirective.js";
|
|
8
|
+
const T = f`:host{--calcite-internal-animation-timing-slow: 0}.stack{block-size:100%}.toolbar-stack{display:flex;gap:8px}:host([toolbar-kind="docked"]) .toolbar-stack{gap:0}.line{display:flex;gap:8px}:host([layout="vertical"]) .line{block-size:100%;flex-direction:column}:host([layout="vertical"]) .line[data-alignment=bottom]{align-self:end}.line[data-alignment=left]{justify-content:left}.line[data-alignment=right]{justify-content:right}:host([layout="vertical"]) .toolbar-stack{block-size:100%}:host([layout="horizontal"]) .toolbar-stack{flex-direction:column}:host([toolbar-kind="docked"][layout="horizontal"]) .toolbar-stack{min-inline-size:100%}:host([toolbar-kind="docked"][layout="vertical"]) .toolbar-stack{min-block-size:100%}:host(:not([allocated-length])){.toolbar-stack{grid-area:1 / 1;min-inline-size:0;min-block-size:0}.toolbar-grid-wrapper{flex:1 1 auto}}`, m = 8;
|
|
9
|
+
class P extends y {
|
|
11
10
|
constructor() {
|
|
12
|
-
super(), this.#
|
|
11
|
+
super(), this.#i = new ResizeObserver((t) => this._updateMeasurement(t)), this.#o = new MutationObserver(() => this._syncToolbars()), this.#a = z(), this.#t = new A(), this._layout = "horizontal", this.scale = "m", this.tooltipAppearance = "native", this.relativePosition = "top-left", this.toolbarKind = "floating", this.listen("arcgisInternalLayoutUpdate", () => this.requestUpdate());
|
|
13
12
|
}
|
|
14
13
|
static {
|
|
15
|
-
this.properties = { _availableLength: 16, _toolbars: 16, effectiveRelativeDirection: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3 };
|
|
14
|
+
this.properties = { _observedSize: 16, _availableLength: 16, _toolbars: 16, effectiveRelativeDirection: 16, layout: 3, scale: 3, tooltipAppearance: 1, relativePosition: 1, toolbarKind: 3, allocatedLength: 11 };
|
|
16
15
|
}
|
|
17
16
|
static {
|
|
18
|
-
this.styles = [T, L, C,
|
|
17
|
+
this.styles = [T, _, L, C, $];
|
|
19
18
|
}
|
|
20
|
-
#
|
|
19
|
+
#i;
|
|
20
|
+
#o;
|
|
21
21
|
#s;
|
|
22
22
|
#a;
|
|
23
|
-
#
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
#t;
|
|
24
|
+
get _availableLength() {
|
|
25
|
+
return this.allocatedLength ?? (this.layout === "horizontal" ? this._observedSize?.width : this._observedSize?.height) ?? 0;
|
|
26
|
+
}
|
|
26
27
|
get effectiveRelativeDirection() {
|
|
27
|
-
const [t, e] = this.relativePosition.split("-"), i = this.#
|
|
28
|
+
const [t, e] = this.relativePosition.split("-"), i = this.#a;
|
|
28
29
|
switch (e) {
|
|
29
30
|
case "left":
|
|
30
31
|
case "right":
|
|
@@ -39,50 +40,47 @@ class M extends y {
|
|
|
39
40
|
return this._layout;
|
|
40
41
|
}
|
|
41
42
|
set layout(t) {
|
|
42
|
-
t !== this._layout && (this._layout = t
|
|
43
|
+
t !== this._layout && (this._layout = t);
|
|
43
44
|
}
|
|
44
45
|
connectedCallback() {
|
|
45
|
-
super.connectedCallback(), this.
|
|
46
|
+
super.connectedCallback(), this.#i.observe(this.el), this.#o.observe(this.el, { childList: !0 }), this._syncToolbars();
|
|
46
47
|
}
|
|
47
48
|
disconnectedCallback() {
|
|
48
|
-
this.#
|
|
49
|
-
}
|
|
50
|
-
_setRulerEl(t) {
|
|
51
|
-
this.#i !== t && (this.#i = t, this.isConnected && this._connectMeasurement(t));
|
|
52
|
-
}
|
|
53
|
-
_connectMeasurement(t) {
|
|
54
|
-
this.#t.disconnect(), t && (this.#t.observe(t), this._updateMeasurement());
|
|
49
|
+
this.#i.disconnect(), this.#o.disconnect(), super.disconnectedCallback();
|
|
55
50
|
}
|
|
56
51
|
_updateMeasurement(t) {
|
|
57
|
-
|
|
58
|
-
e && (this._availableLength = this.layout === "horizontal" ? e.width : e.height);
|
|
52
|
+
this._observedSize = t?.at(0)?.contentRect;
|
|
59
53
|
}
|
|
60
54
|
_syncToolbars() {
|
|
61
|
-
this.#
|
|
62
|
-
const t = Array.from(this.el.children).filter(
|
|
63
|
-
this.#
|
|
55
|
+
this.#s?.abort();
|
|
56
|
+
const t = Array.from(this.el.children).filter(R), e = new AbortController();
|
|
57
|
+
this.#s = e, Promise.all(t.map((i) => i.componentOnReady())).then(() => {
|
|
64
58
|
!this.isConnected || e.signal.aborted || (this._toolbars = t);
|
|
65
59
|
});
|
|
66
60
|
}
|
|
67
61
|
_arrangeToolbarLines(t, e) {
|
|
68
|
-
const i = t.map((
|
|
69
|
-
const d =
|
|
70
|
-
return { toolbar:
|
|
71
|
-
}),
|
|
72
|
-
let o = [],
|
|
73
|
-
for (const
|
|
74
|
-
const d =
|
|
75
|
-
o.length > 0 && (this.toolbarKind === "docked" || d > this._availableLength) ? (
|
|
62
|
+
const i = t.map((n) => {
|
|
63
|
+
const d = n.allocate(e, this._availableLength);
|
|
64
|
+
return { toolbar: n, budget: d.reduce((g, p) => g + p.budget, 0) };
|
|
65
|
+
}), a = [];
|
|
66
|
+
let o = [], s = 0;
|
|
67
|
+
for (const n of i) {
|
|
68
|
+
const d = s + (o.length === 0 ? 0 : m) + n.budget;
|
|
69
|
+
o.length > 0 && (this.toolbarKind === "docked" || d > this._availableLength) ? (a.push(o), o = [n], s = n.budget) : (o.push(n), s = d);
|
|
76
70
|
}
|
|
77
|
-
o.length > 0 &&
|
|
78
|
-
const [
|
|
79
|
-
return (
|
|
71
|
+
o.length > 0 && a.push(o);
|
|
72
|
+
const [c, h] = e.relativePosition.split("-"), r = e.layout === "vertical";
|
|
73
|
+
return (r ? h === "right" : c === "bottom") && a.reverse(), (r ? c === "bottom" : h === "right") && a.forEach((n) => n.reverse()), a;
|
|
74
|
+
}
|
|
75
|
+
#e;
|
|
76
|
+
_renderIntrinsicSizeContribution(t, e) {
|
|
77
|
+
const i = t.map((s) => s.measureIntrinsicSize(e)), a = this.toolbarKind === "docked" ? Math.max(...i.map(({ maximum: s }) => s)) : i.reduce((s, { maximum: c }) => s + c, 0) + m * (t.length - 1), o = Math.max(...i.map(({ minimum: s }) => s));
|
|
78
|
+
return x(o, a, this.layout);
|
|
80
79
|
}
|
|
81
|
-
#o;
|
|
82
80
|
render() {
|
|
83
81
|
const t = this._toolbars;
|
|
84
82
|
if (!t?.length) {
|
|
85
|
-
this.#
|
|
83
|
+
this.#e?.length && (this.#t.moveAllToCache(), this.#e = []);
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
86
|
const e = {
|
|
@@ -92,18 +90,18 @@ class M extends y {
|
|
|
92
90
|
tooltipAppearance: this.tooltipAppearance,
|
|
93
91
|
toolbarKind: this.toolbarKind
|
|
94
92
|
}, i = this._arrangeToolbarLines(t, e);
|
|
95
|
-
|
|
96
|
-
const [
|
|
97
|
-
return b`<div class="stack
|
|
93
|
+
w(this.#e, i) || (this.#t.moveAllToCache(), this.#e = i.map((h) => h.map(({ toolbar: r }) => r)));
|
|
94
|
+
const [a, o] = e.relativePosition.split("-"), s = this.layout === "vertical" ? a : o, c = this.#t;
|
|
95
|
+
return b`<div class="stack intrinsic-sizing-container">${this.allocatedLength === void 0 && this._renderIntrinsicSizeContribution(t, e) || ""}<div class="toolbar-stack">${i.map((h) => b`<div class="line" data-alignment=${s ?? k}>${h.map(({ toolbar: r, budget: u }) => S(c, r, r.proxiedRender(e, u, this.toolbarKind, this._availableLength)))}</div>`)}</div></div>`;
|
|
98
96
|
}
|
|
99
97
|
}
|
|
100
|
-
function
|
|
98
|
+
function R(l) {
|
|
101
99
|
return l.localName === "arcgis-toolbar";
|
|
102
100
|
}
|
|
103
|
-
function
|
|
104
|
-
return l?.length === t.length && t.every((e, i) => e.length === l[i].length && e.every(({ toolbar:
|
|
101
|
+
function w(l, t) {
|
|
102
|
+
return l?.length === t.length && t.every((e, i) => e.length === l[i].length && e.every(({ toolbar: a }, o) => a === l[i][o]));
|
|
105
103
|
}
|
|
106
|
-
|
|
104
|
+
v("arcgis-toolbar-stack", P);
|
|
107
105
|
export {
|
|
108
|
-
|
|
106
|
+
P as ArcgisToolbarStack
|
|
109
107
|
};
|
|
@@ -4,11 +4,11 @@ import { LitElement as h, createEvent as i, nothing as n, safeClassMap as r } fr
|
|
|
4
4
|
import { getSlotAssignedElements as d } from "@arcgis/toolkit/dom/slots";
|
|
5
5
|
import { css as m, html as s } from "lit";
|
|
6
6
|
import { u } from "../../chunks/useT9n.js";
|
|
7
|
-
import { useDirection as
|
|
7
|
+
import { useDirection as y, usePropertyChange as p } from "@arcgis/lumina/controllers";
|
|
8
8
|
const g = m`:host{display:inline-flex;max-inline-size:100%}:host([layout="horizontal"]){min-block-size:var(--calcite-size-xl)}:host([layout="vertical"]){min-inline-size:var(--calcite-size-xl);calcite-action-bar{min-block-size:min-content}}slot{display:flex;flex:1 1 auto;min-block-size:var(--calcite-size-xl);min-inline-size:0}slot.empty{display:none}.container{display:flex;flex-direction:column;block-size:100%;inline-size:100%;min-block-size:0;min-inline-size:0}.root{display:flex;flex-direction:row;align-items:stretch;flex:1;background-color:var(--calcite-color-surface-2);min-block-size:0;min-inline-size:0}.root.vertical-slider{flex-direction:column}.root.vertical-slider slot{flex-direction:column}.root.vertical-slider .separator{border-inline-end:none;border-block-end:solid var(--calcite-border-width-sm) var(--calcite-color-border-3)}calcite-action-bar{flex-shrink:0}:host([floating]) .root{border-radius:var(--calcite-action-bar-corner-radius, var(--calcite-corner-radius-sm));box-shadow:var(--calcite-action-bar-shadow, var(--calcite-shadow-md));overflow:hidden}calcite-action{align-self:center}:host([layout="vertical"]) calcite-action{margin-block-start:auto}:host([layout="vertical"]) calcite-action:last-of-type{margin-block-end:auto}.separator{border-inline-end:solid var(--calcite-border-width-sm) var(--calcite-color-border-3)}`;
|
|
9
9
|
class _ extends h {
|
|
10
10
|
constructor() {
|
|
11
|
-
super(), this._direction =
|
|
11
|
+
super(), this._direction = y(), this.messages = u({ blocking: !0 }), this._isPlaying = !1, this.autoDestroyDisabled = !1, this.disabled = !1, this.floating = !1, this.hideNextButton = !1, this.hidePlayButton = !1, this.hidePreviousButton = !1, this.icon = "list-rectangle", this.label = "", this.layout = "horizontal", this.loop = !1, this.playRate = 1e3, this.arcgisAnimate = i(), this.arcgisNext = i(), this.arcgisPause = i(), this.arcgisPlay = i(), this.arcgisPrevious = i(), this.arcgisPropertyChange = p()("layout", "loop", "playRate", "state"), this.arcgisSlottedElementChange = i(), this.listen("arcgisPropertyChange", () => this.requestUpdate());
|
|
12
12
|
}
|
|
13
13
|
static {
|
|
14
14
|
this.properties = { _isPlaying: 16, _slottedElement: 16, autoDestroyDisabled: 5, disabled: 5, floating: 7, hideNextButton: 5, hidePlayButton: 5, hidePreviousButton: 5, icon: 1, label: 1, layout: 3, loop: 5, playRate: 9, state: 32 };
|
|
@@ -56,24 +56,20 @@ class _ extends h {
|
|
|
56
56
|
return !!t && "disabled" in t;
|
|
57
57
|
}
|
|
58
58
|
_startPlayRate(t) {
|
|
59
|
-
|
|
60
|
-
if (this.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
this.arcgisAnimate.emit({ first: t }), this._startPlayRate(!1);
|
|
59
|
+
if (this._isPlaying) {
|
|
60
|
+
if (!this._slottedElement?.canNext && (this.loop || t))
|
|
61
|
+
this._slottedElement?.reset();
|
|
62
|
+
else if (this._slottedElement?.step("next"), this._slottedElement && !this._slottedElement?.canNext && !this.loop) {
|
|
63
|
+
this.pause();
|
|
64
|
+
return;
|
|
68
65
|
}
|
|
69
|
-
|
|
66
|
+
this.arcgisAnimate.emit({ first: t }), setTimeout(() => {
|
|
67
|
+
this._startPlayRate(!1);
|
|
68
|
+
}, this.playRate);
|
|
69
|
+
}
|
|
70
70
|
}
|
|
71
71
|
_renderActions() {
|
|
72
72
|
const t = this.state === "playing", e = this.layout === "vertical" && this._slottedElement?.localName === "arcgis-value-picker-slider", l = !this.hidePlayButton && s`<calcite-action alignment=center .disabled=${this.disabled || this._slottedElement && !this._slottedElement.canPlay} .icon=${t ? "pause" : "play"} .text=${t ? this.messages.pause : this.messages.play} title=${(t ? this.messages.pause : this.messages.play) ?? n} @click=${() => {
|
|
73
|
-
if (this._slottedElement && !this._slottedElement.canNext && !this.loop) {
|
|
74
|
-
this._slottedElement.reset(), this.play();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
73
|
t ? this.pause() : this.play();
|
|
78
74
|
}}></calcite-action>` || "", a = !this.hidePreviousButton && s`<calcite-action alignment=center .disabled=${this.disabled || t || this._slottedElement && !this._slottedElement.canPrevious} .icon=${this.layout === "horizontal" ? "chevron-left" : e ? "chevron-down" : "chevron-up"} .text=${this.messages.previous} title=${this.messages.previous ?? n} @click=${this.previous}></calcite-action>` || "", o = !this.hideNextButton && s`<calcite-action alignment=center .disabled=${this.disabled || t || this._slottedElement && !this._slottedElement.canNext} .icon=${this.layout === "horizontal" ? "chevron-right" : e ? "chevron-up" : "chevron-down"} .text=${this.messages.next} title=${this.messages.next ?? n} @click=${this.next}></calcite-action>` || "";
|
|
79
75
|
return (this._direction === "rtl" && this.layout === "horizontal" || e ? [l, o, a] : [l, a, o]).filter(Boolean);
|