@esri/solutions-components 0.2.2 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/t9n/solution-config-modal/resources.json +22 -0
- package/dist/assets/t9n/solution-config-modal/resources_en.json +22 -0
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js +18 -401
- package/dist/cjs/calcite-action-menu_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-action_2.cjs.entry.js +423 -71
- package/dist/cjs/calcite-action_2.cjs.entry.js.map +1 -1
- package/dist/cjs/calcite-loader.cjs.entry.js +97 -0
- package/dist/cjs/calcite-loader.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-configuration.cjs.entry.js → calcite-modal_2.cjs.entry.js} +451 -13
- package/dist/cjs/calcite-modal_2.cjs.entry.js.map +1 -0
- package/dist/cjs/{calcite-shell-panel_14.cjs.entry.js → calcite-panel_12.cjs.entry.js} +455 -709
- package/dist/cjs/calcite-panel_12.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/solution-config-modal.cjs.entry.js +131 -0
- package/dist/cjs/solution-config-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-contents_3.cjs.entry.js → solution-contents_7.cjs.entry.js} +664 -5
- package/dist/cjs/solution-contents_7.cjs.entry.js.map +1 -0
- package/dist/cjs/{solution-store-893499a5.js → solution-store-09b3fc53.js} +4 -6
- package/dist/cjs/solution-store-09b3fc53.js.map +1 -0
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.css +91 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js +245 -0
- package/dist/collection/components/solution-config-modal/solution-config-modal.js.map +1 -0
- package/dist/collection/components/solution-configuration/solution-configuration.js +23 -17
- package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
- package/dist/collection/components/solution-item/solution-item.js +0 -2
- package/dist/collection/components/solution-item/solution-item.js.map +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +0 -13
- package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
- package/dist/collection/utils/solution-store.js +3 -5
- package/dist/collection/utils/solution-store.js.map +1 -1
- package/dist/collection/utils/solution-store.ts +3 -5
- package/dist/esm/buffer-tools_6.entry.js +2 -2
- package/dist/esm/calcite-action-bar_6.entry.js +2 -2
- package/dist/esm/calcite-action-menu_2.entry.js +20 -403
- package/dist/esm/calcite-action-menu_2.entry.js.map +1 -1
- package/dist/esm/calcite-action_2.entry.js +424 -72
- package/dist/esm/calcite-action_2.entry.js.map +1 -1
- package/dist/esm/calcite-combobox_3.entry.js +2 -2
- package/dist/esm/calcite-loader.entry.js +93 -0
- package/dist/esm/calcite-loader.entry.js.map +1 -0
- package/dist/esm/{solution-configuration.entry.js → calcite-modal_2.entry.js} +453 -16
- package/dist/esm/calcite-modal_2.entry.js.map +1 -0
- package/dist/esm/{calcite-shell-panel_14.entry.js → calcite-panel_12.entry.js} +454 -706
- package/dist/esm/calcite-panel_12.entry.js.map +1 -0
- package/dist/esm/config-layer-picker.entry.js +2 -2
- package/dist/esm/{interfaces-e2a2064d.js → interfaces-1bdfc3a8.js} +2 -2
- package/dist/esm/{interfaces-e2a2064d.js.map → interfaces-1bdfc3a8.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mapViewUtils-09f1e7bd.js → mapViewUtils-809947c8.js} +2 -2
- package/dist/esm/{mapViewUtils-09f1e7bd.js.map → mapViewUtils-809947c8.js.map} +1 -1
- package/dist/esm/public-notification.entry.js +2 -2
- package/dist/esm/solution-config-modal.entry.js +127 -0
- package/dist/esm/solution-config-modal.entry.js.map +1 -0
- package/dist/esm/{solution-contents_3.entry.js → solution-contents_7.entry.js} +661 -6
- package/dist/esm/solution-contents_7.entry.js.map +1 -0
- package/dist/esm/{solution-store-0c58c852.js → solution-store-d8519c64.js} +5 -7
- package/dist/esm/solution-store-d8519c64.js.map +1 -0
- package/dist/esm/solutions-components.js +1 -1
- package/dist/solutions-components/{p-be1ed982.entry.js → p-11068040.entry.js} +3 -3
- package/dist/solutions-components/{p-be1ed982.entry.js.map → p-11068040.entry.js.map} +0 -0
- package/dist/solutions-components/{p-659edb14.js → p-2910dd9e.js} +5 -7
- package/dist/{cjs/solution-store-893499a5.js.map → solutions-components/p-2910dd9e.js.map} +1 -1
- package/dist/solutions-components/{p-291fd295.entry.js → p-30810b45.entry.js} +3 -3
- package/dist/solutions-components/{p-291fd295.entry.js.map → p-30810b45.entry.js.map} +0 -0
- package/dist/solutions-components/p-38ddadf2.entry.js +342 -0
- package/dist/solutions-components/p-38ddadf2.entry.js.map +1 -0
- package/dist/solutions-components/{p-77c75f3a.entry.js → p-5b20090f.entry.js} +661 -6
- package/dist/solutions-components/p-5b20090f.entry.js.map +1 -0
- package/dist/solutions-components/{p-9393631c.entry.js → p-9ef1328a.entry.js} +3 -3
- package/dist/solutions-components/{p-9393631c.entry.js.map → p-9ef1328a.entry.js.map} +0 -0
- package/dist/solutions-components/{p-984cb687.entry.js → p-a1786d11.entry.js} +454 -706
- package/dist/solutions-components/p-a1786d11.entry.js.map +1 -0
- package/dist/solutions-components/{p-fe0fdd8b.js → p-c20bd963.js} +2 -2
- package/dist/solutions-components/{p-fe0fdd8b.js.map → p-c20bd963.js.map} +1 -1
- package/dist/solutions-components/p-c5721b0f.entry.js +127 -0
- package/dist/solutions-components/p-c5721b0f.entry.js.map +1 -0
- package/dist/solutions-components/{p-24d75151.entry.js → p-c818e661.entry.js} +3 -3
- package/dist/solutions-components/{p-24d75151.entry.js.map → p-c818e661.entry.js.map} +0 -0
- package/dist/solutions-components/{p-90629c1d.entry.js → p-cf59eb16.entry.js} +453 -16
- package/dist/solutions-components/p-cf59eb16.entry.js.map +1 -0
- package/dist/solutions-components/p-e405ebe8.entry.js +93 -0
- package/dist/solutions-components/p-e405ebe8.entry.js.map +1 -0
- package/dist/solutions-components/{p-77e6b03c.entry.js → p-e6fb9cde.entry.js} +3 -3
- package/dist/solutions-components/{p-77e6b03c.entry.js.map → p-e6fb9cde.entry.js.map} +0 -0
- package/dist/solutions-components/{p-97c4a268.entry.js → p-ef6f9e24.entry.js} +113 -229
- package/dist/solutions-components/p-ef6f9e24.entry.js.map +1 -0
- package/dist/solutions-components/{p-6b9dc092.js → p-f04fdb9a.js} +2 -2
- package/dist/solutions-components/{p-6b9dc092.js.map → p-f04fdb9a.js.map} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/solution-store.ts +3 -5
- package/dist/solutions-components_commit.txt +8 -8
- package/dist/types/components/solution-config-modal/solution-config-modal.d.ts +69 -0
- package/dist/types/components/solution-configuration/solution-configuration.d.ts +4 -2
- package/dist/types/components/solution-item-details/solution-item-details.d.ts +0 -1
- package/dist/types/components.d.ts +43 -5
- package/dist/types/preact.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/calcite-modal.cjs.entry.js +0 -449
- package/dist/cjs/calcite-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-panel_2.cjs.entry.js +0 -439
- package/dist/cjs/calcite-panel_2.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-scrim.cjs.entry.js +0 -64
- package/dist/cjs/calcite-scrim.cjs.entry.js.map +0 -1
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-configuration.cjs.entry.js.map +0 -1
- package/dist/cjs/solution-contents_3.cjs.entry.js.map +0 -1
- package/dist/esm/calcite-modal.entry.js +0 -445
- package/dist/esm/calcite-modal.entry.js.map +0 -1
- package/dist/esm/calcite-panel_2.entry.js +0 -434
- package/dist/esm/calcite-panel_2.entry.js.map +0 -1
- package/dist/esm/calcite-scrim.entry.js +0 -60
- package/dist/esm/calcite-scrim.entry.js.map +0 -1
- package/dist/esm/calcite-shell-panel_14.entry.js.map +0 -1
- package/dist/esm/solution-configuration.entry.js.map +0 -1
- package/dist/esm/solution-contents_3.entry.js.map +0 -1
- package/dist/esm/solution-store-0c58c852.js.map +0 -1
- package/dist/solutions-components/p-0fda7d9e.entry.js +0 -434
- package/dist/solutions-components/p-0fda7d9e.entry.js.map +0 -1
- package/dist/solutions-components/p-2ff754ce.entry.js +0 -257
- package/dist/solutions-components/p-2ff754ce.entry.js.map +0 -1
- package/dist/solutions-components/p-30a6199a.entry.js +0 -445
- package/dist/solutions-components/p-30a6199a.entry.js.map +0 -1
- package/dist/solutions-components/p-659edb14.js.map +0 -1
- package/dist/solutions-components/p-77c75f3a.entry.js.map +0 -1
- package/dist/solutions-components/p-90629c1d.entry.js.map +0 -1
- package/dist/solutions-components/p-97c4a268.entry.js.map +0 -1
- package/dist/solutions-components/p-984cb687.entry.js.map +0 -1
- package/dist/solutions-components/p-f5268b4f.entry.js +0 -60
- package/dist/solutions-components/p-f5268b4f.entry.js.map +0 -1
@@ -11,15 +11,20 @@ const index = require('./index-a86078a0.js');
|
|
11
11
|
const observers = require('./observers-5311faf8.js');
|
12
12
|
const interactive = require('./interactive-0a68ab99.js');
|
13
13
|
const dom = require('./dom-4a580af6.js');
|
14
|
+
const floatingUi = require('./floating-ui-ca1bcead.js');
|
14
15
|
const guid = require('./guid-84ac4d91.js');
|
16
|
+
const openCloseComponent = require('./openCloseComponent-bf986132.js');
|
17
|
+
const Heading = require('./Heading-6b7b374c.js');
|
18
|
+
const key = require('./key-55aca5c0.js');
|
15
19
|
require('./resources-b56bce71.js');
|
20
|
+
require('./debounce-69c3bada.js');
|
16
21
|
|
17
22
|
/*!
|
18
23
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
19
24
|
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
20
25
|
* v1.0.0-beta.97
|
21
26
|
*/
|
22
|
-
const CSS = {
|
27
|
+
const CSS$1 = {
|
23
28
|
button: "button",
|
24
29
|
buttonTextVisible: "button--text-visible",
|
25
30
|
buttonCompact: "button--compact",
|
@@ -29,7 +34,7 @@ const CSS = {
|
|
29
34
|
textContainer: "text-container",
|
30
35
|
textContainerVisible: "text-container--visible"
|
31
36
|
};
|
32
|
-
const TEXT = {
|
37
|
+
const TEXT$1 = {
|
33
38
|
loading: "Loading"
|
34
39
|
};
|
35
40
|
const SLOTS = {
|
@@ -70,7 +75,7 @@ const Action = class {
|
|
70
75
|
*
|
71
76
|
* @default "Loading"
|
72
77
|
*/
|
73
|
-
this.intlLoading = TEXT.loading;
|
78
|
+
this.intlLoading = TEXT$1.loading;
|
74
79
|
/**
|
75
80
|
* When `true`, a busy indicator is displayed.
|
76
81
|
*/
|
@@ -140,8 +145,8 @@ const Action = class {
|
|
140
145
|
renderTextContainer() {
|
141
146
|
const { text, textEnabled } = this;
|
142
147
|
const textContainerClasses = {
|
143
|
-
[CSS.textContainer]: true,
|
144
|
-
[CSS.textContainerVisible]: textEnabled
|
148
|
+
[CSS$1.textContainer]: true,
|
149
|
+
[CSS$1.textContainerVisible]: textEnabled
|
145
150
|
};
|
146
151
|
return text ? (index.h("div", { class: textContainerClasses, key: "text-container" }, text)) : null;
|
147
152
|
}
|
@@ -155,18 +160,18 @@ const Action = class {
|
|
155
160
|
const iconNode = calciteLoaderNode || calciteIconNode;
|
156
161
|
const hasIconToDisplay = iconNode || ((_a = el.children) === null || _a === void 0 ? void 0 : _a.length);
|
157
162
|
const slotContainerNode = (index.h("div", { class: {
|
158
|
-
[CSS.slotContainer]: true,
|
159
|
-
[CSS.slotContainerHidden]: loading
|
163
|
+
[CSS$1.slotContainer]: true,
|
164
|
+
[CSS$1.slotContainerHidden]: loading
|
160
165
|
} }, index.h("slot", null)));
|
161
|
-
return hasIconToDisplay ? (index.h("div", { "aria-hidden": "true", class: CSS.iconContainer, key: "icon-container" }, iconNode, slotContainerNode)) : null;
|
166
|
+
return hasIconToDisplay ? (index.h("div", { "aria-hidden": "true", class: CSS$1.iconContainer, key: "icon-container" }, iconNode, slotContainerNode)) : null;
|
162
167
|
}
|
163
168
|
render() {
|
164
169
|
const { compact, disabled, loading, textEnabled, label, text } = this;
|
165
170
|
const ariaLabel = label || text;
|
166
171
|
const buttonClasses = {
|
167
|
-
[CSS.button]: true,
|
168
|
-
[CSS.buttonTextVisible]: textEnabled,
|
169
|
-
[CSS.buttonCompact]: compact
|
172
|
+
[CSS$1.button]: true,
|
173
|
+
[CSS$1.buttonTextVisible]: textEnabled,
|
174
|
+
[CSS$1.buttonCompact]: compact
|
170
175
|
};
|
171
176
|
return (index.h(index.Host, { onClick: this.calciteActionClickHandler }, index.h("button", { "aria-busy": dom.toAriaBoolean(loading), "aria-disabled": dom.toAriaBoolean(disabled), "aria-label": ariaLabel, class: buttonClasses, disabled: disabled, ref: (buttonEl) => (this.buttonEl = buttonEl) }, this.renderIconContainer(), this.renderTextContainer()), index.h("slot", { name: SLOTS.tooltip, onSlotchange: this.handleTooltipSlotChange })));
|
172
177
|
}
|
@@ -174,89 +179,436 @@ const Action = class {
|
|
174
179
|
};
|
175
180
|
Action.style = actionCss;
|
176
181
|
|
177
|
-
|
182
|
+
/*!
|
183
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
184
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
185
|
+
* v1.0.0-beta.97
|
186
|
+
*/
|
187
|
+
const CSS = {
|
188
|
+
container: "container",
|
189
|
+
arrow: "arrow",
|
190
|
+
imageContainer: "image-container",
|
191
|
+
closeButtonContainer: "close-button-container",
|
192
|
+
closeButton: "close-button",
|
193
|
+
content: "content",
|
194
|
+
hasHeader: "has-header",
|
195
|
+
header: "header",
|
196
|
+
headerContent: "header-content",
|
197
|
+
heading: "heading"
|
198
|
+
};
|
199
|
+
const TEXT = {
|
200
|
+
close: "Close"
|
201
|
+
};
|
202
|
+
const defaultPopoverPlacement = "auto";
|
203
|
+
const ARIA_CONTROLS = "aria-controls";
|
204
|
+
const ARIA_EXPANDED = "aria-expanded";
|
205
|
+
const HEADING_LEVEL = 2;
|
178
206
|
|
179
|
-
|
207
|
+
/*!
|
208
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
209
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
210
|
+
* v1.0.0-beta.97
|
211
|
+
*/
|
212
|
+
class PopoverManager {
|
213
|
+
constructor() {
|
214
|
+
// --------------------------------------------------------------------------
|
215
|
+
//
|
216
|
+
// Private Properties
|
217
|
+
//
|
218
|
+
// --------------------------------------------------------------------------
|
219
|
+
this.registeredElements = new Map();
|
220
|
+
this.registeredElementCount = 0;
|
221
|
+
// --------------------------------------------------------------------------
|
222
|
+
//
|
223
|
+
// Private Methods
|
224
|
+
//
|
225
|
+
// --------------------------------------------------------------------------
|
226
|
+
this.queryPopover = (composedPath) => {
|
227
|
+
const { registeredElements } = this;
|
228
|
+
const registeredElement = composedPath.find((pathEl) => registeredElements.has(pathEl));
|
229
|
+
return registeredElements.get(registeredElement);
|
230
|
+
};
|
231
|
+
this.togglePopovers = (event) => {
|
232
|
+
const composedPath = event.composedPath();
|
233
|
+
const togglePopover = this.queryPopover(composedPath);
|
234
|
+
if (togglePopover && !togglePopover.triggerDisabled) {
|
235
|
+
togglePopover.toggle();
|
236
|
+
}
|
237
|
+
Array.from(this.registeredElements.values())
|
238
|
+
.filter((popover) => popover !== togglePopover && popover.autoClose && popover.open && !composedPath.includes(popover))
|
239
|
+
.forEach((popover) => popover.toggle(false));
|
240
|
+
};
|
241
|
+
this.keyHandler = (event) => {
|
242
|
+
if (event.defaultPrevented || !key.isActivationKey(event.key)) {
|
243
|
+
return;
|
244
|
+
}
|
245
|
+
this.togglePopovers(event);
|
246
|
+
};
|
247
|
+
this.clickHandler = (event) => {
|
248
|
+
if (dom.isPrimaryPointerButton(event)) {
|
249
|
+
this.togglePopovers(event);
|
250
|
+
}
|
251
|
+
};
|
252
|
+
}
|
253
|
+
// --------------------------------------------------------------------------
|
254
|
+
//
|
255
|
+
// Public Methods
|
256
|
+
//
|
257
|
+
// --------------------------------------------------------------------------
|
258
|
+
registerElement(referenceEl, popover) {
|
259
|
+
this.registeredElementCount++;
|
260
|
+
this.registeredElements.set(referenceEl, popover);
|
261
|
+
if (this.registeredElementCount === 1) {
|
262
|
+
this.addListeners();
|
263
|
+
}
|
264
|
+
}
|
265
|
+
unregisterElement(referenceEl) {
|
266
|
+
if (this.registeredElements.delete(referenceEl)) {
|
267
|
+
this.registeredElementCount--;
|
268
|
+
}
|
269
|
+
if (this.registeredElementCount === 0) {
|
270
|
+
this.removeListeners();
|
271
|
+
}
|
272
|
+
}
|
273
|
+
addListeners() {
|
274
|
+
document.addEventListener("pointerdown", this.clickHandler, { capture: true });
|
275
|
+
document.addEventListener("keydown", this.keyHandler, { capture: true });
|
276
|
+
}
|
277
|
+
removeListeners() {
|
278
|
+
document.removeEventListener("pointerdown", this.clickHandler, { capture: true });
|
279
|
+
document.removeEventListener("keydown", this.keyHandler, { capture: true });
|
280
|
+
}
|
281
|
+
}
|
282
|
+
|
283
|
+
const popoverCss = "@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block;position:absolute;z-index:900}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;visibility:visible;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.arrow,.arrow::before{position:absolute;inline-size:8px;block-size:8px;z-index:-1}.arrow::before{content:\"\";--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);transform:rotate(45deg);background:var(--calcite-ui-foreground-1)}:host([data-placement^=top]) .arrow{inset-block-end:-4px}:host([data-placement^=bottom]) .arrow{inset-block-start:-4px}:host([data-placement^=left]) .arrow{direction:ltr;inset-inline-end:-4px}:host([data-placement^=right]) .arrow{direction:ltr;inset-inline-start:-4px}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);border-block-end-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}.container.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}";
|
284
|
+
|
285
|
+
const manager = new PopoverManager();
|
286
|
+
const Popover = class {
|
180
287
|
constructor(hostRef) {
|
181
288
|
index.registerInstance(this, hostRef);
|
182
|
-
|
289
|
+
this.calcitePopoverBeforeClose = index.createEvent(this, "calcitePopoverBeforeClose", 6);
|
290
|
+
this.calcitePopoverClose = index.createEvent(this, "calcitePopoverClose", 6);
|
291
|
+
this.calcitePopoverBeforeOpen = index.createEvent(this, "calcitePopoverBeforeOpen", 6);
|
292
|
+
this.calcitePopoverOpen = index.createEvent(this, "calcitePopoverOpen", 6);
|
293
|
+
// --------------------------------------------------------------------------
|
183
294
|
//
|
184
295
|
// Properties
|
185
296
|
//
|
186
|
-
|
187
|
-
/**
|
188
|
-
|
189
|
-
|
190
|
-
this.
|
191
|
-
/**
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
this.
|
297
|
+
// --------------------------------------------------------------------------
|
298
|
+
/**
|
299
|
+
* When `true`, clicking outside of the component automatically closes open `calcite-popover`s.
|
300
|
+
*/
|
301
|
+
this.autoClose = false;
|
302
|
+
/**
|
303
|
+
* When `true`, a close button is added to the component.
|
304
|
+
*
|
305
|
+
* @deprecated use dismissible instead.
|
306
|
+
*/
|
307
|
+
this.closeButton = false;
|
308
|
+
/**
|
309
|
+
* When `true`, a close button is added to the component.
|
310
|
+
*
|
311
|
+
* @deprecated use `closable` instead.
|
312
|
+
*/
|
313
|
+
this.dismissible = false;
|
314
|
+
/** When `true`, display a close button within the component. */
|
315
|
+
this.closable = false;
|
316
|
+
/**
|
317
|
+
* When `true`, prevents flipping the component's placement when overlapping its `referenceElement`.
|
318
|
+
*/
|
319
|
+
this.disableFlip = false;
|
320
|
+
/**
|
321
|
+
* When `true`, removes the caret pointer.
|
322
|
+
*/
|
323
|
+
this.disablePointer = false;
|
197
324
|
/**
|
198
|
-
*
|
325
|
+
* Offsets the position of the component away from the `referenceElement`.
|
199
326
|
*
|
200
|
-
* @
|
327
|
+
* @default 6
|
328
|
+
*/
|
329
|
+
this.offsetDistance = floatingUi.defaultOffsetDistance;
|
330
|
+
/**
|
331
|
+
* Offsets the position of the component along the `referenceElement`.
|
201
332
|
*/
|
202
|
-
this.
|
333
|
+
this.offsetSkidding = 0;
|
334
|
+
/**
|
335
|
+
* When `true`, displays and positions the component.
|
336
|
+
*/
|
337
|
+
this.open = false;
|
338
|
+
/**
|
339
|
+
* Determines the type of positioning to use for the overlaid content.
|
340
|
+
*
|
341
|
+
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
|
342
|
+
*
|
343
|
+
* `"fixed"` value should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
|
344
|
+
*
|
345
|
+
*/
|
346
|
+
this.overlayPositioning = "absolute";
|
347
|
+
/**
|
348
|
+
* Determines where the component will be positioned relative to the `referenceElement`.
|
349
|
+
*
|
350
|
+
* @see [LogicalPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/floating-ui.ts#L25)
|
351
|
+
*/
|
352
|
+
this.placement = defaultPopoverPlacement;
|
353
|
+
/**
|
354
|
+
* When `true`, disables automatically toggling the component when its `referenceElement` has been triggered.
|
355
|
+
*
|
356
|
+
* This property can be set to `true` to manage when the component is open.
|
357
|
+
*/
|
358
|
+
this.triggerDisabled = false;
|
359
|
+
/**
|
360
|
+
* Accessible name for the component's close button.
|
361
|
+
*
|
362
|
+
* @default "Close"
|
363
|
+
*/
|
364
|
+
this.intlClose = TEXT.close;
|
365
|
+
this.guid = `calcite-popover-${guid.guid()}`;
|
366
|
+
this.openTransitionProp = "opacity";
|
367
|
+
this.hasLoaded = false;
|
368
|
+
// --------------------------------------------------------------------------
|
369
|
+
//
|
370
|
+
// Private Methods
|
371
|
+
//
|
372
|
+
// --------------------------------------------------------------------------
|
373
|
+
this.setTransitionEl = (el) => {
|
374
|
+
this.transitionEl = el;
|
375
|
+
openCloseComponent.connectOpenCloseComponent(this);
|
376
|
+
};
|
377
|
+
this.setFilteredPlacements = () => {
|
378
|
+
const { el, flipPlacements } = this;
|
379
|
+
this.filteredFlipPlacements = flipPlacements
|
380
|
+
? floatingUi.filterComputedPlacements(flipPlacements, el)
|
381
|
+
: null;
|
382
|
+
};
|
383
|
+
this.setUpReferenceElement = (warn = true) => {
|
384
|
+
this.removeReferences();
|
385
|
+
this.effectiveReferenceElement = this.getReferenceElement();
|
386
|
+
floatingUi.connectFloatingUI(this, this.effectiveReferenceElement, this.el);
|
387
|
+
const { el, referenceElement, effectiveReferenceElement } = this;
|
388
|
+
if (warn && referenceElement && !effectiveReferenceElement) {
|
389
|
+
console.warn(`${el.tagName}: reference-element id "${referenceElement}" was not found.`, {
|
390
|
+
el
|
391
|
+
});
|
392
|
+
}
|
393
|
+
this.addReferences();
|
394
|
+
};
|
395
|
+
this.getId = () => {
|
396
|
+
return this.el.id || this.guid;
|
397
|
+
};
|
398
|
+
this.setExpandedAttr = () => {
|
399
|
+
const { effectiveReferenceElement, open } = this;
|
400
|
+
if (!effectiveReferenceElement) {
|
401
|
+
return;
|
402
|
+
}
|
403
|
+
if ("setAttribute" in effectiveReferenceElement) {
|
404
|
+
effectiveReferenceElement.setAttribute(ARIA_EXPANDED, dom.toAriaBoolean(open));
|
405
|
+
}
|
406
|
+
};
|
407
|
+
this.addReferences = () => {
|
408
|
+
const { effectiveReferenceElement } = this;
|
409
|
+
if (!effectiveReferenceElement) {
|
410
|
+
return;
|
411
|
+
}
|
412
|
+
const id = this.getId();
|
413
|
+
if ("setAttribute" in effectiveReferenceElement) {
|
414
|
+
effectiveReferenceElement.setAttribute(ARIA_CONTROLS, id);
|
415
|
+
}
|
416
|
+
manager.registerElement(effectiveReferenceElement, this.el);
|
417
|
+
this.setExpandedAttr();
|
418
|
+
};
|
419
|
+
this.removeReferences = () => {
|
420
|
+
const { effectiveReferenceElement } = this;
|
421
|
+
if (!effectiveReferenceElement) {
|
422
|
+
return;
|
423
|
+
}
|
424
|
+
if ("removeAttribute" in effectiveReferenceElement) {
|
425
|
+
effectiveReferenceElement.removeAttribute(ARIA_CONTROLS);
|
426
|
+
effectiveReferenceElement.removeAttribute(ARIA_EXPANDED);
|
427
|
+
}
|
428
|
+
manager.unregisterElement(effectiveReferenceElement);
|
429
|
+
};
|
430
|
+
this.hide = () => {
|
431
|
+
this.open = false;
|
432
|
+
};
|
433
|
+
this.storeArrowEl = (el) => {
|
434
|
+
this.arrowEl = el;
|
435
|
+
this.reposition(true);
|
436
|
+
};
|
203
437
|
}
|
204
|
-
|
438
|
+
handleDismissible(value) {
|
439
|
+
this.closable = value;
|
440
|
+
}
|
441
|
+
handleClosable(value) {
|
442
|
+
this.dismissible = value;
|
443
|
+
}
|
444
|
+
flipPlacementsHandler() {
|
445
|
+
this.setFilteredPlacements();
|
446
|
+
this.reposition(true);
|
447
|
+
}
|
448
|
+
offsetDistanceOffsetHandler() {
|
449
|
+
this.reposition(true);
|
450
|
+
}
|
451
|
+
offsetSkiddingHandler() {
|
452
|
+
this.reposition(true);
|
453
|
+
}
|
454
|
+
openHandler(value) {
|
455
|
+
if (value) {
|
456
|
+
this.reposition(true);
|
457
|
+
}
|
458
|
+
else {
|
459
|
+
floatingUi.updateAfterClose(this.el);
|
460
|
+
}
|
461
|
+
this.setExpandedAttr();
|
462
|
+
}
|
463
|
+
overlayPositioningHandler() {
|
464
|
+
this.reposition(true);
|
465
|
+
}
|
466
|
+
placementHandler() {
|
467
|
+
this.reposition(true);
|
468
|
+
}
|
469
|
+
referenceElementHandler() {
|
470
|
+
this.setUpReferenceElement();
|
471
|
+
this.reposition(true);
|
472
|
+
}
|
473
|
+
// --------------------------------------------------------------------------
|
205
474
|
//
|
206
475
|
// Lifecycle
|
207
476
|
//
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
const
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
const valueNow = Math.floor(value);
|
221
|
-
const hostAttributes = {
|
222
|
-
"aria-valuenow": valueNow,
|
223
|
-
"aria-valuemin": 0,
|
224
|
-
"aria-valuemax": 100,
|
225
|
-
complete: valueNow === 100
|
226
|
-
};
|
227
|
-
const svgAttributes = { r: radius, cx: size / 2, cy: size / 2 };
|
228
|
-
const determinateStyle = { "stroke-dasharray": `${progress} ${remaining}` };
|
229
|
-
return (index.h(index.Host, Object.assign({ "aria-label": label, id: id, role: "progressbar" }, (isDeterminate ? hostAttributes : {})), index.h("div", { class: "loader__svgs" }, index.h("svg", { class: "loader__svg loader__svg--1", viewBox: viewbox }, index.h("circle", Object.assign({}, svgAttributes))), index.h("svg", { class: "loader__svg loader__svg--2", viewBox: viewbox }, index.h("circle", Object.assign({}, svgAttributes))), index.h("svg", Object.assign({ class: "loader__svg loader__svg--3", viewBox: viewbox }, (isDeterminate ? { style: determinateStyle } : {})), index.h("circle", Object.assign({}, svgAttributes)))), text && index.h("div", { class: "loader__text" }, text), isDeterminate && index.h("div", { class: "loader__percentage" }, value)));
|
477
|
+
// --------------------------------------------------------------------------
|
478
|
+
connectedCallback() {
|
479
|
+
this.setFilteredPlacements();
|
480
|
+
openCloseComponent.connectOpenCloseComponent(this);
|
481
|
+
const closable = this.closable || this.dismissible;
|
482
|
+
if (closable) {
|
483
|
+
this.handleDismissible(closable);
|
484
|
+
}
|
485
|
+
if (closable) {
|
486
|
+
this.handleClosable(closable);
|
487
|
+
}
|
488
|
+
this.setUpReferenceElement(this.hasLoaded);
|
230
489
|
}
|
231
|
-
|
490
|
+
componentDidLoad() {
|
491
|
+
if (this.referenceElement && !this.effectiveReferenceElement) {
|
492
|
+
this.setUpReferenceElement();
|
493
|
+
}
|
494
|
+
this.reposition();
|
495
|
+
this.hasLoaded = true;
|
496
|
+
}
|
497
|
+
disconnectedCallback() {
|
498
|
+
this.removeReferences();
|
499
|
+
floatingUi.disconnectFloatingUI(this, this.effectiveReferenceElement, this.el);
|
500
|
+
openCloseComponent.disconnectOpenCloseComponent(this);
|
501
|
+
}
|
502
|
+
// --------------------------------------------------------------------------
|
232
503
|
//
|
233
|
-
//
|
504
|
+
// Public Methods
|
234
505
|
//
|
235
|
-
|
506
|
+
// --------------------------------------------------------------------------
|
507
|
+
/**
|
508
|
+
* Updates the position of the component.
|
509
|
+
*
|
510
|
+
* @param delayed
|
511
|
+
*/
|
512
|
+
async reposition(delayed = false) {
|
513
|
+
const { el, effectiveReferenceElement, placement, overlayPositioning, disableFlip, filteredFlipPlacements, offsetDistance, offsetSkidding, arrowEl } = this;
|
514
|
+
return floatingUi.reposition(this, {
|
515
|
+
floatingEl: el,
|
516
|
+
referenceEl: effectiveReferenceElement,
|
517
|
+
overlayPositioning,
|
518
|
+
placement,
|
519
|
+
disableFlip,
|
520
|
+
flipPlacements: filteredFlipPlacements,
|
521
|
+
offsetDistance,
|
522
|
+
offsetSkidding,
|
523
|
+
includeArrow: !this.disablePointer,
|
524
|
+
arrowEl,
|
525
|
+
type: "popover"
|
526
|
+
}, delayed);
|
527
|
+
}
|
528
|
+
/**
|
529
|
+
* Sets focus on the component.
|
530
|
+
*
|
531
|
+
* @param focusId
|
532
|
+
*/
|
533
|
+
async setFocus(focusId) {
|
534
|
+
var _a;
|
535
|
+
const { closeButtonEl } = this;
|
536
|
+
if (focusId === "close-button" && closeButtonEl) {
|
537
|
+
index.forceUpdate(closeButtonEl);
|
538
|
+
closeButtonEl.setFocus();
|
539
|
+
return;
|
540
|
+
}
|
541
|
+
(_a = this.el) === null || _a === void 0 ? void 0 : _a.focus();
|
542
|
+
}
|
236
543
|
/**
|
237
|
-
*
|
544
|
+
* Toggles the component's open property.
|
238
545
|
*
|
239
|
-
* @param
|
546
|
+
* @param value
|
240
547
|
*/
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
548
|
+
async toggle(value = !this.open) {
|
549
|
+
this.open = value;
|
550
|
+
}
|
551
|
+
getReferenceElement() {
|
552
|
+
const { referenceElement, el } = this;
|
553
|
+
return ((typeof referenceElement === "string"
|
554
|
+
? dom.queryElementRoots(el, { id: referenceElement })
|
555
|
+
: referenceElement) || null);
|
556
|
+
}
|
557
|
+
onBeforeOpen() {
|
558
|
+
this.calcitePopoverBeforeOpen.emit();
|
559
|
+
}
|
560
|
+
onOpen() {
|
561
|
+
this.calcitePopoverOpen.emit();
|
562
|
+
}
|
563
|
+
onBeforeClose() {
|
564
|
+
this.calcitePopoverBeforeClose.emit();
|
565
|
+
}
|
566
|
+
onClose() {
|
567
|
+
this.calcitePopoverClose.emit();
|
568
|
+
}
|
569
|
+
// --------------------------------------------------------------------------
|
570
|
+
//
|
571
|
+
// Render Methods
|
572
|
+
//
|
573
|
+
// --------------------------------------------------------------------------
|
574
|
+
renderCloseButton() {
|
575
|
+
const { closeButton, intlClose, heading, closable } = this;
|
576
|
+
return closable || closeButton ? (index.h("div", { class: CSS.closeButtonContainer }, index.h("calcite-action", { class: CSS.closeButton, onClick: this.hide, ref: (closeButtonEl) => (this.closeButtonEl = closeButtonEl), scale: heading ? "s" : "m", text: intlClose }, index.h("calcite-icon", { icon: "x", scale: heading ? "s" : "m" })))) : null;
|
577
|
+
}
|
578
|
+
renderHeader() {
|
579
|
+
const { heading, headingLevel } = this;
|
580
|
+
const headingNode = heading ? (index.h(Heading.Heading, { class: CSS.heading, level: headingLevel || HEADING_LEVEL }, heading)) : null;
|
581
|
+
return headingNode ? (index.h("div", { class: CSS.header }, headingNode, this.renderCloseButton())) : null;
|
582
|
+
}
|
583
|
+
render() {
|
584
|
+
const { effectiveReferenceElement, heading, label, open, disablePointer } = this;
|
585
|
+
const displayed = effectiveReferenceElement && open;
|
586
|
+
const hidden = !displayed;
|
587
|
+
const arrowNode = !disablePointer ? index.h("div", { class: CSS.arrow, ref: this.storeArrowEl }) : null;
|
588
|
+
return (index.h(index.Host, { "aria-hidden": dom.toAriaBoolean(hidden), "aria-label": label, "aria-live": "polite", "calcite-hydrated-hidden": hidden, id: this.getId(), role: "dialog" }, index.h("div", { class: {
|
589
|
+
[floatingUi.FloatingCSS.animation]: true,
|
590
|
+
[floatingUi.FloatingCSS.animationActive]: displayed
|
591
|
+
}, ref: this.setTransitionEl }, arrowNode, index.h("div", { class: {
|
592
|
+
[CSS.hasHeader]: !!heading,
|
593
|
+
[CSS.container]: true
|
594
|
+
} }, this.renderHeader(), index.h("div", { class: CSS.content }, index.h("slot", null)), !heading ? this.renderCloseButton() : null))));
|
254
595
|
}
|
255
596
|
get el() { return index.getElement(this); }
|
597
|
+
static get watchers() { return {
|
598
|
+
"dismissible": ["handleDismissible"],
|
599
|
+
"closable": ["handleClosable"],
|
600
|
+
"flipPlacements": ["flipPlacementsHandler"],
|
601
|
+
"offsetDistance": ["offsetDistanceOffsetHandler"],
|
602
|
+
"offsetSkidding": ["offsetSkiddingHandler"],
|
603
|
+
"open": ["openHandler"],
|
604
|
+
"overlayPositioning": ["overlayPositioningHandler"],
|
605
|
+
"placement": ["placementHandler"],
|
606
|
+
"referenceElement": ["referenceElementHandler"]
|
607
|
+
}; }
|
256
608
|
};
|
257
|
-
|
609
|
+
Popover.style = popoverCss;
|
258
610
|
|
259
611
|
exports.calcite_action = Action;
|
260
|
-
exports.
|
612
|
+
exports.calcite_popover = Popover;
|
261
613
|
|
262
614
|
//# sourceMappingURL=calcite-action_2.cjs.entry.js.map
|