@arcgis/portal-components 5.0.0-next.1 → 5.0.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.
- package/dist/cdn/3BOLT543.js +4 -0
- package/dist/cdn/5SZ4BUDH.js +4 -0
- package/dist/cdn/65ROHP2V.js +4 -0
- package/dist/cdn/6TKNVPCV.js +4 -0
- package/dist/cdn/{YKLWML27.js → BGIDIIMY.js} +2 -2
- package/dist/cdn/BSK7ZXY7.js +6 -0
- package/dist/cdn/J27ARXGH.js +4 -0
- package/dist/cdn/JM7MX5TZ.js +4 -0
- package/dist/cdn/LJ3I2F7B.js +4 -0
- package/dist/cdn/PDSESC3R.js +4 -0
- package/dist/cdn/PJNXGCYW.js +4 -0
- package/dist/cdn/PUEIILLK.js +4 -0
- package/dist/cdn/VQFGIEOF.js +4 -0
- package/dist/cdn/{36SCONH7.js → WJNAR5WR.js} +1 -1
- package/dist/cdn/YJPLZKMU.js +4 -0
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +71 -67
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +2 -2
- package/dist/chunks/runtime.js +2 -2
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +18 -17
- package/dist/components/arcgis-portal-classification-config/customElement.js +111 -103
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-form-element/customElement.d.ts +2 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +15 -15
- package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +51 -0
- package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
- package/dist/components/arcgis-portal-extent-picker/index.d.ts +8 -0
- package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
- package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +28 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +26 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +3 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
- package/dist/components/arcgis-portal-field-delete/customElement.d.ts +4 -2
- package/dist/components/arcgis-portal-field-delete/customElement.js +82 -75
- package/dist/docs/api.json +316 -38
- package/dist/docs/docs.json +310 -9
- package/dist/docs/vscode.html-custom-data.json +33 -1
- package/dist/docs/web-types.json +133 -2
- package/dist/index.d.ts +27 -5
- package/dist/index.js +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +7 -5
- package/dist/types/classification.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/lumina.d.ts +15 -6
- package/dist/types/preact.d.ts +16 -6
- package/dist/types/preact10.d.ts +17 -6
- package/dist/types/react.d.ts +17 -6
- package/dist/types/stencil.d.ts +15 -6
- package/dist/utils/commonFunctions.d.ts +2 -1
- package/dist/utils/style.d.ts +1 -0
- package/package.json +6 -6
- package/dist/cdn/3C7EKA4P.js +0 -4
- package/dist/cdn/M5TSWZEI.js +0 -4
- package/dist/cdn/MMZ2SLQM.js +0 -4
- package/dist/cdn/OHA5XBKC.js +0 -4
- package/dist/cdn/QXPXCLIB.js +0 -4
- package/dist/cdn/TBZVZ3NK.js +0 -4
- package/dist/cdn/UAMIU7I6.js +0 -4
- package/dist/cdn/UYHDCO7W.js +0 -4
- package/dist/cdn/VUHRSXSV.js +0 -4
- package/dist/cdn/YXRYHZH5.js +0 -6
|
@@ -1,135 +1,135 @@
|
|
|
1
1
|
import { c as g } from "../../chunks/runtime.js";
|
|
2
2
|
import { LitElement as b, nothing as C } from "@arcgis/lumina";
|
|
3
3
|
import { css as v, html as n } from "lit";
|
|
4
|
-
import { Task as E, TaskStatus as
|
|
5
|
-
import { createRef as
|
|
4
|
+
import { Task as E, TaskStatus as I } from "@lit/task";
|
|
5
|
+
import { createRef as y, ref as x } from "lit/directives/ref.js";
|
|
6
6
|
import { usePropertyChange as w } from "@arcgis/lumina/controllers";
|
|
7
|
-
import { getClosestElement as
|
|
8
|
-
import { u as
|
|
9
|
-
import { createArcadeExecutor as
|
|
10
|
-
import { u as
|
|
11
|
-
import { d as
|
|
12
|
-
import { watch as
|
|
7
|
+
import { getClosestElement as R } from "@arcgis/toolkit/dom";
|
|
8
|
+
import { u as $, c as S } from "../../chunks/loadClassificationData.js";
|
|
9
|
+
import { createArcadeExecutor as P } from "@arcgis/core/arcade.js";
|
|
10
|
+
import { u as V } from "../../chunks/useT9n.js";
|
|
11
|
+
import { d as f, a as d, g as O, r as u, c as A, b as F } from "../../chunks/common.js";
|
|
12
|
+
import { watch as _ } from "@arcgis/core/core/reactiveUtils.js";
|
|
13
13
|
import { r as D } from "../../chunks/requests.js";
|
|
14
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
15
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
16
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.100 */
|
|
17
17
|
async function T({
|
|
18
|
-
portalClassificationSchema:
|
|
18
|
+
portalClassificationSchema: a,
|
|
19
19
|
itemClassification: t
|
|
20
20
|
}) {
|
|
21
|
-
const i = Object.entries(
|
|
22
|
-
const r = await
|
|
23
|
-
return { [
|
|
21
|
+
const i = Object.entries(a.attributes).map(async ([s]) => {
|
|
22
|
+
const r = await q(s, a, t);
|
|
23
|
+
return { [s]: { enabled: r } };
|
|
24
24
|
}), e = await Promise.all(i);
|
|
25
25
|
return Object.assign({}, ...e);
|
|
26
26
|
}
|
|
27
|
-
async function
|
|
28
|
-
const e = t?.attributes?.[
|
|
27
|
+
async function q(a, t, i) {
|
|
28
|
+
const e = t?.attributes?.[a];
|
|
29
29
|
if (!e)
|
|
30
30
|
return !1;
|
|
31
|
-
const { isAttributeEnabled:
|
|
32
|
-
return
|
|
33
|
-
|
|
31
|
+
const { isAttributeEnabled: s } = e;
|
|
32
|
+
return s ? await h(
|
|
33
|
+
s,
|
|
34
34
|
JSON.stringify(t),
|
|
35
35
|
i
|
|
36
36
|
) : !0;
|
|
37
37
|
}
|
|
38
|
-
async function
|
|
39
|
-
portalClassificationSchema:
|
|
38
|
+
async function j({
|
|
39
|
+
portalClassificationSchema: a,
|
|
40
40
|
itemClassification: t
|
|
41
41
|
}) {
|
|
42
|
-
const i = Object.entries(
|
|
43
|
-
const r = await
|
|
44
|
-
return { [
|
|
42
|
+
const i = Object.entries(a.attributes).map(async ([s]) => {
|
|
43
|
+
const r = await M(s, a, t);
|
|
44
|
+
return { [s]: { valueExpressionResult: r } };
|
|
45
45
|
}), e = await Promise.all(i);
|
|
46
46
|
return Object.assign({}, ...e);
|
|
47
47
|
}
|
|
48
|
-
async function
|
|
49
|
-
const e = t.attributes[
|
|
48
|
+
async function M(a, t, i) {
|
|
49
|
+
const e = t.attributes[a];
|
|
50
50
|
if (!e)
|
|
51
|
-
throw Error(`Attribute ${
|
|
52
|
-
const
|
|
53
|
-
return r?.length ? r : o && Object.keys(o)?.length ? o :
|
|
54
|
-
|
|
51
|
+
throw Error(`Attribute ${a} not found in schema`);
|
|
52
|
+
const s = e.valueExpression, r = e.validValues, o = e.validValuesMap;
|
|
53
|
+
return r?.length ? r : o && Object.keys(o)?.length ? o : s ? await h(
|
|
54
|
+
s,
|
|
55
55
|
t,
|
|
56
56
|
i,
|
|
57
|
-
|
|
57
|
+
a
|
|
58
58
|
) : null;
|
|
59
59
|
}
|
|
60
|
-
async function
|
|
61
|
-
portalClassificationSchema:
|
|
60
|
+
async function N({
|
|
61
|
+
portalClassificationSchema: a,
|
|
62
62
|
itemClassification: t
|
|
63
63
|
}) {
|
|
64
|
-
const i = Object.entries(
|
|
64
|
+
const i = Object.entries(a.attributes).map(async ([s]) => {
|
|
65
65
|
const r = await H(
|
|
66
|
-
a,
|
|
67
66
|
s,
|
|
67
|
+
a,
|
|
68
68
|
t
|
|
69
69
|
);
|
|
70
|
-
return { [
|
|
70
|
+
return { [s]: { attributeValidationResult: r } };
|
|
71
71
|
}), e = await Promise.all(i);
|
|
72
72
|
return Object.assign({}, ...e);
|
|
73
73
|
}
|
|
74
|
-
async function H(
|
|
75
|
-
const e = t?.attributes?.[
|
|
74
|
+
async function H(a, t, i) {
|
|
75
|
+
const e = t?.attributes?.[a];
|
|
76
76
|
if (!e)
|
|
77
77
|
return null;
|
|
78
|
-
const
|
|
79
|
-
return
|
|
80
|
-
|
|
78
|
+
const s = e?.attributeValidation;
|
|
79
|
+
return s ? await h(
|
|
80
|
+
s,
|
|
81
81
|
JSON.stringify(t),
|
|
82
82
|
i,
|
|
83
|
-
|
|
83
|
+
a
|
|
84
84
|
) : null;
|
|
85
85
|
}
|
|
86
|
-
const
|
|
87
|
-
const i =
|
|
88
|
-
return i?.length ? await
|
|
86
|
+
const m = async (a, t) => {
|
|
87
|
+
const i = a?.bannerExpression;
|
|
88
|
+
return i?.length ? await h(
|
|
89
89
|
i,
|
|
90
|
-
|
|
90
|
+
a,
|
|
91
91
|
t
|
|
92
|
-
) :
|
|
93
|
-
},
|
|
94
|
-
const i = Object.entries(
|
|
92
|
+
) : U(a, t);
|
|
93
|
+
}, U = (a, t) => {
|
|
94
|
+
const i = Object.entries(a.attributes).sort(
|
|
95
95
|
([, o], [, l]) => (o?.bannerOrder ?? 0) - (l?.bannerOrder ?? 0)
|
|
96
|
-
), e = [],
|
|
96
|
+
), e = [], s = [];
|
|
97
97
|
return i.forEach(([o, l]) => {
|
|
98
98
|
const c = t?.[o];
|
|
99
99
|
c && l.bannerOrder && (e.push(
|
|
100
|
-
|
|
100
|
+
L({
|
|
101
101
|
elementType: l.uiElement ?? "",
|
|
102
102
|
selectionDisplayLabel: l.bannerLabel ?? "",
|
|
103
103
|
labelDelimiter: l.labelDelimiter ?? "",
|
|
104
104
|
classificationProp: c,
|
|
105
105
|
valueDelimiter: l.valueDelimiter ?? ""
|
|
106
106
|
})
|
|
107
|
-
),
|
|
107
|
+
), s.push(l.attributeDelimiter ?? ""));
|
|
108
108
|
}), e.length > 0 ? e.reduce(
|
|
109
|
-
(o, l, c) => c === 0 ? l : `${o}${
|
|
109
|
+
(o, l, c) => c === 0 ? l : `${o}${s[c - 1]}${l}`,
|
|
110
110
|
// avoiding to have delimiter at the start
|
|
111
111
|
""
|
|
112
112
|
) : "";
|
|
113
|
-
},
|
|
114
|
-
elementType:
|
|
113
|
+
}, L = ({
|
|
114
|
+
elementType: a,
|
|
115
115
|
selectionDisplayLabel: t,
|
|
116
116
|
labelDelimiter: i,
|
|
117
117
|
classificationProp: e,
|
|
118
|
-
valueDelimiter:
|
|
118
|
+
valueDelimiter: s
|
|
119
119
|
}) => {
|
|
120
|
-
const r =
|
|
120
|
+
const r = a.includes("multi") && e ? e.split("").join(s) : e;
|
|
121
121
|
return `${t}${i}${r}`;
|
|
122
122
|
};
|
|
123
|
-
async function
|
|
124
|
-
const
|
|
123
|
+
async function h(a, t, i, e = "") {
|
|
124
|
+
const s = {
|
|
125
125
|
schemaJsonString: typeof t == "string" ? t : JSON.stringify(t),
|
|
126
126
|
valueJsonString: JSON.stringify(i),
|
|
127
127
|
attributeId: e
|
|
128
128
|
};
|
|
129
|
-
return (await
|
|
129
|
+
return (await B(a)).execute(s);
|
|
130
130
|
}
|
|
131
|
-
async function
|
|
132
|
-
return await
|
|
131
|
+
async function B(a) {
|
|
132
|
+
return await P(a, {
|
|
133
133
|
variables: [
|
|
134
134
|
{
|
|
135
135
|
name: "schemaJsonString",
|
|
@@ -146,23 +146,23 @@ async function L(s) {
|
|
|
146
146
|
]
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
const
|
|
150
|
-
class
|
|
149
|
+
const J = v`:host{height:100%;box-sizing:border-box;display:flex;flex-direction:column}.header-section{padding:var(--calcite-spacing-sm)}.header-section__title-container{display:flex;align-items:center;justify-content:space-between}.header-section__title-text{margin:unset;font-weight:unset;font-size:var(--calcite-font-size)}.header-section__title-popover{padding:var(--calcite-spacing-md)}.form-section{display:flex;border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);padding:var(--calcite-spacing-sm);height:100%;overflow:hidden}.form-section__sidebar{flex:1;padding:var(--calcite-spacing-sm)}.form-section__main-content{flex:3;padding:var(--calcite-spacing-sm);overflow:auto}.danger{color:var(--calcite-color-status-danger)}.spacing-y{margin:var(--calcite-spacing-md) 0}`;
|
|
150
|
+
class W extends b {
|
|
151
151
|
constructor() {
|
|
152
|
-
super(), this.classificationModel =
|
|
152
|
+
super(), this.classificationModel = $(this), this.messages = V(), this.formMainContentRef = y(), this._classificationDataTask = S(this), this._formCreationTask = new E(this, {
|
|
153
153
|
task: async () => {
|
|
154
154
|
if (await this._classificationDataTask.taskComplete, !this.portalClassificationSchema || !this.portalItem)
|
|
155
155
|
throw new Error("Portal item and classification schema are required to render the form");
|
|
156
156
|
const t = this.portalItem.clone();
|
|
157
157
|
if (await t.load(), !this.primaryAttribute)
|
|
158
158
|
throw new Error("primaryAttribute is required but was undefined.");
|
|
159
|
-
this.existingClassification = !!t.classification, t.classification =
|
|
159
|
+
this.existingClassification = !!t.classification, t.classification = f(t.classification, this.primaryAttribute, this.portalClassificationSchema), t.classification && (t.classification.banner = await m(this.portalClassificationSchema, t.classification)), this.pendingPortalItem = t, this._itemClassificationWatchHandle && (this._itemClassificationWatchHandle.remove(), this.portalItem.removeHandles("arcgis-classification-config"), this._itemClassificationWatchHandle = void 0), this._itemClassificationWatchHandle = _(() => this.portalItem.classification, (i) => {
|
|
160
160
|
if (this.pendingPortalItem) {
|
|
161
161
|
const e = this.pendingPortalItem.clone();
|
|
162
162
|
e.load().then(() => {
|
|
163
163
|
e.classification = i, this.pendingPortalItem = e;
|
|
164
|
-
}).catch((
|
|
165
|
-
console.error(
|
|
164
|
+
}).catch((s) => {
|
|
165
|
+
console.error(s);
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}), this.portalItem.addHandles(this._itemClassificationWatchHandle, "arcgis-classification-config"), await this.evaluateAttributeExpressions(this.portalClassificationSchema, this.pendingPortalItem), this.pendingPortalItem.classification = d(this.pendingPortalItem.classification, this.attributeExpressionResults), this.existingClassification && this.validateForm();
|
|
@@ -171,7 +171,7 @@ class J extends b {
|
|
|
171
171
|
}), this.getFormDisplayOrder = (t) => this.portalClassificationSchema?.layouts.default.layoutElements[t].formDisplayOrder ?? 0, this.addEditInfoAttributes = () => {
|
|
172
172
|
if (!this.pendingPortalItem?.classification)
|
|
173
173
|
return {};
|
|
174
|
-
const t = structuredClone(this.pendingPortalItem.classification), i =
|
|
174
|
+
const t = structuredClone(this.pendingPortalItem.classification), i = O(this.pendingPortalItem, t);
|
|
175
175
|
return { ...t, ...i };
|
|
176
176
|
}, this.updateFavoriteClassification = (t) => {
|
|
177
177
|
this.favoriteClassifications = t;
|
|
@@ -179,17 +179,17 @@ class J extends b {
|
|
|
179
179
|
const i = t.classification;
|
|
180
180
|
if (this.selectedFavoriteClassificationName = t.name, this.pendingPortalItem) {
|
|
181
181
|
const e = this.pendingPortalItem.clone();
|
|
182
|
-
if (await e.load(), e.classification =
|
|
182
|
+
if (await e.load(), e.classification = u(this.portalClassificationSchema, i), !this.portalClassificationSchema)
|
|
183
183
|
return;
|
|
184
184
|
await this.evaluateAttributeExpressions(this.portalClassificationSchema, e), e.classification = d(e.classification, this.attributeExpressionResults), this.pendingPortalItem = e;
|
|
185
185
|
}
|
|
186
|
-
}, this.existingClassification = !1, this.portalClassificationSchema = this.classificationModel.portalClassificationSchema, this.primaryAttribute = this.classificationModel.primaryAttribute, this.attributeExpressionResults = /* @__PURE__ */ new Map(), this.formValidationErrors = [], this.remoteValidationErrors = "", this.canUserConfigureClassification = !0, this.favoriteClassifications = [], this.status = this.classificationModel.status, this.values = {}, this.valid = !1, this.autoDestroyDisabled = !1, this.arcgisPropertyChange = w()("status", "values", "valid");
|
|
186
|
+
}, this.existingClassification = !1, this.portalClassificationSchema = this.classificationModel.portalClassificationSchema, this.primaryAttribute = this.classificationModel.primaryAttribute, this.attributeExpressionResults = /* @__PURE__ */ new Map(), this.formValidationErrors = [], this.remoteValidationErrors = "", this.canUserConfigureClassification = !0, this.favoriteClassifications = [], this.isRequiredErrors = /* @__PURE__ */ new Set(), this.status = this.classificationModel.status, this.values = {}, this.valid = !1, this.autoDestroyDisabled = !1, this.arcgisPropertyChange = w()("status", "values", "valid");
|
|
187
187
|
}
|
|
188
188
|
static {
|
|
189
|
-
this.properties = { existingClassification: 16, portalClassificationSchema: 16, primaryAttribute: 16, attributeExpressionResults: 16, formValidationErrors: 16, itemClassification: 16, pendingPortalItem: 16, selectedCategory: 16, remoteValidationErrors: 16, canUserConfigureClassification: 16, favoriteClassifications: 16, selectedFavoriteClassificationName: 16, portalItem: 0, status: 35, values: [1, { type: Object }], valid: 7, autoDestroyDisabled: 5 };
|
|
189
|
+
this.properties = { existingClassification: 16, portalClassificationSchema: 16, primaryAttribute: 16, attributeExpressionResults: 16, formValidationErrors: 16, itemClassification: 16, pendingPortalItem: 16, selectedCategory: 16, remoteValidationErrors: 16, canUserConfigureClassification: 16, favoriteClassifications: 16, selectedFavoriteClassificationName: 16, isRequiredErrors: 16, portalItem: 0, status: 35, values: [1, { type: Object }], valid: 7, autoDestroyDisabled: 5 };
|
|
190
190
|
}
|
|
191
191
|
static {
|
|
192
|
-
this.styles =
|
|
192
|
+
this.styles = J;
|
|
193
193
|
}
|
|
194
194
|
async destroy() {
|
|
195
195
|
await this.manager.destroy();
|
|
@@ -199,7 +199,7 @@ class J extends b {
|
|
|
199
199
|
this.pendingPortalItem = this.portalItem?.clone(), this.portalClassificationSchema && this.pendingPortalItem && (await this.evaluateAttributeExpressions(this.portalClassificationSchema, this.pendingPortalItem), this.pendingPortalItem.classification = d(this.pendingPortalItem.classification, this.attributeExpressionResults), this.validateForm());
|
|
200
200
|
else if (this.portalItem && this.primaryAttribute && this.portalClassificationSchema) {
|
|
201
201
|
const t = this.portalItem.clone();
|
|
202
|
-
await t.load(), this.pendingPortalItem = this.portalItem?.clone(), this.pendingPortalItem.classification =
|
|
202
|
+
await t.load(), this.pendingPortalItem = this.portalItem?.clone(), this.pendingPortalItem.classification = f(t.classification, this.primaryAttribute, this.portalClassificationSchema), this.portalClassificationSchema && this.pendingPortalItem && (await this.evaluateAttributeExpressions(this.portalClassificationSchema, this.pendingPortalItem), this.pendingPortalItem.classification = d(this.pendingPortalItem.classification, this.attributeExpressionResults));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
async validateForm() {
|
|
@@ -229,28 +229,28 @@ class J extends b {
|
|
|
229
229
|
(t.has("formValidationErrors") || t.has("remoteValidationErrors")) && (this.valid = !this.formValidationErrors.length && !this.remoteValidationErrors);
|
|
230
230
|
}
|
|
231
231
|
loaded() {
|
|
232
|
-
const t =
|
|
232
|
+
const t = R(this.el, "form");
|
|
233
233
|
t && (this.listenOn(t, "formdata", this.updateFormData), this.listenOn(t, "submit", this.handleFormSubmit)), this.listen("submit", this.handleFormSubmit);
|
|
234
234
|
}
|
|
235
235
|
async updateClassificationProperty(t) {
|
|
236
236
|
if (!this.pendingPortalItem || !this.portalClassificationSchema)
|
|
237
237
|
return;
|
|
238
238
|
const i = this.pendingPortalItem.clone();
|
|
239
|
-
await i.load(), Object.entries(t ?? {}).forEach(([e,
|
|
239
|
+
await i.load(), Object.entries(t ?? {}).forEach(([e, s]) => {
|
|
240
240
|
if (e === this.primaryAttribute) {
|
|
241
|
-
let r =
|
|
242
|
-
r =
|
|
241
|
+
let r = F(s, i.classification, this.primaryAttribute);
|
|
242
|
+
r = u(this.portalClassificationSchema, r), i.classification = r;
|
|
243
243
|
} else {
|
|
244
244
|
const r = new Map(Object.entries(i.classification ?? {}));
|
|
245
|
-
if (
|
|
245
|
+
if (s === void 0 || s === "" || Array.isArray(s) && s.length === 0)
|
|
246
246
|
r.delete(e);
|
|
247
|
-
else if (r.set(e,
|
|
247
|
+
else if (r.set(e, s), e === "fgi" && !r.has("fgiOptions")) {
|
|
248
248
|
const o = this.portalClassificationSchema?.attributes?.fgiOptions?.defaultValue ?? [];
|
|
249
249
|
r.set("fgiOptions", Array.isArray(o) ? o : [o]);
|
|
250
250
|
}
|
|
251
251
|
i.classification = Object.fromEntries(r);
|
|
252
252
|
}
|
|
253
|
-
}), i.classification && !i.classification.fgi && delete i.classification.fgiOptions, await this.evaluateAttributeExpressions(this.portalClassificationSchema, i), i.classification = d(i.classification, this.attributeExpressionResults), i.classification && (i.classification.banner = await
|
|
253
|
+
}), i.classification && !i.classification.fgi && delete i.classification.fgiOptions, await this.evaluateAttributeExpressions(this.portalClassificationSchema, i), i.classification = d(i.classification, this.attributeExpressionResults), i.classification && (i.classification.banner = await m(this.portalClassificationSchema, i.classification)), this.pendingPortalItem = i, this.existingClassification && this.validateForm(), t && "classification" in t && this.updateIsRequiredErrors();
|
|
254
254
|
}
|
|
255
255
|
handleCategorySelectChange(t) {
|
|
256
256
|
this.selectedCategory = t.target.selectedItems[0].value;
|
|
@@ -259,35 +259,41 @@ class J extends b {
|
|
|
259
259
|
const e = await T({
|
|
260
260
|
portalClassificationSchema: t,
|
|
261
261
|
itemClassification: i.classification
|
|
262
|
-
}),
|
|
262
|
+
}), s = await j({
|
|
263
263
|
portalClassificationSchema: t,
|
|
264
264
|
itemClassification: i.classification
|
|
265
|
-
}), r = await
|
|
265
|
+
}), r = await N({
|
|
266
266
|
portalClassificationSchema: t,
|
|
267
267
|
itemClassification: i.classification
|
|
268
268
|
});
|
|
269
269
|
Object.keys(t.attributes).forEach((o) => {
|
|
270
|
-
const l = e[o]?.enabled ?? !0, c =
|
|
270
|
+
const l = e[o]?.enabled ?? !0, c = s[o]?.valueExpressionResult, p = r[o]?.attributeValidationResult;
|
|
271
271
|
this.attributeExpressionResults.set(o, { enabled: l, valueExpressionResult: c, attributeValidationResult: p });
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
|
-
|
|
275
|
-
const t =
|
|
274
|
+
updateIsRequiredErrors() {
|
|
275
|
+
const t = /* @__PURE__ */ new Set();
|
|
276
276
|
Object.entries(this.portalClassificationSchema?.attributes ?? {})?.forEach(([i, e]) => {
|
|
277
|
-
e.isRequired &&
|
|
277
|
+
e.isRequired && !this.pendingPortalItem?.classification?.[i] && this.pendingPortalItem?.classification?.[i] !== 0 && t.add(i);
|
|
278
|
+
}), this.isRequiredErrors = t;
|
|
279
|
+
}
|
|
280
|
+
updateFormValidationErrors(t = !1) {
|
|
281
|
+
const i = [];
|
|
282
|
+
Object.entries(this.portalClassificationSchema?.attributes ?? {})?.forEach(([e, s]) => {
|
|
283
|
+
s.isRequired && /**
|
|
278
284
|
* Because of the logic in updateClassificationProperty (we delete keys instead of setting falsy values),
|
|
279
285
|
* we can assume that the classification property will not have valid falsy values beyond zero.
|
|
280
286
|
*/
|
|
281
|
-
!this.pendingPortalItem?.classification?.[
|
|
282
|
-
attribute:
|
|
287
|
+
!this.pendingPortalItem?.classification?.[e] && this.pendingPortalItem?.classification?.[e] !== 0 && (!t || this.isRequiredErrors.has(e)) && i.push({
|
|
288
|
+
attribute: s.label,
|
|
283
289
|
reason: this.messages.isrequired ?? "is required",
|
|
284
|
-
category:
|
|
285
|
-
}), this.attributeExpressionResults.get(
|
|
286
|
-
attribute:
|
|
287
|
-
reason: this.attributeExpressionResults.get(
|
|
288
|
-
category:
|
|
290
|
+
category: s.attributeCategory
|
|
291
|
+
}), this.attributeExpressionResults.get(e)?.attributeValidationResult && i.push({
|
|
292
|
+
attribute: s.label,
|
|
293
|
+
reason: this.attributeExpressionResults.get(e)?.attributeValidationResult ?? "",
|
|
294
|
+
category: s.attributeCategory
|
|
289
295
|
});
|
|
290
|
-
}), this.formValidationErrors =
|
|
296
|
+
}), this.formValidationErrors = i;
|
|
291
297
|
}
|
|
292
298
|
async updateRemoteValidationErrors() {
|
|
293
299
|
if (!this.pendingPortalItem?.classification)
|
|
@@ -301,13 +307,13 @@ class J extends b {
|
|
|
301
307
|
this.remoteValidationErrors = t;
|
|
302
308
|
}
|
|
303
309
|
async handleFormSubmit(t) {
|
|
304
|
-
this.validateForm(), this.formMainContentRef.value?.scrollIntoView();
|
|
310
|
+
this.validateForm(), this.updateIsRequiredErrors(), this.formMainContentRef.value?.scrollIntoView();
|
|
305
311
|
}
|
|
306
312
|
updateFormData(t) {
|
|
307
313
|
const i = t.formData;
|
|
308
314
|
let e = this.addEditInfoAttributes();
|
|
309
|
-
e = d(e, this.attributeExpressionResults), Object.entries(e ?? {}).forEach(([
|
|
310
|
-
i.set(
|
|
315
|
+
e = d(e, this.attributeExpressionResults), Object.entries(e ?? {}).forEach(([s, r]) => {
|
|
316
|
+
i.set(s, r);
|
|
311
317
|
});
|
|
312
318
|
}
|
|
313
319
|
renderCategoryTabs() {
|
|
@@ -327,7 +333,7 @@ class J extends b {
|
|
|
327
333
|
renderFavoriteClassification() {
|
|
328
334
|
const t = this.portalClassificationSchema?.attributeCategories?.[0] ?? "Default";
|
|
329
335
|
return this.selectedCategory = this.portalClassificationSchema?.attributeCategories?.length ? this.selectedCategory : "Default", this.selectedCategory === t ? n`<arcgis-portal-classification-favorite .portalItem=${this.pendingPortalItem ?? this.portalItem} .classificationValue=${this.pendingPortalItem?.classification} .favoriteClassifications=${this.favoriteClassifications} .selectedFavoriteClassificationName=${this.selectedFavoriteClassificationName} .attributeExpressionResults=${this.attributeExpressionResults} .resetFavoriteClassification=${(i) => this.updateFavoriteClassification(i)} .updateClassificationData=${async (i) => {
|
|
330
|
-
await this.updateClassificationData(i), this.updateFormValidationErrors();
|
|
336
|
+
await this.updateClassificationData(i), this.updateFormValidationErrors(), this.updateIsRequiredErrors();
|
|
331
337
|
}}></arcgis-portal-classification-favorite>` : null;
|
|
332
338
|
}
|
|
333
339
|
renderForm() {
|
|
@@ -340,8 +346,10 @@ class J extends b {
|
|
|
340
346
|
return n`${this.renderValidationErrors()}${this.renderFavoriteClassification()}${t.filter(([, { attributeCategory: i }]) => this.selectedCategory === i || !i).map(([i, e]) => {
|
|
341
347
|
if (this.attributeExpressionResults.get(i)?.enabled === !1)
|
|
342
348
|
return null;
|
|
343
|
-
const
|
|
344
|
-
return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${e} .value=${
|
|
349
|
+
const s = this.pendingPortalItem?.classification?.[i];
|
|
350
|
+
return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${e} .value=${s} @arcgisAttributeValueChange=${async (r) => {
|
|
351
|
+
await this.updateClassificationProperty(r.detail), e.isRequired && !r.detail[i] ? this.isRequiredErrors.add(i) : this.isRequiredErrors = new Set(Array.from(this.isRequiredErrors).filter((o) => o !== i)), this.updateFormValidationErrors(!0);
|
|
352
|
+
}} .renderingInfo=${this.attributeExpressionResults.get(i)} .isRequiredErrors=${this.isRequiredErrors}></arcgis-portal-classification-form-element>`;
|
|
345
353
|
})}`;
|
|
346
354
|
}
|
|
347
355
|
});
|
|
@@ -356,11 +364,11 @@ class J extends b {
|
|
|
356
364
|
return this.portalItem ? this._classificationDataTask.render({
|
|
357
365
|
pending: () => n`<calcite-loader .label=${this.messages.loading ?? "loading"}></calcite-loader>`,
|
|
358
366
|
error: () => this.renderNotice(this.messages.anerroroccurred ?? "An error has occurred.", "danger"),
|
|
359
|
-
complete: () => this.portalItem ? this.canUserConfigureClassification ? this.portalItem.portal.hasClassificationSchema ? n`<div class="header-section" role=region aria-label=${this.messages.documentbannerpreview ?? "documentbannerpreview" ?? C}><div class="header-section__title-container"><h2 class="header-section__title-text">${this.messages.documentbannerpreview ?? "documentbannerpreview"}</h2>${this.renderHelpTooltip()}</div>${this._formCreationTask.status ===
|
|
367
|
+
complete: () => this.portalItem ? this.canUserConfigureClassification ? this.portalItem.portal.hasClassificationSchema ? n`<div class="header-section" role=region aria-label=${this.messages.documentbannerpreview ?? "documentbannerpreview" ?? C}><div class="header-section__title-container"><h2 class="header-section__title-text">${this.messages.documentbannerpreview ?? "documentbannerpreview"}</h2>${this.renderHelpTooltip()}</div>${this._formCreationTask.status === I.COMPLETE && n`<arcgis-portal-classification-banner .portalItem=${this.pendingPortalItem ?? this.portalItem} variant=preview .missingExistingClassification=${!this.existingClassification}></arcgis-portal-classification-banner>` || ""}</div><div class="form-section">${this.portalClassificationSchema?.attributeCategories?.length && n`<div class="form-section__sidebar">${this.renderCategoryTabs()}</div>` || ""}<div class="form-section__main-content" ${x(this.formMainContentRef)}>${this.renderForm()}</div></div>` : this.renderNotice(this.messages.missingclassificationschema ?? "Portal is missing classification schema.") : this.renderNotice(this.messages.userconfigurepermissionrequired ?? "User configuration permission is required.") : this.renderNotice(this.messages.portalitemrequired ?? "Portal item is required.")
|
|
360
368
|
}) : this.renderNotice(this.messages.portalitemrequired ?? "Portal item is required.");
|
|
361
369
|
}
|
|
362
370
|
}
|
|
363
|
-
g("arcgis-portal-classification-config",
|
|
371
|
+
g("arcgis-portal-classification-config", W);
|
|
364
372
|
export {
|
|
365
|
-
|
|
373
|
+
W as ArcgisPortalClassificationConfig
|
|
366
374
|
};
|
|
@@ -7,7 +7,7 @@ import { u as d, r as v } from "../../chunks/requests.js";
|
|
|
7
7
|
import { g as h } from "../../chunks/common.js";
|
|
8
8
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
9
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
10
|
+
v5.0.0-next.100 */
|
|
11
11
|
const m = r`.select-favorite-label{display:flex;justify-content:space-between;align-items:center}.favorite-actions{display:flex;justify-content:flex-end;gap:1.5rem;align-items:center}.classification-favorite-dialog{--calcite-dialog-content-space: 0;--calcite-dialog-background-color: "var(--calcite-color-foreground-2)"}.save-new-favorite-button{display:flex;justify-content:flex-end;margin-top:.25rem;margin-bottom:1rem}.classification-favorite-item{display:flex;justify-content:space-between;padding-top:.5rem;padding-bottom:.5rem;border-bottom:1px solid var(--calcite-color-border-1)}.classification-favorite-list,.classification-favorite-input-section{margin:1.75rem 1rem}`;
|
|
12
12
|
class C extends n {
|
|
13
13
|
constructor() {
|
|
@@ -114,7 +114,7 @@ class C extends n {
|
|
|
114
114
|
return this.newFavoriteClassificationName ? this.hasDuplicatedClassificationError ? this.messages.duplicatedClassificationError : "" : this.messages.emptyFavoriteError;
|
|
115
115
|
}
|
|
116
116
|
render() {
|
|
117
|
-
return e`<div>${this.favoriteClassifications.length > 0 ? e`<div><calcite-label><div class="select-favorite-label">${this.messages.applyClassificationFavoriteLabel}<calcite-link @click=${() => this.showManageClassificationDialog = !0}>${this.messages.manageClassificationFavoriteBtn}</calcite-link></div><calcite-combobox label=select-calcite-combobox selection-mode=single .placeholder=${this.messages.selectFavoritePlaceholder} placeholder-icon=folder-star @calciteComboboxChange=${this.selectFavoriteClassification} .status=${this.hasUpdateError ? "invalid" : "idle"} .validationIcon=${this.hasUpdateError ? "exclamation-mark-triangle" :
|
|
117
|
+
return e`<div>${this.favoriteClassifications.length > 0 ? e`<div><calcite-label><div class="select-favorite-label">${this.messages.applyClassificationFavoriteLabel}<calcite-link @click=${() => this.showManageClassificationDialog = !0}>${this.messages.manageClassificationFavoriteBtn}</calcite-link></div><calcite-combobox label=select-calcite-combobox selection-mode=single .placeholder=${this.messages.selectFavoritePlaceholder} placeholder-icon=folder-star @calciteComboboxChange=${this.selectFavoriteClassification} .status=${this.hasUpdateError ? "invalid" : "idle"} .validationIcon=${this.hasUpdateError ? "exclamation-mark-triangle" : void 0} .validationMessage=${this.hasUpdateError ? this.messages.updateWarning : ""}>${o(this.favoriteClassifications, ({ name: i }) => i, ({ name: i }) => e`<calcite-combobox-item .selected=${this.selectedFavoriteClassificationName === i} icon=folder-star .value=${i} .heading=${i}></calcite-combobox-item>`)}</calcite-combobox></calcite-label><div class="favorite-actions"><calcite-link icon-start=refresh @click=${this.updateFavoriteClassification}>${this.messages.updateClassificationFavoriteBtn}</calcite-link><calcite-link icon-start=star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationBtn}</calcite-link></div></div>` : e`<div class="save-new-favorite-button"><calcite-link icon-start=folder-star @click=${this.onOpenFavoriteClassificationModal}>${this.messages.saveNewClassificationFavoriteBtn}</calcite-link></div>`}<calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.manageClassificationFavoriteLabel} .open=${this.showManageClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${() => this.showManageClassificationDialog = !1}><calcite-list class="classification-favorite-list" .label=${this.messages.classificationFavoriteListLabel ?? "Classification Favorite list label"} selection-appearance=border selection-mode=single-persist>${o(this.favoriteClassifications, ({ name: i }) => i, ({ name: i }) => e`<calcite-list-item .label=${i} .value=${i} class="classification-favorite-item"><div slot=content-end><calcite-icon icon=trash scale=s @click=${async () => await this.removeFavoriteClassification(i)}></calcite-icon></div></calcite-list-item>`)}</calcite-list><calcite-button slot=footer-end scale=l @click=${() => this.showManageClassificationDialog = !1}><div>${this.messages.favoriteClassificationBtnDone}</div></calcite-button></calcite-dialog><calcite-dialog class="classification-favorite-dialog" overlay-positioning=fixed .heading=${this.messages.addFavoriteDialogHeading} .open=${this.showSaveClassificationDialog} modal placement=center scale=m outside-close-disabled @calciteDialogClose=${() => this.showSaveClassificationDialog = !1}><calcite-label class="classification-favorite-input-section">${this.messages.addClassificationFavorite}<calcite-input id=classification-favorite-name name=classification-favorite-name scale=m .value=${this.newFavoriteClassificationName} @calciteInputInput=${this.changeFavoriteClassificationName} .status=${!this.newFavoriteClassificationName || this.hasDuplicatedClassificationError ? "invalid" : "idle"} validation-icon=exclamation-mark-triangle .validationMessage=${this.getValidationMessage()}></calcite-input></calcite-label><calcite-button scale=l slot=footer-end @click=${this.saveNewFavoriteClassification}>${this.messages.favoriteClassificationBtnDone}</calcite-button></calcite-dialog></div>`;
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
c("arcgis-portal-classification-favorite", C);
|
|
@@ -12,7 +12,8 @@ export declare class ArcgisPortalClassificationFormElement extends LitElement {
|
|
|
12
12
|
attributeKey: string;
|
|
13
13
|
attribute: ClassificationSchema["attributes"][string];
|
|
14
14
|
value: unknown;
|
|
15
|
-
renderingInfo
|
|
15
|
+
renderingInfo?: Pick<NonNullable<ReturnType<AttributeExpressionResults["get"]>>, "attributeValidationResult" | "valueExpressionResult">;
|
|
16
|
+
isRequiredErrors: Set<string>;
|
|
16
17
|
/** The attribute value has changed. */
|
|
17
18
|
readonly arcgisAttributeValueChange: TargetedEvent<this, Record<string, unknown>>;
|
|
18
19
|
}
|
|
@@ -5,28 +5,28 @@ import { css as d, html as i } from "lit";
|
|
|
5
5
|
import { u as h } from "../../chunks/useT9n.js";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.100 */
|
|
9
9
|
const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
10
10
|
function l(n, e) {
|
|
11
11
|
return n.uiElement === e;
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class g extends c {
|
|
14
14
|
constructor() {
|
|
15
|
-
super(...arguments), this.messages = h(), this.arcgisAttributeValueChange = b();
|
|
15
|
+
super(...arguments), this.messages = h(), this.isRequiredErrors = /* @__PURE__ */ new Set(), this.arcgisAttributeValueChange = b();
|
|
16
16
|
}
|
|
17
17
|
static {
|
|
18
|
-
this.properties = { validationMsg: 16, attributeKey: 1, attribute: 0, value: 0, renderingInfo: 0 };
|
|
18
|
+
this.properties = { validationMsg: 16, attributeKey: 1, attribute: 0, value: 0, renderingInfo: 0, isRequiredErrors: 0 };
|
|
19
19
|
}
|
|
20
20
|
static {
|
|
21
21
|
this.styles = m;
|
|
22
22
|
}
|
|
23
23
|
willUpdate(e) {
|
|
24
|
-
e.has("renderingInfo") && (this.validationMsg = this._getValidationMessage());
|
|
24
|
+
(e.has("renderingInfo") || e.has("isRequiredErrors")) && (this.validationMsg = this._getValidationMessage());
|
|
25
25
|
}
|
|
26
26
|
_getValidationMessage() {
|
|
27
|
-
if (this.renderingInfo
|
|
27
|
+
if (this.renderingInfo?.attributeValidationResult)
|
|
28
28
|
return this.renderingInfo.attributeValidationResult;
|
|
29
|
-
if (this.
|
|
29
|
+
if (this.isRequiredErrors.has(this.attributeKey))
|
|
30
30
|
return this.messages.requiredfield ?? "This is a required field.";
|
|
31
31
|
}
|
|
32
32
|
renderCheckbox() {
|
|
@@ -45,16 +45,16 @@ class v extends c {
|
|
|
45
45
|
return l(this.attribute, "single-select") ? i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox selection-mode=single id=${this.attributeKey ?? a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${(e) => this.arcgisAttributeValueChange.emit({ [this.attributeKey]: e.target.value })} .placeholder=${this.attribute.description ?? this.messages.selectanoption} .required=${this.attribute.isRequired} .status=${this.validationMsg ? "invalid" : "valid"} overlay-positioning=fixed validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value} data-testid=${`single-select-${this.attributeKey}`}>${this._renderSingleSelectComboboxOptions()}</calcite-combobox></calcite-label>` : null;
|
|
46
46
|
}
|
|
47
47
|
_renderSingleSelectComboboxOptions() {
|
|
48
|
-
if (!Array.isArray(this.renderingInfo
|
|
48
|
+
if (!Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
49
49
|
return;
|
|
50
50
|
const e = this.value;
|
|
51
|
-
return u(this.renderingInfo
|
|
51
|
+
return u(this.renderingInfo?.valueExpressionResult, (t) => t.label, (t) => i`<calcite-combobox-item .selected=${e === t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`);
|
|
52
52
|
}
|
|
53
53
|
_renderComboboxOptions() {
|
|
54
|
-
if (!Array.isArray(this.renderingInfo
|
|
54
|
+
if (!Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
55
55
|
return;
|
|
56
56
|
const e = this.value;
|
|
57
|
-
return this.renderingInfo
|
|
57
|
+
return this.renderingInfo?.valueExpressionResult.map((t) => i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`);
|
|
58
58
|
}
|
|
59
59
|
renderMultiSelect() {
|
|
60
60
|
return l(this.attribute, "multi-select") ? i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey ?? a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${(e) => {
|
|
@@ -65,10 +65,10 @@ class v extends c {
|
|
|
65
65
|
}} .placeholder=${this.attribute.description ?? this.messages.selectoptions} .required=${this.attribute.isRequired} .status=${this.validationMsg ? "invalid" : "valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}>${this._renderComboboxOptions()}</calcite-combobox></calcite-label>` : null;
|
|
66
66
|
}
|
|
67
67
|
_renderGroupedComboboxOptions() {
|
|
68
|
-
if (!this.renderingInfo
|
|
68
|
+
if (!this.renderingInfo?.valueExpressionResult || Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
69
69
|
return;
|
|
70
70
|
const e = this.value;
|
|
71
|
-
return Object.entries(this.renderingInfo
|
|
71
|
+
return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t, s]) => i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${s.map((r) => i`<calcite-combobox-item .selected=${e?.includes(r.value)} .heading=${r.label} .value=${r.value} data-testid=${`grouped-combobox-item-${r.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`);
|
|
72
72
|
}
|
|
73
73
|
renderMultiGroupedSelectNested() {
|
|
74
74
|
return l(this.attribute, "multi-grouped-select-nested") ? i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey ?? a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${(e) => {
|
|
@@ -97,7 +97,7 @@ class v extends c {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
o("arcgis-portal-classification-form-element",
|
|
100
|
+
o("arcgis-portal-classification-form-element", g);
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
g as ArcgisPortalClassificationFormElement
|
|
103
103
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import { default as Extent } from '@arcgis/core/geometry/Extent.js';
|
|
3
|
+
import { PublicLitElement as LitElement, TargetedEvent, JsxNode } from '@arcgis/lumina';
|
|
4
|
+
import { default as Portal } from '@arcgis/core/portal/Portal.js';
|
|
5
|
+
|
|
6
|
+
export type ExtentValue = {
|
|
7
|
+
ymin: string;
|
|
8
|
+
ymax: string;
|
|
9
|
+
xmin: string;
|
|
10
|
+
xmax: string;
|
|
11
|
+
};
|
|
12
|
+
export type ExtentObj = {
|
|
13
|
+
extent: ExtentValue;
|
|
14
|
+
};
|
|
15
|
+
/** To select extent value from a map or by entering coordinates. */
|
|
16
|
+
export declare class ArcgisPortalExtentPicker extends LitElement {
|
|
17
|
+
/**
|
|
18
|
+
* if true, open the dialog
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
active: boolean;
|
|
23
|
+
/** current extent value */
|
|
24
|
+
extentValue?: ExtentValue;
|
|
25
|
+
/** Optional; if passed, use the itemId to load the Portal item */
|
|
26
|
+
itemId?: string;
|
|
27
|
+
/** Optional; Portal instance */
|
|
28
|
+
portal?: Portal;
|
|
29
|
+
/** Optional; URL of the extent service, used to initialize TileLayer */
|
|
30
|
+
extentService?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional; if true, show only the content without the calcite-dialog wrapper
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
contentOnly: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional; if true, display texts that are for areas rather than the default extent texts
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
isArea: boolean;
|
|
43
|
+
/** Returns the current extent value */
|
|
44
|
+
getExtent(): ExtentObj;
|
|
45
|
+
/** Emitted when the extent value changes */
|
|
46
|
+
readonly arcgisExtentPickerChange: TargetedEvent<this, ExtentObj>;
|
|
47
|
+
/** Emitted when the dialog is closed */
|
|
48
|
+
readonly arcgisExtentPickerClose: TargetedEvent<this, void>;
|
|
49
|
+
/** Emitted when the save button is clicked */
|
|
50
|
+
readonly arcgisExtentPickerSave: TargetedEvent<this, ExtentObj>;
|
|
51
|
+
}
|