@arcgis/portal-components 5.0.0-next.9 → 5.0.0-next.90
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/5QMVDKB4.js +4 -0
- package/dist/cdn/6FPENFUB.js +4 -0
- package/dist/cdn/ARZTGPQ2.js +4 -0
- package/dist/cdn/FZ3WPLJ6.js +4 -0
- package/dist/cdn/GK32CM5B.js +4 -0
- package/dist/cdn/JG4U25EE.js +4 -0
- package/dist/cdn/{IN2QVHWI.js → KBR6BYDK.js} +2 -2
- package/dist/cdn/KBWTPZGX.js +4 -0
- package/dist/cdn/MHTIL3KS.js +6 -0
- package/dist/cdn/NDZBDPBI.js +4 -0
- package/dist/cdn/P4U6VPVJ.js +4 -0
- package/dist/cdn/{OKJI6RLS.js → Y7XMKINS.js} +2 -2
- package/dist/cdn/YLZXV5YU.js +4 -0
- package/dist/cdn/{P3ANBRVZ.js → YPYCZ3TH.js} +1 -1
- package/dist/cdn/ZZ5BR6LQ.js +4 -0
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +164 -151
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +2 -2
- package/dist/chunks/runtime.js +2 -2
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-config/customElement.d.ts +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +7 -7
- package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +51 -0
- package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
- package/dist/components/arcgis-portal-extent-picker/index.d.ts +8 -0
- package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
- package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +28 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +26 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +3 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
- package/dist/components/arcgis-portal-field-delete/customElement.d.ts +4 -2
- package/dist/components/arcgis-portal-field-delete/customElement.js +60 -58
- package/dist/controllers/useClassificationModel.d.ts +1 -1
- package/dist/docs/api.json +301 -39
- package/dist/docs/docs.json +291 -12
- package/dist/docs/vscode.html-custom-data.json +33 -1
- package/dist/docs/web-types.json +131 -4
- package/dist/index.d.ts +27 -5
- package/dist/index.js +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +6 -4
- package/dist/types/classification.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/lumina.d.ts +14 -5
- package/dist/types/preact.d.ts +15 -5
- package/dist/types/preact10.d.ts +16 -5
- package/dist/types/react.d.ts +16 -5
- package/dist/types/stencil.d.ts +14 -5
- package/dist/utils/commonFunctions.d.ts +2 -1
- package/dist/utils/style.d.ts +1 -0
- package/package.json +6 -6
- package/dist/cdn/2DYVQAC5.js +0 -4
- package/dist/cdn/AV752DNT.js +0 -4
- package/dist/cdn/BCVIEEK7.js +0 -4
- package/dist/cdn/BNHA7WX4.js +0 -6
- package/dist/cdn/EKVOI2PF.js +0 -4
- package/dist/cdn/MBAE27EC.js +0 -4
- package/dist/cdn/PFUTMEFJ.js +0 -4
- package/dist/cdn/WMPI3QY7.js +0 -4
- package/dist/cdn/XKTVUXPB.js +0 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
2
|
+
import { default as Map } from '@arcgis/core/Map';
|
|
3
|
+
import { default as Graphic } from '@arcgis/core/Graphic.js';
|
|
4
|
+
import { default as GraphicsLayer } from '@arcgis/core/layers/GraphicsLayer.js';
|
|
5
|
+
import { default as SimpleFillSymbol } from '@arcgis/core/symbols/SimpleFillSymbol.js';
|
|
6
|
+
export default class MaskLayer {
|
|
7
|
+
private outerRing;
|
|
8
|
+
private map?;
|
|
9
|
+
private maskSymbol?;
|
|
10
|
+
maskLayer?: GraphicsLayer;
|
|
11
|
+
overlapLayer?: GraphicsLayer;
|
|
12
|
+
constructor(map: Map);
|
|
13
|
+
init(): void;
|
|
14
|
+
hide(): void;
|
|
15
|
+
show(): void;
|
|
16
|
+
add(geometry: __esri.Extent, symbol?: SimpleFillSymbol): BuildGraphicResult | undefined;
|
|
17
|
+
update(geometry: __esri.Extent, symbol?: SimpleFillSymbol, index?: number): BuildGraphicResult | undefined;
|
|
18
|
+
clear(): void;
|
|
19
|
+
remove(graphic?: Graphic | nullish, index?: number): void;
|
|
20
|
+
private buildGraphic;
|
|
21
|
+
private checkPolyOverlap;
|
|
22
|
+
private toWGS84;
|
|
23
|
+
}
|
|
24
|
+
interface BuildGraphicResult {
|
|
25
|
+
graphic?: Graphic;
|
|
26
|
+
overlap?: number[][];
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import { JsxNode, PublicLitElement as LitElement, TargetedEvent } from '@arcgis/lumina';
|
|
3
|
+
import { PropertyValues } from 'lit';
|
|
4
|
+
|
|
5
|
+
/** @private */
|
|
6
|
+
export declare class ArcgisPortalExtentPickerCoordField extends LitElement {
|
|
7
|
+
/** @default "" */
|
|
8
|
+
label: string;
|
|
9
|
+
/** @default "" */
|
|
10
|
+
value: string;
|
|
11
|
+
/** @default "" */
|
|
12
|
+
errorMessage: string;
|
|
13
|
+
/** @default -180 */
|
|
14
|
+
min: number;
|
|
15
|
+
/** @default 180 */
|
|
16
|
+
max: number;
|
|
17
|
+
validateRelated: (newValue: number) => boolean;
|
|
18
|
+
/** @default "" */
|
|
19
|
+
relatedErrorMessage: string;
|
|
20
|
+
/** @default "" */
|
|
21
|
+
inputId: string;
|
|
22
|
+
checkRelatedField(): string;
|
|
23
|
+
isValid(): boolean;
|
|
24
|
+
setFocus(): void;
|
|
25
|
+
readonly arcgisCoordChange: TargetedEvent<this, string>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
2
|
+
import { createRef as c, ref as d } from "lit/directives/ref.js";
|
|
3
|
+
import { LitElement as u, createEvent as p, safeClassMap as a, nothing as s } from "@arcgis/lumina";
|
|
4
|
+
import { css as h, html as o } from "lit";
|
|
5
|
+
import { useDirection as m } from "@arcgis/lumina/controllers";
|
|
6
|
+
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
+
v5.0.0-next.90 */
|
|
9
|
+
const g = h`.coord-field{margin-bottom:var(--calcite-spacing-sm)}.coord-label{display:block;margin-bottom:var(--calcite-spacing-sm);font-size:14px}.coordinate-input{width:100%;block-size:var(--calcite-spacing-xxxl);box-sizing:border-box;padding-inline:var(--calcite-spacing-md);font-size:14px;color:var(--calcite-color-text-3);outline-color:var(--calcite-color-brand)}.coordinate-input--error{border:1px solid var(--calcite-color-status-danger)}.coord-error-message{position:relative;max-width:100%;margin:var(--calcite-spacing-sm) 0;display:flex;font-size:14px;padding:6px 7px;background-color:var(--calcite-color-foreground-1);border:1px solid var(--calcite-color-status-danger);box-shadow:0 1px 2px #00000054}.coord-error-message:before{pointer-events:none;content:"";position:absolute;left:11px;top:-16px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-status-danger)}.coord-error-message:after{position:absolute;pointer-events:none;content:"";left:11px;top:-15px;width:0;height:0;border:8px solid transparent;border-bottom-color:var(--calcite-color-foreground-1)}.is-rtl .coord-error-message:before,.is-rtl .coord-error-message:after{left:initial;right:11px}.coord-error-message calcite-icon{color:var(--calcite-color-status-danger)}.coord-error-message__text{margin-left:var(--calcite-spacing-sm);margin-right:var(--calcite-spacing-sm);line-height:var(--calcite-spacing-xl)}`;
|
|
10
|
+
class v extends u {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this._direction = m(), this.inputEl = c(), this.isInvalid = !1, this.currentError = "", this.inputValue = "", this.label = "", this.value = "", this.errorMessage = "", this.min = -180, this.max = 180, this.validateRelated = () => !0, this.relatedErrorMessage = "", this.inputId = "", this.arcgisCoordChange = p();
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.properties = { isInvalid: 16, currentError: 16, inputValue: 16, label: 1, value: 1, errorMessage: 1, min: 9, max: 9, validateRelated: 0, relatedErrorMessage: 1, inputId: 1 };
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = g;
|
|
19
|
+
}
|
|
20
|
+
checkRelatedField() {
|
|
21
|
+
return !this.inputValue || !this.isInvalid || !this.validate(this.inputValue) ? "" : this.inputValue;
|
|
22
|
+
}
|
|
23
|
+
isValid() {
|
|
24
|
+
return !this.isInvalid;
|
|
25
|
+
}
|
|
26
|
+
setFocus() {
|
|
27
|
+
this.inputEl.value?.focus();
|
|
28
|
+
}
|
|
29
|
+
willUpdate(r) {
|
|
30
|
+
r.has("value") && this.validate(r.get("value"));
|
|
31
|
+
}
|
|
32
|
+
isValidCoord(r, t, i) {
|
|
33
|
+
if (!r?.match(/^-?[0-9]*(\.|,)?[0-9]+$/u))
|
|
34
|
+
return !1;
|
|
35
|
+
const e = this.parseNumber(r);
|
|
36
|
+
return e >= t && e <= i;
|
|
37
|
+
}
|
|
38
|
+
validate(r) {
|
|
39
|
+
if (this.isInvalid = !this.isValidCoord(r, this.min, this.max), this.isInvalid)
|
|
40
|
+
return this.currentError = this.errorMessage, !1;
|
|
41
|
+
const t = this.parseNumber(r);
|
|
42
|
+
return this.isInvalid = !this.validateRelated(t), this.isInvalid ? (this.currentError = this.relatedErrorMessage, !1) : !0;
|
|
43
|
+
}
|
|
44
|
+
parseNumber(r) {
|
|
45
|
+
const t = `-${Array.from({ length: 10 }, (e, l) => l.toString()).join("")}`;
|
|
46
|
+
let i = r.replace(",", ".");
|
|
47
|
+
return i = Array.from(i).filter((e) => t.includes(e) || e === ".").join(""), parseFloat(i);
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return o`<div class=${a({ "coord-field": !0, "is-rtl": this._direction === "rtl" })}><label class="coord-label" for=${this.inputId ?? s}>${this.label}</label><calcite-input-number number-button-type=none id=${this.inputId ?? s} class=${a({
|
|
51
|
+
"coordinate-input": !0
|
|
52
|
+
})} .value=${`${this.parseNumber(this.value)}`} @calciteInputNumberChange=${(r) => {
|
|
53
|
+
this.inputValue = r.target.value, this.validate(this.inputValue) && this.arcgisCoordChange.emit(this.inputValue);
|
|
54
|
+
}} .status=${this.isInvalid ? "invalid" : "valid"} ${d(this.inputEl)}></calcite-input-number>${this.isInvalid && o`<div class="coord-error-message"><calcite-icon icon=exclamation-mark-triangle scale=s></calcite-icon><div class="coord-error-message__text">${this.currentError}</div></div>` || ""}</div>`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
n("arcgis-portal-extent-picker-coord-field", v);
|
|
58
|
+
export {
|
|
59
|
+
v as ArcgisPortalExtentPickerCoordField
|
|
60
|
+
};
|
|
@@ -14,10 +14,12 @@ export declare class ArcgisPortalFieldDelete extends LitElement {
|
|
|
14
14
|
mapView?: __esri.MapView;
|
|
15
15
|
/** Properties that may need to be passed in case values differ from what is available on Map Viewer. */
|
|
16
16
|
options?: FieldDeleteOptions;
|
|
17
|
-
/** Emitted when the field is successfully deleted. */
|
|
18
|
-
readonly arcgisFieldsDeleted: TargetedEvent<this, void>;
|
|
19
17
|
/** Emitted before the modal is closed if the alert is handled in consumer. */
|
|
20
18
|
readonly arcgisBeforeModalClose: TargetedEvent<this, string>;
|
|
21
19
|
/** Emitted when the component is closed for any reason. */
|
|
22
20
|
readonly arcgisClose: TargetedEvent<this, void>;
|
|
21
|
+
/** Emitted when the user initiates the delete process. */
|
|
22
|
+
readonly arcgisBeforeDelete: TargetedEvent<this, void>;
|
|
23
|
+
/** Emitted when the field is successfully deleted. */
|
|
24
|
+
readonly arcgisFieldsDeleted: TargetedEvent<this, void>;
|
|
23
25
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { html as p, css as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { createRef as
|
|
5
|
-
import { Task as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { c as P } from "../../chunks/runtime.js";
|
|
2
|
+
import { html as p, css as O } from "lit";
|
|
3
|
+
import { LitElement as x, createEvent as T, renderElement as E } from "@arcgis/lumina";
|
|
4
|
+
import { createRef as w, ref as D } from "lit/directives/ref.js";
|
|
5
|
+
import { Task as L } from "@lit/task";
|
|
6
|
+
import * as S from "@arcgis/core/core/lang.js";
|
|
7
|
+
import B from "@arcgis/core/layers/support/FeatureTemplate.js";
|
|
8
|
+
import j from "@arcgis/core/Graphic.js";
|
|
9
|
+
import U from "@arcgis/core/identity/IdentityManager.js";
|
|
10
10
|
import y from "@arcgis/core/request.js";
|
|
11
|
-
import { a as
|
|
12
|
-
import { u as
|
|
11
|
+
import { i as $, a as q, g as R, b as J, d as z, s as W, e as A, f as _ } from "../../chunks/fieldAddDelete.js";
|
|
12
|
+
import { u as V } from "../../chunks/useT9n.js";
|
|
13
|
+
import { log as b, composeMissingPropertyMessage as C, composeEmptyPropertyMessage as G } from "@arcgis/toolkit/log";
|
|
13
14
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
14
15
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
15
|
-
v5.0.0-next.
|
|
16
|
+
v5.0.0-next.90 */
|
|
16
17
|
const n = /* @__PURE__ */ new Map();
|
|
17
18
|
n.set("oid", "key");
|
|
18
19
|
n.set("guid", "key");
|
|
@@ -30,23 +31,24 @@ n.set("date-only", "calendar");
|
|
|
30
31
|
n.set("time-only", "clock");
|
|
31
32
|
n.set("timestamp-offset", "time-zone");
|
|
32
33
|
n.set("string", "string");
|
|
33
|
-
const
|
|
34
|
-
class
|
|
34
|
+
const H = ({ fieldType: I }) => p`<calcite-icon scale=s .icon=${n.get(I)}></calcite-icon>`, K = O`.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}`;
|
|
35
|
+
class Q extends x {
|
|
35
36
|
constructor() {
|
|
36
|
-
super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode =
|
|
37
|
+
super(...arguments), this.arcadeExpMap = /* @__PURE__ */ new Map(), this.cancelNode = w(), this.dialogNode = w(), this.layerFields = [], this.layerFieldsMap = /* @__PURE__ */ new Map(), this.messages = V({ blocking: !0 }), this.deleteInProgress = !1, this.fieldsAreDeletable = !1, this._propWatcherTask = new L(this, {
|
|
37
38
|
task: async ([e, t]) => {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const s = $(e) && $(t);
|
|
40
|
+
if ($(e) || b("error", this, C("layer")), $(t) || b("error", this, C("fieldNames")), !s)
|
|
41
|
+
throw new Error("Required properties are missing");
|
|
40
42
|
this._propWatcherTask.autoRun = !1, await this.processProps();
|
|
41
43
|
},
|
|
42
44
|
args: () => [this.layer, this.fieldNames]
|
|
43
|
-
}), this.
|
|
45
|
+
}), this.arcgisBeforeModalClose = T(), this.arcgisClose = T(), this.arcgisBeforeDelete = T(), this.arcgisFieldsDeleted = T();
|
|
44
46
|
}
|
|
45
47
|
static {
|
|
46
|
-
this.properties = {
|
|
48
|
+
this.properties = { config: 0, fieldNames: 0, layer: 0, mapView: 0, options: 0 };
|
|
47
49
|
}
|
|
48
50
|
static {
|
|
49
|
-
this.styles =
|
|
51
|
+
this.styles = K;
|
|
50
52
|
}
|
|
51
53
|
async processProps() {
|
|
52
54
|
const { layer: e, mapView: t, fieldNames: s } = this;
|
|
@@ -59,15 +61,15 @@ class V extends M {
|
|
|
59
61
|
if (!this.layerFields?.length || a)
|
|
60
62
|
this.fieldsAreDeletable = !1;
|
|
61
63
|
else {
|
|
62
|
-
const o = await Promise.all(this.layerFields.map(async (r) => await
|
|
64
|
+
const o = await Promise.all(this.layerFields.map(async (r) => await q(t, e, r, this.options)));
|
|
63
65
|
if (this.fieldsAreDeletable = o.every((r) => r), !this.fieldsAreDeletable)
|
|
64
66
|
return;
|
|
65
67
|
}
|
|
66
|
-
if (this.layerFieldsMap = await
|
|
68
|
+
if (this.layerFieldsMap = await R(e), this.options?.ignorePopupTemplate || (this.arcadeExpMap = J(e.popupTemplate)), this.portal = e.portalItem?.portal ?? this.options?.portal, this.item = e.portalItem ?? this.options?.item, !this.item) {
|
|
67
69
|
this.fieldsAreDeletable = !1;
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
70
|
-
await
|
|
72
|
+
await U.getCredential(this.item.url.replace("rest/services", "rest/admin/services"));
|
|
71
73
|
}
|
|
72
74
|
getFieldLabel(e) {
|
|
73
75
|
const { layer: t, arcadeExpMap: s } = this;
|
|
@@ -75,12 +77,12 @@ class V extends M {
|
|
|
75
77
|
return this.getFieldDisplayNameFromLayerFields(e);
|
|
76
78
|
{
|
|
77
79
|
const o = (t.popupTemplate ?? t.createPopupTemplate()).fieldInfos?.find((r) => r.fieldName === e);
|
|
78
|
-
return o ?
|
|
80
|
+
return o ? z(t, o, s) : this.getFieldDisplayNameFromLayerFields(e);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
getFieldDisplayNameFromLayerFields(e) {
|
|
82
|
-
const t = this.layerFieldsMap.get(e);
|
|
83
|
-
return t.alias ??
|
|
84
|
+
const { layer: t } = this, s = this.layerFieldsMap.get(e);
|
|
85
|
+
return W(t) ? t.getFieldAlias(e) : s.alias ?? s.name;
|
|
84
86
|
}
|
|
85
87
|
async deleteFields() {
|
|
86
88
|
const { layer: e, fieldNames: t } = this, s = `${e.url.replace("/rest/services", "/rest/admin/services")}/${e.layerId}/deleteFromDefinition`, a = {
|
|
@@ -100,12 +102,12 @@ class V extends M {
|
|
|
100
102
|
t.forEach((i) => {
|
|
101
103
|
e.type === "feature" && e.floorInfo?.floorField === i && (e.floorInfo = null);
|
|
102
104
|
});
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
const i =
|
|
106
|
-
this.currentLayerInfo =
|
|
105
|
+
const m = await y(h, { query: { f: "json" }, responseType: "json" });
|
|
106
|
+
if (m) {
|
|
107
|
+
const i = m.data;
|
|
108
|
+
this.currentLayerInfo = m.data, i && (this.updateTypesAndTemplatesOnLayer(), t.forEach((l) => {
|
|
107
109
|
i.templates?.length ? i.templates.forEach((d) => delete d.prototype.attributes[l]) : i.types?.forEach((d) => {
|
|
108
|
-
d.templates.forEach((
|
|
110
|
+
d.templates.forEach((u) => delete u.prototype.attributes[l]);
|
|
109
111
|
});
|
|
110
112
|
}), this.updateFeatureService(i));
|
|
111
113
|
} else
|
|
@@ -128,7 +130,7 @@ class V extends M {
|
|
|
128
130
|
updateTemplatesList(e) {
|
|
129
131
|
const { currentLayerInfo: t, messages: s } = this, a = [];
|
|
130
132
|
return (e ?? []).forEach((o) => {
|
|
131
|
-
const r = new
|
|
133
|
+
const r = new B();
|
|
132
134
|
r.description = o.description ?? "", r.name = o.name || s.newFeature, r.drawingTool = o.drawingTool || "point";
|
|
133
135
|
const h = {};
|
|
134
136
|
t.fields.forEach((i) => {
|
|
@@ -140,8 +142,8 @@ class V extends M {
|
|
|
140
142
|
}
|
|
141
143
|
!l && i.editable && (h[i.name] = i.defaultValue || null);
|
|
142
144
|
});
|
|
143
|
-
const
|
|
144
|
-
r.prototype =
|
|
145
|
+
const m = new j({ attributes: h });
|
|
146
|
+
r.prototype = m, a.push(r);
|
|
145
147
|
}), a;
|
|
146
148
|
}
|
|
147
149
|
addType(e, t) {
|
|
@@ -161,48 +163,48 @@ class V extends M {
|
|
|
161
163
|
responseType: "json"
|
|
162
164
|
}).then(async (h) => {
|
|
163
165
|
if (h.data?.success) {
|
|
164
|
-
const
|
|
166
|
+
const m = `${A(this.portal)}content/items/${this.item.id}/data`;
|
|
165
167
|
if (this.options?.ignorePopupTemplate || s.forEach((i) => {
|
|
166
168
|
t.popupTemplate?.fieldInfos && (t.popupTemplate.fieldInfos = t.popupTemplate.fieldInfos.filter((l) => l.fieldName !== i)), t.popupTemplate?.content?.forEach((l, d) => {
|
|
167
|
-
l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((
|
|
169
|
+
l.type === "fields" && l.fieldInfos && ((t.popupTemplate?.content)[d].fieldInfos = (t.popupTemplate?.content)[d].fieldInfos?.filter((u) => u.fieldName !== i));
|
|
168
170
|
});
|
|
169
171
|
}), t.attributeTableTemplate) {
|
|
170
172
|
const i = t.attributeTableTemplate.clone();
|
|
171
173
|
i.elements = i.elements.filter((l) => !(l.type === "field" && s.includes(l.fieldName))), i.orderByFields = i.orderByFields.filter((l) => !s.includes(l.field)), t.attributeTableTemplate = i;
|
|
172
174
|
}
|
|
173
175
|
if (t.fieldConfigurations?.length) {
|
|
174
|
-
const l =
|
|
176
|
+
const l = S.clone(t.fieldConfigurations).filter((d) => !s.includes(d.name));
|
|
175
177
|
t.fieldConfigurations = l;
|
|
176
178
|
}
|
|
177
|
-
await y(
|
|
179
|
+
await y(m, {
|
|
178
180
|
query: { f: "json" },
|
|
179
181
|
responseType: "json"
|
|
180
182
|
}).then(async (i) => {
|
|
181
183
|
const l = i.data;
|
|
182
184
|
if (l?.layers || l?.tables) {
|
|
183
|
-
const d = t.isTable,
|
|
185
|
+
const d = t.isTable, u = d ? l.tables : l.layers, c = u?.find((g) => g.id === t.layerId);
|
|
184
186
|
if (s.forEach((g) => {
|
|
185
187
|
c?.attributeTableInfo?.attributeTableElements && (c.attributeTableInfo.attributeTableElements = c.attributeTableInfo.attributeTableElements.filter((f) => !(f.type === "field" && f.fieldName === g)), c.attributeTableInfo.orderByFields = c.attributeTableInfo.orderByFields.filter((f) => f.field !== g));
|
|
186
188
|
}), c?.layerDefinition?.fieldConfigurations && (c.layerDefinition.fieldConfigurations = c.layerDefinition.fieldConfigurations.filter((g) => !s.includes(g.name))), c?.popupInfo) {
|
|
187
|
-
s.forEach((
|
|
188
|
-
c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !==
|
|
189
|
-
v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[
|
|
189
|
+
s.forEach((F) => {
|
|
190
|
+
c.popupInfo.fieldInfos = c.popupInfo.fieldInfos.filter((v) => v.fieldName !== F), c.popupInfo.popupElements?.forEach((v, N) => {
|
|
191
|
+
v.type === "fields" && v.fieldInfos && (c.popupInfo.popupElements[N].fieldInfos = c.popupInfo.popupElements[N].fieldInfos.filter((M) => M.fieldName !== F));
|
|
190
192
|
});
|
|
191
193
|
});
|
|
192
|
-
const g = `${
|
|
193
|
-
d ? (f.tables =
|
|
194
|
-
const
|
|
194
|
+
const g = `${A(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`, f = {};
|
|
195
|
+
d ? (f.tables = u, l.layers && (f.layers = l.layers)) : (f.layers = u, l.tables && (f.tables = l.tables));
|
|
196
|
+
const k = {
|
|
195
197
|
f: "json",
|
|
196
198
|
text: JSON.stringify(f)
|
|
197
199
|
};
|
|
198
200
|
await y(g, {
|
|
199
201
|
query: {
|
|
200
|
-
...
|
|
202
|
+
...k
|
|
201
203
|
},
|
|
202
204
|
method: "post",
|
|
203
205
|
responseType: "json"
|
|
204
|
-
}).then((
|
|
205
|
-
|
|
206
|
+
}).then((F) => {
|
|
207
|
+
F.data?.success ? this.handleSuccess() : this.handleError();
|
|
206
208
|
}, () => this.handleError());
|
|
207
209
|
} else
|
|
208
210
|
this.handleSuccess();
|
|
@@ -219,20 +221,20 @@ class V extends M {
|
|
|
219
221
|
}
|
|
220
222
|
displaySuccessAlert() {
|
|
221
223
|
const { messages: e, fieldNames: t } = this;
|
|
222
|
-
this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode =
|
|
224
|
+
this.successAlertNode && (this.successAlertNode.parentElement?.removeChild(this.successAlertNode), this.successAlertNode = void 0), this.successAlertNode = E(p`<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);
|
|
223
225
|
}
|
|
224
226
|
displayErrorAlert() {
|
|
225
227
|
const { messages: e } = this;
|
|
226
|
-
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode =
|
|
228
|
+
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<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);
|
|
227
229
|
}
|
|
228
230
|
displayReadOnlyErrorAlert() {
|
|
229
231
|
const { messages: e, portal: t } = this;
|
|
230
|
-
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode =
|
|
232
|
+
this.errorAlertNode && (this.errorAlertNode.parentElement?.removeChild(this.errorAlertNode), this.errorAlertNode = void 0), this.errorAlertNode = E(p`<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 && p`<calcite-link slot=link target=_blank href=https://status.arcgis.com>${e.healthDashboard}</calcite-link>` || ""}</calcite-alert>`), document.body.append(this.errorAlertNode);
|
|
231
233
|
}
|
|
232
234
|
render() {
|
|
233
235
|
const { messages: e, fieldsAreDeletable: t, fieldNames: s, deleteInProgress: a } = this;
|
|
234
236
|
return this._propWatcherTask.render({
|
|
235
|
-
complete: () => (t || (s?.length ? s?.length === 1 ?
|
|
237
|
+
complete: () => (t || (s?.length ? s?.length === 1 ? b("error", this, "Field cannot be deleted") : b("error", this, "One or more fields cannot be deleted") : b("error", this, G("fieldNames"))), p`<calcite-dialog class="dialog" width=s open modal outside-close-disabled escape-disabled @calciteDialogClose=${() => this.arcgisClose.emit()} .heading=${s?.length === 1 ? e.deleteField : e.deleteFields} ${D(this.dialogNode)}>${t ? p`<div class=${`dialog-content-wrapper ${a ? "hide-overflow" : ""}`}>${this.renderDeleteLoader()}<calcite-label>${s.length === 1 ? e.deletePrompt : e.deleteMultiplePrompt}</calcite-label>${this.renderFieldsPreview()}</div>${this.renderCancelButton()}${this.renderDeleteButton()}` : this.renderError()}</calcite-dialog>`)
|
|
236
238
|
});
|
|
237
239
|
}
|
|
238
240
|
renderError() {
|
|
@@ -246,23 +248,23 @@ class V extends M {
|
|
|
246
248
|
renderFieldsPreview() {
|
|
247
249
|
const { fieldNames: e, layerFields: t, layerFieldsMap: s, arcadeExpMap: a, messages: o } = this;
|
|
248
250
|
return p`<calcite-list .label=${o.fields}>${e.map((r) => {
|
|
249
|
-
const h = t.find((
|
|
250
|
-
return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${
|
|
251
|
+
const h = t.find((m) => m.name === r);
|
|
252
|
+
return p`<calcite-list-item .label=${this.getFieldLabel(r)} .description=${`{${r}}`} .value=${r} .disabled=${!h.editable}><div slot=actions-end class="field-icons">${H({ fieldType: _(r, s, a) })}</div></calcite-list-item>`;
|
|
251
253
|
})}</calcite-list>`;
|
|
252
254
|
}
|
|
253
255
|
renderCancelButton() {
|
|
254
256
|
const { messages: e } = this;
|
|
255
|
-
return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${
|
|
257
|
+
return p`<calcite-button @click=${() => this.dialogNode.value.open = !1} slot=footer-end appearance=outline ${D(this.cancelNode)}>${e.cancel}</calcite-button>`;
|
|
256
258
|
}
|
|
257
259
|
renderDeleteButton() {
|
|
258
260
|
const { messages: e, fieldNames: t } = this;
|
|
259
261
|
return p`<calcite-button kind=danger slot=footer-end @click=${async (s) => {
|
|
260
262
|
const { portal: a } = this;
|
|
261
|
-
s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, await this.deleteFields());
|
|
263
|
+
s.currentTarget.disabled = !0, this.cancelNode.value.disabled = !0, this.dialogNode.value.closeDisabled = !0, a.sourceJSON?.isReadOnly ? this.handleError(!0) : (this.deleteInProgress = !0, this.requestUpdate(), this.arcgisBeforeDelete.emit(), await this.deleteFields());
|
|
262
264
|
}}>${t.length === 1 ? e.deleteField : e.deleteFieldsWithNumber.replace("${number}", `${t.length}`)}</calcite-button>`;
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
|
-
|
|
267
|
+
P("arcgis-portal-field-delete", Q);
|
|
266
268
|
export {
|
|
267
|
-
|
|
269
|
+
Q as ArcgisPortalFieldDelete
|
|
268
270
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Use this controller to access and update shared classification info
|
|
4
4
|
* between multiple instances of the classification banner.
|
|
5
5
|
*/
|
|
6
|
-
export declare const useClassificationModel: (component: import('@arcgis/lumina').LitElement & Omit<Pick<import('../models/classificationModel').ClassificationModel, "portalClassificationSchema">, "addHandles" | "declaredClass" | "destroyed" | "hasHandles" | "initialized" | "removeHandles" | "
|
|
6
|
+
export declare const useClassificationModel: (component: import('@arcgis/lumina').LitElement & Omit<Pick<import('../models/classificationModel').ClassificationModel, "portalClassificationSchema">, "set" | "addHandles" | "declaredClass" | "destroyed" | "hasHandles" | "initialized" | "removeHandles" | "watch"> & {
|
|
7
7
|
autoDestroyDisabled: boolean;
|
|
8
8
|
destroy: () => Promise<void>;
|
|
9
9
|
}) => import('../models/classificationModel').ClassificationModel;
|