@esri/solutions-components 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/{pciUtils-6a806ba4.js → pciUtils-423cfc68.js} +25 -7
- package/dist/collection/demos/deduct-calculator.html +2 -5
- package/dist/collection/demos/new-public-notification.html +6 -4
- package/dist/collection/utils/pciUtils.js +25 -7
- package/dist/collection/utils/pciUtils.ts +30 -7
- package/dist/components/ExpandToggle.js +110 -0
- package/dist/components/Heading.js +22 -0
- package/dist/components/_commonjsHelpers.js +22 -0
- package/dist/components/action-bar.js +276 -0
- package/dist/components/action-group.js +149 -0
- package/dist/components/action-menu.js +356 -0
- package/dist/components/action.js +214 -0
- package/dist/components/add-record-modal.d.ts +11 -0
- package/dist/components/add-record-modal.js +171 -0
- package/dist/components/array.js +15 -0
- package/dist/components/block.js +272 -0
- package/dist/components/buffer-tools.d.ts +11 -0
- package/dist/components/buffer-tools.js +11 -0
- package/dist/components/buffer-tools2.js +262 -0
- package/dist/components/button.js +263 -0
- package/dist/components/calcite-accordion-item.js +244 -0
- package/dist/components/calcite-accordion.js +180 -0
- package/dist/components/calcite-action-bar.js +11 -0
- package/dist/components/calcite-action-group.js +11 -0
- package/dist/components/calcite-action-menu.js +11 -0
- package/dist/components/calcite-action-pad.js +197 -0
- package/dist/components/calcite-action.js +11 -0
- package/dist/components/calcite-alert.js +297 -0
- package/dist/components/calcite-avatar.js +182 -0
- package/dist/components/calcite-block-section.js +155 -0
- package/dist/components/calcite-block.js +11 -0
- package/dist/components/calcite-button.js +11 -0
- package/dist/components/calcite-card.js +187 -0
- package/dist/components/calcite-checkbox.js +11 -0
- package/dist/components/calcite-chip.js +11 -0
- package/dist/components/calcite-color-picker-hex-input.js +11 -0
- package/dist/components/calcite-color-picker-swatch.js +11 -0
- package/dist/components/calcite-color-picker.js +1036 -0
- package/dist/components/calcite-combobox-item-group.js +75 -0
- package/dist/components/calcite-combobox-item.js +11 -0
- package/dist/components/calcite-combobox.js +11 -0
- package/dist/components/calcite-date-picker-day.js +11 -0
- package/dist/components/calcite-date-picker-month-header.js +11 -0
- package/dist/components/calcite-date-picker-month.js +11 -0
- package/dist/components/calcite-date-picker.js +11 -0
- package/dist/components/calcite-dropdown-group.js +11 -0
- package/dist/components/calcite-dropdown-item.js +11 -0
- package/dist/components/calcite-dropdown.js +11 -0
- package/dist/components/calcite-fab.js +144 -0
- package/dist/components/calcite-filter.js +195 -0
- package/dist/components/calcite-flow-item.js +243 -0
- package/dist/components/calcite-flow.js +147 -0
- package/dist/components/calcite-graph.js +11 -0
- package/dist/components/calcite-handle.js +11 -0
- package/dist/components/calcite-icon.js +11 -0
- package/dist/components/calcite-inline-editable.js +294 -0
- package/dist/components/calcite-input-date-picker.js +713 -0
- package/dist/components/calcite-input-message.js +11 -0
- package/dist/components/calcite-input-number.js +637 -0
- package/dist/components/calcite-input-text.js +400 -0
- package/dist/components/calcite-input-time-picker.js +434 -0
- package/dist/components/calcite-input.js +11 -0
- package/dist/components/calcite-label.js +11 -0
- package/dist/components/calcite-link.js +11 -0
- package/dist/components/calcite-list-item-group.js +65 -0
- package/dist/components/calcite-list-item.js +11 -0
- package/dist/components/calcite-list.js +11 -0
- package/dist/components/calcite-loader.js +11 -0
- package/dist/components/calcite-modal.js +11 -0
- package/dist/components/calcite-notice.js +11 -0
- package/dist/components/calcite-option-group.js +64 -0
- package/dist/components/calcite-option.js +11 -0
- package/dist/components/calcite-pagination.js +258 -0
- package/dist/components/calcite-panel.js +11 -0
- package/dist/components/calcite-pick-list-group.js +74 -0
- package/dist/components/calcite-pick-list-item.js +11 -0
- package/dist/components/calcite-pick-list.js +11 -0
- package/dist/components/calcite-popover-manager.js +94 -0
- package/dist/components/calcite-popover.js +11 -0
- package/dist/components/calcite-progress.js +11 -0
- package/dist/components/calcite-radio-button-group.js +132 -0
- package/dist/components/calcite-radio-button.js +310 -0
- package/dist/components/calcite-radio-group-item.js +11 -0
- package/dist/components/calcite-radio-group.js +11 -0
- package/dist/components/calcite-rating.js +201 -0
- package/dist/components/calcite-scrim.js +11 -0
- package/dist/components/calcite-select.js +11 -0
- package/dist/components/calcite-shell-center-row.js +100 -0
- package/dist/components/calcite-shell-panel.js +11 -0
- package/dist/components/calcite-shell.js +11 -0
- package/dist/components/calcite-slider.js +11 -0
- package/dist/components/calcite-sortable-list.js +202 -0
- package/dist/components/calcite-split-button.js +11 -0
- package/dist/components/calcite-stepper-item.js +271 -0
- package/dist/components/calcite-stepper.js +256 -0
- package/dist/components/calcite-switch.js +11 -0
- package/dist/components/calcite-tab-nav.js +11 -0
- package/dist/components/calcite-tab-title.js +11 -0
- package/dist/components/calcite-tab.js +11 -0
- package/dist/components/calcite-tabs.js +11 -0
- package/dist/components/calcite-tile-select-group.js +65 -0
- package/dist/components/calcite-tile-select.js +266 -0
- package/dist/components/calcite-tile.js +11 -0
- package/dist/components/calcite-time-picker.js +11 -0
- package/dist/components/calcite-tip-group.js +41 -0
- package/dist/components/calcite-tip-manager.js +223 -0
- package/dist/components/calcite-tip.js +162 -0
- package/dist/components/calcite-tooltip-manager.js +57 -0
- package/dist/components/calcite-tooltip.js +11 -0
- package/dist/components/calcite-tree-item.js +11 -0
- package/dist/components/calcite-tree.js +11 -0
- package/dist/components/calcite-value-list-item.js +11 -0
- package/dist/components/calcite-value-list.js +11 -0
- package/dist/components/card-manager.d.ts +11 -0
- package/dist/components/card-manager.js +143 -0
- package/dist/components/check-list.d.ts +11 -0
- package/dist/components/check-list.js +11 -0
- package/dist/components/check-list2.js +131 -0
- package/dist/components/checkbox.js +165 -0
- package/dist/components/chip.js +170 -0
- package/dist/components/color-picker-hex-input.js +363 -0
- package/dist/components/color-picker-swatch.js +2034 -0
- package/dist/components/combobox-item.js +182 -0
- package/dist/components/combobox.js +912 -0
- package/dist/components/comment-card.d.ts +11 -0
- package/dist/components/comment-card.js +90 -0
- package/dist/components/conditionalSlot.js +50 -0
- package/dist/components/config-buffer-tools.d.ts +11 -0
- package/dist/components/config-buffer-tools.js +187 -0
- package/dist/components/config-draw-tools.d.ts +11 -0
- package/dist/components/config-draw-tools.js +121 -0
- package/dist/components/config-layer-picker.d.ts +11 -0
- package/dist/components/config-layer-picker.js +163 -0
- package/dist/components/config-pdf-download.d.ts +11 -0
- package/dist/components/config-pdf-download.js +154 -0
- package/dist/components/crowdsource-manager.d.ts +11 -0
- package/dist/components/crowdsource-manager.js +90 -0
- package/dist/components/crowdsource-reporter.d.ts +11 -0
- package/dist/components/crowdsource-reporter.js +90 -0
- package/dist/components/csvUtils.js +74 -0
- package/dist/components/date-picker-day.js +111 -0
- package/dist/components/date-picker-month-header.js +224 -0
- package/dist/components/date-picker-month.js +344 -0
- package/dist/components/date-picker.js +575 -0
- package/dist/components/date.js +180 -0
- package/dist/components/debounce.js +487 -0
- package/dist/components/deduct-calculator.d.ts +11 -0
- package/dist/components/deduct-calculator.js +11 -0
- package/dist/components/deduct-calculator2.js +1002 -0
- package/dist/components/dom.js +231 -0
- package/dist/components/dropdown-group.js +96 -0
- package/dist/components/dropdown-item.js +232 -0
- package/dist/components/dropdown.js +505 -0
- package/dist/components/edit-record-modal.d.ts +11 -0
- package/dist/components/edit-record-modal.js +11 -0
- package/dist/components/edit-record-modal2.js +161 -0
- package/dist/components/filter.js +763 -0
- package/dist/components/floating-ui.js +1768 -0
- package/dist/components/form.js +228 -0
- package/dist/components/graph.js +254 -0
- package/dist/components/guid.js +24 -0
- package/dist/components/handle.js +119 -0
- package/dist/components/icon.js +202 -0
- package/dist/components/index.d.ts +61 -0
- package/dist/components/index.js +196 -0
- package/dist/components/index2.js +199 -0
- package/dist/components/info-card.d.ts +11 -0
- package/dist/components/info-card.js +11 -0
- package/dist/components/info-card2.js +97 -0
- package/dist/components/input-message.js +101 -0
- package/dist/components/input.js +740 -0
- package/dist/components/interactive.js +51 -0
- package/dist/components/interfaces.js +19 -0
- package/dist/components/interfaces2.js +21 -0
- package/dist/components/interfaces3.js +80 -0
- package/dist/components/json-editor.d.ts +11 -0
- package/dist/components/json-editor.js +11 -0
- package/dist/components/json-editor2.js +441 -0
- package/dist/components/key.js +16 -0
- package/dist/components/label.js +106 -0
- package/dist/components/label2.js +131 -0
- package/dist/components/labelFormats.js +210 -0
- package/dist/components/layer-table.d.ts +11 -0
- package/dist/components/layer-table.js +453 -0
- package/dist/components/link.js +123 -0
- package/dist/components/list-item.d.ts +11 -0
- package/dist/components/list-item.js +90 -0
- package/dist/components/list-item2.js +149 -0
- package/dist/components/list.js +83 -0
- package/dist/components/loadModules.js +28 -0
- package/dist/components/loader.js +116 -0
- package/dist/components/locale.js +412 -0
- package/dist/components/locale2.js +413 -0
- package/dist/components/map-card.d.ts +11 -0
- package/dist/components/map-card.js +354 -0
- package/dist/components/map-draw-tools.d.ts +11 -0
- package/dist/components/map-draw-tools.js +11 -0
- package/dist/components/map-draw-tools2.js +228 -0
- package/dist/components/map-layer-picker.d.ts +11 -0
- package/dist/components/map-layer-picker.js +11 -0
- package/dist/components/map-layer-picker2.js +188 -0
- package/dist/components/map-search.d.ts +11 -0
- package/dist/components/map-search.js +155 -0
- package/dist/components/map-select-tools.d.ts +11 -0
- package/dist/components/map-select-tools.js +11 -0
- package/dist/components/map-select-tools2.js +588 -0
- package/dist/components/mapViewUtils.js +129 -0
- package/dist/components/math.js +24 -0
- package/dist/components/media-card.d.ts +11 -0
- package/dist/components/media-card.js +11 -0
- package/dist/components/media-card2.js +177 -0
- package/dist/components/modal.js +495 -0
- package/dist/components/nonChromiumPlatformUtils.js +503 -0
- package/dist/components/notice.js +192 -0
- package/dist/components/observers.js +56 -0
- package/dist/components/openCloseComponent.js +56 -0
- package/dist/components/option.js +109 -0
- package/dist/components/panel.js +459 -0
- package/dist/components/pci-calculator.d.ts +11 -0
- package/dist/components/pci-calculator.js +193 -0
- package/dist/components/pdf-download.d.ts +11 -0
- package/dist/components/pdf-download.js +11 -0
- package/dist/components/pdf-download2.js +189 -0
- package/dist/components/pick-list-item.js +255 -0
- package/dist/components/pick-list.js +170 -0
- package/dist/components/popover.js +500 -0
- package/dist/components/progress.js +60 -0
- package/dist/components/public-notification.d.ts +11 -0
- package/dist/components/public-notification.js +825 -0
- package/dist/components/publicNotificationStore.js +38 -0
- package/dist/components/queryUtils.js +187 -0
- package/dist/components/radio-group-item.js +101 -0
- package/dist/components/radio-group.js +235 -0
- package/dist/components/refine-selection-tools.d.ts +11 -0
- package/dist/components/refine-selection-tools.js +11 -0
- package/dist/components/refine-selection-tools2.js +492 -0
- package/dist/components/refine-selection.d.ts +11 -0
- package/dist/components/refine-selection.js +11 -0
- package/dist/components/refine-selection2.js +376 -0
- package/dist/components/resources.js +24 -0
- package/dist/components/resources2.js +21 -0
- package/dist/components/resources3.js +38 -0
- package/dist/components/scrim.js +83 -0
- package/dist/components/select.js +259 -0
- package/dist/components/shared-list-render.js +319 -0
- package/dist/components/shell-panel.js +281 -0
- package/dist/components/shell.js +121 -0
- package/dist/components/slider.js +896 -0
- package/dist/components/solution-configuration.d.ts +11 -0
- package/dist/components/solution-configuration.js +2233 -0
- package/dist/components/solution-contents.d.ts +11 -0
- package/dist/components/solution-contents.js +11 -0
- package/dist/components/solution-contents2.js +128 -0
- package/dist/components/solution-item-details.d.ts +11 -0
- package/dist/components/solution-item-details.js +11 -0
- package/dist/components/solution-item-details2.js +234 -0
- package/dist/components/solution-item-icon.d.ts +11 -0
- package/dist/components/solution-item-icon.js +11 -0
- package/dist/components/solution-item-icon2.js +342 -0
- package/dist/components/solution-item-sharing.d.ts +11 -0
- package/dist/components/solution-item-sharing.js +11 -0
- package/dist/components/solution-item-sharing2.js +167 -0
- package/dist/components/solution-item.d.ts +11 -0
- package/dist/components/solution-item.js +11 -0
- package/dist/components/solution-item2.js +315 -0
- package/dist/components/solution-organization-variables.d.ts +11 -0
- package/dist/components/solution-organization-variables.js +11 -0
- package/dist/components/solution-organization-variables2.js +132 -0
- package/dist/components/solution-resource-item.d.ts +11 -0
- package/dist/components/solution-resource-item.js +11 -0
- package/dist/components/solution-resource-item2.js +356 -0
- package/dist/components/solution-spatial-ref.d.ts +11 -0
- package/dist/components/solution-spatial-ref.js +11 -0
- package/dist/components/solution-spatial-ref2.js +21446 -0
- package/dist/components/solution-store.js +4092 -0
- package/dist/components/solution-template-data.d.ts +11 -0
- package/dist/components/solution-template-data.js +11 -0
- package/dist/components/solution-template-data2.js +233 -0
- package/dist/components/solution-variables.d.ts +11 -0
- package/dist/components/solution-variables.js +11 -0
- package/dist/components/solution-variables2.js +150 -0
- package/dist/components/sortable.esm.js +3026 -0
- package/dist/components/split-button.js +165 -0
- package/dist/components/store-manager.d.ts +11 -0
- package/dist/components/store-manager.js +83 -0
- package/dist/components/switch.js +139 -0
- package/dist/components/tab-nav.js +241 -0
- package/dist/components/tab-title.js +276 -0
- package/dist/components/tab.js +154 -0
- package/dist/components/tabs.js +188 -0
- package/dist/components/tile.js +129 -0
- package/dist/components/time-picker.js +943 -0
- package/dist/components/tooltip.js +399 -0
- package/dist/components/tree-item.js +294 -0
- package/dist/components/tree.js +327 -0
- package/dist/components/utils.js +119 -0
- package/dist/components/utils2.js +51 -0
- package/dist/components/value-list-item.js +204 -0
- package/dist/components/value-list.js +333 -0
- package/dist/esm/deduct-calculator.entry.js +1 -1
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/{pciUtils-e3007a1c.js → pciUtils-ecda46e5.js} +25 -7
- package/dist/solutions-components/demos/deduct-calculator.html +2 -5
- package/dist/solutions-components/demos/new-public-notification.html +6 -4
- package/dist/solutions-components/{p-ff80ffbb.entry.js → p-0512635b.entry.js} +1 -1
- package/dist/solutions-components/{p-5ec407c2.entry.js → p-0c088725.entry.js} +1 -1
- package/dist/solutions-components/p-cc815aca.js +21 -0
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components/utils/pciUtils.ts +30 -7
- package/dist/types/utils/pciUtils.d.ts +2 -1
- package/package.json +4 -3
- package/dist/solutions-components/p-647bbd18.js +0 -21
@@ -0,0 +1,500 @@
|
|
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 { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
7
|
+
import { b as defaultOffsetDistance, f as filterComputedPlacements, c as connectFloatingUI, u as updateAfterClose, a as disconnectFloatingUI, r as reposition, F as FloatingCSS } from './floating-ui.js';
|
8
|
+
import { g as guid } from './guid.js';
|
9
|
+
import { i as isPrimaryPointerButton, t as toAriaBoolean, q as queryElementRoots } from './dom.js';
|
10
|
+
import { c as connectOpenCloseComponent, d as disconnectOpenCloseComponent } from './openCloseComponent.js';
|
11
|
+
import { H as Heading } from './Heading.js';
|
12
|
+
import { i as isActivationKey } from './key.js';
|
13
|
+
import { d as defineCustomElement$3 } from './action.js';
|
14
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
15
|
+
import { d as defineCustomElement$1 } from './loader.js';
|
16
|
+
|
17
|
+
/*!
|
18
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
19
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
20
|
+
* v1.0.0-beta.97
|
21
|
+
*/
|
22
|
+
const CSS = {
|
23
|
+
container: "container",
|
24
|
+
arrow: "arrow",
|
25
|
+
imageContainer: "image-container",
|
26
|
+
closeButtonContainer: "close-button-container",
|
27
|
+
closeButton: "close-button",
|
28
|
+
content: "content",
|
29
|
+
hasHeader: "has-header",
|
30
|
+
header: "header",
|
31
|
+
headerContent: "header-content",
|
32
|
+
heading: "heading"
|
33
|
+
};
|
34
|
+
const TEXT = {
|
35
|
+
close: "Close"
|
36
|
+
};
|
37
|
+
const defaultPopoverPlacement = "auto";
|
38
|
+
const ARIA_CONTROLS = "aria-controls";
|
39
|
+
const ARIA_EXPANDED = "aria-expanded";
|
40
|
+
const HEADING_LEVEL = 2;
|
41
|
+
|
42
|
+
/*!
|
43
|
+
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
44
|
+
* See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
|
45
|
+
* v1.0.0-beta.97
|
46
|
+
*/
|
47
|
+
class PopoverManager {
|
48
|
+
constructor() {
|
49
|
+
// --------------------------------------------------------------------------
|
50
|
+
//
|
51
|
+
// Private Properties
|
52
|
+
//
|
53
|
+
// --------------------------------------------------------------------------
|
54
|
+
this.registeredElements = new Map();
|
55
|
+
this.registeredElementCount = 0;
|
56
|
+
// --------------------------------------------------------------------------
|
57
|
+
//
|
58
|
+
// Private Methods
|
59
|
+
//
|
60
|
+
// --------------------------------------------------------------------------
|
61
|
+
this.queryPopover = (composedPath) => {
|
62
|
+
const { registeredElements } = this;
|
63
|
+
const registeredElement = composedPath.find((pathEl) => registeredElements.has(pathEl));
|
64
|
+
return registeredElements.get(registeredElement);
|
65
|
+
};
|
66
|
+
this.togglePopovers = (event) => {
|
67
|
+
const composedPath = event.composedPath();
|
68
|
+
const togglePopover = this.queryPopover(composedPath);
|
69
|
+
if (togglePopover && !togglePopover.triggerDisabled) {
|
70
|
+
togglePopover.toggle();
|
71
|
+
}
|
72
|
+
Array.from(this.registeredElements.values())
|
73
|
+
.filter((popover) => popover !== togglePopover && popover.autoClose && popover.open && !composedPath.includes(popover))
|
74
|
+
.forEach((popover) => popover.toggle(false));
|
75
|
+
};
|
76
|
+
this.keyHandler = (event) => {
|
77
|
+
if (event.defaultPrevented || !isActivationKey(event.key)) {
|
78
|
+
return;
|
79
|
+
}
|
80
|
+
this.togglePopovers(event);
|
81
|
+
};
|
82
|
+
this.clickHandler = (event) => {
|
83
|
+
if (isPrimaryPointerButton(event)) {
|
84
|
+
this.togglePopovers(event);
|
85
|
+
}
|
86
|
+
};
|
87
|
+
}
|
88
|
+
// --------------------------------------------------------------------------
|
89
|
+
//
|
90
|
+
// Public Methods
|
91
|
+
//
|
92
|
+
// --------------------------------------------------------------------------
|
93
|
+
registerElement(referenceEl, popover) {
|
94
|
+
this.registeredElementCount++;
|
95
|
+
this.registeredElements.set(referenceEl, popover);
|
96
|
+
if (this.registeredElementCount === 1) {
|
97
|
+
this.addListeners();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
unregisterElement(referenceEl) {
|
101
|
+
if (this.registeredElements.delete(referenceEl)) {
|
102
|
+
this.registeredElementCount--;
|
103
|
+
}
|
104
|
+
if (this.registeredElementCount === 0) {
|
105
|
+
this.removeListeners();
|
106
|
+
}
|
107
|
+
}
|
108
|
+
addListeners() {
|
109
|
+
document.addEventListener("pointerdown", this.clickHandler, { capture: true });
|
110
|
+
document.addEventListener("keydown", this.keyHandler, { capture: true });
|
111
|
+
}
|
112
|
+
removeListeners() {
|
113
|
+
document.removeEventListener("pointerdown", this.clickHandler, { capture: true });
|
114
|
+
document.removeEventListener("keydown", this.keyHandler, { capture: true });
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
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%}";
|
119
|
+
|
120
|
+
const manager = new PopoverManager();
|
121
|
+
const Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
122
|
+
constructor() {
|
123
|
+
super();
|
124
|
+
this.__registerHost();
|
125
|
+
this.__attachShadow();
|
126
|
+
this.calcitePopoverBeforeClose = createEvent(this, "calcitePopoverBeforeClose", 6);
|
127
|
+
this.calcitePopoverClose = createEvent(this, "calcitePopoverClose", 6);
|
128
|
+
this.calcitePopoverBeforeOpen = createEvent(this, "calcitePopoverBeforeOpen", 6);
|
129
|
+
this.calcitePopoverOpen = createEvent(this, "calcitePopoverOpen", 6);
|
130
|
+
// --------------------------------------------------------------------------
|
131
|
+
//
|
132
|
+
// Properties
|
133
|
+
//
|
134
|
+
// --------------------------------------------------------------------------
|
135
|
+
/**
|
136
|
+
* When `true`, clicking outside of the component automatically closes open `calcite-popover`s.
|
137
|
+
*/
|
138
|
+
this.autoClose = false;
|
139
|
+
/**
|
140
|
+
* When `true`, a close button is added to the component.
|
141
|
+
*
|
142
|
+
* @deprecated use dismissible instead.
|
143
|
+
*/
|
144
|
+
this.closeButton = false;
|
145
|
+
/**
|
146
|
+
* When `true`, a close button is added to the component.
|
147
|
+
*
|
148
|
+
* @deprecated use `closable` instead.
|
149
|
+
*/
|
150
|
+
this.dismissible = false;
|
151
|
+
/** When `true`, display a close button within the component. */
|
152
|
+
this.closable = false;
|
153
|
+
/**
|
154
|
+
* When `true`, prevents flipping the component's placement when overlapping its `referenceElement`.
|
155
|
+
*/
|
156
|
+
this.disableFlip = false;
|
157
|
+
/**
|
158
|
+
* When `true`, removes the caret pointer.
|
159
|
+
*/
|
160
|
+
this.disablePointer = false;
|
161
|
+
/**
|
162
|
+
* Offsets the position of the component away from the `referenceElement`.
|
163
|
+
*
|
164
|
+
* @default 6
|
165
|
+
*/
|
166
|
+
this.offsetDistance = defaultOffsetDistance;
|
167
|
+
/**
|
168
|
+
* Offsets the position of the component along the `referenceElement`.
|
169
|
+
*/
|
170
|
+
this.offsetSkidding = 0;
|
171
|
+
/**
|
172
|
+
* When `true`, displays and positions the component.
|
173
|
+
*/
|
174
|
+
this.open = false;
|
175
|
+
/**
|
176
|
+
* Determines the type of positioning to use for the overlaid content.
|
177
|
+
*
|
178
|
+
* Using `"absolute"` will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout.
|
179
|
+
*
|
180
|
+
* `"fixed"` value should be used to escape an overflowing parent container, or when the reference element's `position` CSS property is `"fixed"`.
|
181
|
+
*
|
182
|
+
*/
|
183
|
+
this.overlayPositioning = "absolute";
|
184
|
+
/**
|
185
|
+
* Determines where the component will be positioned relative to the `referenceElement`.
|
186
|
+
*
|
187
|
+
* @see [LogicalPlacement](https://github.com/Esri/calcite-components/blob/master/src/utils/floating-ui.ts#L25)
|
188
|
+
*/
|
189
|
+
this.placement = defaultPopoverPlacement;
|
190
|
+
/**
|
191
|
+
* When `true`, disables automatically toggling the component when its `referenceElement` has been triggered.
|
192
|
+
*
|
193
|
+
* This property can be set to `true` to manage when the component is open.
|
194
|
+
*/
|
195
|
+
this.triggerDisabled = false;
|
196
|
+
/**
|
197
|
+
* Accessible name for the component's close button.
|
198
|
+
*
|
199
|
+
* @default "Close"
|
200
|
+
*/
|
201
|
+
this.intlClose = TEXT.close;
|
202
|
+
this.guid = `calcite-popover-${guid()}`;
|
203
|
+
this.openTransitionProp = "opacity";
|
204
|
+
this.hasLoaded = false;
|
205
|
+
// --------------------------------------------------------------------------
|
206
|
+
//
|
207
|
+
// Private Methods
|
208
|
+
//
|
209
|
+
// --------------------------------------------------------------------------
|
210
|
+
this.setTransitionEl = (el) => {
|
211
|
+
this.transitionEl = el;
|
212
|
+
connectOpenCloseComponent(this);
|
213
|
+
};
|
214
|
+
this.setFilteredPlacements = () => {
|
215
|
+
const { el, flipPlacements } = this;
|
216
|
+
this.filteredFlipPlacements = flipPlacements
|
217
|
+
? filterComputedPlacements(flipPlacements, el)
|
218
|
+
: null;
|
219
|
+
};
|
220
|
+
this.setUpReferenceElement = (warn = true) => {
|
221
|
+
this.removeReferences();
|
222
|
+
this.effectiveReferenceElement = this.getReferenceElement();
|
223
|
+
connectFloatingUI(this, this.effectiveReferenceElement, this.el);
|
224
|
+
const { el, referenceElement, effectiveReferenceElement } = this;
|
225
|
+
if (warn && referenceElement && !effectiveReferenceElement) {
|
226
|
+
console.warn(`${el.tagName}: reference-element id "${referenceElement}" was not found.`, {
|
227
|
+
el
|
228
|
+
});
|
229
|
+
}
|
230
|
+
this.addReferences();
|
231
|
+
};
|
232
|
+
this.getId = () => {
|
233
|
+
return this.el.id || this.guid;
|
234
|
+
};
|
235
|
+
this.setExpandedAttr = () => {
|
236
|
+
const { effectiveReferenceElement, open } = this;
|
237
|
+
if (!effectiveReferenceElement) {
|
238
|
+
return;
|
239
|
+
}
|
240
|
+
if ("setAttribute" in effectiveReferenceElement) {
|
241
|
+
effectiveReferenceElement.setAttribute(ARIA_EXPANDED, toAriaBoolean(open));
|
242
|
+
}
|
243
|
+
};
|
244
|
+
this.addReferences = () => {
|
245
|
+
const { effectiveReferenceElement } = this;
|
246
|
+
if (!effectiveReferenceElement) {
|
247
|
+
return;
|
248
|
+
}
|
249
|
+
const id = this.getId();
|
250
|
+
if ("setAttribute" in effectiveReferenceElement) {
|
251
|
+
effectiveReferenceElement.setAttribute(ARIA_CONTROLS, id);
|
252
|
+
}
|
253
|
+
manager.registerElement(effectiveReferenceElement, this.el);
|
254
|
+
this.setExpandedAttr();
|
255
|
+
};
|
256
|
+
this.removeReferences = () => {
|
257
|
+
const { effectiveReferenceElement } = this;
|
258
|
+
if (!effectiveReferenceElement) {
|
259
|
+
return;
|
260
|
+
}
|
261
|
+
if ("removeAttribute" in effectiveReferenceElement) {
|
262
|
+
effectiveReferenceElement.removeAttribute(ARIA_CONTROLS);
|
263
|
+
effectiveReferenceElement.removeAttribute(ARIA_EXPANDED);
|
264
|
+
}
|
265
|
+
manager.unregisterElement(effectiveReferenceElement);
|
266
|
+
};
|
267
|
+
this.hide = () => {
|
268
|
+
this.open = false;
|
269
|
+
};
|
270
|
+
this.storeArrowEl = (el) => {
|
271
|
+
this.arrowEl = el;
|
272
|
+
this.reposition(true);
|
273
|
+
};
|
274
|
+
}
|
275
|
+
handleDismissible(value) {
|
276
|
+
this.closable = value;
|
277
|
+
}
|
278
|
+
handleClosable(value) {
|
279
|
+
this.dismissible = value;
|
280
|
+
}
|
281
|
+
flipPlacementsHandler() {
|
282
|
+
this.setFilteredPlacements();
|
283
|
+
this.reposition(true);
|
284
|
+
}
|
285
|
+
offsetDistanceOffsetHandler() {
|
286
|
+
this.reposition(true);
|
287
|
+
}
|
288
|
+
offsetSkiddingHandler() {
|
289
|
+
this.reposition(true);
|
290
|
+
}
|
291
|
+
openHandler(value) {
|
292
|
+
if (value) {
|
293
|
+
this.reposition(true);
|
294
|
+
}
|
295
|
+
else {
|
296
|
+
updateAfterClose(this.el);
|
297
|
+
}
|
298
|
+
this.setExpandedAttr();
|
299
|
+
}
|
300
|
+
overlayPositioningHandler() {
|
301
|
+
this.reposition(true);
|
302
|
+
}
|
303
|
+
placementHandler() {
|
304
|
+
this.reposition(true);
|
305
|
+
}
|
306
|
+
referenceElementHandler() {
|
307
|
+
this.setUpReferenceElement();
|
308
|
+
this.reposition(true);
|
309
|
+
}
|
310
|
+
// --------------------------------------------------------------------------
|
311
|
+
//
|
312
|
+
// Lifecycle
|
313
|
+
//
|
314
|
+
// --------------------------------------------------------------------------
|
315
|
+
connectedCallback() {
|
316
|
+
this.setFilteredPlacements();
|
317
|
+
connectOpenCloseComponent(this);
|
318
|
+
const closable = this.closable || this.dismissible;
|
319
|
+
if (closable) {
|
320
|
+
this.handleDismissible(closable);
|
321
|
+
}
|
322
|
+
if (closable) {
|
323
|
+
this.handleClosable(closable);
|
324
|
+
}
|
325
|
+
this.setUpReferenceElement(this.hasLoaded);
|
326
|
+
}
|
327
|
+
componentDidLoad() {
|
328
|
+
if (this.referenceElement && !this.effectiveReferenceElement) {
|
329
|
+
this.setUpReferenceElement();
|
330
|
+
}
|
331
|
+
this.reposition();
|
332
|
+
this.hasLoaded = true;
|
333
|
+
}
|
334
|
+
disconnectedCallback() {
|
335
|
+
this.removeReferences();
|
336
|
+
disconnectFloatingUI(this, this.effectiveReferenceElement, this.el);
|
337
|
+
disconnectOpenCloseComponent(this);
|
338
|
+
}
|
339
|
+
// --------------------------------------------------------------------------
|
340
|
+
//
|
341
|
+
// Public Methods
|
342
|
+
//
|
343
|
+
// --------------------------------------------------------------------------
|
344
|
+
/**
|
345
|
+
* Updates the position of the component.
|
346
|
+
*
|
347
|
+
* @param delayed
|
348
|
+
*/
|
349
|
+
async reposition(delayed = false) {
|
350
|
+
const { el, effectiveReferenceElement, placement, overlayPositioning, disableFlip, filteredFlipPlacements, offsetDistance, offsetSkidding, arrowEl } = this;
|
351
|
+
return reposition(this, {
|
352
|
+
floatingEl: el,
|
353
|
+
referenceEl: effectiveReferenceElement,
|
354
|
+
overlayPositioning,
|
355
|
+
placement,
|
356
|
+
disableFlip,
|
357
|
+
flipPlacements: filteredFlipPlacements,
|
358
|
+
offsetDistance,
|
359
|
+
offsetSkidding,
|
360
|
+
includeArrow: !this.disablePointer,
|
361
|
+
arrowEl,
|
362
|
+
type: "popover"
|
363
|
+
}, delayed);
|
364
|
+
}
|
365
|
+
/**
|
366
|
+
* Sets focus on the component.
|
367
|
+
*
|
368
|
+
* @param focusId
|
369
|
+
*/
|
370
|
+
async setFocus(focusId) {
|
371
|
+
var _a;
|
372
|
+
const { closeButtonEl } = this;
|
373
|
+
if (focusId === "close-button" && closeButtonEl) {
|
374
|
+
forceUpdate(closeButtonEl);
|
375
|
+
closeButtonEl.setFocus();
|
376
|
+
return;
|
377
|
+
}
|
378
|
+
(_a = this.el) === null || _a === void 0 ? void 0 : _a.focus();
|
379
|
+
}
|
380
|
+
/**
|
381
|
+
* Toggles the component's open property.
|
382
|
+
*
|
383
|
+
* @param value
|
384
|
+
*/
|
385
|
+
async toggle(value = !this.open) {
|
386
|
+
this.open = value;
|
387
|
+
}
|
388
|
+
getReferenceElement() {
|
389
|
+
const { referenceElement, el } = this;
|
390
|
+
return ((typeof referenceElement === "string"
|
391
|
+
? queryElementRoots(el, { id: referenceElement })
|
392
|
+
: referenceElement) || null);
|
393
|
+
}
|
394
|
+
onBeforeOpen() {
|
395
|
+
this.calcitePopoverBeforeOpen.emit();
|
396
|
+
}
|
397
|
+
onOpen() {
|
398
|
+
this.calcitePopoverOpen.emit();
|
399
|
+
}
|
400
|
+
onBeforeClose() {
|
401
|
+
this.calcitePopoverBeforeClose.emit();
|
402
|
+
}
|
403
|
+
onClose() {
|
404
|
+
this.calcitePopoverClose.emit();
|
405
|
+
}
|
406
|
+
// --------------------------------------------------------------------------
|
407
|
+
//
|
408
|
+
// Render Methods
|
409
|
+
//
|
410
|
+
// --------------------------------------------------------------------------
|
411
|
+
renderCloseButton() {
|
412
|
+
const { closeButton, intlClose, heading, closable } = this;
|
413
|
+
return closable || closeButton ? (h("div", { class: CSS.closeButtonContainer }, h("calcite-action", { class: CSS.closeButton, onClick: this.hide, ref: (closeButtonEl) => (this.closeButtonEl = closeButtonEl), scale: heading ? "s" : "m", text: intlClose }, h("calcite-icon", { icon: "x", scale: heading ? "s" : "m" })))) : null;
|
414
|
+
}
|
415
|
+
renderHeader() {
|
416
|
+
const { heading, headingLevel } = this;
|
417
|
+
const headingNode = heading ? (h(Heading, { class: CSS.heading, level: headingLevel || HEADING_LEVEL }, heading)) : null;
|
418
|
+
return headingNode ? (h("div", { class: CSS.header }, headingNode, this.renderCloseButton())) : null;
|
419
|
+
}
|
420
|
+
render() {
|
421
|
+
const { effectiveReferenceElement, heading, label, open, disablePointer } = this;
|
422
|
+
const displayed = effectiveReferenceElement && open;
|
423
|
+
const hidden = !displayed;
|
424
|
+
const arrowNode = !disablePointer ? h("div", { class: CSS.arrow, ref: this.storeArrowEl }) : null;
|
425
|
+
return (h(Host, { "aria-hidden": toAriaBoolean(hidden), "aria-label": label, "aria-live": "polite", "calcite-hydrated-hidden": hidden, id: this.getId(), role: "dialog" }, h("div", { class: {
|
426
|
+
[FloatingCSS.animation]: true,
|
427
|
+
[FloatingCSS.animationActive]: displayed
|
428
|
+
}, ref: this.setTransitionEl }, arrowNode, h("div", { class: {
|
429
|
+
[CSS.hasHeader]: !!heading,
|
430
|
+
[CSS.container]: true
|
431
|
+
} }, this.renderHeader(), h("div", { class: CSS.content }, h("slot", null)), !heading ? this.renderCloseButton() : null))));
|
432
|
+
}
|
433
|
+
get el() { return this; }
|
434
|
+
static get watchers() { return {
|
435
|
+
"dismissible": ["handleDismissible"],
|
436
|
+
"closable": ["handleClosable"],
|
437
|
+
"flipPlacements": ["flipPlacementsHandler"],
|
438
|
+
"offsetDistance": ["offsetDistanceOffsetHandler"],
|
439
|
+
"offsetSkidding": ["offsetSkiddingHandler"],
|
440
|
+
"open": ["openHandler"],
|
441
|
+
"overlayPositioning": ["overlayPositioningHandler"],
|
442
|
+
"placement": ["placementHandler"],
|
443
|
+
"referenceElement": ["referenceElementHandler"]
|
444
|
+
}; }
|
445
|
+
static get style() { return popoverCss; }
|
446
|
+
}, [1, "calcite-popover", {
|
447
|
+
"autoClose": [516, "auto-close"],
|
448
|
+
"closeButton": [516, "close-button"],
|
449
|
+
"dismissible": [1540],
|
450
|
+
"closable": [1540],
|
451
|
+
"disableFlip": [516, "disable-flip"],
|
452
|
+
"disablePointer": [516, "disable-pointer"],
|
453
|
+
"flipPlacements": [16],
|
454
|
+
"heading": [1],
|
455
|
+
"headingLevel": [514, "heading-level"],
|
456
|
+
"label": [1],
|
457
|
+
"offsetDistance": [514, "offset-distance"],
|
458
|
+
"offsetSkidding": [514, "offset-skidding"],
|
459
|
+
"open": [1540],
|
460
|
+
"overlayPositioning": [513, "overlay-positioning"],
|
461
|
+
"placement": [513],
|
462
|
+
"referenceElement": [1, "reference-element"],
|
463
|
+
"triggerDisabled": [516, "trigger-disabled"],
|
464
|
+
"intlClose": [1, "intl-close"],
|
465
|
+
"effectiveReferenceElement": [32],
|
466
|
+
"reposition": [64],
|
467
|
+
"setFocus": [64],
|
468
|
+
"toggle": [64]
|
469
|
+
}]);
|
470
|
+
function defineCustomElement() {
|
471
|
+
if (typeof customElements === "undefined") {
|
472
|
+
return;
|
473
|
+
}
|
474
|
+
const components = ["calcite-popover", "calcite-action", "calcite-icon", "calcite-loader"];
|
475
|
+
components.forEach(tagName => { switch (tagName) {
|
476
|
+
case "calcite-popover":
|
477
|
+
if (!customElements.get(tagName)) {
|
478
|
+
customElements.define(tagName, Popover);
|
479
|
+
}
|
480
|
+
break;
|
481
|
+
case "calcite-action":
|
482
|
+
if (!customElements.get(tagName)) {
|
483
|
+
defineCustomElement$3();
|
484
|
+
}
|
485
|
+
break;
|
486
|
+
case "calcite-icon":
|
487
|
+
if (!customElements.get(tagName)) {
|
488
|
+
defineCustomElement$2();
|
489
|
+
}
|
490
|
+
break;
|
491
|
+
case "calcite-loader":
|
492
|
+
if (!customElements.get(tagName)) {
|
493
|
+
defineCustomElement$1();
|
494
|
+
}
|
495
|
+
break;
|
496
|
+
} });
|
497
|
+
}
|
498
|
+
defineCustomElement();
|
499
|
+
|
500
|
+
export { Popover as P, defineCustomElement as d };
|
@@ -0,0 +1,60 @@
|
|
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 { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
7
|
+
|
8
|
+
const progressCss = "@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{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:1;inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:1;background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) * 11) linear infinite}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}";
|
9
|
+
|
10
|
+
const Progress = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
11
|
+
constructor() {
|
12
|
+
super();
|
13
|
+
this.__registerHost();
|
14
|
+
this.__attachShadow();
|
15
|
+
/**
|
16
|
+
* Specifies the component type.
|
17
|
+
*
|
18
|
+
* Use `"indeterminate"` if finding actual progress value is impossible.
|
19
|
+
*
|
20
|
+
*/
|
21
|
+
this.type = "determinate";
|
22
|
+
/** The component's progress value, with a range of 0.0 - 1.0. */
|
23
|
+
this.value = 0;
|
24
|
+
/** When `true` and for `"indeterminate"` progress bars, reverses the animation direction. */
|
25
|
+
this.reversed = false;
|
26
|
+
}
|
27
|
+
render() {
|
28
|
+
const isDeterminate = this.type === "determinate";
|
29
|
+
const barStyles = isDeterminate ? { width: `${this.value * 100}%` } : {};
|
30
|
+
return (h("div", { "aria-label": this.label || this.text, "aria-valuemax": 1, "aria-valuemin": 0, "aria-valuenow": this.value, role: "progressbar" }, h("div", { class: "track" }, h("div", { class: {
|
31
|
+
bar: true,
|
32
|
+
indeterminate: this.type === "indeterminate",
|
33
|
+
reversed: this.reversed
|
34
|
+
}, style: barStyles })), this.text ? h("div", { class: "text" }, this.text) : null));
|
35
|
+
}
|
36
|
+
get el() { return this; }
|
37
|
+
static get style() { return progressCss; }
|
38
|
+
}, [1, "calcite-progress", {
|
39
|
+
"type": [513],
|
40
|
+
"value": [2],
|
41
|
+
"label": [1],
|
42
|
+
"text": [1],
|
43
|
+
"reversed": [516]
|
44
|
+
}]);
|
45
|
+
function defineCustomElement() {
|
46
|
+
if (typeof customElements === "undefined") {
|
47
|
+
return;
|
48
|
+
}
|
49
|
+
const components = ["calcite-progress"];
|
50
|
+
components.forEach(tagName => { switch (tagName) {
|
51
|
+
case "calcite-progress":
|
52
|
+
if (!customElements.get(tagName)) {
|
53
|
+
customElements.define(tagName, Progress);
|
54
|
+
}
|
55
|
+
break;
|
56
|
+
} });
|
57
|
+
}
|
58
|
+
defineCustomElement();
|
59
|
+
|
60
|
+
export { Progress as P, defineCustomElement as d };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
2
|
+
|
3
|
+
interface PublicNotification extends Components.PublicNotification, HTMLElement {}
|
4
|
+
export const PublicNotification: {
|
5
|
+
prototype: PublicNotification;
|
6
|
+
new (): PublicNotification;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Used to define this component and all nested components recursively.
|
10
|
+
*/
|
11
|
+
export const defineCustomElement: () => void;
|