@esri/solutions-components 0.6.13 → 0.6.14

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 (109) hide show
  1. package/dist/assets/t9n/layer-table/resources.json +1 -1
  2. package/dist/assets/t9n/layer-table/resources_en.json +1 -1
  3. package/dist/assets/t9n/map-layer-picker/resources.json +4 -0
  4. package/dist/assets/t9n/map-layer-picker/resources_en.json +4 -0
  5. package/dist/cjs/basemap-gallery_6.cjs.entry.js +20 -5
  6. package/dist/cjs/buffer-tools_4.cjs.entry.js +1 -1
  7. package/dist/cjs/calcite-chip_3.cjs.entry.js +803 -0
  8. package/dist/cjs/calcite-combobox_6.cjs.entry.js +76 -28
  9. package/dist/cjs/card-manager_3.cjs.entry.js +112 -54
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +18 -5
  11. package/dist/cjs/{downloadUtils-fb4744e0.js → downloadUtils-34a515ad.js} +2 -2
  12. package/dist/cjs/edit-card_2.cjs.entry.js +5 -0
  13. package/dist/cjs/{index.es-372e33de.js → index.es-0ba11065.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  16. package/dist/cjs/{mapViewUtils-a4dd36ec.js → mapViewUtils-a2884698.js} +39 -55
  17. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  18. package/dist/cjs/{publicNotificationStore-b69862af.js → publicNotificationStore-610bd880.js} +0 -4
  19. package/dist/cjs/solutions-components.cjs.js +1 -1
  20. package/dist/collection/components/basemap-gallery/basemap-gallery.js +23 -1
  21. package/dist/collection/components/card-manager/card-manager.js +2 -2
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +171 -5
  23. package/dist/collection/components/edit-card/edit-card.js +19 -0
  24. package/dist/collection/components/layer-table/layer-table.js +127 -47
  25. package/dist/collection/components/map-card/map-card.js +115 -5
  26. package/dist/collection/components/map-layer-picker/map-layer-picker.css +4 -0
  27. package/dist/collection/components/map-layer-picker/map-layer-picker.js +107 -27
  28. package/dist/collection/components/map-picker/map-picker.css +5 -1
  29. package/dist/collection/components/map-picker/map-picker.js +3 -3
  30. package/dist/collection/components/map-tools/map-tools.js +104 -1
  31. package/dist/collection/utils/interfaces.ts +12 -1
  32. package/dist/collection/utils/mapViewUtils.js +38 -52
  33. package/dist/collection/utils/mapViewUtils.ts +41 -57
  34. package/dist/collection/utils/publicNotificationStore.js +0 -4
  35. package/dist/collection/utils/publicNotificationStore.ts +0 -4
  36. package/dist/components/basemap-gallery2.js +2 -0
  37. package/dist/components/card-manager2.js +2 -2
  38. package/dist/components/crowdsource-manager.js +27 -6
  39. package/dist/components/edit-card2.js +5 -0
  40. package/dist/components/layer-table2.js +136 -78
  41. package/dist/components/map-card2.js +17 -5
  42. package/dist/components/map-layer-picker2.js +114 -52
  43. package/dist/components/map-picker2.js +4 -4
  44. package/dist/components/map-select-tools2.js +55 -43
  45. package/dist/components/map-tools2.js +20 -1
  46. package/dist/components/mapViewUtils.js +39 -53
  47. package/dist/components/public-notification.js +1 -1
  48. package/dist/components/publicNotificationStore.js +0 -4
  49. package/dist/components/refine-selection2.js +61 -49
  50. package/dist/esm/basemap-gallery_6.entry.js +20 -5
  51. package/dist/esm/buffer-tools_4.entry.js +1 -1
  52. package/dist/esm/calcite-chip_3.entry.js +797 -0
  53. package/dist/esm/calcite-combobox_6.entry.js +76 -28
  54. package/dist/esm/card-manager_3.entry.js +112 -54
  55. package/dist/esm/crowdsource-manager.entry.js +18 -5
  56. package/dist/esm/{downloadUtils-67c7a6c8.js → downloadUtils-ac67a786.js} +2 -2
  57. package/dist/esm/edit-card_2.entry.js +5 -0
  58. package/dist/esm/{index.es-59a67d3d.js → index.es-f553598f.js} +2 -2
  59. package/dist/esm/loader.js +1 -1
  60. package/dist/esm/map-select-tools_3.entry.js +3 -3
  61. package/dist/esm/{mapViewUtils-00a04d52.js → mapViewUtils-8141d8c1.js} +39 -53
  62. package/dist/esm/public-notification.entry.js +3 -3
  63. package/dist/esm/{publicNotificationStore-90a6a274.js → publicNotificationStore-dcf39a55.js} +0 -4
  64. package/dist/esm/solutions-components.js +1 -1
  65. package/dist/solutions-components/p-08b52ed8.entry.js +6 -0
  66. package/dist/solutions-components/p-16362eb4.js +36 -0
  67. package/dist/solutions-components/{p-3691a072.js → p-1ab414e0.js} +2 -2
  68. package/dist/solutions-components/{p-73ab9d9a.entry.js → p-3d7aa1b2.entry.js} +1 -1
  69. package/dist/solutions-components/{p-9a8c51bf.entry.js → p-57cf6784.entry.js} +1 -1
  70. package/dist/solutions-components/p-64b22d57.entry.js +6 -0
  71. package/dist/solutions-components/p-654dd5df.entry.js +6 -0
  72. package/dist/solutions-components/{p-f9166fcb.js → p-a26711e8.js} +1 -1
  73. package/dist/solutions-components/p-b1c8c6d7.entry.js +6 -0
  74. package/dist/solutions-components/{p-b892e595.entry.js → p-b9d29f30.entry.js} +1 -1
  75. package/dist/solutions-components/{p-1b41181b.js → p-c8d0ce92.js} +2 -2
  76. package/dist/solutions-components/{p-0219a1a9.entry.js → p-e76949eb.entry.js} +6 -6
  77. package/dist/solutions-components/p-ee7e2f00.entry.js +34 -0
  78. package/dist/solutions-components/solutions-components.esm.js +1 -1
  79. package/dist/solutions-components/utils/interfaces.ts +12 -1
  80. package/dist/solutions-components/utils/mapViewUtils.ts +41 -57
  81. package/dist/solutions-components/utils/publicNotificationStore.ts +0 -4
  82. package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +5 -0
  83. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +37 -1
  84. package/dist/types/components/edit-card/edit-card.d.ts +8 -0
  85. package/dist/types/components/layer-table/layer-table.d.ts +40 -0
  86. package/dist/types/components/map-card/map-card.d.ts +25 -1
  87. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +50 -3
  88. package/dist/types/components/map-picker/map-picker.d.ts +2 -2
  89. package/dist/types/components/map-tools/map-tools.d.ts +21 -1
  90. package/dist/types/components.d.ts +182 -2
  91. package/dist/types/preact.d.ts +6 -3
  92. package/dist/types/utils/interfaces.d.ts +10 -1
  93. package/dist/types/utils/mapViewUtils.d.ts +8 -24
  94. package/dist/types/utils/publicNotificationStore.d.ts +0 -2
  95. package/package.json +1 -1
  96. package/dist/cjs/calcite-chip.cjs.entry.js +0 -259
  97. package/dist/cjs/calcite-notice.cjs.entry.js +0 -139
  98. package/dist/cjs/calcite-tooltip.cjs.entry.js +0 -439
  99. package/dist/esm/calcite-chip.entry.js +0 -255
  100. package/dist/esm/calcite-notice.entry.js +0 -135
  101. package/dist/esm/calcite-tooltip.entry.js +0 -435
  102. package/dist/solutions-components/p-2cff8331.entry.js +0 -6
  103. package/dist/solutions-components/p-3a6c8fc3.entry.js +0 -6
  104. package/dist/solutions-components/p-3b1fc7a2.entry.js +0 -6
  105. package/dist/solutions-components/p-767002cd.js +0 -36
  106. package/dist/solutions-components/p-a776b7e6.entry.js +0 -6
  107. package/dist/solutions-components/p-be36d5ed.entry.js +0 -22
  108. package/dist/solutions-components/p-c644edf5.entry.js +0 -11
  109. package/dist/solutions-components/p-cfd88a2f.entry.js +0 -11
@@ -19,38 +19,22 @@ import { IMapItemHash, ISelectionSet } from "./interfaces";
19
19
  * Gets the layer names from the current map
20
20
  *
21
21
  * @param mapView the map view to fetch the layer names from
22
+ * @param onlyShowUpdatableLayers when true only layers that support editing and updates will be returned
22
23
  *
23
24
  * @returns Promise resolving with an array of layer names
24
25
  *
25
26
  */
26
- export declare function getMapLayerHash(mapView: __esri.MapView): Promise<IMapItemHash>;
27
+ export declare function getMapLayerHash(mapView: __esri.MapView, onlyShowUpdatableLayers: boolean): Promise<IMapItemHash>;
27
28
  /**
28
29
  * Gets the table names from the current map
29
30
  *
30
31
  * @param mapView the map view to fetch the table names from
32
+ * @param onlyShowUpdatableLayers when true only layers that support editing and updates will be returned
31
33
  *
32
34
  * @returns Promise resolving with an array of table names
33
35
  *
34
36
  */
35
- export declare function getMapTableHash(mapView: __esri.MapView): Promise<IMapItemHash>;
36
- /**
37
- * Gets the layer names from the current map
38
- *
39
- * @param mapView the map view to fetch the layer names from
40
- *
41
- * @returns Promise resolving with an array of layer names
42
- *
43
- */
44
- export declare function getMapLayerIds(mapView: __esri.MapView): Promise<string[]>;
45
- /**
46
- * Gets the table names from the current map
47
- *
48
- * @param mapView the map view to fetch the table names from
49
- *
50
- * @returns Promise resolving with an array of table names
51
- *
52
- */
53
- export declare function getMapTableIds(mapView: __esri.MapView): Promise<string[]>;
37
+ export declare function getMapTableHash(mapView: __esri.MapView, onlyShowUpdatableTables: boolean): Promise<IMapItemHash>;
54
38
  /**
55
39
  * Get a layer view by id
56
40
  *
@@ -62,15 +46,15 @@ export declare function getMapTableIds(mapView: __esri.MapView): Promise<string[
62
46
  */
63
47
  export declare function getFeatureLayerView(mapView: __esri.MapView, id: string): Promise<__esri.FeatureLayerView>;
64
48
  /**
65
- * Get a layer by id
49
+ * Get a layer or table by id
66
50
  *
67
51
  * @param mapView the map view to fetch the layer from
68
- * @param id the id if the layer to fetch
52
+ * @param id the id of the layer or table to fetch
69
53
  *
70
- * @returns Promise resolving with the fetched layer
54
+ * @returns Promise resolving with the fetched layer or table
71
55
  *
72
56
  */
73
- export declare function getLayer(mapView: __esri.MapView, id: string): Promise<__esri.FeatureLayer>;
57
+ export declare function getLayerOrTable(mapView: __esri.MapView, id: string): Promise<__esri.FeatureLayer>;
74
58
  /**
75
59
  * Highlight features by OID
76
60
  *
@@ -17,8 +17,6 @@ declare const state: {
17
17
  managedLayers: any[];
18
18
  managedTables: any[];
19
19
  highlightHandles: any[];
20
- layerNameHash: {};
21
- tableNameHash: {};
22
20
  removeHandles: () => void;
23
21
  };
24
22
  export default state;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/solutions-components",
3
- "version": "0.6.13",
3
+ "version": "0.6.14",
4
4
  "description": "Web Components for Esri's Solutions Applications",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1,259 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- const index = require('./index-ee37804b.js');
11
- const dom = require('./dom-456f9f13.js');
12
- const conditionalSlot = require('./conditionalSlot-f10611d3.js');
13
- const loadable = require('./loadable-13605f73.js');
14
- const t9n = require('./t9n-58d20225.js');
15
- const interactive = require('./interactive-48299817.js');
16
- const locale = require('./locale-79c3d30e.js');
17
- const observers = require('./observers-9912f013.js');
18
- const key = require('./key-8de93212.js');
19
- require('./guid-d1123d5e.js');
20
- require('./resources-993f6faf.js');
21
-
22
- /*!
23
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
24
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
25
- * v1.6.1
26
- */
27
- const CSS = {
28
- title: "title",
29
- close: "close",
30
- imageContainer: "image-container",
31
- chipIcon: "chip-icon",
32
- textSlotted: "text--slotted",
33
- container: "container",
34
- imageSlotted: "image--slotted",
35
- closable: "closable",
36
- multiple: "multiple",
37
- selectable: "selectable",
38
- selectIcon: "select-icon",
39
- selectIconActive: "select-icon--active",
40
- nonInteractive: "non-interactive",
41
- isCircle: "is-circle",
42
- };
43
- const SLOTS = {
44
- image: "image",
45
- };
46
- const ICONS = {
47
- close: "x",
48
- unchecked: "circle",
49
- checkedSingle: "circle-f",
50
- checked: "check-circle-f",
51
- };
52
-
53
- const chipCss = ":host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([scale=s]){block-size:1.5rem;font-size:var(--calcite-font-size--2);--calcite-chip-spacing-s-internal:0.25rem;--calcite-chip-spacing-l-internal:0.5rem}:host([scale=s]) .close,:host([scale=s]) .select-icon--active{block-size:1rem;inline-size:1rem}:host([scale=s]) .image-container{block-size:1.25rem;inline-size:1.25rem}:host([scale=s]) .container.is-circle{block-size:1.5rem;inline-size:1.5rem}:host([scale=m]){block-size:2rem;font-size:var(--calcite-font-size--1);--calcite-chip-spacing-s-internal:0.375rem;--calcite-chip-spacing-l-internal:0.5rem}:host([scale=m]) .close,:host([scale=m]) .image-container,:host([scale=m]) .select-icon--active{block-size:1.5rem;inline-size:1.5rem}:host([scale=m]) .container.is-circle{block-size:2rem;inline-size:2rem}:host([scale=l]){block-size:2.75rem;font-size:var(--calcite-font-size-0);--calcite-chip-spacing-s-internal:0.5rem;--calcite-chip-spacing-l-internal:0.75rem}:host([scale=l]) .image-container,:host([scale=l]) .close,:host([scale=l]) .select-icon--active{block-size:2rem;inline-size:2rem}:host([scale=l]) .container.is-circle{block-size:2.75rem;inline-size:2.75rem}:host{display:inline-flex;cursor:default;border-radius:9999px}.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1);font-weight:var(--calcite-font-weight-medium);outline-color:transparent}.container:not(.is-circle){padding-inline:var(--calcite-chip-spacing-s-internal)}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n 2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}:host([scale=s]) .container.image--slotted{padding-inline-start:calc(0.125rem / 2)}:host([scale=s]) .container.is-circle{padding-inline:0}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:var(--calcite-chip-spacing-s-internal)}.container:not(.text--slotted) .title{display:none}.container:not(.image--slotted) .image-container{display:none}.container.closable{padding-inline-end:calc(var(--calcite-chip-spacing-l-internal) / 2)}.container:not(.is-circle).image--slotted{padding-inline-start:calc(var(--calcite-chip-spacing-l-internal) / 2)}.container:not(.is-circle).image--slotted .image-container{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle).image--slotted .image-container~.chip-icon{margin-inline-start:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle).selectable:not(.text--slotted) .chip-icon{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.selectable):not(.text--slotted) .chip-icon{margin-inline-start:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.text--slotted) .chip-icon{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.text-slotted).image--slotted .image-container{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.closable):not(.text--slotted).image--slotted.selectable .image-container{margin-inline-end:0}.container:not(.is-circle):not(.closable):not(.text--slotted).image--slotted.selectable .image-container~.chip-icon{margin-inline-start:calc(var(--calcite-chip-spacing-s-internal) * 2)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);margin-inline:var(--calcite-chip-spacing-s-internal)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none}.close{margin:0px;cursor:pointer;align-items:center;border-style:none;background-color:transparent;color:var(--calcite-ui-text-1);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-appearance:none;display:flex;border-radius:50%;align-content:center;justify-content:center;--calcite-chip-transparent-hover:var(--calcite-button-transparent-hover);--calcite-chip-transparent-press:var(--calcite-button-transparent-press)}.close:hover{background-color:var(--calcite-chip-transparent-hover)}.close:focus{background-color:var(--calcite-chip-transparent-hover);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.close:active{background-color:var(--calcite-chip-transparent-press)}.close calcite-icon{color:inherit}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:relative;visibility:hidden;inline-size:0;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out}.select-icon.select-icon--active{visibility:visible;opacity:0.5}.container:not(.is-circle).image--slotted .select-icon.select-icon--active{margin-inline-end:var(--calcite-chip-spacing-s-internal)}:host([selected]) .select-icon{opacity:1}.container:hover .select-icon--active{opacity:1}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}:host([kind=neutral]){background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host([kind=neutral]) .container{border-color:transparent}:host([kind=neutral]) .close{color:var(--calcite-ui-text-3)}:host([kind=neutral]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([kind=inverse]){background-color:var(--calcite-ui-inverse);color:var(--calcite-ui-text-inverse)}:host([kind=inverse]) .container{border-color:transparent}:host([kind=inverse]) .close{color:var(--calcite-ui-text-inverse)}:host([kind=inverse]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-inverse))}:host([kind=brand]){background-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-inverse)}:host([kind=brand]) .container{border-color:transparent}:host([kind=brand]) .close{color:var(--calcite-ui-text-inverse)}:host([kind=brand]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-inverse))}:host([appearance=outline-fill]),:host([appearance=outline]){background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}:host([appearance=outline-fill]) .close,:host([appearance=outline]) .close{color:var(--calcite-ui-text-3)}:host([appearance=outline-fill]) .chip-icon,:host([appearance=outline]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([appearance=outline-fill]){background-color:var(--calcite-ui-foreground-1)}:host([appearance=outline]){background-color:transparent}:host([kind=neutral][appearance=outline-fill]) .container,:host([kind=neutral][appearance=outline]) .container{border-color:var(--calcite-ui-border-1)}:host([kind=inverse][appearance=outline-fill]) .container,:host([kind=inverse][appearance=outline]) .container{border-color:var(--calcite-ui-border-inverse)}:host([kind=brand][appearance=outline-fill]) .container,:host([kind=brand][appearance=outline]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand][appearance=solid]) button,:host([kind=inverse][appearance=solid]) button{outline-color:var(--calcite-ui-text-inverse)}:host([closed]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([hidden]){display:none}[hidden]{display:none}";
54
-
55
- const Chip = class {
56
- constructor(hostRef) {
57
- index.registerInstance(this, hostRef);
58
- this.calciteChipClose = index.createEvent(this, "calciteChipClose", 6);
59
- this.calciteChipSelect = index.createEvent(this, "calciteChipSelect", 6);
60
- this.calciteInternalChipKeyEvent = index.createEvent(this, "calciteInternalChipKeyEvent", 6);
61
- this.mutationObserver = observers.createObserver("mutation", () => this.updateHasText());
62
- // --------------------------------------------------------------------------
63
- //
64
- // Private Methods
65
- //
66
- // --------------------------------------------------------------------------
67
- this.close = () => {
68
- this.calciteChipClose.emit();
69
- this.selected = false;
70
- this.closed = true;
71
- };
72
- this.closeButtonKeyDownHandler = (event) => {
73
- if (key.isActivationKey(event.key)) {
74
- event.preventDefault();
75
- this.close();
76
- }
77
- };
78
- this.handleSlotImageChange = (event) => {
79
- this.hasImage = dom.slotChangeHasAssignedElement(event);
80
- };
81
- this.handleEmittingEvent = () => {
82
- if (this.interactive) {
83
- this.calciteChipSelect.emit();
84
- }
85
- };
86
- this.disabled = false;
87
- this.appearance = "solid";
88
- this.kind = "neutral";
89
- this.closable = false;
90
- this.icon = undefined;
91
- this.iconFlipRtl = false;
92
- this.scale = "m";
93
- this.label = undefined;
94
- this.value = undefined;
95
- this.closed = false;
96
- this.selectionMode = "none";
97
- this.selected = false;
98
- this.messageOverrides = undefined;
99
- this.messages = undefined;
100
- this.interactive = false;
101
- this.defaultMessages = undefined;
102
- this.effectiveLocale = undefined;
103
- this.hasText = false;
104
- this.hasImage = false;
105
- }
106
- onMessagesChange() {
107
- /* wired up by t9n util */
108
- }
109
- effectiveLocaleChange() {
110
- t9n.updateMessages(this, this.effectiveLocale);
111
- }
112
- // --------------------------------------------------------------------------
113
- //
114
- // Lifecycle
115
- //
116
- // --------------------------------------------------------------------------
117
- connectedCallback() {
118
- var _a;
119
- conditionalSlot.connectConditionalSlotComponent(this);
120
- interactive.connectInteractive(this);
121
- locale.connectLocalized(this);
122
- t9n.connectMessages(this);
123
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
124
- }
125
- componentDidLoad() {
126
- loadable.setComponentLoaded(this);
127
- }
128
- componentDidRender() {
129
- interactive.updateHostInteraction(this);
130
- }
131
- disconnectedCallback() {
132
- var _a;
133
- conditionalSlot.disconnectConditionalSlotComponent(this);
134
- interactive.disconnectInteractive(this);
135
- locale.disconnectLocalized(this);
136
- t9n.disconnectMessages(this);
137
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
138
- }
139
- async componentWillLoad() {
140
- loadable.setUpLoadableComponent(this);
141
- {
142
- await t9n.setUpMessages(this);
143
- this.updateHasText();
144
- }
145
- }
146
- //--------------------------------------------------------------------------
147
- //
148
- // Event Listeners
149
- //
150
- //--------------------------------------------------------------------------
151
- keyDownHandler(event) {
152
- if (event.target === this.el) {
153
- switch (event.key) {
154
- case " ":
155
- case "Enter":
156
- this.handleEmittingEvent();
157
- event.preventDefault();
158
- break;
159
- case "ArrowRight":
160
- case "ArrowLeft":
161
- case "Home":
162
- case "End":
163
- this.calciteInternalChipKeyEvent.emit(event);
164
- event.preventDefault();
165
- break;
166
- }
167
- }
168
- }
169
- clickHandler() {
170
- if (!this.interactive && this.closable) {
171
- this.closeButtonEl.focus();
172
- }
173
- }
174
- //--------------------------------------------------------------------------
175
- //
176
- // Public Methods
177
- //
178
- //--------------------------------------------------------------------------
179
- /** Sets focus on the component. */
180
- async setFocus() {
181
- var _a, _b;
182
- await loadable.componentFocusable(this);
183
- if (!this.disabled && this.interactive) {
184
- (_a = this.containerEl) === null || _a === void 0 ? void 0 : _a.focus();
185
- }
186
- else if (!this.disabled && this.closable) {
187
- (_b = this.closeButtonEl) === null || _b === void 0 ? void 0 : _b.focus();
188
- }
189
- }
190
- updateHasText() {
191
- this.hasText = this.el.textContent.trim().length > 0;
192
- }
193
- //--------------------------------------------------------------------------
194
- //
195
- // Render Methods
196
- //
197
- //--------------------------------------------------------------------------
198
- renderChipImage() {
199
- return (index.h("div", { class: CSS.imageContainer }, index.h("slot", { name: SLOTS.image, onSlotchange: this.handleSlotImageChange })));
200
- }
201
- renderSelectionIcon() {
202
- const icon = this.selectionMode === "multiple" && this.selected
203
- ? ICONS.checked
204
- : this.selectionMode === "multiple"
205
- ? ICONS.unchecked
206
- : this.selected
207
- ? ICONS.checkedSingle
208
- : undefined;
209
- return (index.h("div", { class: {
210
- [CSS.selectIcon]: true,
211
- [CSS.selectIconActive]: this.selectionMode === "multiple" || this.selected,
212
- } }, index.h("calcite-icon", { icon: icon, scale: this.scale === "l" ? "m" : "s" })));
213
- }
214
- renderCloseButton() {
215
- return (index.h("button", { "aria-label": this.messages.dismissLabel, class: CSS.close, onClick: this.close, onKeyDown: this.closeButtonKeyDownHandler, tabIndex: this.disabled ? -1 : 0,
216
- // eslint-disable-next-line react/jsx-sort-props
217
- ref: (el) => (this.closeButtonEl = el) }, index.h("calcite-icon", { icon: ICONS.close, scale: this.scale === "l" ? "m" : "s" })));
218
- }
219
- renderIcon() {
220
- return (index.h("calcite-icon", { class: CSS.chipIcon, flipRtl: this.iconFlipRtl, icon: this.icon, scale: this.scale === "l" ? "m" : "s" }));
221
- }
222
- render() {
223
- const disableInteraction = this.disabled || (!this.disabled && !this.interactive);
224
- const role = this.selectionMode === "multiple" && this.interactive
225
- ? "checkbox"
226
- : this.selectionMode !== "none" && this.interactive
227
- ? "radio"
228
- : this.interactive
229
- ? "button"
230
- : undefined;
231
- return (index.h(index.Host, null, index.h("div", { "aria-checked": this.selectionMode !== "none" && this.interactive
232
- ? dom.toAriaBoolean(this.selected)
233
- : undefined, "aria-disabled": disableInteraction ? dom.toAriaBoolean(this.disabled) : undefined, "aria-label": this.label, class: {
234
- [CSS.container]: true,
235
- [CSS.textSlotted]: this.hasText,
236
- [CSS.imageSlotted]: this.hasImage,
237
- [CSS.selectable]: this.selectionMode !== "none",
238
- [CSS.multiple]: this.selectionMode === "multiple",
239
- [CSS.closable]: this.closable,
240
- [CSS.nonInteractive]: !this.interactive,
241
- [CSS.isCircle]: !this.closable &&
242
- !this.hasText &&
243
- (!this.icon || !this.hasImage) &&
244
- (this.selectionMode === "none" ||
245
- (!!this.selectionMode && this.selectionMode !== "multiple" && !this.selected)),
246
- }, onClick: this.handleEmittingEvent, role: role, tabIndex: disableInteraction ? -1 : 0,
247
- // eslint-disable-next-line react/jsx-sort-props
248
- ref: (el) => (this.containerEl = el) }, this.selectionMode !== "none" && this.renderSelectionIcon(), this.renderChipImage(), this.icon && this.renderIcon(), index.h("span", { class: CSS.title }, index.h("slot", null)), this.closable && this.renderCloseButton())));
249
- }
250
- static get assetsDirs() { return ["assets"]; }
251
- get el() { return index.getElement(this); }
252
- static get watchers() { return {
253
- "messageOverrides": ["onMessagesChange"],
254
- "effectiveLocale": ["effectiveLocaleChange"]
255
- }; }
256
- };
257
- Chip.style = chipCss;
258
-
259
- exports.calcite_chip = Chip;
@@ -1,139 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- 'use strict';
7
-
8
- Object.defineProperty(exports, '__esModule', { value: true });
9
-
10
- const index = require('./index-ee37804b.js');
11
- const conditionalSlot = require('./conditionalSlot-f10611d3.js');
12
- const dom = require('./dom-456f9f13.js');
13
- const loadable = require('./loadable-13605f73.js');
14
- const locale = require('./locale-79c3d30e.js');
15
- const t9n = require('./t9n-58d20225.js');
16
- const resources = require('./resources-acf9a7ea.js');
17
- require('./observers-9912f013.js');
18
- require('./guid-d1123d5e.js');
19
- require('./resources-993f6faf.js');
20
- require('./key-8de93212.js');
21
-
22
- /*!
23
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
24
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
25
- * v1.6.1
26
- */
27
- const SLOTS = {
28
- title: "title",
29
- message: "message",
30
- link: "link",
31
- actionsEnd: "actions-end",
32
- };
33
- const CSS = {
34
- actionsEnd: "actions-end",
35
- close: "notice-close",
36
- container: "container",
37
- content: "notice-content",
38
- icon: "notice-icon",
39
- };
40
-
41
- const noticeCss = ":host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([hidden]){display:none}[hidden]{display:none}";
42
-
43
- const Notice = class {
44
- constructor(hostRef) {
45
- index.registerInstance(this, hostRef);
46
- this.calciteNoticeClose = index.createEvent(this, "calciteNoticeClose", 6);
47
- this.calciteNoticeOpen = index.createEvent(this, "calciteNoticeOpen", 6);
48
- //--------------------------------------------------------------------------
49
- //
50
- // Private Methods
51
- //
52
- //--------------------------------------------------------------------------
53
- this.close = () => {
54
- this.open = false;
55
- this.calciteNoticeClose.emit();
56
- };
57
- this.open = false;
58
- this.kind = "brand";
59
- this.closable = false;
60
- this.icon = undefined;
61
- this.iconFlipRtl = false;
62
- this.scale = "m";
63
- this.width = "auto";
64
- this.messages = undefined;
65
- this.messageOverrides = undefined;
66
- this.effectiveLocale = undefined;
67
- this.defaultMessages = undefined;
68
- }
69
- onMessagesChange() {
70
- /* wired up by t9n util */
71
- }
72
- updateRequestedIcon() {
73
- this.requestedIcon = dom.setRequestedIcon(resources.KindIcons, this.icon, this.kind);
74
- }
75
- //--------------------------------------------------------------------------
76
- //
77
- // Lifecycle
78
- //
79
- //--------------------------------------------------------------------------
80
- connectedCallback() {
81
- conditionalSlot.connectConditionalSlotComponent(this);
82
- locale.connectLocalized(this);
83
- t9n.connectMessages(this);
84
- }
85
- disconnectedCallback() {
86
- conditionalSlot.disconnectConditionalSlotComponent(this);
87
- locale.disconnectLocalized(this);
88
- t9n.disconnectMessages(this);
89
- }
90
- async componentWillLoad() {
91
- loadable.setUpLoadableComponent(this);
92
- this.requestedIcon = dom.setRequestedIcon(resources.KindIcons, this.icon, this.kind);
93
- await t9n.setUpMessages(this);
94
- }
95
- componentDidLoad() {
96
- loadable.setComponentLoaded(this);
97
- }
98
- render() {
99
- const { el } = this;
100
- const closeButton = (index.h("button", { "aria-label": this.messages.close, class: CSS.close, onClick: this.close,
101
- // eslint-disable-next-line react/jsx-sort-props
102
- ref: (el) => (this.closeButton = el) }, index.h("calcite-icon", { icon: "x", scale: this.scale === "l" ? "m" : "s" })));
103
- const hasActionEnd = dom.getSlotted(el, SLOTS.actionsEnd);
104
- return (index.h("div", { class: CSS.container }, this.requestedIcon ? (index.h("div", { class: CSS.icon }, index.h("calcite-icon", { flipRtl: this.iconFlipRtl, icon: this.requestedIcon, scale: this.scale === "l" ? "m" : "s" }))) : null, index.h("div", { class: CSS.content }, index.h("slot", { name: SLOTS.title }), index.h("slot", { name: SLOTS.message }), index.h("slot", { name: SLOTS.link })), hasActionEnd ? (index.h("div", { class: CSS.actionsEnd }, index.h("slot", { name: SLOTS.actionsEnd }))) : null, this.closable ? closeButton : null));
105
- }
106
- //--------------------------------------------------------------------------
107
- //
108
- // Public Methods
109
- //
110
- //--------------------------------------------------------------------------
111
- /** Sets focus on the component's first focusable element. */
112
- async setFocus() {
113
- await loadable.componentFocusable(this);
114
- const noticeLinkEl = this.el.querySelector("calcite-link");
115
- if (!this.closeButton && !noticeLinkEl) {
116
- return;
117
- }
118
- if (noticeLinkEl) {
119
- return noticeLinkEl.setFocus();
120
- }
121
- else if (this.closeButton) {
122
- this.closeButton.focus();
123
- }
124
- }
125
- effectiveLocaleChange() {
126
- t9n.updateMessages(this, this.effectiveLocale);
127
- }
128
- static get assetsDirs() { return ["assets"]; }
129
- get el() { return index.getElement(this); }
130
- static get watchers() { return {
131
- "messageOverrides": ["onMessagesChange"],
132
- "icon": ["updateRequestedIcon"],
133
- "kind": ["updateRequestedIcon"],
134
- "effectiveLocale": ["effectiveLocaleChange"]
135
- }; }
136
- };
137
- Notice.style = noticeCss;
138
-
139
- exports.calcite_notice = Notice;