@arcgis/portal-components 5.0.0-next.124 → 5.0.0-next.126

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.
Files changed (55) hide show
  1. package/dist/cdn/{RM6AIDDG.js → AHCZTVJ4.js} +2 -2
  2. package/dist/cdn/GCTJZYV7.js +4 -0
  3. package/dist/cdn/GIBWEC6K.js +4 -0
  4. package/dist/cdn/{KMD37AXG.js → HW5C3XJH.js} +1 -1
  5. package/dist/cdn/JA2VDMRG.js +4 -0
  6. package/dist/cdn/MKNHIW7X.js +4 -0
  7. package/dist/cdn/{K7OKVJO4.js → MX35WWUC.js} +2 -2
  8. package/dist/cdn/{DG5T5NHE.js → OY4KOUHF.js} +2 -2
  9. package/dist/cdn/P4LUN5GB.js +4 -0
  10. package/dist/cdn/{BXIFWHHK.js → SM2CK2AO.js} +2 -2
  11. package/dist/cdn/SV22LY6H.js +4 -0
  12. package/dist/cdn/{HWITQHPU.js → UCKMUAOS.js} +2 -2
  13. package/dist/cdn/WKZKBMHW.js +4 -0
  14. package/dist/cdn/{NY2LFOEQ.js → WNOLDDB4.js} +2 -2
  15. package/dist/cdn/{AZHELUFD.js → XUQULGNP.js} +1 -1
  16. package/dist/cdn/{26TRY2HX.js → YMTH6GIB.js} +2 -2
  17. package/dist/cdn/{XBTBPX2A.js → ZXAIECQ4.js} +2 -2
  18. package/dist/cdn/assets/portal-replacement-item-redirect/t9n/messages.en.json +1 -0
  19. package/dist/cdn/index.js +2 -2
  20. package/dist/cdn/main.css +1 -1
  21. package/dist/chunks/common.js +1 -1
  22. package/dist/chunks/fieldAddDelete.js +148 -234
  23. package/dist/chunks/item.js +103 -0
  24. package/dist/chunks/loadClassificationData.js +1 -1
  25. package/dist/chunks/requests.js +1 -1
  26. package/dist/chunks/runtime.js +1 -1
  27. package/dist/chunks/useT9n.js +1 -1
  28. package/dist/components/arcgis-portal-classification-banner/customElement.js +1 -1
  29. package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
  30. package/dist/components/arcgis-portal-classification-favorite/customElement.js +1 -1
  31. package/dist/components/arcgis-portal-classification-form-element/customElement.js +1 -1
  32. package/dist/components/arcgis-portal-extent-picker/customElement.js +1 -1
  33. package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +1 -1
  34. package/dist/components/arcgis-portal-field-delete/customElement.js +34 -33
  35. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.d.ts +24 -0
  36. package/dist/components/arcgis-portal-replacement-item-redirect/customElement.js +72 -0
  37. package/dist/components/arcgis-portal-replacement-item-redirect/index.d.ts +4 -0
  38. package/dist/components/arcgis-portal-replacement-item-redirect/index.js +4 -0
  39. package/dist/docs/api.json +159 -2
  40. package/dist/docs/docs.json +165 -2
  41. package/dist/docs/vscode.html-custom-data.json +6 -0
  42. package/dist/docs/web-types.json +27 -1
  43. package/dist/index.d.ts +5 -0
  44. package/dist/index.js +1 -1
  45. package/dist/loader.js +3 -2
  46. package/dist/types/lumina.d.ts +5 -0
  47. package/dist/types/preact.d.ts +6 -0
  48. package/dist/types/react.d.ts +7 -0
  49. package/dist/types/stencil.d.ts +5 -0
  50. package/package.json +4 -3
  51. package/dist/cdn/CUDVRICK.js +0 -4
  52. package/dist/cdn/J6M2MF6L.js +0 -4
  53. package/dist/cdn/KRHBOI3V.js +0 -4
  54. package/dist/cdn/NHYKXE24.js +0 -4
  55. package/dist/cdn/YJVU6YU3.js +0 -4
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2026-01-14T04:45:25",
2
+ "timestamp": "2026-01-15T04:43:01",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "5.0.0-next.124",
5
+ "version": "5.0.0-next.126",
6
6
  "typescriptVersion": "5.9.3"
7
7
  },
8
8
  "components": [
@@ -1349,6 +1349,169 @@
1349
1349
  "slots": [],
1350
1350
  "parts": [],
1351
1351
  "listeners": []
1352
+ },
1353
+ {
1354
+ "filePath": "src/components/portal-replacement-item-redirect/portal-replacement-item-redirect.tsx",
1355
+ "tag": "arcgis-portal-replacement-item-redirect",
1356
+ "overview": "",
1357
+ "readme": "",
1358
+ "usage": {},
1359
+ "docs": "The `arcgis-portal-replacement-item-redirect` component takes an item on a given portal, and checks if there is a replacement item associated with it\nvia the `ReplacementItem2Item` relationship.\n\nIf so, it displays a dialog to the user notifying them of the replacement item, and redirects to the replacement item's default Open Action after a timeout.",
1360
+ "docsTags": [
1361
+ {
1362
+ "name": "internal"
1363
+ },
1364
+ {
1365
+ "name": "superclass",
1366
+ "text": "{\"name\":\"PublicLitElement\",\"module\":\"PublicLitElement\",\"package\":\"@arcgis/lumina\"}"
1367
+ }
1368
+ ],
1369
+ "encapsulation": "shadow",
1370
+ "dependents": [],
1371
+ "dependencies": [],
1372
+ "dependencyGraph": {},
1373
+ "props": [
1374
+ {
1375
+ "name": "item",
1376
+ "type": "PortalItem | SearchResultItem",
1377
+ "complexType": {
1378
+ "original": "PortalItem | SearchResultItem",
1379
+ "resolved": "PortalItem | SearchResultItem",
1380
+ "references": {
1381
+ "PortalItem": {
1382
+ "location": "import",
1383
+ "path": "@arcgis/core/portal/PortalItem.d.ts",
1384
+ "id": "notImplemented"
1385
+ },
1386
+ "SearchResultItem": {
1387
+ "location": "import",
1388
+ "path": "@arcgis/app-components/dist/types/utils/types.d.ts",
1389
+ "id": "notImplemented"
1390
+ }
1391
+ }
1392
+ },
1393
+ "mutable": true,
1394
+ "reflectToAttr": false,
1395
+ "docs": "The deprecated/retired item to be checked for a replacement",
1396
+ "docsTags": [],
1397
+ "values": [
1398
+ {
1399
+ "type": "PortalItem"
1400
+ },
1401
+ {
1402
+ "type": "SearchResultItem"
1403
+ }
1404
+ ],
1405
+ "optional": true,
1406
+ "required": false
1407
+ },
1408
+ {
1409
+ "name": "portal",
1410
+ "type": "Portal",
1411
+ "complexType": {
1412
+ "original": "Portal",
1413
+ "resolved": "Portal",
1414
+ "references": {
1415
+ "Portal": {
1416
+ "location": "import",
1417
+ "path": "@arcgis/core/portal/Portal.d.ts",
1418
+ "id": "notImplemented"
1419
+ }
1420
+ }
1421
+ },
1422
+ "mutable": true,
1423
+ "reflectToAttr": false,
1424
+ "docs": "The portal instance",
1425
+ "docsTags": [],
1426
+ "values": [],
1427
+ "optional": true,
1428
+ "required": false
1429
+ },
1430
+ {
1431
+ "name": "user",
1432
+ "type": "PortalUser",
1433
+ "complexType": {
1434
+ "original": "PortalUser",
1435
+ "resolved": "PortalUser",
1436
+ "references": {
1437
+ "PortalUser": {
1438
+ "location": "import",
1439
+ "path": "@arcgis/core/portal/PortalUser.d.ts",
1440
+ "id": "notImplemented"
1441
+ }
1442
+ }
1443
+ },
1444
+ "mutable": true,
1445
+ "reflectToAttr": false,
1446
+ "docs": "The signed in user",
1447
+ "docsTags": [],
1448
+ "values": [],
1449
+ "optional": true,
1450
+ "required": false
1451
+ }
1452
+ ],
1453
+ "methods": [
1454
+ {
1455
+ "name": "componentOnReady",
1456
+ "returns": {
1457
+ "type": "Promise<this>",
1458
+ "docs": ""
1459
+ },
1460
+ "complexType": {
1461
+ "signature": "(): Promise<this>",
1462
+ "parameters": [],
1463
+ "return": "Promise<this>",
1464
+ "references": {
1465
+ "Promise": {
1466
+ "location": "import",
1467
+ "path": "typescript/lib/lib.es5.d.ts",
1468
+ "id": "notImplemented"
1469
+ }
1470
+ }
1471
+ },
1472
+ "signature": "componentOnReady(): Promise<this>",
1473
+ "parameters": [],
1474
+ "docs": "Create a promise that resolves once component is fully loaded.",
1475
+ "docsTags": [
1476
+ {
1477
+ "name": "example",
1478
+ "text": "```js\nconst arcgisPortalReplacementItemRedirect = document.querySelector(\"arcgis-portal-replacement-item-redirect\");\ndocument.body.append(arcgisPortalReplacementItemRedirect);\nawait arcgisPortalReplacementItemRedirect.componentOnReady();\nconsole.log(\"arcgis-portal-replacement-item-redirect is ready to go!\");\n```"
1479
+ },
1480
+ {
1481
+ "name": "inheritedFrom",
1482
+ "text": "{\"name\":\"PublicLitElement\",\"module\":\"PublicLitElement\",\"package\":\"@arcgis/lumina\"}"
1483
+ }
1484
+ ]
1485
+ },
1486
+ {
1487
+ "name": "setFocus",
1488
+ "returns": {
1489
+ "type": "Promise<void>",
1490
+ "docs": ""
1491
+ },
1492
+ "complexType": {
1493
+ "signature": "(): Promise<void>",
1494
+ "parameters": [],
1495
+ "return": "Promise<void>",
1496
+ "references": {
1497
+ "Promise": {
1498
+ "location": "import",
1499
+ "path": "typescript/lib/lib.es5.d.ts",
1500
+ "id": "notImplemented"
1501
+ }
1502
+ }
1503
+ },
1504
+ "signature": "setFocus(): Promise<void>",
1505
+ "parameters": [],
1506
+ "docs": "Set focus on the component",
1507
+ "docsTags": []
1508
+ }
1509
+ ],
1510
+ "events": [],
1511
+ "styles": [],
1512
+ "slots": [],
1513
+ "parts": [],
1514
+ "listeners": []
1352
1515
  }
1353
1516
  ],
1354
1517
  "typeLibrary": {}
@@ -125,6 +125,12 @@
125
125
  "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<this>` - Create a promise that resolves once component is fully loaded.",
126
126
  "attributes": [],
127
127
  "references": []
128
+ },
129
+ {
130
+ "name": "arcgis-portal-replacement-item-redirect",
131
+ "description": "The `arcgis-portal-replacement-item-redirect` component takes an item on a given portal, and checks if there is a replacement item associated with it\nvia the `ReplacementItem2Item` relationship.\n\nIf so, it displays a dialog to the user notifying them of the replacement item, and redirects to the replacement item's default Open Action after a timeout.\n--\n\n### Methods\n- `componentOnReady(): Promise<this>` - Create a promise that resolves once component is fully loaded.\n- `setFocus(): Promise<void>` - Set focus on the component",
132
+ "attributes": [],
133
+ "references": []
128
134
  }
129
135
  ]
130
136
  }
@@ -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.124",
4
+ "version": "5.0.0-next.126",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -429,6 +429,32 @@
429
429
  }
430
430
  ]
431
431
  }
432
+ },
433
+ {
434
+ "name": "arcgis-portal-replacement-item-redirect",
435
+ "description": "The `arcgis-portal-replacement-item-redirect` component takes an item on a given portal, and checks if there is a replacement item associated with it\nvia the `ReplacementItem2Item` relationship.\n\nIf so, it displays a dialog to the user notifying them of the replacement item, and redirects to the replacement item's default Open Action after a timeout.\n--\n\n### Methods\n- `componentOnReady(): Promise<this>` - Create a promise that resolves once component is fully loaded.\n- `setFocus(): Promise<void>` - Set focus on the component",
436
+ "attributes": [],
437
+ "events": [],
438
+ "js": {
439
+ "properties": [
440
+ {
441
+ "name": "item",
442
+ "description": "The deprecated/retired item to be checked for a replacement",
443
+ "type": "PortalItem | SearchResultItem"
444
+ },
445
+ {
446
+ "name": "portal",
447
+ "description": "The portal instance",
448
+ "type": "Portal"
449
+ },
450
+ {
451
+ "name": "user",
452
+ "description": "The signed in user",
453
+ "type": "PortalUser"
454
+ }
455
+ ],
456
+ "events": []
457
+ }
432
458
  }
433
459
  ]
434
460
  },
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { ArcgisPortalClassificationFavorite } from "./components/arcgis-por
4
4
  import type { ArcgisPortalClassificationFormElement } from "./components/arcgis-portal-classification-form-element/customElement.js";
5
5
  import type { ArcgisPortalExtentPicker } from "./components/arcgis-portal-extent-picker/customElement.js";
6
6
  import type { ArcgisPortalFieldDelete } from "./components/arcgis-portal-field-delete/customElement.js";
7
+ import type { ArcgisPortalReplacementItemRedirect } from "./components/arcgis-portal-replacement-item-redirect/customElement.js";
7
8
 
8
9
  /**
9
10
  * Place in this file any utility functions you wish to expose for the consumers
@@ -47,6 +48,7 @@ declare global {
47
48
  "arcgis-portal-classification-form-element": ArcgisPortalClassificationFormElement;
48
49
  "arcgis-portal-extent-picker": ArcgisPortalExtentPicker;
49
50
  "arcgis-portal-field-delete": ArcgisPortalFieldDelete;
51
+ "arcgis-portal-replacement-item-redirect": ArcgisPortalReplacementItemRedirect;
50
52
  }
51
53
 
52
54
  type HTMLArcgisPortalClassificationBannerElement = ArcgisPortalClassificationBanner;
@@ -71,4 +73,7 @@ declare global {
71
73
  type HTMLArcgisPortalFieldDeleteElement = ArcgisPortalFieldDelete;
72
74
 
73
75
 
76
+ type HTMLArcgisPortalReplacementItemRedirectElement = ArcgisPortalReplacementItemRedirect;
77
+
78
+
74
79
  }
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.124 */
5
+ v5.0.0-next.126 */
6
6
  export {
7
7
  o as canAddField,
8
8
  r as canDeleteField,
package/dist/loader.js CHANGED
@@ -2,7 +2,7 @@ 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.124 */
5
+ v5.0.0-next.126 */
6
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"],
@@ -10,7 +10,8 @@ const r = t(e, {
10
10
  "arcgis-portal-classification-form-element": [() => import("./components/arcgis-portal-classification-form-element/customElement.js"), "attribute:,attributeKey,isRequiredErrors:,renderingInfo:,value:"],
11
11
  "arcgis-portal-extent-picker": [() => import("./components/arcgis-portal-extent-picker/customElement.js"), "active,contentOnly,extentService,extentValue:,isArea,itemId,portal:;;getExtent"],
12
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"],
13
- "arcgis-portal-field-delete": [() => import("./components/arcgis-portal-field-delete/customElement.js"), "config:,fieldNames:,layer:,mapView:,options:"]
13
+ "arcgis-portal-field-delete": [() => import("./components/arcgis-portal-field-delete/customElement.js"), "config:,fieldNames:,layer:,mapView:,options:"],
14
+ "arcgis-portal-replacement-item-redirect": [() => import("./components/arcgis-portal-replacement-item-redirect/customElement.js"), "item:,portal:,user:;setFocus"]
14
15
  });
15
16
  export {
16
17
  r as defineCustomElements
@@ -5,6 +5,7 @@ import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-po
5
5
  import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/customElement.js";
6
6
  import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/customElement.js";
7
7
  import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/customElement.js";
8
+ import type { ArcgisPortalReplacementItemRedirect } from "../components/arcgis-portal-replacement-item-redirect/customElement.js";
8
9
  import type { h, EventHandler } from "@arcgis/lumina";
9
10
 
10
11
  interface LuminaArcgisPortalClassificationBanner extends Partial<Pick<ArcgisPortalClassificationBanner, 'missingExistingClassification' | 'portalItem' | 'validationErrors' | 'variant'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalClassificationBannerElement> {
@@ -34,6 +35,9 @@ interface LuminaArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDe
34
35
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
35
36
  }
36
37
 
38
+ interface LuminaArcgisPortalReplacementItemRedirect extends Partial<Pick<ArcgisPortalReplacementItemRedirect, 'item' | 'portal' | 'user'>>, h.JSX.HTMLAttributes<HTMLArcgisPortalReplacementItemRedirectElement> {
39
+ }
40
+
37
41
  declare module "@arcgis/lumina" {
38
42
  export namespace h.JSX {
39
43
  interface IntrinsicElements {
@@ -43,6 +47,7 @@ declare module "@arcgis/lumina" {
43
47
  "arcgis-portal-classification-form-element": LuminaArcgisPortalClassificationFormElement;
44
48
  "arcgis-portal-extent-picker": LuminaArcgisPortalExtentPicker;
45
49
  "arcgis-portal-field-delete": LuminaArcgisPortalFieldDelete;
50
+ "arcgis-portal-replacement-item-redirect": LuminaArcgisPortalReplacementItemRedirect;
46
51
  }
47
52
  }
48
53
  }
@@ -5,6 +5,7 @@ import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-po
5
5
  import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/customElement.js";
6
6
  import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/customElement.js";
7
7
  import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/customElement.js";
8
+ import type { ArcgisPortalReplacementItemRedirect } from "../components/arcgis-portal-replacement-item-redirect/customElement.js";
8
9
  import { HTMLAttributes } from "preact";
9
10
  import type { EventHandler } from "@arcgis/lumina";
10
11
 
@@ -35,6 +36,9 @@ interface PreactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDe
35
36
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
36
37
  }
37
38
 
39
+ interface PreactArcgisPortalReplacementItemRedirect extends Partial<Pick<ArcgisPortalReplacementItemRedirect, 'item' | 'portal' | 'user'>>, HTMLAttributes<HTMLArcgisPortalReplacementItemRedirectElement> {
40
+ }
41
+
38
42
  declare module 'preact' {
39
43
  namespace createElement.JSX {
40
44
  interface IntrinsicElements {
@@ -44,6 +48,7 @@ declare module 'preact' {
44
48
  "arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
45
49
  "arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
46
50
  "arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
51
+ "arcgis-portal-replacement-item-redirect": PreactArcgisPortalReplacementItemRedirect;
47
52
  }
48
53
  }
49
54
  namespace h.JSX {
@@ -54,6 +59,7 @@ declare module 'preact' {
54
59
  "arcgis-portal-classification-form-element": PreactArcgisPortalClassificationFormElement;
55
60
  "arcgis-portal-extent-picker": PreactArcgisPortalExtentPicker;
56
61
  "arcgis-portal-field-delete": PreactArcgisPortalFieldDelete;
62
+ "arcgis-portal-replacement-item-redirect": PreactArcgisPortalReplacementItemRedirect;
57
63
  }
58
64
  }
59
65
  }
@@ -5,6 +5,7 @@ import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-po
5
5
  import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/customElement.js";
6
6
  import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/customElement.js";
7
7
  import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/customElement.js";
8
+ import type { ArcgisPortalReplacementItemRedirect } from "../components/arcgis-portal-replacement-item-redirect/customElement.js";
8
9
  import type { HTMLProps } from 'react';
9
10
  import type { EventHandler } from "@arcgis/lumina";
10
11
 
@@ -35,6 +36,9 @@ interface ReactArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldDel
35
36
  onarcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
36
37
  }
37
38
 
39
+ interface ReactArcgisPortalReplacementItemRedirect extends Partial<Pick<ArcgisPortalReplacementItemRedirect, 'item' | 'portal' | 'user'>>, HTMLProps<HTMLArcgisPortalReplacementItemRedirectElement> {
40
+ }
41
+
38
42
  declare module "react" {
39
43
  namespace JSX {
40
44
  interface IntrinsicElements {
@@ -44,6 +48,7 @@ declare module "react" {
44
48
  "arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
45
49
  "arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
46
50
  "arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
51
+ "arcgis-portal-replacement-item-redirect": ReactArcgisPortalReplacementItemRedirect;
47
52
  }
48
53
  }
49
54
  }
@@ -56,6 +61,7 @@ declare module "react/jsx-runtime" {
56
61
  "arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
57
62
  "arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
58
63
  "arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
64
+ "arcgis-portal-replacement-item-redirect": ReactArcgisPortalReplacementItemRedirect;
59
65
  }
60
66
  }
61
67
  }
@@ -68,6 +74,7 @@ declare module "react/jsx-dev-runtime" {
68
74
  "arcgis-portal-classification-form-element": ReactArcgisPortalClassificationFormElement;
69
75
  "arcgis-portal-extent-picker": ReactArcgisPortalExtentPicker;
70
76
  "arcgis-portal-field-delete": ReactArcgisPortalFieldDelete;
77
+ "arcgis-portal-replacement-item-redirect": ReactArcgisPortalReplacementItemRedirect;
71
78
  }
72
79
  }
73
80
  }
@@ -5,6 +5,7 @@ import type { ArcgisPortalClassificationFavorite } from "../components/arcgis-po
5
5
  import type { ArcgisPortalClassificationFormElement } from "../components/arcgis-portal-classification-form-element/customElement.js";
6
6
  import type { ArcgisPortalExtentPicker } from "../components/arcgis-portal-extent-picker/customElement.js";
7
7
  import type { ArcgisPortalFieldDelete } from "../components/arcgis-portal-field-delete/customElement.js";
8
+ import type { ArcgisPortalReplacementItemRedirect } from "../components/arcgis-portal-replacement-item-redirect/customElement.js";
8
9
  import { JSXBase as StencilJsx } from "@stencil/core/internal";
9
10
  import type { EventHandler } from "@arcgis/lumina";
10
11
 
@@ -35,6 +36,9 @@ interface StencilArcgisPortalFieldDelete extends Partial<Pick<ArcgisPortalFieldD
35
36
  onArcgisFieldsDeleted?: EventHandler<HTMLArcgisPortalFieldDeleteElement["arcgisFieldsDeleted"]>;
36
37
  }
37
38
 
39
+ interface StencilArcgisPortalReplacementItemRedirect extends Partial<Pick<ArcgisPortalReplacementItemRedirect, 'item' | 'portal' | 'user'>>, StencilJsx.HTMLAttributes<HTMLArcgisPortalReplacementItemRedirectElement> {
40
+ }
41
+
38
42
  interface ExposedElements {
39
43
  "arcgis-portal-classification-banner": StencilArcgisPortalClassificationBanner;
40
44
  "arcgis-portal-classification-config": StencilArcgisPortalClassificationConfig;
@@ -42,6 +46,7 @@ interface ExposedElements {
42
46
  "arcgis-portal-classification-form-element": StencilArcgisPortalClassificationFormElement;
43
47
  "arcgis-portal-extent-picker": StencilArcgisPortalExtentPicker;
44
48
  "arcgis-portal-field-delete": StencilArcgisPortalFieldDelete;
49
+ "arcgis-portal-replacement-item-redirect": StencilArcgisPortalReplacementItemRedirect;
45
50
  }
46
51
 
47
52
  export namespace JSX {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/portal-components",
3
- "version": "5.0.0-next.124",
3
+ "version": "5.0.0-next.126",
4
4
  "description": "ArcGIS Portal Components",
5
5
  "keywords": [
6
6
  "ArcGIS",
@@ -38,8 +38,9 @@
38
38
  ],
39
39
  "license": "SEE LICENSE IN LICENSE.md",
40
40
  "dependencies": {
41
- "@arcgis/lumina": "5.0.0-next.124",
42
- "@arcgis/toolkit": "5.0.0-next.124",
41
+ "@arcgis/app-components": "~4.15.9",
42
+ "@arcgis/lumina": "5.0.0-next.126",
43
+ "@arcgis/toolkit": "5.0.0-next.126",
43
44
  "@lit/task": "^1.0.3",
44
45
  "lit": "^3.3.0",
45
46
  "tslib": "^2.8.1"
@@ -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.124 */
4
- import{a as m}from"./NHYKXE24.js";import{a as h}from"./26TRY2HX.js";import"./K7OKVJO4.js";import{H as b,K as a,N as d,h as c,j as i,t as u}from"./HWITQHPU.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 s(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 s(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 s(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(!s(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 s(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} .heading=${t.label} .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)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`)}renderMultiSelect(){return s(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)} .heading=${t} .value=${t}>${r.map(l=>i`<calcite-combobox-item .selected=${e?.includes(l.value)} .heading=${l.label} .value=${l.value} data-testid=${`grouped-combobox-item-${l.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`)}renderMultiGroupedSelectNested(){return s(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};
@@ -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.124 */
4
- import a from"./AZHELUFD.js";import{b as P}from"./RM6AIDDG.js";import{a as b}from"./K7OKVJO4.js";import{l as v,q as g,r as C,v as w}from"./HWITQHPU.js";export default $arcgis.t(([j,{property:p,subclass:I},{on:Y,watch:M},{createObservable:D,trackAccess:O},{property:J,subclass:Q},z,{a:E,b:x}])=>{var A=(t,o)=>i=>U(i,t),u=class extends w{constructor(o,i){super(o),this.Y=new Map,this.A=void 0,this.#e=D();let e=this;e.#t=i,e.Z(),e.setProvisionalExports(S(o,new WeakRef(e),o.M.length-1,e.instance,e.Y),!1),g(o,r=>{if(r){let n=M(()=>o[r],s=>{if(s===e.instance)return;let c=e.instance;e.exports=s,e.instance=s,e.Y.forEach((d,m)=>o.requestUpdate(d,c[m])),e.#o&&c.destroy(),e.#o=!1},{sync:!0});e.onDestroy(n.remove)}},e.exports)}#o;#e;#t;get exports(){return O(this.#e),super.exports}set exports(o){super.exports=o,this.#e.notify()}Z(){let o=this;o.instance="prototype"in o.#t&&"declaredClass"in o.#t.prototype?new o.#t:o.#t(),o.#o=!0}hostConnected(){this.exports=this.instance}hostDestroy(){this.#o&&this.instance.destroy?.()}},U=b(u),S=(t,o,i,e,r)=>new Proxy(e,{get:(n,s)=>{let c=n[s];if(typeof s=="symbol"||r.has(s))return c;let d=t.M[i];return d.A=s,C(t,m=>{if(d.A=void 0,m!==void 0){let f=m.key;r.set(s,f);let h=t.constructor.getPropertyOptions(f),y=s!==f&&f.toLowerCase().includes("disable");$(o,h,s,f,y),h.i===void 0&&N(h,i,s,y)}},c)}}),$=(t,o,i,e,r,n)=>n=M(()=>{let s=t.deref();return s===void 0||s.component.manager.destroyed?n=n.remove():s.exports[i]},(s,c)=>{if(!n)return;t.deref().component?.requestUpdate(e,r?!c:c),o.c=!1},{sync:!0}),N=(t,o,i,e)=>{t.d.get=function(){let r=this.M[o]?.exports[i];return e?!r:r},t.d.set=function(r){let n=this.M[o];n.A!==i&&(n.exports[i]=e?!r:r)}};var L=Object.defineProperty,V=Object.getOwnPropertyDescriptor,l=(t,o,i,e)=>{for(var r=e>1?void 0:e?V(o,i):o,n=t.length-1,s;n>=0;n--)(s=t[n])&&(r=(e?s(o,i,r):s(r))||r);return e&&r&&L(o,i,r),r},a=class extends j{constructor(){super(...arguments),this.fetching=!1,this.status="idle",this.error=void 0,this.portalUrl=void 0,this._itemClassificationValidationErrors=new Map,this.fetchingPromise=new v}get primaryAttribute(){return this.portalClassificationSchema?.classificationMetadata.primaryAttribute}setPortalClassificationData({portalUrl:t,schema:o}){this.portalUrl=t,this.portalClassificationSchema=o,this.status="loaded",this.fetchingPromise.resolve(!0)}setFetching(t){this.fetching=t}async loadPortalClassificationData(t,{signal:o}){this.status="loading";let{result:i,error:e}=await E(t,o);if(e){e.name==="AbortError"?console.log("Request aborted."):(this.error=e,this.status="error",this.fetchingPromise.reject(e));return}else this.setPortalClassificationData({schema:i,portalUrl:t})}async validateClassification(t,o,i,e){if(!o)return"";let r=t?this._itemClassificationValidationErrors.get(t):void 0;if(r)return await r;let n=(async()=>{let{error:s}=await x(i,o,e??{});return s?s?.details.raw.messages.join(", "):""})();return t&&this._itemClassificationValidationErrors.set(t,n),t?await this._itemClassificationValidationErrors.get(t):await n}};l([p()],a.prototype,"portalClassificationSchema",2);l([p()],a.prototype,"fetching",2);l([p()],a.prototype,"status",2);l([p()],a.prototype,"error",2);l([p()],a.prototype,"portalUrl",2);l([p()],a.prototype,"_itemClassificationValidationErrors",2);a=l([I("custom.ClassificationModel")],a);var k;function _(t){return k??=new a(t),k}var at=A(_),ct=t=>new P(t,{task:async([o],{signal:i})=>{if(!o)throw new Error("Portal item is required to load classification data");if(o.loaded||await o.load({signal:i}),t.itemClassification=o.classification,t.classificationModel.status==="loading"&&await t.classificationModel.fetchingPromise.promise,!t.portalItem?.portal.hasClassificationSchema){t.classificationModel.setPortalClassificationData({portalUrl:o.portal.restUrl,schema:void 0});return}(t.classificationModel.status==="idle"||t.classificationModel.status==="loaded"&&t.classificationModel.portalUrl!==o.portal.restUrl)&&await t.classificationModel.loadPortalClassificationData(o.portal.restUrl,{signal:i})},args:()=>[t.portalItem]});return{a:at,b:ct}},"core/Accessor","core/accessorSupport/decorators","core/reactiveUtils","applications/Components/reactiveUtils","core/accessorSupport/decorators","core/Accessor",a)
@@ -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.124 */
4
- import{b as G}from"./RM6AIDDG.js";import{a as V}from"./26TRY2HX.js";import"./K7OKVJO4.js";import{F as C,G as k,H as q,L as S,N as W,h as J,j as y,m as T,o as A,p as B,t as $}from"./HWITQHPU.js";export default $arcgis.t(([Q,Ne,Te,$e,D,I,te,se,L,E,x])=>{var M=(i=>(i.expression="expression/",i.raster="Raster.",i.relationship="relationships/",i))(M||{}),ie=["feature"];function O(i){return"fieldConfigurations"in i&&ie.includes(i.type)}function F(i){return i!=null}function _(i,e,t){let s=e.fieldName;if(s.includes(M.expression)){let r=t.get(s);return r?.title?r.title:s}else return O(i)&&i.getFieldConfiguration(s)?i.getFieldAlias(s)||s:e.label||s}function z(i,e,t){let s="";if(/^raster.(?:item|service)pixelvalue/iu.test(i))s="number";else if(e.has(i)){let r=e.get(i);s=r.type?r.type.toLowerCase():""}else if(t.has(i)){let r=t.get(i);s=r.returnType?r.returnType.toLowerCase():""}else s="number";return s}async function U(i){return new Map((await re(i)).filter(e=>e.visible).map(e=>[e.name,e]))}function K(i){let e=new Map;return i?.expressionInfos&&i.expressionInfos.forEach(t=>{let s=`${M.expression}${t.name}`;e.set(s,t)}),e}async function re(i){return await new Promise((e,t)=>{switch(i.type){case"feature":case"ogc-feature":case"stream":e(i.fields);break;case"sublayer":{let s=i,r=s?.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(s.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(s.fields)}).catch(a=>{t(new Error(a))}):e(s.fields);break}case"imagery":case"imagery-tile":case"wcs":e(i.rasterFields);break;default:e("fields"in i?i.fields??[]:[])}})}var ae=i=>i&&!i.endsWith("/")?`${i}/`:i;function N(i){return ae(i.restUrl)}function ne(i,e){return H(i,e)||oe(i,e)}function H(i,e){return i.owner===e.username}function oe(i,e){let t=i.owner,s=i.itemControl==="admin",r=["esri_livingatlas","esri_demographics","esri_boundaries"];return i.portal?.isPortal&&!H(i,e)&&s&&t?.includes("esri_")&&!r.includes(t)?!1:s}function le(i){return i.typeKeywords?.includes("Spatiotemporal")}function de(i){return i.typeKeywords?.includes("View Service")}function ce(i){return i.typeKeywords?.includes("Hosted Service")}function pe(i){return i.typeKeywords?.includes("Multi Services View")}function fe(i){return i?.hasViews&&!i.sourceSchemaChangesAllowed}async function ue(i){let e=i?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal;if(t?.user){let s=`${N(t)}community/users/${t.user.username}`;return await E(s,{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 me(i){let e=i?.portalItem;if(!e)return await Promise.resolve(null);let t=e.portal,s=`${N(t)}content/items/${e.id}/groups`;return await E(s,{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 he(i,e,{relationshipType:t,direction:s}){let r=`${N(e)}content/items/${i}/relatedItems`;return await E(r,{query:{f:"json",relationshipType:t,direction:s},responseType:"json"})}function ye(i,e){return i?.some(t=>e?.some(s=>t.id===s.id&&t.capabilities.includes("updateitemcontrol")))}function d(i,e){return!i||!e?!1:i.toLocaleLowerCase()===e.toLocaleLowerCase()}async function X(i,e,t,s){if(!t)return!1;let r=["feature","oriented-imagery"].includes(e.type),a=s?.item??e.portalItem,n=e.sourceJSON;if(!r||!a||!a.portal.user||!ce(a)||de(a)||pe(a)||fe(n)||a.portal.isPortal&&le(a)||["oid","global-id","geometry"].includes(t.type)||await ge(e,t.name,s))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(!s?.ignoreLayerRenderer&&e.featureReduction){let u=new Set;if(await I.collectFeatureReductionFields(u,e,e.featureReduction),Array.from(u).some(b=>d(b,t.name)))return!1}if(!s?.ignoreLayerRenderer&&(await I.getRendererFields(e.renderer,e.fieldsIndex)).some(u=>d(u,t.name)))return!1;if(!s?.ignoreLayerLabelingInfo){let u=e.labelingInfo?.map(b=>b.labelExpressionInfo?.expression);if(u&&((await I.getExpressionFields(e,u)).some(b=>d(b,t.name))||await Y(e,t,"layer")))return!1}if(!s?.ignoreLayerDefinitionExpression&&e.definitionExpression&&(await x.parseWhereClause(e.definitionExpression,e.fieldsIndex)).fieldNames.some(u=>d(u,t.name))||await be(e,t,s)||await Ie(e,t))return!1;if(await ve(e,t))return await Promise.resolve(!1);if(await Fe(e,t))return await Promise.resolve(!1);if(we(i,e,t)||e.relationships?.map(u=>u.keyField)?.some(u=>d(u,t.name)))return!1;let f=ne(a,a.portal.user),v=s?.userItemInfo?.userGroups??await ue(e)??[],h=s?.userItemInfo?.itemGroups??await me(e)??[],w=ye(v,h);if(!f&&!w)return!1;let g=s?.userItemInfo?.relatedItems??await he(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 ge(i,e,t){let s=`${i.url}/${i.layerId}/fieldGroups`,r=t?.userItemInfo&&"fieldGroups"in t.userItemInfo?t.userItemInfo.fieldGroups:(await E(s,{query:{f:"json"},responseType:"json"}))?.data?.fieldGroups;return r?r.some(a=>a.fields.some(n=>d(n,e))):!1}function we(i,e,t){if(!i)return!1;let s=i.map?.applicationProperties?.viewing?.search;if(s){let r=s.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 Y(i,e,t){let s=t==="layer"?i.labelingInfo?.filter(n=>F(n.where)):i.sourceJSON?.drawingInfo?.labelingInfo?.filter(n=>F(n.where));if(!s?.length)return!1;let r=[...await Promise.all(s.map(async n=>await x.parseWhereClause(n.where,i.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 be(i,e,t){let s=i.portalItem;if(!s)return!1;let r=`${N(s.portal)}content/items/${s.id}/data`,a=(t?.userItemInfo?.itemData??await E(r,{query:{f:"json"},responseType:"json"}))?.data;if(!a)return!1;if(a?.layers){let n=a.layers.find(l=>l.id===i.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=L.fromJSON(c);if((await I.getRendererFields(l,i.fieldsIndex)).some(f=>d(f,e.name)))return!0}if(!t?.ignoreItemFeatureReduction&&p&&await Z(i,e,p)||o&&(await x.parseWhereClause(o,i.fieldsIndex)).fieldNames.some(l=>d(l,e.name)))return!0}return!1}async function Ie(i,e){let t=i.sourceJSON,s=t?.drawingInfo?.renderer,r=t?.featureReduction;if(!s&&!r)return!1;if(s){let a=L.fromJSON(s);if((await I.getRendererFields(a,i.fieldsIndex)).some(n=>d(n,e.name)))return!0}return!!(r&&await Z(i,e,r))}async function ve(i,e){let t=i.sourceJSON?.drawingInfo?.labelingInfo;if(!t)return await Promise.resolve(!1);let s=t?.map(r=>r.labelExpressionInfo?.expression);if(s){if((await I.getExpressionFields(i,s)).some(r=>d(r,e.name)))return await Promise.resolve(!0);if(await Y(i,e,"service"))return await Promise.resolve(!0)}return await Promise.resolve(!1)}async function Fe(i,e){let t=i.sourceJSON?.definitionQuery;return t?(await x.parseWhereClause(t,i.fieldsIndex)).fieldNames.some(s=>d(s,e.name))?await Promise.resolve(!0):await Promise.resolve(!1):await Promise.resolve(!1)}async function Z(i,e,t){let s=t.type==="binning"?te.fromJSON(t):se.fromJSON(t),r=new Set;return await I.collectFeatureReductionFields(r,i,s),!!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 Ee=({fieldType:i})=>y`<calcite-icon scale=s .icon=${m.get(i)}></calcite-icon>`,xe=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}`,j=class extends q{constructor(){super(...arguments),this.arcadeExpMap=new Map,this.cancelNode=C(),this.dialogNode=C(),this.layerFields=[],this.layerFieldsMap=new Map,this.messages=V({blocking:!0}),this.deleteInProgress=!1,this.fieldsAreDeletable=!1,this._propWatcherTask=new G(this,{task:async([e,t])=>{let s=F(e)&&F(t);if(F(e)||T("error",this,A("layer")),F(t)||T("error",this,A("fieldNames")),!s)throw new Error("Required properties are missing");this._propWatcherTask.autoRun=!1,await this.processProps()},args:()=>[this.layer,this.fieldNames]}),this.arcgisBeforeModalClose=$(),this.arcgisClose=$(),this.arcgisBeforeDelete=$(),this.arcgisFieldsDeleted=$()}static{this.properties={config:0,fieldNames:0,layer:0,mapView:0,options:0}}static{this.styles=xe}async processProps(){let{layer:e,mapView:t,fieldNames:s}=this;if(!e||!s){this.fieldsAreDeletable=!1;return}e.loaded||await e.load(),this.layerFields=e.fields.filter(a=>s.includes(a.name));let r=s.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 X(t,e,n,this.options)));if(this.fieldsAreDeletable=a.every(n=>n),!this.fieldsAreDeletable)return}if(this.layerFieldsMap=await U(e),this.options?.ignorePopupTemplate||(this.arcadeExpMap=K(e.popupTemplate)),this.portal=e.portalItem?.portal??this.options?.portal,this.item=e.portalItem??this.options?.item,!this.item){this.fieldsAreDeletable=!1;return}await $e.getCredential(this.item.url.replace("rest/services","rest/admin/services"))}getFieldLabel(e){let{layer:t,arcadeExpMap:s}=this;if(this.options?.ignorePopupTemplate)return this.getFieldDisplayNameFromLayerFields(e);{let r=(t.popupTemplate??t.createPopupTemplate()).fieldInfos?.find(a=>a.fieldName===e);return r?_(t,r,s):this.getFieldDisplayNameFromLayerFields(e)}}getFieldDisplayNameFromLayerFields(e){let{layer:t}=this,s=this.layerFieldsMap.get(e);return O(t)?t.getFieldAlias(e):s.alias??s.name}async deleteFields(){let{layer:e,fieldNames:t}=this,s=`${e.url.replace("/rest/services","/rest/admin/services")}/${e.layerId}/deleteFromDefinition`,r={fields:t.map(n=>({name:n}))},a={deleteFromDefinition:JSON.stringify(r)};await D(s,{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 D(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(v=>delete v.prototype.attributes[l])})}),this.updateFeatureService(o))}else this.handleError()}},()=>this.handleError())}updateTypesAndTemplatesOnLayer(){let{currentLayerInfo:e}=this,t=e;if(t.templates?.length){let s=this.updateTemplatesList(t.templates);t.templates=s}else if(t.types){let s=t.types;t.types=[],s.forEach(r=>{r.templates=this.updateTemplatesList(r.templates),this.addType(t,r)})}}updateTemplatesList(e){let{currentLayerInfo:t,messages:s}=this,r=[];return(e??[]).forEach(a=>{let n=new Ne;n.description=a.description??"",n.name=a.name||s.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 Te({attributes:c});n.prototype=p,r.push(n)}),r}addType(e,t){e.types?e.types.some(s=>s.id===t.id)||e.types.push(t):e.types=[t]}async updateFeatureService(e){let{layer:t,fieldNames:s}=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 D(a,{query:{...n,f:"json"},method:"post",responseType:"json"}).then(async c=>{if(c.data?.success){let p=`${N(this.portal)}content/items/${this.item.id}/data`;if(this.options?.ignorePopupTemplate||s.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(v=>v.fieldName!==o))})}),t.attributeTableTemplate){let o=t.attributeTableTemplate.clone();o.elements=o.elements.filter(l=>!(l.type==="field"&&s.includes(l.fieldName))),o.orderByFields=o.orderByFields.filter(l=>!s.includes(l.field)),t.attributeTableTemplate=o}if(t.fieldConfigurations?.length){let o=Q.clone(t.fieldConfigurations).filter(l=>!s.includes(l.name));t.fieldConfigurations=o}await D(p,{query:{f:"json"},responseType:"json"}).then(async o=>{let l=o.data;if(l?.layers||l?.tables){let f=t.isTable,v=f?l.tables:l.layers,h=v?.find(w=>w.id===t.layerId);if(s.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=>!s.includes(w.name))),h?.popupInfo){s.forEach(b=>{h.popupInfo.fieldInfos=h.popupInfo.fieldInfos.filter(P=>P.fieldName!==b),h.popupInfo.popupElements?.forEach((P,R)=>{P.type==="fields"&&P.fieldInfos&&(h.popupInfo.popupElements[R].fieldInfos=h.popupInfo.popupElements[R].fieldInfos.filter(ee=>ee.fieldName!==b))})});let w=`${N(this.portal)}content/users/${this.item.owner}/items/${this.item.id}/update`,g={};f?(g.tables=v,l.layers&&(g.layers=l.layers)):(g.layers=v,l.tables&&(g.tables=l.tables));let u={f:"json",text:JSON.stringify(g)};await D(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=S(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=S(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=S(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:s,deleteInProgress:r}=this;return this._propWatcherTask.render({complete:()=>(t||(s?.length?s?.length===1?T("error",this,"Field cannot be deleted"):T("error",this,"One or more fields cannot be deleted"):T("error",this,B("fieldNames"))),y`<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} ${k(this.dialogNode)}>${t?y`<div class=${`dialog-content-wrapper ${r?"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>`)})}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:s}=this;return y`<div class=${`loader-container ${s?"active":""}`}><calcite-loader class="loader" .label=${t.length===1?e.deletingField:e.deletingFields} .hidden=${!s}></calcite-loader><div class="loader-text">${t.length===1?e.deletingField:e.deletingFields}</div></div>`}renderFieldsPreview(){let{fieldNames:e,layerFields:t,layerFieldsMap:s,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">${Ee({fieldType:z(n,s,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 ${k(this.cancelNode)}>${e.cancel}</calcite-button>`}renderDeleteButton(){let{messages:e,fieldNames:t}=this;return y`<calcite-button kind=danger slot=footer-end @click=${async s=>{let{portal:r}=this;s.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>`}};W("arcgis-portal-field-delete",j);return j},"core/lang","layers/support/FeatureTemplate","Graphic","identity/IdentityManager","request","layers/support/fieldUtils","layers/support/FeatureReductionBinning","layers/support/FeatureReductionCluster","renderers/support/jsonUtils","request","core/sql")
@@ -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.124 */
4
- import{A as m,B as h,C as A,D,E as y,k as P,x as k,y as w,z as V}from"./HWITQHPU.js";var b=(s,f,c)=>{let p=new Map;for(let e=f;e<=c;e++)p.set(s[e],e);return p},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let p;c===void 0?c=f:f!==void 0&&(p=f);let e=[],n=[],o=0;for(let a of s)e[o]=p?p(a,o):o,n[o]=c(a,o),o++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,p]){let e=D(s),{values:n,keys:o}=this.dt(f,c,p);if(!Array.isArray(e))return this.ut=o,n;let a=this.ut??=[],u=[],v,g,t=0,l=e.length-1,r=0,i=n.length-1;for(;t<=l&&r<=i;)if(e[t]===null)t++;else if(e[l]===null)l--;else if(a[t]===o[r])u[r]=h(e[t],n[r]),t++,r++;else if(a[l]===o[i])u[i]=h(e[l],n[i]),l--,i--;else if(a[t]===o[i])u[i]=h(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[l]===o[r])u[r]=h(e[l],n[r]),m(s,e[t],e[l]),l--,r++;else if(v===void 0&&(v=b(o,r,i),g=b(a,t,l)),v.has(a[t]))if(v.has(a[l])){let d=g.get(o[r]),x=d!==void 0?e[d]:null;if(x===null){let C=m(s,e[t]);h(C,n[r]),u[r]=C}else u[r]=h(x,n[r]),m(s,e[t],x),e[d]=null;r++}else y(e[l]),l--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);h(d,n[r]),u[r++]=d}for(;t<=l;){let d=e[t++];d!==null&&y(d)}return this.ut=o,A(s,u),P}});export{I as a};
@@ -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.124 */
4
- import b from"./J6M2MF6L.js";import a from"./AZHELUFD.js";import"./RM6AIDDG.js";import{a as h}from"./26TRY2HX.js";import"./K7OKVJO4.js";import{H as n,J as c,N as l,h as e,j as s,n as o}from"./HWITQHPU.js";export default $arcgis.t(([,{a:f,b:d}])=>{var p=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}`,r=class extends n{constructor(){super(...arguments),this.classificationModel=f(this),this.messages=h(),this._classificationDataTask=d(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=p}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(o(this)).then(t=>{this.validationErrors=t??""}):this.validationErrors=""}).catch(o(this))}}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=${c(this.getStyle())}>${this.itemClassification?.banner??this.messages.notyetclassified??"Not yet classified"}</div>`:""})}};l("arcgis-portal-classification-banner",r);return r},a,b)