@arcgis/portal-components 5.0.0-next.79 → 5.0.0-next.80
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/3PLIPHN3.js +4 -0
- package/dist/cdn/{3DX537T6.js → 6VVNKH3C.js} +2 -2
- package/dist/cdn/BP374N4Z.js +4 -0
- package/dist/cdn/CWFDUEWC.js +4 -0
- package/dist/cdn/{6W2TW24S.js → EAQU436Q.js} +1 -1
- package/dist/cdn/FB3OEXTD.js +4 -0
- package/dist/cdn/IGTNTMJZ.js +4 -0
- package/dist/cdn/L7XZSKU5.js +4 -0
- package/dist/cdn/LJC3RJ32.js +4 -0
- package/dist/cdn/{SMJ76VUJ.js → Q5GZCFBS.js} +2 -2
- package/dist/cdn/{PCSZRBM6.js → RNZZASX2.js} +2 -2
- package/dist/cdn/{O4GBFABF.js → S4MD7LWI.js} +3 -3
- package/dist/cdn/SRAY4KFR.js +4 -0
- package/dist/cdn/TACZTOXO.js +4 -0
- package/dist/cdn/{G6NW27P4.js → XTIAGADP.js} +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.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 +1 -1
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
- 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.js +1 -1
- package/dist/docs/api.json +266 -2
- package/dist/docs/docs.json +267 -2
- package/dist/docs/vscode.html-custom-data.json +32 -0
- package/dist/docs/web-types.json +118 -1
- package/dist/index.d.ts +21 -0
- package/dist/index.js +1 -1
- package/dist/loader.js +6 -4
- package/dist/types/lumina.d.ts +8 -0
- package/dist/types/preact.d.ts +9 -0
- package/dist/types/preact10.d.ts +10 -0
- package/dist/types/react.d.ts +10 -0
- package/dist/types/stencil.d.ts +8 -0
- package/dist/utils/style.d.ts +1 -0
- package/package.json +3 -3
- package/dist/cdn/24DGNFDU.js +0 -4
- package/dist/cdn/4LA6DBZQ.js +0 -4
- package/dist/cdn/55K7F2TM.js +0 -4
- package/dist/cdn/7QVEOEKB.js +0 -4
- package/dist/cdn/RLMC5JTM.js +0 -4
- package/dist/cdn/WN3TZSCN.js +0 -4
package/dist/docs/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@arcgis/portal-components",
|
|
4
|
-
"version": "5.0.0-next.
|
|
4
|
+
"version": "5.0.0-next.80",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -235,6 +235,123 @@
|
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
237
|
},
|
|
238
|
+
{
|
|
239
|
+
"name": "arcgis-portal-extent-picker",
|
|
240
|
+
"description": "To select extent value from a map or by entering coordinates.\n--\n\n### Events\n- **arcgisExtentPickerChange** - Emitted when the extent value changes\n- **arcgisExtentPickerClose** - Emitted when the dialog is closed\n- **arcgisExtentPickerSave** - Emitted when the save button is clicked\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.\n- `getExtent(): ExtentObj` - Returns the current extent value",
|
|
241
|
+
"attributes": [
|
|
242
|
+
{
|
|
243
|
+
"name": "active",
|
|
244
|
+
"description": "if true, open the dialog",
|
|
245
|
+
"default": "false",
|
|
246
|
+
"value": {
|
|
247
|
+
"type": "boolean"
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "content-only",
|
|
252
|
+
"description": "Optional; if true, show only the content without the calcite-dialog wrapper",
|
|
253
|
+
"default": "false",
|
|
254
|
+
"value": {
|
|
255
|
+
"type": "boolean"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "extent-service",
|
|
260
|
+
"description": "Optional; URL of the extent service, used to initialize TileLayer",
|
|
261
|
+
"value": {
|
|
262
|
+
"type": "string"
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"name": "is-area",
|
|
267
|
+
"description": "Optional; if true, display texts that are for areas rather than the default extent texts",
|
|
268
|
+
"default": "false",
|
|
269
|
+
"value": {
|
|
270
|
+
"type": "boolean"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"name": "item-id",
|
|
275
|
+
"description": "Optional; if passed, use the itemId to load the Portal item",
|
|
276
|
+
"value": {
|
|
277
|
+
"type": "string"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
],
|
|
281
|
+
"events": [
|
|
282
|
+
{
|
|
283
|
+
"name": "arcgisExtentPickerChange",
|
|
284
|
+
"type": "{ extent: ExtentValue; }",
|
|
285
|
+
"description": "Emitted when the extent value changes"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "arcgisExtentPickerClose",
|
|
289
|
+
"type": "void",
|
|
290
|
+
"description": "Emitted when the dialog is closed"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "arcgisExtentPickerSave",
|
|
294
|
+
"type": "{ extent: ExtentValue; }",
|
|
295
|
+
"description": "Emitted when the save button is clicked"
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
"js": {
|
|
299
|
+
"properties": [
|
|
300
|
+
{
|
|
301
|
+
"name": "active",
|
|
302
|
+
"description": "if true, open the dialog",
|
|
303
|
+
"type": "boolean"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "contentOnly",
|
|
307
|
+
"description": "Optional; if true, show only the content without the calcite-dialog wrapper",
|
|
308
|
+
"type": "boolean"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "extentService",
|
|
312
|
+
"description": "Optional; URL of the extent service, used to initialize TileLayer",
|
|
313
|
+
"type": "string"
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "extentValue",
|
|
317
|
+
"description": "current extent value",
|
|
318
|
+
"type": "{\n ymin: string;\n ymax: string;\n xmin: string;\n xmax: string;\n}"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"name": "isArea",
|
|
322
|
+
"description": "Optional; if true, display texts that are for areas rather than the default extent texts",
|
|
323
|
+
"type": "boolean"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"name": "itemId",
|
|
327
|
+
"description": "Optional; if passed, use the itemId to load the Portal item",
|
|
328
|
+
"type": "string"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "portal",
|
|
332
|
+
"description": "Optional; Portal instance",
|
|
333
|
+
"type": "Portal"
|
|
334
|
+
}
|
|
335
|
+
],
|
|
336
|
+
"events": [
|
|
337
|
+
{
|
|
338
|
+
"name": "arcgisExtentPickerChange",
|
|
339
|
+
"type": "{ extent: ExtentValue; }",
|
|
340
|
+
"description": "Emitted when the extent value changes"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "arcgisExtentPickerClose",
|
|
344
|
+
"type": "void",
|
|
345
|
+
"description": "Emitted when the dialog is closed"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"name": "arcgisExtentPickerSave",
|
|
349
|
+
"type": "{ extent: ExtentValue; }",
|
|
350
|
+
"description": "Emitted when the save button is clicked"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
},
|
|
238
355
|
{
|
|
239
356
|
"name": "arcgis-portal-field-delete",
|
|
240
357
|
"description": "### Events\n- **arcgisBeforeDelete** - Emitted when the user initiates the delete process.\n- **arcgisBeforeModalClose** - Emitted before the modal is closed if the alert is handled in consumer.\n- **arcgisClose** - Emitted when the component is closed for any reason.\n- **arcgisFieldsDeleted** - Emitted when the field is successfully deleted.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ArcgisPortalClassificationBanner } from "./components/arcgis-porta
|
|
|
2
2
|
import type { ArcgisPortalClassificationConfig } from "./components/arcgis-portal-classification-config/index.js";
|
|
3
3
|
import type { ArcgisPortalClassificationFavorite } from "./components/arcgis-portal-classification-favorite/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFormElement } from "./components/arcgis-portal-classification-form-element/index.js";
|
|
5
|
+
import type { ArcgisPortalExtentPicker } from "./components/arcgis-portal-extent-picker/index.js";
|
|
5
6
|
import type { ArcgisPortalFieldDelete } from "./components/arcgis-portal-field-delete/index.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -23,6 +24,11 @@ export interface ArcgisPortalClassificationFormElementCustomEvent<T> extends Cus
|
|
|
23
24
|
target: HTMLArcgisPortalClassificationFormElementElement;
|
|
24
25
|
currentTarget: HTMLArcgisPortalClassificationFormElementElement;
|
|
25
26
|
}
|
|
27
|
+
export interface ArcgisPortalExtentPickerCustomEvent<T> extends CustomEvent<T> {
|
|
28
|
+
detail: T;
|
|
29
|
+
target: HTMLArcgisPortalExtentPickerElement;
|
|
30
|
+
currentTarget: HTMLArcgisPortalExtentPickerElement;
|
|
31
|
+
}
|
|
26
32
|
export interface ArcgisPortalFieldDeleteCustomEvent<T> extends CustomEvent<T> {
|
|
27
33
|
detail: T;
|
|
28
34
|
target: HTMLArcgisPortalFieldDeleteElement;
|
|
@@ -37,6 +43,7 @@ declare global {
|
|
|
37
43
|
"arcgis-portal-classification-config": HTMLArcgisPortalClassificationConfigElement;
|
|
38
44
|
"arcgis-portal-classification-favorite": HTMLArcgisPortalClassificationFavoriteElement;
|
|
39
45
|
"arcgis-portal-classification-form-element": HTMLArcgisPortalClassificationFormElementElement;
|
|
46
|
+
"arcgis-portal-extent-picker": HTMLArcgisPortalExtentPickerElement;
|
|
40
47
|
"arcgis-portal-field-delete": HTMLArcgisPortalFieldDeleteElement;
|
|
41
48
|
}
|
|
42
49
|
|
|
@@ -70,6 +77,20 @@ declare global {
|
|
|
70
77
|
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
71
78
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
72
79
|
}
|
|
80
|
+
interface HTMLArcgisPortalExtentPickerElementEventMap {
|
|
81
|
+
"arcgisExtentPickerChange": ArcgisPortalExtentPicker["arcgisExtentPickerChange"]["detail"];
|
|
82
|
+
"arcgisExtentPickerClose": ArcgisPortalExtentPicker["arcgisExtentPickerClose"]["detail"];
|
|
83
|
+
"arcgisExtentPickerSave": ArcgisPortalExtentPicker["arcgisExtentPickerSave"]["detail"];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface HTMLArcgisPortalExtentPickerElement extends ArcgisPortalExtentPicker {
|
|
87
|
+
addEventListener<K extends keyof HTMLArcgisPortalExtentPickerElementEventMap>(type: K, listener: (this: HTMLArcgisPortalExtentPickerElement, ev: ArcgisPortalExtentPickerCustomEvent<HTMLArcgisPortalExtentPickerElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
88
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
89
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
90
|
+
removeEventListener<K extends keyof HTMLArcgisPortalExtentPickerElementEventMap>(type: K, listener: (this: HTMLArcgisPortalExtentPickerElement, ev: ArcgisPortalExtentPickerCustomEvent<HTMLArcgisPortalExtentPickerElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
91
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
92
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
93
|
+
}
|
|
73
94
|
interface HTMLArcgisPortalFieldDeleteElementEventMap {
|
|
74
95
|
"arcgisBeforeDelete": ArcgisPortalFieldDelete["arcgisBeforeDelete"]["detail"];
|
|
75
96
|
"arcgisBeforeModalClose": ArcgisPortalFieldDelete["arcgisBeforeModalClose"]["detail"];
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { g as a, s as t } from "./chunks/runtime.js";
|
|
|
2
2
|
import { c as o, a as r } from "./chunks/fieldAddDelete.js";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
5
|
+
v5.0.0-next.80 */
|
|
6
6
|
export {
|
|
7
7
|
o as canAddField,
|
|
8
8
|
r as canDeleteField,
|
package/dist/loader.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as e } from "./chunks/runtime.js";
|
|
2
2
|
import { makeDefineCustomElements as t } from "@arcgis/lumina";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
6
|
-
const
|
|
5
|
+
v5.0.0-next.80 */
|
|
6
|
+
const r = t(e, {
|
|
7
7
|
"arcgis-portal-classification-banner": [() => import("./components/arcgis-portal-classification-banner/customElement.js"), "autoDestroyDisabled,missingExistingClassification,portalItem:,validationErrors,variant;destroy"],
|
|
8
8
|
"arcgis-portal-classification-config": [() => import("./components/arcgis-portal-classification-config/customElement.js"), "autoDestroyDisabled,portalItem:,status,valid,values;destroy,resetForm,validateForm"],
|
|
9
9
|
"arcgis-portal-classification-favorite": [() => import("./components/arcgis-portal-classification-favorite/customElement.js"), "attributeExpressionResults:,classificationValue:,favoriteClassifications:,portalItem:,resetFavoriteClassification:,selectedFavoriteClassificationName,updateClassificationData:"],
|
|
10
10
|
"arcgis-portal-classification-form-element": [() => import("./components/arcgis-portal-classification-form-element/customElement.js"), "attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],
|
|
11
|
+
"arcgis-portal-extent-picker": [() => import("./components/arcgis-portal-extent-picker/customElement.js"), "active,contentOnly,extentService,extentValue:,isArea,itemId,portal:;;getExtent"],
|
|
12
|
+
"arcgis-portal-extent-picker-coord-field": [() => import("./components/arcgis-portal-extent-picker-coord-field/customElement.js"), "errorMessage,inputId,label,max,min,relatedErrorMessage,validateRelated:,value;;checkRelatedField,isValid,setFocus"],
|
|
11
13
|
"arcgis-portal-field-delete": [() => import("./components/arcgis-portal-field-delete/customElement.js"), "config:,fieldNames:,layer:,mapView:,options:"]
|
|
12
14
|
});
|
|
13
15
|
export {
|
|
14
|
-
|
|
16
|
+
r as defineCustomElements
|
|
15
17
|
};
|
package/dist/types/lumina.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ArcgisPortalClassificationBanner } from "../components/arcgis-port
|
|
|
3
3
|
import type { ArcgisPortalClassificationConfig } from "../components/arcgis-portal-classification-config/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-portal-classification-favorite/index.js";
|
|
5
5
|
import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/index.js";
|
|
6
|
+
import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/index.js";
|
|
6
7
|
import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/index.js";
|
|
7
8
|
import type { h, EventHandler } from "@arcgis/lumina";
|
|
8
9
|
|
|
@@ -20,6 +21,12 @@ interface LuminaArcgisPortalClassificationFormElement extends Partial<Pick<Arcgi
|
|
|
20
21
|
onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
interface LuminaArcgisPortalExtentPicker extends Partial<Pick<ArcgisPortalExtentPicker, 'active' | 'contentOnly' | 'extentService' | 'extentValue' | 'isArea' | 'itemId' | 'portal'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalExtentPickerElement> {
|
|
25
|
+
onarcgisExtentPickerChange?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerChange"]>;
|
|
26
|
+
onarcgisExtentPickerClose?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerClose"]>;
|
|
27
|
+
onarcgisExtentPickerSave?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerSave"]>;
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
interface LuminaArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
|
|
24
31
|
onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
|
|
25
32
|
onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
|
|
@@ -34,6 +41,7 @@ declare module "@arcgis/lumina" {
|
|
|
34
41
|
"arcgis-portal-classification-config": LuminaArcgisPortalClassificationConfig;
|
|
35
42
|
"arcgis-portal-classification-favorite": LuminaArcgisPortalClassificationFavorite;
|
|
36
43
|
"arcgis-portal-classification-form-element": LuminaArcgisPortalClassificationFormElement;
|
|
44
|
+
"arcgis-portal-extent-picker": LuminaArcgisPortalExtentPicker;
|
|
37
45
|
"arcgis-portal-field-delete": LuminaArcgisPortalFieldDelete;
|
|
38
46
|
}
|
|
39
47
|
}
|
package/dist/types/preact.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ArcgisPortalClassificationBanner } from "../components/arcgis-port
|
|
|
3
3
|
import type { ArcgisPortalClassificationConfig } from "../components/arcgis-portal-classification-config/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-portal-classification-favorite/index.js";
|
|
5
5
|
import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/index.js";
|
|
6
|
+
import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/index.js";
|
|
6
7
|
import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/index.js";
|
|
7
8
|
import { HTMLAttributes } from "preact";
|
|
8
9
|
import type { EventHandler } from "@arcgis/lumina";
|
|
@@ -21,6 +22,12 @@ interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<Arcgi
|
|
|
21
22
|
onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
interface PreactArcgisPortalExtentPicker extends Partial<Pick<ArcgisPortalExtentPicker, 'active' | 'contentOnly' | 'extentService' | 'extentValue' | 'isArea' | 'itemId' | 'portal'>>, HTMLAttributes<HTMLArcgisPortalExtentPickerElement> {
|
|
26
|
+
onarcgisExtentPickerChange?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerChange"]>;
|
|
27
|
+
onarcgisExtentPickerClose?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerClose"]>;
|
|
28
|
+
onarcgisExtentPickerSave?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerSave"]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
interface PreactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
|
|
25
32
|
onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
|
|
26
33
|
onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
|
|
@@ -35,6 +42,7 @@ declare module 'preact' {
|
|
|
35
42
|
"arcgis-portal-classification-config": PreactArcgisPortalClassificationConfig;
|
|
36
43
|
"arcgis-portal-classification-favorite": PreactArcgisPortalClassificationFavorite;
|
|
37
44
|
"arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
|
|
45
|
+
"arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
|
|
38
46
|
"arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
|
|
39
47
|
}
|
|
40
48
|
}
|
|
@@ -44,6 +52,7 @@ declare module 'preact' {
|
|
|
44
52
|
"arcgis-portal-classification-config": PreactArcgisPortalClassificationConfig;
|
|
45
53
|
"arcgis-portal-classification-favorite": PreactArcgisPortalClassificationFavorite;
|
|
46
54
|
"arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
|
|
55
|
+
"arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
|
|
47
56
|
"arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
|
|
48
57
|
}
|
|
49
58
|
}
|
package/dist/types/preact10.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ArcgisPortalClassificationBanner } from "../components/arcgis-port
|
|
|
3
3
|
import type { ArcgisPortalClassificationConfig } from "../components/arcgis-portal-classification-config/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-portal-classification-favorite/index.js";
|
|
5
5
|
import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/index.js";
|
|
6
|
+
import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/index.js";
|
|
6
7
|
import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/index.js";
|
|
7
8
|
import { JSX as PreactJsx } from "preact";
|
|
8
9
|
import type { EventHandler } from "@arcgis/lumina";
|
|
@@ -25,6 +26,13 @@ interface PreactArcgisPortalClassificationFormElement extends Partial<Pick<Arcgi
|
|
|
25
26
|
onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
|
|
30
|
+
interface PreactArcgisPortalExtentPicker extends Partial<Pick<ArcgisPortalExtentPicker, 'active' | 'contentOnly' | 'extentService' | 'extentValue' | 'isArea' | 'itemId' | 'portal'>>, PreactJsx.HTMLAttributes<HTMLArcgisPortalExtentPickerElement> {
|
|
31
|
+
onarcgisExtentPickerChange?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerChange"]>;
|
|
32
|
+
onarcgisExtentPickerClose?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerClose"]>;
|
|
33
|
+
onarcgisExtentPickerSave?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerSave"]>;
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
|
|
29
37
|
interface PreactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, PreactJsx.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
|
|
30
38
|
onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
|
|
@@ -40,6 +48,7 @@ declare module 'preact' {
|
|
|
40
48
|
"arcgis-portal-classification-config": PreactArcgisPortalClassificationConfig;
|
|
41
49
|
"arcgis-portal-classification-favorite": PreactArcgisPortalClassificationFavorite;
|
|
42
50
|
"arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
|
|
51
|
+
"arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
|
|
43
52
|
"arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
|
|
44
53
|
}
|
|
45
54
|
}
|
|
@@ -49,6 +58,7 @@ declare module 'preact' {
|
|
|
49
58
|
"arcgis-portal-classification-config": PreactArcgisPortalClassificationConfig;
|
|
50
59
|
"arcgis-portal-classification-favorite": PreactArcgisPortalClassificationFavorite;
|
|
51
60
|
"arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
|
|
61
|
+
"arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
|
|
52
62
|
"arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
|
|
53
63
|
}
|
|
54
64
|
}
|
package/dist/types/react.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ArcgisPortalClassificationBanner } from "../components/arcgis-port
|
|
|
3
3
|
import type { ArcgisPortalClassificationConfig } from "../components/arcgis-portal-classification-config/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-portal-classification-favorite/index.js";
|
|
5
5
|
import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/index.js";
|
|
6
|
+
import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/index.js";
|
|
6
7
|
import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/index.js";
|
|
7
8
|
import type { HTMLProps } from 'react';
|
|
8
9
|
import type { EventHandler } from "@arcgis/lumina";
|
|
@@ -21,6 +22,12 @@ interface ReactArcgisPortalClassificationFormElement extends Partial<Pick<Arcgis
|
|
|
21
22
|
onarcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
interface ReactArcgisPortalExtentPicker extends Partial<Pick<ArcgisPortalExtentPicker, 'active' | 'contentOnly' | 'extentService' | 'extentValue' | 'isArea' | 'itemId' | 'portal'>>, HTMLProps<HTMLArcgisPortalExtentPickerElement> {
|
|
26
|
+
onarcgisExtentPickerChange?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerChange"]>;
|
|
27
|
+
onarcgisExtentPickerClose?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerClose"]>;
|
|
28
|
+
onarcgisExtentPickerSave?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerSave"]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
interface ReactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, HTMLProps<HTMLArcgisPortalFieldDeleteElement> {
|
|
25
32
|
onarcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
|
|
26
33
|
onarcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
|
|
@@ -35,6 +42,7 @@ declare module "react" {
|
|
|
35
42
|
"arcgis-portal-classification-config": ReactArcgisPortalClassificationConfig;
|
|
36
43
|
"arcgis-portal-classification-favorite": ReactArcgisPortalClassificationFavorite;
|
|
37
44
|
"arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
|
|
45
|
+
"arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
|
|
38
46
|
"arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
|
|
39
47
|
}
|
|
40
48
|
}
|
|
@@ -46,6 +54,7 @@ declare module "react/jsx-runtime" {
|
|
|
46
54
|
"arcgis-portal-classification-config": ReactArcgisPortalClassificationConfig;
|
|
47
55
|
"arcgis-portal-classification-favorite": ReactArcgisPortalClassificationFavorite;
|
|
48
56
|
"arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
|
|
57
|
+
"arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
|
|
49
58
|
"arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
|
|
50
59
|
}
|
|
51
60
|
}
|
|
@@ -57,6 +66,7 @@ declare module "react/jsx-dev-runtime" {
|
|
|
57
66
|
"arcgis-portal-classification-config": ReactArcgisPortalClassificationConfig;
|
|
58
67
|
"arcgis-portal-classification-favorite": ReactArcgisPortalClassificationFavorite;
|
|
59
68
|
"arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
|
|
69
|
+
"arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
|
|
60
70
|
"arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
|
|
61
71
|
}
|
|
62
72
|
}
|
package/dist/types/stencil.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ArcgisPortalClassificationBanner } from "../components/arcgis-port
|
|
|
3
3
|
import type { ArcgisPortalClassificationConfig } from "../components/arcgis-portal-classification-config/index.js";
|
|
4
4
|
import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-portal-classification-favorite/index.js";
|
|
5
5
|
import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/index.js";
|
|
6
|
+
import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/index.js";
|
|
6
7
|
import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/index.js";
|
|
7
8
|
import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
8
9
|
import type { EventHandler } from "@arcgis/lumina";
|
|
@@ -21,6 +22,12 @@ interface StencilArcgisPortalClassificationFormElement extends Partial<Pick<Arcg
|
|
|
21
22
|
onArcgisAttributeValueChange?: EventHandler<HTMLArcgisPortalClassificationFormElementElement["arcgisAttributeValueChange"]>;
|
|
22
23
|
}
|
|
23
24
|
|
|
25
|
+
interface StencilArcgisPortalExtentPicker extends Partial<Pick<ArcgisPortalExtentPicker, 'active' | 'contentOnly' | 'extentService' | 'extentValue' | 'isArea' | 'itemId' | 'portal'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalExtentPickerElement> {
|
|
26
|
+
onArcgisExtentPickerChange?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerChange"]>;
|
|
27
|
+
onArcgisExtentPickerClose?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerClose"]>;
|
|
28
|
+
onArcgisExtentPickerSave?: EventHandler<HTMLArcgisPortalExtentPickerElement["arcgisExtentPickerSave"]>;
|
|
29
|
+
}
|
|
30
|
+
|
|
24
31
|
interface StencilArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDelete, 'config' | 'fieldNames' | 'layer' | 'mapView' | 'options'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalFieldDeleteElement> {
|
|
25
32
|
onArcgisBeforeDelete?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeDelete"]>;
|
|
26
33
|
onArcgisBeforeModalClose?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisBeforeModalClose"]>;
|
|
@@ -33,6 +40,7 @@ interface ExposedElements {
|
|
|
33
40
|
"arcgis-portal-classification-config": StencilArcgisPortalClassificationConfig;
|
|
34
41
|
"arcgis-portal-classification-favorite": StencilArcgisPortalClassificationFavorite;
|
|
35
42
|
"arcgis-portal-classification-form-element": StencilArcgisPortalClassificationFormElement;
|
|
43
|
+
"arcgis-portal-extent-picker": StencilArcgisPortalExtentPicker;
|
|
36
44
|
"arcgis-portal-field-delete": StencilArcgisPortalFieldDelete;
|
|
37
45
|
}
|
|
38
46
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insertJsApiStylesheet(shadowRoot: ShadowRoot | null): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/portal-components",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.80",
|
|
4
4
|
"description": "ArcGIS Portal Components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
],
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@arcgis/lumina": "5.0.0-next.
|
|
42
|
-
"@arcgis/toolkit": "5.0.0-next.
|
|
41
|
+
"@arcgis/lumina": "5.0.0-next.80",
|
|
42
|
+
"@arcgis/toolkit": "5.0.0-next.80",
|
|
43
43
|
"@lit/task": "^1.0.3",
|
|
44
44
|
"lit": "^3.3.0",
|
|
45
45
|
"tslib": "^2.8.1"
|
package/dist/cdn/24DGNFDU.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import{b as B}from"./PCSZRBM6.js";import{d as q}from"./7QVEOEKB.js";import{B as S,C as A,D as R,G as P,I as J,h as j,j as y,p as N}from"./O4GBFABF.js";export default $arcgis.t(([Y,ve,Ie,Fe,x,v,X,Z,C,$,E])=>{var k=(s=>(s.expression="expression/",s.raster="Raster.",s.relationship="relationships/",s))(k||{}),ee=["feature"];function L(s){return"fieldConfigurations"in s&&ee.includes(s.type)}function T(s){return s!=null}function W(s,e,t){let i=e.fieldName;if(i.includes(k.expression)){let r=t.get(i);return r?.title?r.title:i}else return L(s)&&s.getFieldConfiguration(i)?s.getFieldAlias(i)||i:e.label||i}function V(s,e,t){let i="";if(/^raster.(?:item|service)pixelvalue/iu.test(s))i="number";else if(e.has(s)){let r=e.get(s);i=r.type?r.type.toLowerCase():""}else if(t.has(s)){let r=t.get(s);i=r.returnType?r.returnType.toLowerCase():""}else i="number";return i}async function _(s){return new Map((await te(s)).filter(e=>e.visible).map(e=>[e.name,e]))}function G(s){let e=new Map;return s?.expressionInfos&&s.expressionInfos.forEach(t=>{let i=`${k.expression}${t.name}`;e.set(i,t)}),e}async function te(s){return await new Promise((e,t)=>{switch(s.type){case"feature":case"ogc-feature":case"stream":e(s.fields);break;case"sublayer":{let i=s,r=i?.layer;r?.portalItem&&r.url.includes("https://demographics")&&r.url.includes(".arcgis.com")?r.portalItem?.fetchData().then(a=>{if(a?.thematicGroup){let n=new Map(i.fields.map(o=>[o.name,o])),c=a.thematicGroup.fieldNames,p=[];c.forEach(o=>{n.has(o)&&p.push(n.get(o))}),e(p)}else e(i.fields)}).catch(a=>{t(new Error(a))}):e(i.fields);break}case"imagery":case"imagery-tile":case"wcs":e(s.rasterFields);break;default:e("fields"in s?s.fields??[]:[])}})}var se=s=>s&&!s.endsWith("/")?`${s}/`:s;function F(s){return se(s.restUrl)}function ie(s,e){return z(s,e)||re(s,e)}function z(s,e){return s.owner===e.username}function re(s,e){let t=s.owner,i=s.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return s.portal?.isPortal&&!z(s,e)&&i&&t?.includes("esri_")&&!r.includes(t)?!1:i}function ae(s){return s.typeKeywords?.includes("Spatiotemporal")}function ne(s){return s.typeKeywords?.includes("View Service")}function oe(s){return s.typeKeywords?.includes("Hosted Service")}function le(s){return s.typeKeywords?.includes("Multi Services View")}function de(s){return s?.hasViews&&!s.sourceSchemaChangesAllowed}async function ce(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal;if(t?.user){let i=`${F(t)}community/users/${t.user.username}`;return await $(i,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.groups??[];return await Promise.resolve(a)},async()=>await Promise.reject(new Error("Failed to fetch user groups")))}return await Promise.resolve(null)}async function pe(s){let e=s?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal,i=`${F(t)}content/items/${e.id}/groups`;return await $(i,{query:{f:"json",token:e.portal.credential?.token},responseType:"json"}).then(async r=>{let a=r.data?.admin??[],n=r.data?.member??[],c=r.data?.other??[],p=[...a,...n,...c];return await Promise.resolve(p)},async()=>await Promise.reject(new Error("Failed to fetch item groups")))}async function fe(s,e,{relationshipType:t,direction:i}){let r=`${F(e)}content/items/${s}/relatedItems`;return await $(r,{query:{f:"json",relationshipType:t,direction:i},responseType:"json"})}function ue(s,e){return s?.some(t=>e?.some(i=>t.id===i.id&&t.capabilities.includes("updateitemcontrol")))}function d(s,e){return!s||!e?!1:s.toLocaleLowerCase()===e.toLocaleLowerCase()}async function U(s,e,t,i){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=i?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!oe(a)||ne(a)||le(a)||de(n)||a.portal.isPortal&&ae(a)||["oid","global-id","geometry"].includes(t.type)||await me(e,t.name,i))return!1;let c=e.sourceJSON.geometryProperties,p=c?.shapeLengthFieldName,o=c?.shapeAreaFieldName;if(d(p,t.name)||d(o,t.name))return!1;let l=e.editFieldsInfo;if(l&&(d(l.creationDateField,t.name)||d(l.creatorField,t.name)||d(l.editDateField,t.name)||d(l.editorField,t.name))||d(e.objectIdField,t.name)||d(e.displayField,t.name)||d(e.typeIdField,t.name)||d(e.subtypeField,t.name)||e.timeInfo&&(d(e.timeInfo.startField,t.name)||d(e.timeInfo.endField,t.name)||d(e.timeInfo.trackIdField,t.name)))return!1;if(!i?.ignoreLayerRenderer&&e.featureReduction){let u=new Set;if(await v.collectFeatureReductionFields(u,e,e.featureReduction),Array.from(u).some(b=>d(b,t.name)))return!1}if(!i?.ignoreLayerRenderer&&(await v.getRendererFields(e.renderer,e.fieldsIndex)).some(u=>d(u,t.name)))return!1;if(!i?.ignoreLayerLabelingInfo){let u=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(u&&((await v.getExpressionFields(e,u)).some(b=>d(b,t.name))||await K(e,t,"layer")))return!1}if(!i?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await E.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await ye(e,t,i)||await ge(e,t))return!1;if(await we(e,t))return await Promise.resolve(!1);if(await be(e,t))return await Promise.resolve(!1);if(he(s,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=ie(a,a.portal.user),I=i?.userItemInfo?.userGroups??await ce(e)??[],h=i?.userItemInfo?.itemGroups??await pe(e)??[],w=ue(I,h);if(!f&&!w)return!1;let g=i?.userItemInfo?.relatedItems??await fe(a.id,a.portal,{relationshipType:"Service2Service"});return!(g?.data?.relatedItems&&g.data.relatedItems.some(u=>["WMTS","Map Service","Vector Tile Service"].includes(u.type)))}async function me(s,e,t){let i=`${s.url}/${s.layerId}/fieldGroups`,r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await $(i,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}function he(s,e,t){if(!s)return!1;let i=s.map?.applicationProperties?.viewing?.search;if(i){let r=i.layers?.find(a=>a.id===e.id);if(r){let a=r?.field?.name;if(a)return d(a,t.name)}}return!1}async function K(s,e,t){let i=t==="layer"?s.labelingInfo?.filter(n=>T(n.where)):s.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>T(n.where));if(!i?.length)return!1;let r=[...await Promise.all(i.map(async n=>await E.parseWhereClause(n.where,s.fieldsIndex)))],a=!1;for(let n=0;n<r.length;n++){let c=r[n].fieldNames?.some(p=>d(p,e.name));if(!a&&c){a=!0;break}}return await Promise.resolve(a)}async function ye(s,e,t){let i=s.portalItem;if(!i)return!1;let r=`${F(i.portal)}content/items/${i.id}/data`,a=(t?.userItemInfo?.itemData??await $(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===s.layerId),c=n?.layerDefinition?.drawingInfo?.renderer,p=n?.layerDefinition?.featureReduction,o=n?.layerDefinition?.definitionExpression;if(!c&&!p&&!o)return!1;if(!t?.ignoreItemRenderer&&c){let l=C.fromJSON(c);if((await v.getRendererFields(l,s.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await H(s,e,p)||o&&(await E.parseWhereClause(o,s.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function ge(s,e){let t=s.sourceJSON,i=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!i&&!r)return!1;if(i){let a=C.fromJSON(i);if((await v.getRendererFields(a,s.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await H(s,e,r))}async function we(s,e){let t=s.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let i=t?.map(r=>r.labelExpressionInfo?.expression);if(i){if((await v.getExpressionFields(s,i)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await K(s,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function be(s,e){let t=s.sourceJSON?.definitionQuery;return t?(await E.parseWhereClause(t,s.fieldsIndex)).fieldNames.some(i=>d(i,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function H(s,e,t){let i=t.type==="binning"?X.fromJSON(t):Z.fromJSON(t),r=new Set;return await v.collectFeatureReductionFields(r,s,i),!!Array.from(r).some(a=>d(a,e.name))}var m=new Map;m.set("oid","key");m.set("guid","key");m.set("global-id","key");m.set("blob","binary");m.set("integer","integer");m.set("small-integer","integer");m.set("big-integer","integer");m.set("single","number");m.set("double","number");m.set("long","number");m.set("number","number");m.set("date","date-time");m.set("date-only","calendar");m.set("time-only","clock");m.set("timestamp-offset","time-zone");m.set("string","string");var Ne=({fieldType:s})=>y`<calcite-icon scale=s .icon=${m.get(s)}></calcite-icon>`,Te=j`.dialog{--calcite-dialog-max-size-y: 60%}.dialog-content-wrapper{position:relative;min-height:100px}.hide-overflow{overflow:hidden}.field-icons{padding:0 var(--calcite-spacing-lg);display:flex;align-items:center}.warning{border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);margin-bottom:var(--calcite-spacing-md)}.warning-message{font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold)}.loader-container{position:absolute;height:100%;width:100%;top:0;right:0;display:none;z-index:40;overflow:hidden;background:#fffffff2;padding:0}.active{display:flex;flex-direction:column;align-items:center;justify-content:center}.loader{padding:0}.loader-text{font-weight:var(--calcite-font-weight-medium);text-align:center;margin-right:6.25rem;margin-left:6.25rem}`,O=class extends R{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=S(),this.dialogNode=S(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=q({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new B(this,{task:async([e,t])=>{if(!(T(e)&&T(t)))throw console.error("Required properties are missing."),new Error;this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=N(),this.arcgisClose=N(),this.arcgisBeforeDelete=N(),this.arcgisFieldsDeleted=N()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=Te}async processProps(){let{layer:e,mapView:t,fieldNames:i}=this;if(!e||!i){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>i.includes(a.name));let r=i.some(a=>!e.fields.find(n=>n.name===a));if(!this.layerFields?.length||r)this.fieldsAreDeletable=!1;else{let a=await Promise.all(this.layerFields.map(async n=>await U(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await _(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=G(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await Fe.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:i}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?W(t,r,i):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,i=this.layerFieldsMap.get(e);return L(t)?t.getFieldAlias(e):i.alias??i.name}async deleteFields(){let{layer:e,fieldNames:t}=this,i=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await x(i,{query:{...a,f:"json",async:!1},method:"post",responseType:"json"}).then(async n=>{if(n.data?.success){let c=`${e.url}/${e.layerId}`;t.forEach(o=>{e.type==="feature"&&e.floorInfo?.floorField===o&&(e.floorInfo=null)});let p=await x(c,{query:{f:"json"},responseType:"json"});if(p){let o=p.data;this.currentLayerInfo=p.data,o&&(this.updateTypesAndTemplatesOnLayer(),t.forEach(l=>{o.templates?.length?o.templates.forEach(f=>delete f.prototype.attributes[l]):o.types?.forEach(f=>{f.templates.forEach(I=>delete I.prototype.attributes[l])})}),this.updateFeatureService(o))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let i=this.updateTemplatesList(t.templates);t.templates=i}else if(t.types){let i=t.types;t.types=[],i.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:i}=this,r=[];return(e??[]).forEach(a=>{let n=new ve;n.description=a.description??"",n.name=a.name||i.newFeature,n.drawingTool=a.drawingTool||"point";let c={};t.fields.forEach(o=>{let l=!1;for(let f=0;f<a.prototype.attributes.length;f++)if(a.prototype.attributes[f]===o.name){l=!0,c[o.name]=a.prototype.attributes[o.name];break}!l&&o.editable&&(c[o.name]=o.defaultValue||null)});let p=new Ie({attributes:c});n.prototype=p,r.push(n)}),r}addType(e,t){e.types?e.types.some(i=>i.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:i}=this,r={templates:e.templates,types:e.types},a=`${t.url.replace("/rest/services","/rest/admin/services")}/${t.layerId}/updateDefinition`,n={f:"json",updateDefinition:JSON.stringify(r)};await x(a,{query:{...n,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${F(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||i.forEach(o=>{t.popupTemplate?.fieldInfos&&(t.popupTemplate.fieldInfos=t.popupTemplate.fieldInfos.filter(l=>l.fieldName!==o)),t.popupTemplate?.content?.forEach((l,f)=>{l.type==="fields"&&l.fieldInfos&&((t.popupTemplate?.content)[f].fieldInfos=(t.popupTemplate?.content)[f].fieldInfos?.filter(I=>I.fieldName!==o))})}),t.attributeTableTemplate){let o=t.attributeTableTemplate.clone();o.elements=o.elements.filter(l=>!(l.type==="field"&&i.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!i.includes(l.field)),t.attributeTableTemplate=o}if(t.fieldConfigurations?.length){let o=Y.clone(t.fieldConfigurations).filter(l=>!i.includes(l.name));t.fieldConfigurations=o}await x(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let f=t.isTable,I=f?l.tables:l.layers,h=I?.find(w=>w.id===t.layerId);if(i.forEach(w=>{h?.attributeTableInfo?.attributeTableElements&&(h.attributeTableInfo.attributeTableElements=h.attributeTableInfo.attributeTableElements.filter(g=>!(g.type==="field"&&g.fieldName===w)),h.attributeTableInfo.orderByFields=h.attributeTableInfo.orderByFields.filter(g=>g.field!==w))}),h?.layerDefinition?.fieldConfigurations&&(h.layerDefinition.fieldConfigurations=h.layerDefinition.fieldConfigurations.filter(w=>!i.includes(w.name))),h?.popupInfo){i.forEach(b=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(D=>D.fieldName!==b),h.popupInfo.popupElements?.forEach((D,M)=>{D.type==="fields"&&D.fieldInfos&&(h.popupInfo.popupElements[M].fieldInfos=h.popupInfo.popupElements[M].fieldInfos.filter(Q=>Q.fieldName!==b))})});let w=`${F(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,g={};f?(g.tables=I,l.layers&&(g.layers=l.layers)):(g.layers=I,l.tables&&(g.tables=l.tables));let u={f:"json",text:JSON.stringify(g)};await x(w,{query:{...u},method:"post",responseType:"json"}).then(b=>{b.data?.success?this.handleSuccess():this.handleError()},()=>this.handleError())}else this.handleSuccess()}else o.httpStatus===200&&(!o.data||JSON.stringify(o.data)==="{}")?this.handleSuccess():this.handleError()},()=>this.handleError())}},()=>this.handleError())}handleSuccess(){this.arcgisFieldsDeleted.emit(),this.dialogNode?.value&&(this.dialogNode.value.open=!1),this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("success"):this.displaySuccessAlert()}handleError(e){this.dialogNode?.value&&(this.dialogNode.value.open=!1),e?this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("read-only-error"):this.displayReadOnlyErrorAlert():this.options?.handleCloseOnConsumer?this.arcgisBeforeModalClose.emit("error"):this.displayErrorAlert()}displaySuccessAlert(){let{messages:e,fieldNames:t}=this;this.successAlertNode&&(this.successAlertNode.parentElement?.removeChild(this.successAlertNode),this.successAlertNode=void 0),this.successAlertNode=P(y`<calcite-alert .label=${t.length===1?e.fieldDeleted:e.fieldsDeleted} kind=success icon=check-circle auto-close open><div slot=message>${t.length===1?e.fieldDeleted:e.fieldsDeleted}</div></calcite-alert>`),document.body.append(this.successAlertNode)}displayErrorAlert(){let{messages:e}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=P(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close open><div slot=message>${e.fieldDeletionUnsuccessful}</div></calcite-alert>`),document.body.append(this.errorAlertNode)}displayReadOnlyErrorAlert(){let{messages:e,portal:t}=this;this.errorAlertNode&&(this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode),this.errorAlertNode=void 0),this.errorAlertNode=P(y`<calcite-alert .label=${e.fieldDeletionUnsuccessful} kind=danger icon=exclamation-mark-triangle auto-close auto-close-duration=slow open><div slot=title>${e.error}</div><div slot=message>${t.isPortal?e.readOnlyErrorMessageEnterprise:e.readOnlyErrorMessage}</div>${!t.isPortal&&y`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>`||""}</calcite-alert>`),document.body.append(this.errorAlertNode)}render(){let{messages:e,fieldsAreDeletable:t,fieldNames:i,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(i?.length?i?.length===1?console.error("Field cannot be deleted"):console.error("One or more fields cannot be deleted"):console.error("You must select at least one field.")),y`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${()=>this.arcgisClose.emit()} .heading=${i?.length===1?e.deleteField:e.deleteFields} ${A(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"hide-overflow":""}`}>${this.renderDeleteLoader()}<calcite-label>${i.length===1?e.deletePrompt:e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}`:this.renderError()}</calcite-dialog>`)})}renderError(){let{messages:e}=this;return y`<div class="loader-container active"><div class="loader-text">${e.errorOccurred}</div></div>`}renderDeleteLoader(){let{messages:e,fieldNames:t,deleteInProgress:i}=this;return y`<div class=${`loader-container ${i?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!i}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:i,arcadeExpMap:r,messages:a}=this;return y`<calcite-list .label=${a.fields}>${e.map(n=>{let c=t.find(p=>p.name===n);return y`<calcite-list-item .label=${this.getFieldLabel(n)} .description=${`{${n}}`} .value=${n} .disabled=${!c.editable}><div slot=actions-end class="field-icons">${Ne({fieldType:V(n,i,r)})}</div></calcite-list-item>`})}</calcite-list>`}renderCancelButton(){let{messages:e}=this;return y`<calcite-button @click=${()=>this.dialogNode.value.open=!1} slot=footer-end appearance=outline ${A(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async i=>{let{portal:r}=this;i.currentTarget.disabled=!0,this.cancelNode.value.disabled=!0,this.dialogNode.value.closeDisabled=!0,r.sourceJSON?.isReadOnly?this.handleError(!0):(this.deleteInProgress=!0,this.requestUpdate(),this.arcgisBeforeDelete.emit(),await this.deleteFields())}}>${t.length===1?e.deleteField:e.deleteFieldsWithNumber.replace("${number}",`${t.length}`)}</calcite-button>`}};J("arcgis-portal-field-delete",O);return O},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")
|
package/dist/cdn/4LA6DBZQ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import b from"./3DX537T6.js";import a from"./G6NW27P4.js";import"./PCSZRBM6.js";import{d}from"./7QVEOEKB.js";import{D as r,E as n,I as c,h as e,j as s}from"./O4GBFABF.js";export default $arcgis.t(([,{a:l,b:f}])=>{var h=e`.banner{box-sizing:border-box;width:100%;left:0;text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);text-transform:uppercase;overflow-wrap:break-word}.invalid-container{background-color:#fff;color:#000;display:flex;align-items:center;justify-content:center;gap:8px}.invalid-icon{--calcite-icon-color: var(--calcite-color-status-danger)}.invalid-message{text-align:center;font-family:var(--calcite-font-family);background-color:#fff;color:#000;padding:var(--calcite-spacing-sm);font-size:var(--calcite-font-size);overflow-wrap:break-word}`,o=class extends r{constructor(){super(...arguments),this.classificationModel=l(this),this.messages=d(),this._classificationDataTask=f(this),this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.status=this.classificationModel.status,this.missingExistingClassification=!1,this.variant="full",this.autoDestroyDisabled=!1,this.validationErrors=""}static{this.properties={portalClassificationSchema:16,status:16,itemClassification:16,portalItem:0,missingExistingClassification:5,variant:1,autoDestroyDisabled:5,validationErrors:1}}static{this.styles=h}async destroy(){await this.manager.destroy()}willUpdate(a){if(a.has("portalItem")){let{portalItem:i}=this;i?.load().then(()=>{i?.id&&i?.loaded&&i?.classification&&!this.missingExistingClassification?this.classificationModel.validateClassification(this.variant==="preview"?null:i.id,i.classification,i?.portal.restUrl).catch(console.error).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(console.error)}}getStyle(){let a={};if(this.variant==="preview"&&(a.fontSize="var(--calcite-font-size-sm)",a.padding="var(--calcite-spacing-xs)"),this.itemClassification&&this.portalClassificationSchema){let i=this.itemClassification.classification,t=this.portalClassificationSchema.classificationMetadata.classificationValueProperties.find(({value:m})=>m===i);t?.backgroundColor&&(a.backgroundColor=t.backgroundColor),t?.textColor&&(a.color=t.textColor)}return a}render(){return this._classificationDataTask.render({pending:void 0,error:void 0,complete:()=>this.portalClassificationSchema&&this.portalItem?.portal.authMode!=="anonymous"?this.validationErrors&&this.variant==="full"?s`<div class="invalid-container"><calcite-icon class="invalid-icon" scale=s icon=exclamation-mark-triangle .textLabel=${this.messages.invalidclassificationerror}></calcite-icon><span class="invalid-message">${this.messages.invalidclassificationerror}</span></div>`:s`<div class="banner" style=${n(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};c("arcgis-portal-classification-banner",o);return o},a,b)
|
package/dist/cdn/55K7F2TM.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import{a as m}from"./SMJ76VUJ.js";import{d as h}from"./7QVEOEKB.js";import{D as b,F as a,I as d,h as c,j as i,p as u}from"./O4GBFABF.js";var g=c`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;function l(o,e){return o.uiElement===e}var n=class extends b{constructor(){super(...arguments),this.messages=h(),this.isRequiredErrors=new Set,this.arcgisAttributeValueChange=u()}static{this.properties={validationMsg:16,attributeKey:1,attribute:0,value:0,renderingInfo:0,isRequiredErrors:0}}static{this.styles=g}willUpdate(e){(e.has("renderingInfo")||e.has("isRequiredErrors"))&&(this.validationMsg=this._getValidationMessage())}_getValidationMessage(){if(this.renderingInfo?.attributeValidationResult)return this.renderingInfo.attributeValidationResult;if(this.isRequiredErrors.has(this.attributeKey))return this.messages.requiredfield??"This is a required field."}renderCheckbox(){return l(this.attribute,"checkbox")?i`<calcite-label class="spacing-y" .for=${this.attributeKey} layout=inline><calcite-checkbox .checked=${this.value} id=${this.attributeKey??a} @calciteCheckboxChange=${e=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.checked})} .required=${this.attribute.isRequired??!1} .status=${this.validationMsg?"invalid":"valid"}></calcite-checkbox>${this.attribute.label}</calcite-label>`:null}renderDateInput(){return l(this.attribute,"date")?i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-input-date-picker id=${this.attributeKey??a} .name=${this.attribute.label} @calciteInputDatePickerChange=${e=>this.isConnected&&this.arcgisAttributeValueChange.emit({[this.attributeKey]:e.target.value})} overlay-positioning=fixed .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-date-picker></calcite-label>`:null}renderTextInput(){if(!l(this.attribute,"text"))return null;let e=this.attribute.label,t=this.attribute.description;return i`<calcite-label .for=${this.attributeKey}><div class="portal-classification-form-element-tooltip">${e}${this.attribute.labelTooltip&&i`<div><calcite-icon scale=s icon=information .id=${`tooltip-button-${this.attribute.bannerLabel}`} text-label=${this.messages.information??"Information"??a}></calcite-icon><calcite-tooltip .referenceElement=${`tooltip-button-${this.attribute.bannerLabel}`} placement=right>${this.attribute.labelTooltip}</calcite-tooltip></div>`||""}</div><calcite-input-text id=${this.attributeKey??a} .label=${e} .name=${this.attributeKey} @calciteInputTextChange=${r=>this.arcgisAttributeValueChange.emit({[this.attributeKey]:r.target.value})} .placeholder=${t} .required=${this.attribute.isRequired} .status=${this.validationMsg?"invalid":"valid"} validation-icon=exclamation-mark-triangle .validationMessage=${this.validationMsg} .value=${this.value}></calcite-input-text></calcite-label>`}renderSingleSelect(){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}_renderSingleSelectComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return m(this.renderingInfo?.valueExpressionResult,t=>t.label,t=>i`<calcite-combobox-item .selected=${e===t.value} text-label=${t.label??a} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`)}_renderComboboxOptions(){if(!Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return this.renderingInfo?.valueExpressionResult.map(t=>i`<calcite-combobox-item .selected=${e?.includes(t.value)} text-label=${t.label??a} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){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=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .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}_renderGroupedComboboxOptions(){if(!this.renderingInfo?.valueExpressionResult||Array.isArray(this.renderingInfo?.valueExpressionResult))return;let e=this.value;return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t,r])=>i`<calcite-combobox-item .selected=${e?.includes(t)} text-label=${t??a} .value=${t}>${r.map(s=>i`<calcite-combobox-item .selected=${e?.includes(s.value)} text-label=${s.label??a} .value=${s.value} data-testid=${`grouped-combobox-item-${s.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){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=>{let t=e.target.value;this.arcgisAttributeValueChange.emit({[this.attributeKey]:t?Array.isArray(t)?t:[t]:void 0})}} .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._renderGroupedComboboxOptions()}</calcite-combobox></calcite-label>`:null}render(){switch(this.attribute.uiElement){case"checkbox":return this.renderCheckbox();case"date":return this.renderDateInput();case"multi-select":return this.renderMultiSelect();case"multi-grouped-select-nested":return this.renderMultiGroupedSelectNested();case"single-select":return this.renderSingleSelect();case"text":return this.renderTextInput();default:return i`<div>Not Implemented Yet.</div>`}}};d("arcgis-portal-classification-form-element",n);export{n as ArcgisPortalClassificationFormElement};
|
package/dist/cdn/7QVEOEKB.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import{J as A,a as x,b as L,c as O,d as f,e as m,f as P,g as w,n as g,o as N,q as T}from"./O4GBFABF.js";var V=(e,n)=>{let t=e;for(;t;){if(t===n)return!0;if(!t.parentNode)return!1;t.parentNode instanceof ShadowRoot?t=t.parentNode.host:t=t.parentNode}return!1},k=(e,n,t)=>{let o=z(n).subscribe;return o(s=>{s.some(i=>V(e,i.target))&&t()})},v={},z=e=>{let n=e.join(","),t=v[n];if(t!==void 0)return t;let o=new Set,s=new MutationObserver(i=>o.forEach(a=>a(i)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let r={subscribe:i=>(o.add(i),()=>{o.delete(i),o.size===0&&(s.disconnect(),v[n]=void 0)})};return v[n]=r,r},R=(e,n)=>{let t=e;for(;t;){let o=t.closest?.(n);if(o)return o;let s=t.getRootNode?.();if(s===globalThis.document)return;t=s.host}};var M=(e,n,t)=>R(e,`[${n}]`)?.getAttribute(n)??t;var _=e=>(...n)=>{let t=m(),o=new e(...n),s=o.exports;f(t.at(-1));let r=o.component.manager;r.W(o,s),o.watchExports(r.W.bind(r,o)),P(o);let i=[o.component,...t].reverse();return g(i,a=>a===void 0?void 0:U(o,a,s),s)},U=(e,{host:n,key:t,isReactive:o},s)=>{let r=n,i=r[t]!==e.exports,a=r[t]!==s,c=s!==e.exports;if(i&&!a&&c&&(r[t]=e.exports),n===e.component){if(o){let l=e.component.manager;a&&l.W(e,r[t]),e.onUpdate(d=>{if(d.has(t)){let C=r[t];C!==e.exports&&l.W(e,C)}})}e.O=o?void 0:t}let u=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{r[t]!==e.exports&&(u?w(()=>{r[t]=e.exports}):r[t]=e.exports)})};var G="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),W=new Set(G),h="en",H={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},K=async(e,n,t="")=>{let o=`${n}/${t}`,s=`${o}${e}.json`;return b[s]??(b[s]=$(e,o)),await b[s]},b={},$=async(e,n)=>{let t=`${n}${e}.json`;try{let o=await fetch(t);if(o.ok)return await o.json()}catch(o){return console.error(o),{}}return e===h?{}:await $(h,n)},E=e=>{let n=M(e,"lang",globalThis.navigator?.language||h);return{lang:n,t9nLocale:D(n)}},D=e=>{let[n,t]=e.split("-"),o=n.toLowerCase(),s=o;return t&&(s=`${o}-${t.toUpperCase()}`),s=H[s]??s,W.has(s)?s:t?D(o):h},S=(e,n,t,o)=>{let s,r=()=>I(e,n(),o).then(i=>{(s?.lang!==i.lang||s.t9nLocale!==i.t9nLocale||s.t9nStrings!==i.t9nStrings)&&t(i),s=i}).catch(console.error);return queueMicrotask(r),k(e,["lang"],r)},I=async(e,n,t=e.localName.split("-").slice(1).join("-"))=>{let{lang:o,t9nLocale:s}=E(e),r=`${n}/${t}/t9n`,a=t===null?{}:await K(s,r,"messages.");return{lang:o,t9nLocale:s,t9nStrings:a}};var q=e=>B(void 0,e);var y=class extends T{constructor(n,t){super(n);let o=this.exports;try{L(this.component);let s=t(this.component,this),r=this.exports!==o;if(x(s)){r||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a),console.error(a)});this.onLoad(async()=>await i)}else(!r||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s),console.error(s)}}catchUpLifecycle(){}},B=_(y);var j=e=>(n={})=>q((t,o)=>{let s=E(t.el),r={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;o.onLifecycle(()=>S(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:p,lang:u})=>{let l={...p,_lang:u,_t9nLocale:c,_loading:!1};o.exports=l;let d=p.componentLabel;typeof d=="string"&&"label"in t&&t.label==null&&(t.label??=d),a(i.messageOverrides)},n.name));let a=c=>{let p=o.exports,u=p._original??p,l=F(u,c);c&&(l._original=u),o.exports=l};return"messageOverrides"in i&&o.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),n.blocking?(o.setProvisionalExports(r,!1),o.ready):r}),F=(e,n)=>{if(!n)return e;let t={...e};return Object.entries(n).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=F(e[o],s):t[o]=s??e[o])}),t},pt=e=>X,J="arcgisPropertyChange",X=(...e)=>{let n=O(),t=N(J,void 0,n),o=!0;return n.manager.onUpdated(s=>{if(o||!n.el.isConnected){o=!1;return}for(let r of e)s.has(r)&&t.emit({name:r})}),t};var ft=j(A);export{_ as a,R as b,pt as c,ft as d};
|
package/dist/cdn/RLMC5JTM.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import d from"./3DX537T6.js";import c from"./6W2TW24S.js";import a from"./G6NW27P4.js";import{a as E,b as I}from"./PCSZRBM6.js";import{b as x,c as P,d as $}from"./7QVEOEKB.js";import{B as u,C as g,D as b,F as C,I as y,h as p,j as n}from"./O4GBFABF.js";export default $arcgis.t(([{createArcadeExecutor:F},{watch:q},{c:v},{a:d,b:c,c:m,d:R,e:O,f:_},{a:S,b:w}])=>{async function k({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await T(e,r,t);return{[e]:{enabled:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function T(r,t,i){let a=t?.attributes?.[r];if(!a)return!1;let{isAttributeEnabled:e}=a;return e?await h(e,JSON.stringify(t),i):!0}async function j({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await N(e,r,t);return{[e]:{valueExpressionResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function N(r,t,i){let a=t.attributes[r];if(!a)throw Error(`Attribute ${r} not found in schema`);let e=a.valueExpression,s=a.validValues,o=a.validValuesMap;return s?.length?s:o&&Object.keys(o)?.length?o:e?await h(e,t,i,r):null}async function M({portalClassificationSchema:r,itemClassification:t}){let i=Object.entries(r.attributes).map(async([e])=>{let s=await H(e,r,t);return{[e]:{attributeValidationResult:s}}}),a=await Promise.all(i);return Object.assign({},...a)}async function H(r,t,i){let a=t?.attributes?.[r];if(!a)return null;let e=a?.attributeValidation;return e?await h(e,JSON.stringify(t),i,r):null}var V=async(r,t)=>{let i=r?.bannerExpression;return i?.length?await h(i,r,t):J(r,t)},J=(r,t)=>{let i=Object.entries(r.attributes).sort(([,s],[,o])=>(s?.bannerOrder??0)-(o?.bannerOrder??0)),a=[],e=[];return i.forEach(([s,o])=>{let l=t?.[s];l&&o.bannerOrder&&(a.push(U({elementType:o.uiElement??"",selectionDisplayLabel:o.bannerLabel??"",labelDelimiter:o.labelDelimiter??"",classificationProp:l,valueDelimiter:o.valueDelimiter??""})),e.push(o.attributeDelimiter??""))}),a.length>0?a.reduce((s,o,l)=>l===0?o:`${s}${e[l-1]}${o}`,""):""},U=({elementType:r,selectionDisplayLabel:t,labelDelimiter:i,classificationProp:a,valueDelimiter:e})=>{let s=r.includes("multi")&&a?a.split("").join(e):a;return`${t}${i}${s}`};async function h(r,t,i,a=""){let e={schemaJsonString:typeof t=="string"?t:JSON.stringify(t),valueJsonString:JSON.stringify(i),attributeId:a};return(await L(r)).execute(e)}async function L(r){return await F(r,{variables:[{name:"schemaJsonString",type:"text"},{name:"valueJsonString",type:"text"},{name:"attributeId",type:"text"}]})}var W=p`: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}`,f=class extends b{constructor(){super(),this.classificationModel=S(this),this.messages=$(),this.formMainContentRef=u(),this._classificationDataTask=w(this),this._formCreationTask=new I(this,{task:async()=>{if(await this._classificationDataTask.taskComplete,!this.portalClassificationSchema||!this.portalItem)throw new Error("Portal item and classification schema are required to render the form");let t=this.portalItem.clone();if(await t.load(),!this.primaryAttribute)throw new Error("primaryAttribute is required but was undefined.");this.existingClassification=!!t.classification,t.classification=d(t.classification,this.primaryAttribute,this.portalClassificationSchema),t.classification&&(t.classification.banner=await V(this.portalClassificationSchema,t.classification)),this.pendingPortalItem=t,this._itemClassificationWatchHandle&&(this._itemClassificationWatchHandle.remove(),this.portalItem.removeHandles("arcgis-classification-config"),this._itemClassificationWatchHandle=void 0),this._itemClassificationWatchHandle=q(()=>this.portalItem.classification,i=>{if(this.pendingPortalItem){let a=this.pendingPortalItem.clone();a.load().then(()=>{a.classification=i,this.pendingPortalItem=a}).catch(e=>{console.error(e)})}}),this.portalItem.addHandles(this._itemClassificationWatchHandle,"arcgis-classification-config"),await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.existingClassification&&this.validateForm()},args:()=>[this.portalItem,this.portalClassificationSchema]}),this.getFormDisplayOrder=t=>this.portalClassificationSchema?.layouts.default.layoutElements[t].formDisplayOrder??0,this.addEditInfoAttributes=()=>{if(!this.pendingPortalItem?.classification)return{};let t=structuredClone(this.pendingPortalItem.classification),i=_(this.pendingPortalItem,t);return{...t,...i}},this.updateFavoriteClassification=t=>{this.favoriteClassifications=t},this.updateClassificationData=async t=>{let i=t.classification;if(this.selectedFavoriteClassificationName=t.name,this.pendingPortalItem){let a=this.pendingPortalItem.clone();if(await a.load(),a.classification=m(this.portalClassificationSchema,i),!this.portalClassificationSchema)return;await this.evaluateAttributeExpressions(this.portalClassificationSchema,a),a.classification=c(a.classification,this.attributeExpressionResults),this.pendingPortalItem=a}},this.existingClassification=!1,this.portalClassificationSchema=this.classificationModel.portalClassificationSchema,this.primaryAttribute=this.classificationModel.primaryAttribute,this.attributeExpressionResults=new Map,this.formValidationErrors=[],this.remoteValidationErrors="",this.canUserConfigureClassification=!0,this.favoriteClassifications=[],this.isRequiredErrors=new Set,this.status=this.classificationModel.status,this.values={},this.valid=!1,this.autoDestroyDisabled=!1,this.arcgisPropertyChange=P()("status","values","valid")}static{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}}static{this.styles=W}async destroy(){await this.manager.destroy()}async resetForm(){if(this.existingClassification)this.pendingPortalItem=this.portalItem?.clone(),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults),this.validateForm());else if(this.portalItem&&this.primaryAttribute&&this.portalClassificationSchema){let t=this.portalItem.clone();await t.load(),this.pendingPortalItem=this.portalItem?.clone(),this.pendingPortalItem.classification=d(t.classification,this.primaryAttribute,this.portalClassificationSchema),this.portalClassificationSchema&&this.pendingPortalItem&&(await this.evaluateAttributeExpressions(this.portalClassificationSchema,this.pendingPortalItem),this.pendingPortalItem.classification=c(this.pendingPortalItem.classification,this.attributeExpressionResults))}}async validateForm(){this.updateFormValidationErrors(),await this.updateRemoteValidationErrors()}async load(){try{await O(this.portalItem)||(this.canUserConfigureClassification=!1);let t=await v(this.portalItem);if(t){let{result:i,error:a}=t;if(a&&a.details.raw.messageCode!=="COM_1177"){console.error(a);return}i&&(this.favoriteClassifications=i.favorites)}}catch(t){console.error("Error occured while loading arcgis-classification-config:",t)}}willUpdate(t){if(t.has("pendingPortalItem")){let i=this.addEditInfoAttributes();this.values=i}(t.has("formValidationErrors")||t.has("remoteValidationErrors"))&&(this.valid=!this.formValidationErrors.length&&!this.remoteValidationErrors)}loaded(){let t=x(this.el,"form");t&&(this.listenOn(t,"formdata",this.updateFormData),this.listenOn(t,"submit",this.handleFormSubmit)),this.listen("submit",this.handleFormSubmit)}async updateClassificationProperty(t){if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let i=this.pendingPortalItem.clone();await i.load(),Object.entries(t??{}).forEach(([a,e])=>{if(a===this.primaryAttribute){let s=R(e,i.classification,this.primaryAttribute);s=m(this.portalClassificationSchema,s),i.classification=s}else{let s=new Map(Object.entries(i.classification??{}));if(e===void 0||e===""||Array.isArray(e)&&e.length===0)s.delete(a);else if(s.set(a,e),a==="fgi"&&!s.has("fgiOptions")){let o=this.portalClassificationSchema?.attributes?.fgiOptions?.defaultValue??[];s.set("fgiOptions",Array.isArray(o)?o:[o])}i.classification=Object.fromEntries(s)}}),i.classification&&!i.classification.fgi&&delete i.classification.fgiOptions,await this.evaluateAttributeExpressions(this.portalClassificationSchema,i),i.classification=c(i.classification,this.attributeExpressionResults),i.classification&&(i.classification.banner=await V(this.portalClassificationSchema,i.classification)),this.pendingPortalItem=i,this.existingClassification&&this.validateForm(),t&&"classification"in t&&this.updateIsRequiredErrors()}handleCategorySelectChange(t){this.selectedCategory=t.target.selectedItems[0].value}async evaluateAttributeExpressions(t,i){let a=await k({portalClassificationSchema:t,itemClassification:i.classification}),e=await j({portalClassificationSchema:t,itemClassification:i.classification}),s=await M({portalClassificationSchema:t,itemClassification:i.classification});Object.keys(t.attributes).forEach(o=>{let l=a[o]?.enabled??!0,A=e[o]?.valueExpressionResult,D=s[o]?.attributeValidationResult;this.attributeExpressionResults.set(o,{enabled:l,valueExpressionResult:A,attributeValidationResult:D})})}updateIsRequiredErrors(){let t=new Set;Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([i,a])=>{a.isRequired&&!this.pendingPortalItem?.classification?.[i]&&this.pendingPortalItem?.classification?.[i]!==0&&t.add(i)}),this.isRequiredErrors=t}updateFormValidationErrors(t=!1){let i=[];Object.entries(this.portalClassificationSchema?.attributes??{})?.forEach(([a,e])=>{e.isRequired&&!this.pendingPortalItem?.classification?.[a]&&this.pendingPortalItem?.classification?.[a]!==0&&(!t||this.isRequiredErrors.has(a))&&i.push({attribute:e.label,reason:this.messages.isrequired??"is required",category:e.attributeCategory}),this.attributeExpressionResults.get(a)?.attributeValidationResult&&i.push({attribute:e.label,reason:this.attributeExpressionResults.get(a)?.attributeValidationResult??"",category:e.attributeCategory})}),this.formValidationErrors=i}async updateRemoteValidationErrors(){if(!this.pendingPortalItem?.classification)return;let t=await this.classificationModel.validateClassification(void 0,this.pendingPortalItem?.classification,this.pendingPortalItem.portal.restUrl);this.remoteValidationErrors=t}async handleFormSubmit(t){this.validateForm(),this.updateIsRequiredErrors(),this.formMainContentRef.value?.scrollIntoView()}updateFormData(t){let i=t.formData,a=this.addEditInfoAttributes();a=c(a,this.attributeExpressionResults),Object.entries(a??{}).forEach(([e,s])=>{i.set(e,s)})}renderCategoryTabs(){return this._classificationDataTask.render({complete:()=>{if(this.portalClassificationSchema?.attributeCategories?.length)return this.selectedCategory||(this.selectedCategory=this.portalClassificationSchema?.attributeCategories[0]),n`<calcite-list .label=${this.messages.selectcategory??"select category"} selection-appearance=border selection-mode=single-persist @calciteListChange=${this.handleCategorySelectChange}>${this.portalClassificationSchema.attributeCategories.map(t=>{let i=this.formValidationErrors.filter(a=>a.category===t).length;return n`<calcite-list-item .label=${t} .value=${t} .selected=${this.selectedCategory===t} .description=${i?`${i} ${i>1?this.messages.errors:this.messages.error}`:void 0}>${i&&n`<div slot=content-end class="danger"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon></div>`||""}</calcite-list-item>`})}</calcite-list>`}})}renderValidationErrors(){return this.formValidationErrors.length&&(!this.selectedCategory||this.formValidationErrors.some(t=>this.selectedCategory===t.category))?n`<calcite-notice open icon=exclamation-mark-triangle class="spacing-y" kind=danger><div slot=message>${this.messages.bannererror??"Some fields are incomplete or contain errors. Check the highlighted fields for details."}</div></calcite-notice>`:null}renderFavoriteClassification(){let t=this.portalClassificationSchema?.attributeCategories?.[0]??"Default";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=>{await this.updateClassificationData(i),this.updateFormValidationErrors(),this.updateIsRequiredErrors()}}></arcgis-portal-classification-favorite>`:null}renderForm(){return this._formCreationTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,complete:()=>{if(!this.pendingPortalItem||!this.portalClassificationSchema)return;let t=Object.entries(this.portalClassificationSchema.attributes).sort(([i],[a])=>this.getFormDisplayOrder(i)-this.getFormDisplayOrder(a));return n`${this.renderValidationErrors()}${this.renderFavoriteClassification()}${t.filter(([,{attributeCategory:i}])=>this.selectedCategory===i||!i).map(([i,a])=>{if(this.attributeExpressionResults.get(i)?.enabled===!1)return null;let e=this.pendingPortalItem?.classification?.[i];return n`<arcgis-portal-classification-form-element .attributeKey=${i} .attribute=${a} .value=${e} @arcgisAttributeValueChange=${async s=>{await this.updateClassificationProperty(s.detail),a.isRequired&&!s.detail[i]?this.isRequiredErrors.add(i):this.isRequiredErrors=new Set(Array.from(this.isRequiredErrors).filter(o=>o!==i)),this.updateFormValidationErrors(!0)}} .renderingInfo=${this.attributeExpressionResults.get(i)} .isRequiredErrors=${this.isRequiredErrors}></arcgis-portal-classification-form-element>`})}`}})}renderNotice(t,i="warning"){return n`<calcite-notice icon=exclamation-mark-triangle open class="spacing-y" .kind=${i}><div slot=message>${t}</div></calcite-notice>`}renderHelpTooltip(){return this.portalClassificationSchema?.helpTooltip?n`<calcite-action id=portal-classification-config-tooltip-button .text=${this.portalClassificationSchema?.helpTooltip} icon=information></calcite-action><calcite-popover .label=${this.portalClassificationSchema?.helpTooltip} reference-element=portal-classification-config-tooltip-button placement=bottom-end overlay-positioning=fixed auto-close><div class="header-section__title-popover"><calcite-link .href=${this.portalClassificationSchema?.helpUrl} target=_blank id=portal-classification-config-tooltip-button>${this.portalClassificationSchema?.helpTooltip}</calcite-link></div></calcite-popover>`:null}render(){return this.portalItem?this._classificationDataTask.render({pending:()=>n`<calcite-loader .label=${this.messages.loading??"loading"}></calcite-loader>`,error:()=>this.renderNotice(this.messages.anerroroccurred??"An error has occurred.","danger"),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===E.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" ${g(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.")}):this.renderNotice(this.messages.portalitemrequired??"Portal item is required.")}};y("arcgis-portal-classification-config",f);return f},"arcade","core/reactiveUtils",a,c,d)
|
package/dist/cdn/WN3TZSCN.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.79 */
|
|
4
|
-
import b from"./6W2TW24S.js";import a from"./G6NW27P4.js";import{a as o}from"./SMJ76VUJ.js";import{d as h}from"./7QVEOEKB.js";import{D as n,I as r,h as c,j as e}from"./O4GBFABF.js";export default $arcgis.t(([{c:f,d:d},{f:v}])=>{var C=c`.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}`,l=class extends n{constructor(){super(...arguments),this.messages=h(),this.selectFavoriteClassification=i=>{let a=i.target.value;if(a){this.hasUpdateError=!1;let t=this.favoriteClassifications.find(({name:s})=>s===a);t&&this.updateClassificationData(t)}},this.uploadFavoriteClassificationValueHandle=async i=>{let a=await d(this.portalItem,this.favoriteClassifications);if(this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i}),a){let{result:t,error:s}=a;if(s){console.error(s),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.uploadClassificationFavoriteError??"Failed to upload classification favorites"});return}t&&this.renderFavoriteClassificationError({alertIndicatorType:"success",alertIndicatorIcon:"check",alertIndicatorInfo:i})}},this.retrieveFavoriteClassificationHandle=async()=>{let i=await f(this.portalItem);if(i){let{result:a,error:t}=i;if(t){console.error(t),this.renderFavoriteClassificationError({alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:this.messages.retrieveClassificationFavoriteError??"Failed to retrieve classification favorites"});return}a&&this.resetFavoriteClassification(a.favorites)}},this.changeFavoriteClassificationName=i=>{let a=i.target.value;this.newFavoriteClassificationName=a,this.hasDuplicatedClassificationError=this.favoriteClassifications.some(t=>t.name===a)},this.saveNewFavoriteClassification=async()=>{let i=this.newFavoriteClassificationName;if(this.favoriteClassifications.some(s=>s.name===i)){this.hasDuplicatedClassificationError=!0;return}if(!i)return;let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a};this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.addClassificationFavoriteSuccessMessage??"Classification Favorite added successfully"),await this.retrieveFavoriteClassificationHandle(),this.showSaveClassificationDialog=!1},this.updateFavoriteClassification=async()=>{if(!this.selectedFavoriteClassificationName){this.hasUpdateError=!0;return}await this.addFavoriteClassification(this.selectedFavoriteClassificationName),await this.retrieveFavoriteClassificationHandle()},this.deleteNonEnabledAttributes=()=>{let i=structuredClone(this.portalItem?.classification??{}),a=Object.fromEntries(Object.entries(i).filter(([t])=>this.attributeExpressionResults?.get(t)?.enabled!==!1));return{...a,...v(this.portalItem,a)}},this.addFavoriteClassification=async i=>{let a=this.deleteNonEnabledAttributes(),t={name:i,classification:a},s=this.favoriteClassifications.findIndex(m=>m.name===i);s>=0?this.favoriteClassifications[s].classification=a:this.favoriteClassifications=[...this.favoriteClassifications,t],await this.uploadFavoriteClassificationValueHandle(this.messages.updateClassificationFavoriteSuccessMessage??"Classification Favorite updated successfully")},this.removeFavoriteClassification=async i=>{this.favoriteClassifications=this.favoriteClassifications.filter(a=>a.name!==i),this.favoriteClassifications.length===0&&(this.showManageClassificationDialog=!1),await this.uploadFavoriteClassificationValueHandle(this.messages.removeClassificationFavoriteSuccessMessage??"Classification Favorite removed successfully"),await this.retrieveFavoriteClassificationHandle()},this.newFavoriteClassificationName="",this.showManageClassificationDialog=!1,this.showSaveClassificationDialog=!1,this.hasDuplicatedClassificationError=!1,this.hasUpdateError=!1,this.alertIndicator={alertIndicatorType:"danger",alertIndicatorIcon:"exclamation-mark-triangle",alertIndicatorInfo:""},this.isNotificationModalActive=!1,this.favoriteClassifications=[],this.selectedFavoriteClassificationName="",this.resetFavoriteClassification=()=>{},this.updateClassificationData=()=>{},this.renderFavoriteClassificationError=i=>{let{alertIndicatorType:a,alertIndicatorIcon:t,alertIndicatorInfo:s}=i;return e`<calcite-alert .icon=${t} .label=${this.messages.classificationNotificationHandler??"Classification notification handler"} auto-close-duration=medium open .kind=${a} @calciteAlertClose=${()=>this.alertIndicator===null}><div slot=message>${s}</div></calcite-alert>`}}static{this.properties={newFavoriteClassificationName:16,showManageClassificationDialog:16,showSaveClassificationDialog:16,hasDuplicatedClassificationError:16,hasUpdateError:16,alertIndicator:16,isNotificationModalActive:16,portalItem:0,classificationValue:0,favoriteClassifications:0,selectedFavoriteClassificationName:1,attributeExpressionResults:0,resetFavoriteClassification:0,updateClassificationData:0}}static{this.styles=C}load(){this.newFavoriteClassificationName=this.classificationValue?.banner??""}onOpenFavoriteClassificationModal(){this.newFavoriteClassificationName=this.classificationValue?.banner??"",this.showSaveClassificationDialog=!0}getValidationMessage(){return this.newFavoriteClassificationName?this.hasDuplicatedClassificationError?this.messages.duplicatedClassificationError:"":this.messages.emptyFavoriteError}render(){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":""} .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} .textLabel=${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>`}};r("arcgis-portal-classification-favorite",l);return l},a,b)
|