@esri/solutions-components 0.6.13 → 0.6.14

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,255 +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
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c7de2486.js';
7
- import { r as slotChangeHasAssignedElement, t as toAriaBoolean } from './dom-2b326ec3.js';
8
- import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-dff8f839.js';
9
- import { a as setComponentLoaded, s as setUpLoadableComponent, c as componentFocusable } from './loadable-f848be11.js';
10
- import { u as updateMessages, c as connectMessages, d as disconnectMessages, s as setUpMessages } from './t9n-9791aa0c.js';
11
- import { c as connectInteractive, u as updateHostInteraction, d as disconnectInteractive } from './interactive-bd6837bc.js';
12
- import { c as connectLocalized, d as disconnectLocalized } from './locale-00000ab4.js';
13
- import { c as createObserver } from './observers-95c50046.js';
14
- import { i as isActivationKey } from './key-02fa06ae.js';
15
- import './guid-70cda807.js';
16
- import './resources-1e6d76df.js';
17
-
18
- /*!
19
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
21
- * v1.6.1
22
- */
23
- const CSS = {
24
- title: "title",
25
- close: "close",
26
- imageContainer: "image-container",
27
- chipIcon: "chip-icon",
28
- textSlotted: "text--slotted",
29
- container: "container",
30
- imageSlotted: "image--slotted",
31
- closable: "closable",
32
- multiple: "multiple",
33
- selectable: "selectable",
34
- selectIcon: "select-icon",
35
- selectIconActive: "select-icon--active",
36
- nonInteractive: "non-interactive",
37
- isCircle: "is-circle",
38
- };
39
- const SLOTS = {
40
- image: "image",
41
- };
42
- const ICONS = {
43
- close: "x",
44
- unchecked: "circle",
45
- checkedSingle: "circle-f",
46
- checked: "check-circle-f",
47
- };
48
-
49
- 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}";
50
-
51
- const Chip = class {
52
- constructor(hostRef) {
53
- registerInstance(this, hostRef);
54
- this.calciteChipClose = createEvent(this, "calciteChipClose", 6);
55
- this.calciteChipSelect = createEvent(this, "calciteChipSelect", 6);
56
- this.calciteInternalChipKeyEvent = createEvent(this, "calciteInternalChipKeyEvent", 6);
57
- this.mutationObserver = createObserver("mutation", () => this.updateHasText());
58
- // --------------------------------------------------------------------------
59
- //
60
- // Private Methods
61
- //
62
- // --------------------------------------------------------------------------
63
- this.close = () => {
64
- this.calciteChipClose.emit();
65
- this.selected = false;
66
- this.closed = true;
67
- };
68
- this.closeButtonKeyDownHandler = (event) => {
69
- if (isActivationKey(event.key)) {
70
- event.preventDefault();
71
- this.close();
72
- }
73
- };
74
- this.handleSlotImageChange = (event) => {
75
- this.hasImage = slotChangeHasAssignedElement(event);
76
- };
77
- this.handleEmittingEvent = () => {
78
- if (this.interactive) {
79
- this.calciteChipSelect.emit();
80
- }
81
- };
82
- this.disabled = false;
83
- this.appearance = "solid";
84
- this.kind = "neutral";
85
- this.closable = false;
86
- this.icon = undefined;
87
- this.iconFlipRtl = false;
88
- this.scale = "m";
89
- this.label = undefined;
90
- this.value = undefined;
91
- this.closed = false;
92
- this.selectionMode = "none";
93
- this.selected = false;
94
- this.messageOverrides = undefined;
95
- this.messages = undefined;
96
- this.interactive = false;
97
- this.defaultMessages = undefined;
98
- this.effectiveLocale = undefined;
99
- this.hasText = false;
100
- this.hasImage = false;
101
- }
102
- onMessagesChange() {
103
- /* wired up by t9n util */
104
- }
105
- effectiveLocaleChange() {
106
- updateMessages(this, this.effectiveLocale);
107
- }
108
- // --------------------------------------------------------------------------
109
- //
110
- // Lifecycle
111
- //
112
- // --------------------------------------------------------------------------
113
- connectedCallback() {
114
- var _a;
115
- connectConditionalSlotComponent(this);
116
- connectInteractive(this);
117
- connectLocalized(this);
118
- connectMessages(this);
119
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true, subtree: true });
120
- }
121
- componentDidLoad() {
122
- setComponentLoaded(this);
123
- }
124
- componentDidRender() {
125
- updateHostInteraction(this);
126
- }
127
- disconnectedCallback() {
128
- var _a;
129
- disconnectConditionalSlotComponent(this);
130
- disconnectInteractive(this);
131
- disconnectLocalized(this);
132
- disconnectMessages(this);
133
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
134
- }
135
- async componentWillLoad() {
136
- setUpLoadableComponent(this);
137
- {
138
- await setUpMessages(this);
139
- this.updateHasText();
140
- }
141
- }
142
- //--------------------------------------------------------------------------
143
- //
144
- // Event Listeners
145
- //
146
- //--------------------------------------------------------------------------
147
- keyDownHandler(event) {
148
- if (event.target === this.el) {
149
- switch (event.key) {
150
- case " ":
151
- case "Enter":
152
- this.handleEmittingEvent();
153
- event.preventDefault();
154
- break;
155
- case "ArrowRight":
156
- case "ArrowLeft":
157
- case "Home":
158
- case "End":
159
- this.calciteInternalChipKeyEvent.emit(event);
160
- event.preventDefault();
161
- break;
162
- }
163
- }
164
- }
165
- clickHandler() {
166
- if (!this.interactive && this.closable) {
167
- this.closeButtonEl.focus();
168
- }
169
- }
170
- //--------------------------------------------------------------------------
171
- //
172
- // Public Methods
173
- //
174
- //--------------------------------------------------------------------------
175
- /** Sets focus on the component. */
176
- async setFocus() {
177
- var _a, _b;
178
- await componentFocusable(this);
179
- if (!this.disabled && this.interactive) {
180
- (_a = this.containerEl) === null || _a === void 0 ? void 0 : _a.focus();
181
- }
182
- else if (!this.disabled && this.closable) {
183
- (_b = this.closeButtonEl) === null || _b === void 0 ? void 0 : _b.focus();
184
- }
185
- }
186
- updateHasText() {
187
- this.hasText = this.el.textContent.trim().length > 0;
188
- }
189
- //--------------------------------------------------------------------------
190
- //
191
- // Render Methods
192
- //
193
- //--------------------------------------------------------------------------
194
- renderChipImage() {
195
- return (h("div", { class: CSS.imageContainer }, h("slot", { name: SLOTS.image, onSlotchange: this.handleSlotImageChange })));
196
- }
197
- renderSelectionIcon() {
198
- const icon = this.selectionMode === "multiple" && this.selected
199
- ? ICONS.checked
200
- : this.selectionMode === "multiple"
201
- ? ICONS.unchecked
202
- : this.selected
203
- ? ICONS.checkedSingle
204
- : undefined;
205
- return (h("div", { class: {
206
- [CSS.selectIcon]: true,
207
- [CSS.selectIconActive]: this.selectionMode === "multiple" || this.selected,
208
- } }, h("calcite-icon", { icon: icon, scale: this.scale === "l" ? "m" : "s" })));
209
- }
210
- renderCloseButton() {
211
- return (h("button", { "aria-label": this.messages.dismissLabel, class: CSS.close, onClick: this.close, onKeyDown: this.closeButtonKeyDownHandler, tabIndex: this.disabled ? -1 : 0,
212
- // eslint-disable-next-line react/jsx-sort-props
213
- ref: (el) => (this.closeButtonEl = el) }, h("calcite-icon", { icon: ICONS.close, scale: this.scale === "l" ? "m" : "s" })));
214
- }
215
- renderIcon() {
216
- return (h("calcite-icon", { class: CSS.chipIcon, flipRtl: this.iconFlipRtl, icon: this.icon, scale: this.scale === "l" ? "m" : "s" }));
217
- }
218
- render() {
219
- const disableInteraction = this.disabled || (!this.disabled && !this.interactive);
220
- const role = this.selectionMode === "multiple" && this.interactive
221
- ? "checkbox"
222
- : this.selectionMode !== "none" && this.interactive
223
- ? "radio"
224
- : this.interactive
225
- ? "button"
226
- : undefined;
227
- return (h(Host, null, h("div", { "aria-checked": this.selectionMode !== "none" && this.interactive
228
- ? toAriaBoolean(this.selected)
229
- : undefined, "aria-disabled": disableInteraction ? toAriaBoolean(this.disabled) : undefined, "aria-label": this.label, class: {
230
- [CSS.container]: true,
231
- [CSS.textSlotted]: this.hasText,
232
- [CSS.imageSlotted]: this.hasImage,
233
- [CSS.selectable]: this.selectionMode !== "none",
234
- [CSS.multiple]: this.selectionMode === "multiple",
235
- [CSS.closable]: this.closable,
236
- [CSS.nonInteractive]: !this.interactive,
237
- [CSS.isCircle]: !this.closable &&
238
- !this.hasText &&
239
- (!this.icon || !this.hasImage) &&
240
- (this.selectionMode === "none" ||
241
- (!!this.selectionMode && this.selectionMode !== "multiple" && !this.selected)),
242
- }, onClick: this.handleEmittingEvent, role: role, tabIndex: disableInteraction ? -1 : 0,
243
- // eslint-disable-next-line react/jsx-sort-props
244
- ref: (el) => (this.containerEl = el) }, this.selectionMode !== "none" && this.renderSelectionIcon(), this.renderChipImage(), this.icon && this.renderIcon(), h("span", { class: CSS.title }, h("slot", null)), this.closable && this.renderCloseButton())));
245
- }
246
- static get assetsDirs() { return ["assets"]; }
247
- get el() { return getElement(this); }
248
- static get watchers() { return {
249
- "messageOverrides": ["onMessagesChange"],
250
- "effectiveLocale": ["effectiveLocaleChange"]
251
- }; }
252
- };
253
- Chip.style = chipCss;
254
-
255
- export { Chip as calcite_chip };
@@ -1,135 +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
- import { r as registerInstance, c as createEvent, h, g as getElement } from './index-c7de2486.js';
7
- import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-dff8f839.js';
8
- import { v as setRequestedIcon, g as getSlotted } from './dom-2b326ec3.js';
9
- import { s as setUpLoadableComponent, a as setComponentLoaded, c as componentFocusable } from './loadable-f848be11.js';
10
- import { c as connectLocalized, d as disconnectLocalized } from './locale-00000ab4.js';
11
- import { c as connectMessages, d as disconnectMessages, s as setUpMessages, u as updateMessages } from './t9n-9791aa0c.js';
12
- import { K as KindIcons } from './resources-efae7280.js';
13
- import './observers-95c50046.js';
14
- import './guid-70cda807.js';
15
- import './resources-1e6d76df.js';
16
- import './key-02fa06ae.js';
17
-
18
- /*!
19
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
21
- * v1.6.1
22
- */
23
- const SLOTS = {
24
- title: "title",
25
- message: "message",
26
- link: "link",
27
- actionsEnd: "actions-end",
28
- };
29
- const CSS = {
30
- actionsEnd: "actions-end",
31
- close: "notice-close",
32
- container: "container",
33
- content: "notice-content",
34
- icon: "notice-icon",
35
- };
36
-
37
- 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}";
38
-
39
- const Notice = class {
40
- constructor(hostRef) {
41
- registerInstance(this, hostRef);
42
- this.calciteNoticeClose = createEvent(this, "calciteNoticeClose", 6);
43
- this.calciteNoticeOpen = createEvent(this, "calciteNoticeOpen", 6);
44
- //--------------------------------------------------------------------------
45
- //
46
- // Private Methods
47
- //
48
- //--------------------------------------------------------------------------
49
- this.close = () => {
50
- this.open = false;
51
- this.calciteNoticeClose.emit();
52
- };
53
- this.open = false;
54
- this.kind = "brand";
55
- this.closable = false;
56
- this.icon = undefined;
57
- this.iconFlipRtl = false;
58
- this.scale = "m";
59
- this.width = "auto";
60
- this.messages = undefined;
61
- this.messageOverrides = undefined;
62
- this.effectiveLocale = undefined;
63
- this.defaultMessages = undefined;
64
- }
65
- onMessagesChange() {
66
- /* wired up by t9n util */
67
- }
68
- updateRequestedIcon() {
69
- this.requestedIcon = setRequestedIcon(KindIcons, this.icon, this.kind);
70
- }
71
- //--------------------------------------------------------------------------
72
- //
73
- // Lifecycle
74
- //
75
- //--------------------------------------------------------------------------
76
- connectedCallback() {
77
- connectConditionalSlotComponent(this);
78
- connectLocalized(this);
79
- connectMessages(this);
80
- }
81
- disconnectedCallback() {
82
- disconnectConditionalSlotComponent(this);
83
- disconnectLocalized(this);
84
- disconnectMessages(this);
85
- }
86
- async componentWillLoad() {
87
- setUpLoadableComponent(this);
88
- this.requestedIcon = setRequestedIcon(KindIcons, this.icon, this.kind);
89
- await setUpMessages(this);
90
- }
91
- componentDidLoad() {
92
- setComponentLoaded(this);
93
- }
94
- render() {
95
- const { el } = this;
96
- const closeButton = (h("button", { "aria-label": this.messages.close, class: CSS.close, onClick: this.close,
97
- // eslint-disable-next-line react/jsx-sort-props
98
- ref: (el) => (this.closeButton = el) }, h("calcite-icon", { icon: "x", scale: this.scale === "l" ? "m" : "s" })));
99
- const hasActionEnd = getSlotted(el, SLOTS.actionsEnd);
100
- return (h("div", { class: CSS.container }, this.requestedIcon ? (h("div", { class: CSS.icon }, h("calcite-icon", { flipRtl: this.iconFlipRtl, icon: this.requestedIcon, scale: this.scale === "l" ? "m" : "s" }))) : null, h("div", { class: CSS.content }, h("slot", { name: SLOTS.title }), h("slot", { name: SLOTS.message }), h("slot", { name: SLOTS.link })), hasActionEnd ? (h("div", { class: CSS.actionsEnd }, h("slot", { name: SLOTS.actionsEnd }))) : null, this.closable ? closeButton : null));
101
- }
102
- //--------------------------------------------------------------------------
103
- //
104
- // Public Methods
105
- //
106
- //--------------------------------------------------------------------------
107
- /** Sets focus on the component's first focusable element. */
108
- async setFocus() {
109
- await componentFocusable(this);
110
- const noticeLinkEl = this.el.querySelector("calcite-link");
111
- if (!this.closeButton && !noticeLinkEl) {
112
- return;
113
- }
114
- if (noticeLinkEl) {
115
- return noticeLinkEl.setFocus();
116
- }
117
- else if (this.closeButton) {
118
- this.closeButton.focus();
119
- }
120
- }
121
- effectiveLocaleChange() {
122
- updateMessages(this, this.effectiveLocale);
123
- }
124
- static get assetsDirs() { return ["assets"]; }
125
- get el() { return getElement(this); }
126
- static get watchers() { return {
127
- "messageOverrides": ["onMessagesChange"],
128
- "icon": ["updateRequestedIcon"],
129
- "kind": ["updateRequestedIcon"],
130
- "effectiveLocale": ["effectiveLocaleChange"]
131
- }; }
132
- };
133
- Notice.style = noticeCss;
134
-
135
- export { Notice as calcite_notice };