@esri/solutions-components 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. package/dist/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  2. package/dist/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  3. package/dist/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  4. package/dist/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  5. package/dist/assets/arcgis-pdf-creator/grid.js +1 -1
  6. package/dist/assets/data/images/grid.png +0 -0
  7. package/dist/assets/data/images/horizontal.png +0 -0
  8. package/dist/assets/data/images/vertical.png +0 -0
  9. package/dist/assets/t9n/crowdsource-manager/resources.json +7 -1
  10. package/dist/assets/t9n/crowdsource-manager/resources_en.json +7 -1
  11. package/dist/cjs/buffer-tools_6.cjs.entry.js +88 -92
  12. package/dist/cjs/{calcite-block_2.cjs.entry.js → calcite-action-bar_4.cjs.entry.js} +307 -18
  13. package/dist/cjs/{calcite-action.cjs.entry.js → calcite-action_2.cjs.entry.js} +84 -1
  14. package/dist/cjs/{calcite-combobox_3.cjs.entry.js → calcite-chip_4.cjs.entry.js} +131 -5
  15. package/dist/cjs/{calcite-dropdown-group_4.cjs.entry.js → calcite-dropdown_5.cjs.entry.js} +467 -1
  16. package/dist/cjs/calcite-input-message_5.cjs.entry.js +19 -17
  17. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  18. package/dist/cjs/{calcite-action-bar_2.cjs.entry.js → calcite-tooltip.cjs.entry.js} +2 -208
  19. package/dist/cjs/crowdsource-manager.cjs.entry.js +88 -14
  20. package/dist/cjs/{downloadUtils-415ab342.js → downloadUtils-9359e9ff.js} +135 -44
  21. package/dist/cjs/{index.es-98008aa0.js → index.es-9c0d0ed6.js} +3 -3
  22. package/dist/cjs/{interfaces-17c631bf.js → interfaces-cac36920.js} +6 -0
  23. package/dist/cjs/layer-table_2.cjs.entry.js +512 -0
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/cjs/{mapViewUtils-f617ae9a.js → mapViewUtils-090f4d4d.js} +3 -3
  26. package/dist/cjs/public-notification.cjs.entry.js +173 -48
  27. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  28. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  29. package/dist/cjs/{solution-store-b86759b2.js → solution-store-d28c332e.js} +1 -1
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator.js +6 -3
  32. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_jsPDF.js +1 -1
  33. package/dist/collection/assets/arcgis-pdf-creator/PDFCreator_pdf_lib.js +1 -1
  34. package/dist/collection/assets/arcgis-pdf-creator/PDFLabels.js +54 -3
  35. package/dist/collection/assets/arcgis-pdf-creator/grid.js +1 -1
  36. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +122 -0
  37. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +130 -14
  38. package/dist/collection/components/layer-table/layer-table.css +2 -70
  39. package/dist/collection/components/layer-table/layer-table.js +66 -106
  40. package/dist/collection/components/map-card/map-card.css +4 -7
  41. package/dist/collection/components/map-card/map-card.js +44 -10
  42. package/dist/collection/components/map-draw-tools/map-draw-tools.js +4 -8
  43. package/dist/collection/components/map-select-tools/map-select-tools.js +75 -15
  44. package/dist/collection/components/public-notification/public-notification.js +217 -25
  45. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +1 -1
  46. package/dist/collection/demos/crowdsource-manager.html +14 -41
  47. package/dist/collection/utils/csvDownload.js +41 -0
  48. package/dist/collection/utils/csvDownload.ts +42 -0
  49. package/dist/collection/utils/csvUtils.js +6 -23
  50. package/dist/collection/utils/csvUtils.ts +8 -27
  51. package/dist/collection/utils/downloadUtils.js +30 -14
  52. package/dist/collection/utils/downloadUtils.ts +36 -14
  53. package/dist/collection/utils/interfaces.js +6 -0
  54. package/dist/collection/utils/interfaces.ts +6 -0
  55. package/dist/collection/utils/pdfUtils.js +9 -6
  56. package/dist/collection/utils/pdfUtils.ts +13 -8
  57. package/dist/collection/utils/queryUtils.js +2 -2
  58. package/dist/collection/utils/queryUtils.ts +2 -2
  59. package/dist/collection/utils/test/csvUtils.spec.tsx +56 -0
  60. package/dist/collection/utils/test/downloadUtils.spec.tsx +133 -0
  61. package/dist/components/crowdsource-manager.js +293 -17
  62. package/dist/components/downloadUtils.js +133 -42
  63. package/dist/components/interfaces3.js +7 -1
  64. package/dist/components/layer-table.js +1 -443
  65. package/dist/components/layer-table2.js +429 -0
  66. package/dist/components/map-card.js +1 -339
  67. package/dist/{esm/map-card.entry.js → components/map-card2.js} +118 -22
  68. package/dist/components/map-draw-tools2.js +19 -23
  69. package/dist/components/map-layer-picker2.js +1 -1
  70. package/dist/components/map-select-tools2.js +21 -16
  71. package/dist/components/public-notification.js +209 -81
  72. package/dist/components/queryUtils.js +2 -2
  73. package/dist/components/refine-selection-tools2.js +3 -3
  74. package/dist/components/refine-selection2.js +1 -1
  75. package/dist/components/solution-resource-item2.js +1 -1
  76. package/dist/components/solution-store.js +1 -1
  77. package/dist/esm/buffer-tools_6.entry.js +79 -83
  78. package/dist/esm/{calcite-block_2.entry.js → calcite-action-bar_4.entry.js} +307 -20
  79. package/dist/esm/{calcite-action.entry.js → calcite-action_2.entry.js} +84 -2
  80. package/dist/esm/{calcite-combobox_3.entry.js → calcite-chip_4.entry.js} +134 -9
  81. package/dist/esm/{calcite-dropdown-group_4.entry.js → calcite-dropdown_5.entry.js} +468 -3
  82. package/dist/esm/calcite-input-message_5.entry.js +19 -17
  83. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  84. package/dist/esm/{calcite-action-bar_2.entry.js → calcite-tooltip.entry.js} +4 -209
  85. package/dist/esm/crowdsource-manager.entry.js +88 -14
  86. package/dist/esm/{downloadUtils-606b0f0e.js → downloadUtils-a8f139c5.js} +135 -44
  87. package/dist/esm/{index.es-c736c805.js → index.es-a75412ff.js} +3 -3
  88. package/dist/esm/{interfaces-d0d83efa.js → interfaces-cd4054e5.js} +7 -1
  89. package/dist/esm/layer-table_2.entry.js +507 -0
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{mapViewUtils-4e945e07.js → mapViewUtils-8ffcd36d.js} +4 -4
  92. package/dist/esm/public-notification.entry.js +169 -44
  93. package/dist/esm/solution-configuration.entry.js +2 -2
  94. package/dist/esm/solution-contents_3.entry.js +2 -2
  95. package/dist/esm/{solution-store-477288ac.js → solution-store-1b67f2c8.js} +1 -1
  96. package/dist/esm/solutions-components.js +1 -1
  97. package/dist/solutions-components/demos/crowdsource-manager.html +14 -41
  98. package/dist/solutions-components/{p-dd11eeb2.js → p-1395b0ef.js} +1 -1
  99. package/dist/solutions-components/{p-4f5641b4.entry.js → p-1affd711.entry.js} +18 -18
  100. package/dist/solutions-components/p-30de8da1.entry.js +17 -0
  101. package/dist/solutions-components/{p-91cad71e.entry.js → p-439c878d.entry.js} +3 -9
  102. package/dist/solutions-components/{p-72117a18.js → p-765a27f3.js} +1 -1
  103. package/dist/solutions-components/p-813a04c3.entry.js +6 -0
  104. package/dist/solutions-components/{p-9e8a371f.entry.js → p-874b39a7.entry.js} +3 -3
  105. package/dist/solutions-components/p-8cece97f.js +21 -0
  106. package/dist/solutions-components/{p-dd0241fb.entry.js → p-97aa7211.entry.js} +1 -1
  107. package/dist/solutions-components/{p-0e459cc7.entry.js → p-a955a3e6.entry.js} +10 -4
  108. package/dist/solutions-components/{p-6a657ff6.js → p-bb64bd47.js} +25 -9
  109. package/dist/solutions-components/p-c392dd95.entry.js +17 -0
  110. package/dist/solutions-components/p-ca386a72.entry.js +6 -0
  111. package/dist/solutions-components/p-d47d74a6.entry.js +23 -0
  112. package/dist/solutions-components/p-db846ee2.entry.js +11 -0
  113. package/dist/solutions-components/p-dc53c9c1.js +36 -0
  114. package/dist/solutions-components/p-e1c93241.entry.js +6 -0
  115. package/dist/solutions-components/{p-4cbaf0f1.entry.js → p-e6d235d6.entry.js} +1 -1
  116. package/dist/solutions-components/solutions-components.esm.js +6 -6
  117. package/dist/solutions-components/utils/csvDownload.ts +42 -0
  118. package/dist/solutions-components/utils/csvUtils.ts +8 -27
  119. package/dist/solutions-components/utils/downloadUtils.ts +36 -14
  120. package/dist/solutions-components/utils/interfaces.ts +6 -0
  121. package/dist/solutions-components/utils/pdfUtils.ts +13 -8
  122. package/dist/solutions-components/utils/queryUtils.ts +2 -2
  123. package/dist/solutions-components/utils/test/csvUtils.spec.tsx +56 -0
  124. package/dist/solutions-components/utils/test/downloadUtils.spec.tsx +133 -0
  125. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +39 -0
  126. package/dist/types/components/layer-table/layer-table.d.ts +35 -48
  127. package/dist/types/components/map-card/map-card.d.ts +10 -6
  128. package/dist/types/components/map-select-tools/map-select-tools.d.ts +16 -1
  129. package/dist/types/components/public-notification/public-notification.d.ts +86 -4
  130. package/dist/types/components.d.ts +68 -0
  131. package/dist/types/preact.d.ts +2 -1
  132. package/dist/types/utils/csvDownload.d.ts +24 -0
  133. package/dist/types/utils/csvUtils.d.ts +2 -1
  134. package/dist/types/utils/downloadUtils.d.ts +25 -0
  135. package/dist/types/utils/interfaces.d.ts +5 -0
  136. package/dist/types/utils/pdfUtils.d.ts +2 -1
  137. package/package.json +4 -4
  138. package/dist/cjs/calcite-chip.cjs.entry.js +0 -142
  139. package/dist/cjs/calcite-dropdown.cjs.entry.js +0 -481
  140. package/dist/cjs/calcite-handle.cjs.entry.js +0 -99
  141. package/dist/cjs/calcite-loader.cjs.entry.js +0 -95
  142. package/dist/cjs/layer-table.cjs.entry.js +0 -317
  143. package/dist/cjs/map-card.cjs.entry.js +0 -252
  144. package/dist/esm/calcite-chip.entry.js +0 -138
  145. package/dist/esm/calcite-dropdown.entry.js +0 -477
  146. package/dist/esm/calcite-handle.entry.js +0 -95
  147. package/dist/esm/calcite-loader.entry.js +0 -91
  148. package/dist/esm/layer-table.entry.js +0 -313
  149. package/dist/solutions-components/p-11132485.entry.js +0 -11
  150. package/dist/solutions-components/p-15b43c29.entry.js +0 -11
  151. package/dist/solutions-components/p-5034aabc.entry.js +0 -11
  152. package/dist/solutions-components/p-5ee7b022.entry.js +0 -12
  153. package/dist/solutions-components/p-6f012424.entry.js +0 -6
  154. package/dist/solutions-components/p-7fd10eb3.entry.js +0 -11
  155. package/dist/solutions-components/p-84bbaebf.entry.js +0 -6
  156. package/dist/solutions-components/p-88e28de2.js +0 -36
  157. package/dist/solutions-components/p-a57ef371.entry.js +0 -6
  158. package/dist/solutions-components/p-ac76d270.entry.js +0 -17
  159. package/dist/solutions-components/p-dbc9a5a8.js +0 -21
  160. package/dist/solutions-components/p-e162304e.entry.js +0 -6
  161. package/dist/solutions-components/p-f5c70be2.entry.js +0 -6
  162. package/dist/solutions-components/p-f6b17cc6.entry.js +0 -11
@@ -4,25 +4,228 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c246d90e.js';
7
- import { a as getSlotted, t as toAriaBoolean } from './dom-3bdc69ee.js';
8
- import { H as Heading } from './Heading-34ddc076.js';
7
+ import { t as toggleChildActionText, o as overflowActionsDebounceInMs, q as queryActions, g as geActionDimensions, a as overflowActions, E as ExpandToggle, b as getOverflowCount } from './ExpandToggle-5f4b222f.js';
8
+ import { f as focusElement, a as getSlotted, t as toAriaBoolean } from './dom-3bdc69ee.js';
9
+ import { c as createObserver } from './observers-31601001.js';
9
10
  import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-d09506c4.js';
11
+ import { d as debounce } from './debounce-4c884e5c.js';
12
+ import { H as Heading } from './Heading-34ddc076.js';
10
13
  import { u as updateHostInteraction } from './interactive-822ffed6.js';
11
14
  import { g as guid } from './guid-15fce7c0.js';
12
15
  import { I as ICON_TYPES } from './resources-2235e4ff.js';
13
16
  import { m as mutationObserverCallback, d as deselectRemovedItems, a as deselectSiblingItems, s as selectSiblings, h as handleFilter, g as getItemData, k as keyDownHandler, i as initialize, b as initializeObserver, c as cleanUpObserver, r as removeItem, e as calciteListItemChangeHandler, f as calciteInternalListItemValueChangeHandler, j as calciteListFocusOutHandler, l as setUpItems, n as setFocus, L as List } from './shared-list-render-13a77297.js';
14
- import { c as createObserver } from './observers-31601001.js';
17
+ import './resources-d60362c3.js';
18
+ import './resources-3d641588.js';
15
19
  import './resources-436ae282.js';
16
20
  import './array-2ab3b18f.js';
17
21
  import './resources-78132e50.js';
18
- import './debounce-4c884e5c.js';
19
22
 
20
23
  /*!
21
24
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
22
25
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
23
26
  * v1.0.0-beta.97
24
27
  */
25
- const CSS = {
28
+ const CSS$2 = {
29
+ actionGroupBottom: "action-group--bottom"
30
+ };
31
+ const SLOTS$1 = {
32
+ bottomActions: "bottom-actions",
33
+ expandTooltip: "expand-tooltip"
34
+ };
35
+ const TEXT$1 = {
36
+ expand: "Expand",
37
+ collapse: "Collapse"
38
+ };
39
+
40
+ const actionBarCss = "@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}}:host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{pointer-events:auto;display:inline-flex;align-self:stretch;background:transparent;--calcite-action-bar-expanded-max-width:auto}:host([layout=vertical]){flex-direction:column}:host([layout=horizontal]){flex-direction:row}:host([layout=vertical][overflow-actions-disabled]){overflow-y:auto}:host([layout=horizontal][overflow-actions-disabled]){overflow-x:auto}:host([layout=vertical][expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width)}::slotted(calcite-action-group){border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}:host([layout=horizontal]) ::slotted(calcite-action-group){border-width:0px;border-inline-end-width:1px;border-style:solid}::slotted(calcite-action-group:last-child){border-block-end-width:0px;border-inline-end-width:0px}.action-group--bottom{flex-grow:1;justify-content:flex-end;-webkit-padding-after:0px;padding-block-end:0px;-webkit-padding-end:0px;padding-inline-end:0px}";
41
+
42
+ const ActionBar = class {
43
+ constructor(hostRef) {
44
+ registerInstance(this, hostRef);
45
+ this.calciteActionBarToggle = createEvent(this, "calciteActionBarToggle", 6);
46
+ // --------------------------------------------------------------------------
47
+ //
48
+ // Properties
49
+ //
50
+ // --------------------------------------------------------------------------
51
+ /**
52
+ * When `true`, the expand-toggling behavior is disabled.
53
+ */
54
+ this.expandDisabled = false;
55
+ /**
56
+ * When `true`, the component is expanded.
57
+ */
58
+ this.expanded = false;
59
+ /**
60
+ * The layout direction of the actions.
61
+ */
62
+ this.layout = "vertical";
63
+ /**
64
+ * Disables automatically overflowing `calcite-action`s that won't fit into menus.
65
+ */
66
+ this.overflowActionsDisabled = false;
67
+ this.mutationObserver = createObserver("mutation", () => {
68
+ const { el, expanded } = this;
69
+ toggleChildActionText({ parent: el, expanded });
70
+ this.conditionallyOverflowActions();
71
+ });
72
+ this.resizeObserver = createObserver("resize", (entries) => this.resizeHandlerEntries(entries));
73
+ // --------------------------------------------------------------------------
74
+ //
75
+ // Private Methods
76
+ //
77
+ // --------------------------------------------------------------------------
78
+ this.actionMenuOpenChangeHandler = (event) => {
79
+ if (event.detail) {
80
+ const composedPath = event.composedPath();
81
+ Array.from(this.el.querySelectorAll("calcite-action-group")).forEach((group) => {
82
+ if (!composedPath.includes(group)) {
83
+ group.menuOpen = false;
84
+ }
85
+ });
86
+ }
87
+ };
88
+ this.resizeHandlerEntries = (entries) => {
89
+ entries.forEach(this.resizeHandler);
90
+ };
91
+ this.resizeHandler = (entry) => {
92
+ const { width, height } = entry.contentRect;
93
+ this.resize({ width, height });
94
+ };
95
+ this.resize = debounce(({ width, height }) => {
96
+ const { el, expanded, expandDisabled, layout } = this;
97
+ if ((layout === "vertical" && !height) || (layout === "horizontal" && !width)) {
98
+ return;
99
+ }
100
+ const actions = queryActions(el);
101
+ const actionCount = expandDisabled ? actions.length : actions.length + 1;
102
+ const actionGroups = Array.from(el.querySelectorAll("calcite-action-group"));
103
+ const groupCount = getSlotted(el, SLOTS$1.bottomActions) || !expandDisabled
104
+ ? actionGroups.length + 1
105
+ : actionGroups.length;
106
+ const { actionHeight, actionWidth } = geActionDimensions(actions);
107
+ const overflowCount = getOverflowCount({
108
+ layout,
109
+ actionCount,
110
+ actionHeight,
111
+ actionWidth,
112
+ height,
113
+ width,
114
+ groupCount
115
+ });
116
+ overflowActions({
117
+ actionGroups,
118
+ expanded,
119
+ overflowCount
120
+ });
121
+ }, overflowActionsDebounceInMs);
122
+ this.conditionallyOverflowActions = () => {
123
+ if (!this.overflowActionsDisabled) {
124
+ this.overflowActions();
125
+ }
126
+ };
127
+ this.toggleExpand = () => {
128
+ this.expanded = !this.expanded;
129
+ this.calciteActionBarToggle.emit();
130
+ };
131
+ this.setExpandToggleRef = (el) => {
132
+ this.expandToggleEl = el;
133
+ };
134
+ }
135
+ expandHandler() {
136
+ this.conditionallyOverflowActions();
137
+ }
138
+ expandedHandler(expanded) {
139
+ toggleChildActionText({ parent: this.el, expanded });
140
+ this.conditionallyOverflowActions();
141
+ }
142
+ overflowDisabledHandler(overflowActionsDisabled) {
143
+ overflowActionsDisabled
144
+ ? this.resizeObserver.disconnect()
145
+ : this.resizeObserver.observe(this.el);
146
+ }
147
+ // --------------------------------------------------------------------------
148
+ //
149
+ // Lifecycle
150
+ //
151
+ // --------------------------------------------------------------------------
152
+ componentDidLoad() {
153
+ this.conditionallyOverflowActions();
154
+ }
155
+ connectedCallback() {
156
+ var _a, _b;
157
+ const { el, expanded } = this;
158
+ toggleChildActionText({ parent: el, expanded });
159
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(el, { childList: true, subtree: true });
160
+ if (!this.overflowActionsDisabled) {
161
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.observe(el);
162
+ }
163
+ this.conditionallyOverflowActions();
164
+ connectConditionalSlotComponent(this);
165
+ }
166
+ disconnectedCallback() {
167
+ var _a, _b;
168
+ (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
169
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
170
+ disconnectConditionalSlotComponent(this);
171
+ }
172
+ // --------------------------------------------------------------------------
173
+ //
174
+ // Methods
175
+ //
176
+ // --------------------------------------------------------------------------
177
+ /**
178
+ * Overflows actions that won't fit into menus.
179
+ *
180
+ * @internal
181
+ */
182
+ async overflowActions() {
183
+ this.resize({ width: this.el.clientWidth, height: this.el.clientHeight });
184
+ }
185
+ /**
186
+ * Sets focus on the component.
187
+ *
188
+ * @param focusId
189
+ */
190
+ async setFocus(focusId) {
191
+ var _a;
192
+ if (focusId === "expand-toggle") {
193
+ await focusElement(this.expandToggleEl);
194
+ return;
195
+ }
196
+ (_a = this.el) === null || _a === void 0 ? void 0 : _a.focus();
197
+ }
198
+ // --------------------------------------------------------------------------
199
+ //
200
+ // Render Methods
201
+ //
202
+ // --------------------------------------------------------------------------
203
+ renderBottomActionGroup() {
204
+ const { expanded, expandDisabled, intlExpand, intlCollapse, el, position, toggleExpand, scale, layout } = this;
205
+ const tooltip = getSlotted(el, SLOTS$1.expandTooltip);
206
+ const expandLabel = intlExpand || TEXT$1.expand;
207
+ const collapseLabel = intlCollapse || TEXT$1.collapse;
208
+ const expandToggleNode = !expandDisabled ? (h(ExpandToggle, { el: el, expanded: expanded, intlCollapse: collapseLabel, intlExpand: expandLabel, position: position, ref: this.setExpandToggleRef, scale: scale, toggle: toggleExpand, tooltip: tooltip })) : null;
209
+ return getSlotted(el, SLOTS$1.bottomActions) || expandToggleNode ? (h("calcite-action-group", { class: CSS$2.actionGroupBottom, layout: layout, scale: scale }, h("slot", { name: SLOTS$1.bottomActions }), h("slot", { name: SLOTS$1.expandTooltip }), expandToggleNode)) : null;
210
+ }
211
+ render() {
212
+ return (h(Host, { onCalciteActionMenuOpenChange: this.actionMenuOpenChangeHandler }, h("slot", null), this.renderBottomActionGroup()));
213
+ }
214
+ get el() { return getElement(this); }
215
+ static get watchers() { return {
216
+ "expandDisabled": ["expandHandler"],
217
+ "expanded": ["expandedHandler"],
218
+ "overflowActionsDisabled": ["overflowDisabledHandler"]
219
+ }; }
220
+ };
221
+ ActionBar.style = actionBarCss;
222
+
223
+ /*!
224
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
225
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
226
+ * v1.0.0-beta.97
227
+ */
228
+ const CSS$1 = {
26
229
  container: "container",
27
230
  content: "content",
28
231
  contentSpaced: "content--spaced",
@@ -53,7 +256,7 @@ const SLOTS = {
53
256
  control: "control",
54
257
  headerMenuActions: "header-menu-actions"
55
258
  };
56
- const ICONS = {
259
+ const ICONS$1 = {
57
260
  opened: "chevron-up",
58
261
  closed: "chevron-down",
59
262
  valid: "check-circle",
@@ -166,42 +369,126 @@ const Block = class {
166
369
  renderIcon() {
167
370
  const { el, status } = this;
168
371
  const showingLoadingStatus = this.loading && !this.open;
169
- const statusIcon = showingLoadingStatus ? ICONS.refresh : ICONS[status];
372
+ const statusIcon = showingLoadingStatus ? ICONS$1.refresh : ICONS$1[status];
170
373
  const hasIcon = getSlotted(el, SLOTS.icon) || statusIcon;
171
374
  const iconEl = !statusIcon ? (h("slot", { key: "icon-slot", name: SLOTS.icon })) : (h("calcite-icon", { class: {
172
- [CSS.statusIcon]: true,
173
- [CSS.valid]: status == "valid",
174
- [CSS.invalid]: status == "invalid",
175
- [CSS.loading]: showingLoadingStatus
375
+ [CSS$1.statusIcon]: true,
376
+ [CSS$1.valid]: status == "valid",
377
+ [CSS$1.invalid]: status == "invalid",
378
+ [CSS$1.loading]: showingLoadingStatus
176
379
  }, icon: statusIcon, scale: "m" }));
177
- return hasIcon ? h("div", { class: CSS.icon }, iconEl) : null;
380
+ return hasIcon ? h("div", { class: CSS$1.icon }, iconEl) : null;
178
381
  }
179
382
  renderTitle() {
180
383
  const { heading, headingLevel, summary, description } = this;
181
- return heading || summary || description ? (h("div", { class: CSS.title }, h(Heading, { class: CSS.heading, level: headingLevel || HEADING_LEVEL }, heading), summary || description ? (h("div", { class: CSS.description }, summary || description)) : null)) : null;
384
+ return heading || summary || description ? (h("div", { class: CSS$1.title }, h(Heading, { class: CSS$1.heading, level: headingLevel || HEADING_LEVEL }, heading), summary || description ? (h("div", { class: CSS$1.description }, summary || description)) : null)) : null;
182
385
  }
183
386
  render() {
184
387
  const { collapsible, el, intlCollapse, intlExpand, loading, open, intlLoading } = this;
185
388
  const toggleLabel = open ? intlCollapse || TEXT.collapse : intlExpand || TEXT.expand;
186
- const headerContent = (h("header", { class: CSS.header }, this.renderIcon(), this.renderTitle()));
389
+ const headerContent = (h("header", { class: CSS$1.header }, this.renderIcon(), this.renderTitle()));
187
390
  const hasControl = !!getSlotted(el, SLOTS.control);
188
391
  const hasMenuActions = !!getSlotted(el, SLOTS.headerMenuActions);
189
- const collapseIcon = open ? ICONS.opened : ICONS.closed;
392
+ const collapseIcon = open ? ICONS$1.opened : ICONS$1.closed;
190
393
  const { guid } = this;
191
394
  const regionId = `${guid}-region`;
192
395
  const buttonId = `${guid}-button`;
193
- const headerNode = (h("div", { class: CSS.headerContainer }, this.dragHandle ? h("calcite-handle", null) : null, collapsible ? (h("button", { "aria-controls": regionId, "aria-expanded": collapsible ? toAriaBoolean(open) : null, "aria-label": toggleLabel, class: CSS.toggle, id: buttonId, onClick: this.onHeaderClick, title: toggleLabel }, headerContent, !hasControl && !hasMenuActions ? (h("calcite-icon", { "aria-hidden": "true", class: CSS.toggleIcon, icon: collapseIcon, scale: "s" })) : null)) : (headerContent), loading ? (h("calcite-loader", { inline: true, "is-active": true, label: intlLoading })) : hasControl ? (h("div", { class: CSS.controlContainer }, h("slot", { name: SLOTS.control }))) : null, hasMenuActions ? (h("calcite-action-menu", { label: this.intlOptions || TEXT.options }, h("slot", { name: SLOTS.headerMenuActions }))) : null));
396
+ const headerNode = (h("div", { class: CSS$1.headerContainer }, this.dragHandle ? h("calcite-handle", null) : null, collapsible ? (h("button", { "aria-controls": regionId, "aria-expanded": collapsible ? toAriaBoolean(open) : null, "aria-label": toggleLabel, class: CSS$1.toggle, id: buttonId, onClick: this.onHeaderClick, title: toggleLabel }, headerContent, !hasControl && !hasMenuActions ? (h("calcite-icon", { "aria-hidden": "true", class: CSS$1.toggleIcon, icon: collapseIcon, scale: "s" })) : null)) : (headerContent), loading ? (h("calcite-loader", { inline: true, "is-active": true, label: intlLoading })) : hasControl ? (h("div", { class: CSS$1.controlContainer }, h("slot", { name: SLOTS.control }))) : null, hasMenuActions ? (h("calcite-action-menu", { label: this.intlOptions || TEXT.options }, h("slot", { name: SLOTS.headerMenuActions }))) : null));
194
397
  return (h(Host, null, h("article", { "aria-busy": toAriaBoolean(loading), class: {
195
- [CSS.container]: true
398
+ [CSS$1.container]: true
196
399
  } }, headerNode, h("section", { "aria-expanded": toAriaBoolean(open), "aria-labelledby": buttonId, class: {
197
- [CSS.content]: true,
198
- [CSS.contentSpaced]: !this.disablePadding
400
+ [CSS$1.content]: true,
401
+ [CSS$1.contentSpaced]: !this.disablePadding
199
402
  }, hidden: !open, id: regionId }, this.renderScrim()))));
200
403
  }
201
404
  get el() { return getElement(this); }
202
405
  };
203
406
  Block.style = blockCss;
204
407
 
408
+ /*!
409
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
410
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
411
+ * v1.0.0-beta.97
412
+ */
413
+ const CSS = {
414
+ handle: "handle",
415
+ handleActivated: "handle--activated"
416
+ };
417
+ const ICONS = {
418
+ drag: "drag"
419
+ };
420
+
421
+ const handleCss = "@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:flex}.handle{display:flex;cursor:move;align-items:center;justify-content:center;align-self:stretch;border-style:none;background-color:transparent;outline-color:transparent;color:var(--calcite-ui-border-input);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle:hover{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.handle:focus{color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.handle--activated{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}.handle calcite-icon{color:inherit}";
422
+
423
+ const Handle = class {
424
+ constructor(hostRef) {
425
+ registerInstance(this, hostRef);
426
+ this.calciteHandleNudge = createEvent(this, "calciteHandleNudge", 6);
427
+ // --------------------------------------------------------------------------
428
+ //
429
+ // Properties
430
+ //
431
+ // --------------------------------------------------------------------------
432
+ /**
433
+ * @internal
434
+ */
435
+ this.activated = false;
436
+ /**
437
+ * Value for the button title attribute
438
+ */
439
+ this.textTitle = "handle";
440
+ // --------------------------------------------------------------------------
441
+ //
442
+ // Private Methods
443
+ //
444
+ // --------------------------------------------------------------------------
445
+ this.handleKeyDown = (event) => {
446
+ switch (event.key) {
447
+ case " ":
448
+ this.activated = !this.activated;
449
+ event.preventDefault();
450
+ break;
451
+ case "ArrowUp":
452
+ case "ArrowDown":
453
+ if (!this.activated) {
454
+ return;
455
+ }
456
+ event.preventDefault();
457
+ const direction = event.key.toLowerCase().replace("arrow", "");
458
+ this.calciteHandleNudge.emit({ handle: this.el, direction });
459
+ break;
460
+ }
461
+ };
462
+ this.handleBlur = () => {
463
+ this.activated = false;
464
+ };
465
+ }
466
+ // --------------------------------------------------------------------------
467
+ //
468
+ // Methods
469
+ //
470
+ // --------------------------------------------------------------------------
471
+ /** Sets focus on the component. */
472
+ async setFocus() {
473
+ var _a;
474
+ (_a = this.handleButton) === null || _a === void 0 ? void 0 : _a.focus();
475
+ }
476
+ // --------------------------------------------------------------------------
477
+ //
478
+ // Render Methods
479
+ //
480
+ // --------------------------------------------------------------------------
481
+ render() {
482
+ return (
483
+ // Needs to be a span because of https://github.com/SortableJS/Sortable/issues/1486
484
+ h("span", { "aria-pressed": toAriaBoolean(this.activated), class: { [CSS.handle]: true, [CSS.handleActivated]: this.activated }, onBlur: this.handleBlur, onKeyDown: this.handleKeyDown, ref: (el) => {
485
+ this.handleButton = el;
486
+ }, role: "button", tabindex: "0", title: this.textTitle }, h("calcite-icon", { icon: ICONS.drag, scale: "s" })));
487
+ }
488
+ get el() { return getElement(this); }
489
+ };
490
+ Handle.style = handleCss;
491
+
205
492
  const pickListCss = "@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([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;box-sizing:border-box;display:flex;flex-shrink:0;flex-grow:1;flex-direction:column;align-items:stretch;background-color:transparent;font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}:host *{box-sizing:border-box}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([filter-enabled]) header{-webkit-margin-after:0.25rem;margin-block-end:0.25rem;display:flex;align-items:stretch;justify-content:flex-end;background-color:var(--calcite-ui-foreground-1);--tw-shadow:0 1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([filter-enabled]) header.sticky-pos{position:sticky;inset-block-start:0px;z-index:1}calcite-filter{-webkit-margin-after:0px;margin-block-end:0px}:host([loading][disabled]){min-block-size:2rem}";
206
493
 
207
494
  const PickList = class {
@@ -332,4 +619,4 @@ const PickList = class {
332
619
  };
333
620
  PickList.style = pickListCss;
334
621
 
335
- export { Block as calcite_block, PickList as calcite_pick_list };
622
+ export { ActionBar as calcite_action_bar, Block as calcite_block, Handle as calcite_handle, PickList as calcite_pick_list };
@@ -7,8 +7,8 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement,
7
7
  import { c as createObserver } from './observers-31601001.js';
8
8
  import { u as updateHostInteraction } from './interactive-822ffed6.js';
9
9
  import { t as toAriaBoolean } from './dom-3bdc69ee.js';
10
+ import { g as guid } from './guid-15fce7c0.js';
10
11
  import './resources-436ae282.js';
11
- import './guid-15fce7c0.js';
12
12
 
13
13
  /*!
14
14
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
@@ -170,4 +170,86 @@ const Action = class {
170
170
  };
171
171
  Action.style = actionCss;
172
172
 
173
- export { Action as calcite_action };
173
+ const loaderCss = "@charset \"UTF-8\";@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;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) * 2) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:none}:host([active]){display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);-webkit-margin-before:calc(var(--calcite-loader-size) + 1.5rem);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;-webkit-margin-start:calc(var(--calcite-loader-size) / 2 * -1);margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;-webkit-margin-start:calc(var(--calcite-loader-size) / 2 * -1);margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);transform:scale(1, 1)}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear;animation-name:loader-clockwise}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-ui-border-3)}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);-webkit-margin-end:calc(var(--calcite-loader-size-inline) * 0.5);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([active][inline]){display:inline-block}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-ui-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) * 2.4)}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444% 251.3272%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-83.7757333333%}100%{stroke-dasharray:27.9252444444% 251.3272%;stroke-dashoffset:-279.2524444444%}}.loader__svg--2{stroke-dasharray:55.8504888889% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) * 3.2)}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889% 223.4019555556%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-97.7383555556%}100%{stroke-dasharray:55.8504888889% 223.4019555556%;stroke-dashoffset:-279.2524444444%}}.loader__svg--3{stroke-dasharray:13.9626222222% 139.6262222222%;animation-duration:calc(var(--calcite-internal-animation-timing-slow) * 3.867)}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222% 265.2898222222%;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222% 139.6262222222%;stroke-dashoffset:-76.7944222222%}100%{stroke-dasharray:13.9626222222% 265.2898222222%;stroke-dashoffset:-279.2524444444%}}@keyframes loader-color-shift{0%{stroke:var(--calcite-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
174
+
175
+ const Loader = class {
176
+ constructor(hostRef) {
177
+ registerInstance(this, hostRef);
178
+ //--------------------------------------------------------------------------
179
+ //
180
+ // Properties
181
+ //
182
+ //--------------------------------------------------------------------------
183
+ /** When `true`, the component is active. */
184
+ this.active = false;
185
+ /** When `true`, displays smaller and appears to the left of the text. */
186
+ this.inline = false;
187
+ /** Specifies the size of the component. */
188
+ this.scale = "m";
189
+ /** The component's value. Valid only for `"determinate"` indicators. Percent complete of 100. */
190
+ this.value = 0;
191
+ /** Text that displays under the component's indicator. */
192
+ this.text = "";
193
+ /**
194
+ * Disables spacing around the component.
195
+ *
196
+ * @deprecated Use `--calcite-loader-padding` CSS variable instead.
197
+ */
198
+ this.noPadding = false;
199
+ }
200
+ //--------------------------------------------------------------------------
201
+ //
202
+ // Lifecycle
203
+ //
204
+ //--------------------------------------------------------------------------
205
+ render() {
206
+ const { el, inline, label, scale, text, type, value } = this;
207
+ const id = el.id || guid();
208
+ const radiusRatio = 0.45;
209
+ const size = inline ? this.getInlineSize(scale) : this.getSize(scale);
210
+ const radius = size * radiusRatio;
211
+ const viewbox = `0 0 ${size} ${size}`;
212
+ const isDeterminate = type === "determinate";
213
+ const circumference = 2 * radius * Math.PI;
214
+ const progress = (value / 100) * circumference;
215
+ const remaining = circumference - progress;
216
+ const valueNow = Math.floor(value);
217
+ const hostAttributes = {
218
+ "aria-valuenow": valueNow,
219
+ "aria-valuemin": 0,
220
+ "aria-valuemax": 100,
221
+ complete: valueNow === 100
222
+ };
223
+ const svgAttributes = { r: radius, cx: size / 2, cy: size / 2 };
224
+ const determinateStyle = { "stroke-dasharray": `${progress} ${remaining}` };
225
+ return (h(Host, Object.assign({ "aria-label": label, id: id, role: "progressbar" }, (isDeterminate ? hostAttributes : {})), h("div", { class: "loader__svgs" }, h("svg", { class: "loader__svg loader__svg--1", viewBox: viewbox }, h("circle", Object.assign({}, svgAttributes))), h("svg", { class: "loader__svg loader__svg--2", viewBox: viewbox }, h("circle", Object.assign({}, svgAttributes))), h("svg", Object.assign({ class: "loader__svg loader__svg--3", viewBox: viewbox }, (isDeterminate ? { style: determinateStyle } : {})), h("circle", Object.assign({}, svgAttributes)))), text && h("div", { class: "loader__text" }, text), isDeterminate && h("div", { class: "loader__percentage" }, value)));
226
+ }
227
+ //--------------------------------------------------------------------------
228
+ //
229
+ // Private Methods
230
+ //
231
+ //--------------------------------------------------------------------------
232
+ /**
233
+ * Return the proper sizes based on the scale property
234
+ *
235
+ * @param scale
236
+ */
237
+ getSize(scale) {
238
+ return {
239
+ s: 32,
240
+ m: 56,
241
+ l: 80
242
+ }[scale];
243
+ }
244
+ getInlineSize(scale) {
245
+ return {
246
+ s: 12,
247
+ m: 16,
248
+ l: 20
249
+ }[scale];
250
+ }
251
+ get el() { return getElement(this); }
252
+ };
253
+ Loader.style = loaderCss;
254
+
255
+ export { Action as calcite_action, Loader as calcite_loader };