@esri/solutions-components 0.8.8 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. package/dist/assets/t9n/crowdsource-reporter/resources.json +11 -2
  2. package/dist/assets/t9n/crowdsource-reporter/resources_en.json +11 -2
  3. package/dist/cjs/{calcite-action-menu_2.cjs.entry.js → calcite-action-menu_3.cjs.entry.js} +114 -7
  4. package/dist/cjs/calcite-alert_4.cjs.entry.js +47 -5
  5. package/dist/cjs/{calcite-input-date-picker_3.cjs.entry.js → calcite-block_5.cjs.entry.js} +691 -13
  6. package/dist/cjs/{calcite-combobox_5.cjs.entry.js → calcite-combobox_3.cjs.entry.js} +876 -844
  7. package/dist/cjs/calcite-dropdown_4.cjs.entry.js +1023 -0
  8. package/dist/cjs/{calcite-flow_5.cjs.entry.js → calcite-flow_6.cjs.entry.js} +327 -2
  9. package/dist/cjs/card-manager_3.cjs.entry.js +5 -5
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +25 -17
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +122 -21
  12. package/dist/cjs/{downloadUtils-8b05d7cc.js → downloadUtils-dd787ddf.js} +2 -2
  13. package/dist/cjs/{index.es-e7587227.js → index.es-29fa176d.js} +2 -2
  14. package/dist/cjs/loader.cjs.js +1 -1
  15. package/dist/cjs/map-select-tools_3.cjs.entry.js +8 -8
  16. package/dist/cjs/{mapViewUtils-3e0fa457.js → mapViewUtils-82018df6.js} +12 -6
  17. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  18. package/dist/cjs/solutions-components.cjs.js +1 -1
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/create-feature/create-feature.js +18 -0
  21. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +15 -0
  22. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +48 -16
  23. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.css +16 -0
  24. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +155 -35
  25. package/dist/collection/components/feature-details/feature-details.css +18 -0
  26. package/dist/collection/components/feature-details/feature-details.js +500 -0
  27. package/dist/collection/components/feature-details/test/feature-details.e2e.js +14 -0
  28. package/dist/collection/components/feature-details/test/feature-details.spec.js +22 -0
  29. package/dist/collection/components/feature-list/feature-list.js +14 -1
  30. package/dist/collection/components/info-card/info-card.css +15 -5
  31. package/dist/collection/components/info-card/info-card.js +179 -5
  32. package/dist/collection/components/layer-table/layer-table.js +2 -2
  33. package/dist/collection/components/map-card/map-card.js +1 -1
  34. package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
  35. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  36. package/dist/collection/demos/crowdsource-manager.html +7 -2
  37. package/dist/collection/demos/crowdsource-reporter.html +115 -1
  38. package/dist/collection/utils/mapViewUtils.js +12 -6
  39. package/dist/collection/utils/mapViewUtils.ts +14 -6
  40. package/dist/components/create-feature2.js +4 -0
  41. package/dist/components/crowdsource-manager.js +26 -18
  42. package/dist/components/crowdsource-reporter.js +270 -81
  43. package/dist/components/feature-details.d.ts +11 -0
  44. package/dist/components/feature-details.js +11 -0
  45. package/dist/components/feature-details2.js +449 -0
  46. package/dist/components/feature-list2.js +14 -1
  47. package/dist/components/info-card2.js +54 -5
  48. package/dist/components/layer-table2.js +2 -2
  49. package/dist/components/map-card2.js +1 -1
  50. package/dist/components/map-select-tools2.js +5 -5
  51. package/dist/components/mapViewUtils.js +12 -6
  52. package/dist/components/refine-selection2.js +1 -1
  53. package/dist/esm/{calcite-action-menu_2.entry.js → calcite-action-menu_3.entry.js} +118 -12
  54. package/dist/esm/calcite-alert_4.entry.js +47 -5
  55. package/dist/esm/{calcite-input-date-picker_3.entry.js → calcite-block_5.entry.js} +688 -12
  56. package/dist/esm/{calcite-combobox_5.entry.js → calcite-combobox_3.entry.js} +878 -844
  57. package/dist/esm/calcite-date-picker-day_3.entry.js +1 -1
  58. package/dist/esm/calcite-dropdown_4.entry.js +1016 -0
  59. package/dist/esm/{calcite-flow_5.entry.js → calcite-flow_6.entry.js} +327 -3
  60. package/dist/esm/card-manager_3.entry.js +5 -5
  61. package/dist/esm/crowdsource-manager.entry.js +26 -18
  62. package/dist/esm/crowdsource-reporter.entry.js +122 -21
  63. package/dist/esm/{date-5630530d.js → date-0c026a8b.js} +1 -1
  64. package/dist/esm/{downloadUtils-0c1e4d7b.js → downloadUtils-25aa808f.js} +2 -2
  65. package/dist/esm/{index.es-286e3cfa.js → index.es-a16c9db4.js} +2 -2
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/map-select-tools_3.entry.js +8 -8
  68. package/dist/esm/{mapViewUtils-253178f1.js → mapViewUtils-c83c03a4.js} +12 -6
  69. package/dist/esm/public-notification.entry.js +2 -2
  70. package/dist/esm/solutions-components.js +1 -1
  71. package/dist/solutions-components/demos/crowdsource-manager.html +7 -2
  72. package/dist/solutions-components/demos/crowdsource-reporter.html +115 -1
  73. package/dist/solutions-components/p-2f687975.entry.js +17 -0
  74. package/dist/solutions-components/{p-813fd8a4.entry.js → p-3e5085ae.entry.js} +2 -2
  75. package/dist/solutions-components/p-40039b84.entry.js +6 -0
  76. package/dist/solutions-components/p-511b1c91.entry.js +23 -0
  77. package/dist/solutions-components/{p-94de9279.js → p-5817d78c.js} +1 -1
  78. package/dist/solutions-components/{p-15f9624a.entry.js → p-58997cc1.entry.js} +1 -1
  79. package/dist/solutions-components/p-82e398cb.entry.js +17 -0
  80. package/dist/solutions-components/p-ae75d7d7.entry.js +6 -0
  81. package/dist/solutions-components/{p-331b5d1e.js → p-b1376c75.js} +2 -2
  82. package/dist/solutions-components/p-b5acfcd8.entry.js +6 -0
  83. package/dist/solutions-components/{p-212b02e7.js → p-bdd77f17.js} +1 -1
  84. package/dist/solutions-components/{p-038fcd93.entry.js → p-c273ab7a.entry.js} +1 -1
  85. package/dist/solutions-components/p-d742b915.entry.js +29 -0
  86. package/dist/solutions-components/p-d9c89479.js +36 -0
  87. package/dist/solutions-components/p-dfad61a8.entry.js +24 -0
  88. package/dist/solutions-components/p-fffc9e08.entry.js +6 -0
  89. package/dist/solutions-components/solutions-components.esm.js +1 -1
  90. package/dist/solutions-components/utils/mapViewUtils.ts +14 -6
  91. package/dist/types/components/create-feature/create-feature.d.ts +4 -4
  92. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +13 -1
  93. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +91 -10
  94. package/dist/types/components/feature-details/feature-details.d.ts +151 -0
  95. package/dist/types/components/feature-list/feature-list.d.ts +6 -0
  96. package/dist/types/components/info-card/info-card.d.ts +33 -1
  97. package/dist/types/components.d.ts +148 -12
  98. package/dist/types/preact.d.ts +9 -2
  99. package/dist/types/utils/mapViewUtils.d.ts +5 -3
  100. package/package.json +1 -1
  101. package/dist/cjs/calcite-block_2.cjs.entry.js +0 -652
  102. package/dist/cjs/calcite-graph_2.cjs.entry.js +0 -1055
  103. package/dist/cjs/calcite-scrim.cjs.entry.js +0 -125
  104. package/dist/cjs/utils-7bc7f595.js +0 -64
  105. package/dist/esm/calcite-block_2.entry.js +0 -647
  106. package/dist/esm/calcite-graph_2.entry.js +0 -1050
  107. package/dist/esm/calcite-scrim.entry.js +0 -121
  108. package/dist/esm/utils-9fb4104a.js +0 -61
  109. package/dist/solutions-components/p-04c37d69.entry.js +0 -17
  110. package/dist/solutions-components/p-0b92e4b1.entry.js +0 -11
  111. package/dist/solutions-components/p-13ca3b00.entry.js +0 -6
  112. package/dist/solutions-components/p-238d3b5f.entry.js +0 -6
  113. package/dist/solutions-components/p-3af79063.js +0 -36
  114. package/dist/solutions-components/p-80b11ec1.entry.js +0 -17
  115. package/dist/solutions-components/p-a3a11749.entry.js +0 -6
  116. package/dist/solutions-components/p-aec06ce4.entry.js +0 -18
  117. package/dist/solutions-components/p-bfdf89c2.js +0 -11
  118. package/dist/solutions-components/p-c4ff3b52.entry.js +0 -17
  119. package/dist/solutions-components/p-ced067bd.entry.js +0 -17
  120. package/dist/solutions-components/p-d136eab0.entry.js +0 -23
  121. package/dist/solutions-components/p-e0446d5b.entry.js +0 -6
@@ -3,19 +3,20 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-164d485a.js';
7
- import { d as datePartsFromISO, a as datePartsFromLocalizedString, b as dateFromLocalizedString, i as inRange, c as dateToISO, e as dateFromISO, f as dateFromRange } from './date-5630530d.js';
8
- import { t as toAriaBoolean } from './dom-38c6f027.js';
6
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement, a as getAssetPath } from './index-164d485a.js';
7
+ import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-12c4fcfb.js';
8
+ import { f as focusFirstTabbable, g as getSlotted, t as toAriaBoolean } from './dom-38c6f027.js';
9
+ import { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction, I as InteractiveContainer } from './interactive-39bf5602.js';
10
+ import { c as connectLocalized, d as disconnectLocalized, g as getSupportedLocale, n as numberStringFormatter, a as getDateTimeFormat, b as getSupportedNumberingSystem } from './locale-904407bf.js';
11
+ import { u as updateMessages, c as connectMessages, d as disconnectMessages, s as setUpMessages } from './t9n-436fb2b1.js';
12
+ import { H as Heading } from './Heading-94780f62.js';
13
+ import { c as componentFocusable, s as setUpLoadableComponent, a as setComponentLoaded } from './loadable-37e7fbd6.js';
14
+ import { o as onToggleOpenCloseComponent } from './openCloseComponent-9f90f493.js';
15
+ import { d as dateFromISO, g as getDaysDiff, a as dateToISO, b as dateFromRange, s as setEndOfDay, c as datePartsFromISO, e as datePartsFromLocalizedString, f as dateFromLocalizedString, i as inRange } from './date-0c026a8b.js';
9
16
  import { f as filterComputedPlacements, c as connectFloatingUI, d as defaultMenuPlacement, r as reposition, a as disconnectFloatingUI, F as FloatingCSS } from './floating-ui-41dfe3f1.js';
10
17
  import { s as submitForm, c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from './form-50dcd52e.js';
11
- import { c as connectInteractive, d as disconnectInteractive, u as updateHostInteraction, I as InteractiveContainer } from './interactive-39bf5602.js';
12
18
  import { n as numberKeys } from './key-c83d835f.js';
13
19
  import { c as connectLabel, d as disconnectLabel } from './label-b4cea72e.js';
14
- import { c as componentFocusable, s as setUpLoadableComponent, a as setComponentLoaded } from './loadable-37e7fbd6.js';
15
- import { n as numberStringFormatter, c as connectLocalized, d as disconnectLocalized, b as getSupportedNumberingSystem } from './locale-904407bf.js';
16
- import { o as onToggleOpenCloseComponent } from './openCloseComponent-9f90f493.js';
17
- import { g as getValueAsDateRange, a as getLocaleData } from './utils-9fb4104a.js';
18
- import { c as connectMessages, s as setUpMessages, d as disconnectMessages } from './t9n-436fb2b1.js';
19
20
  import { c as connectFocusTrap, d as deactivateFocusTrap, a as activateFocusTrap } from './focusTrapComponent-47ddce58.js';
20
21
  import { g as guid } from './guid-b75a5f7b.js';
21
22
  import { g as getIconScale } from './component-edd2c3cd.js';
@@ -23,14 +24,689 @@ import { V as Validation } from './Validation-ea480265.js';
23
24
  import { l as loadModules } from './loadModules-7a5f1022.js';
24
25
  import { g as getMessages } from './locale-4cab280d.js';
25
26
  import { g as getMode } from './mode-66911cb5.js';
27
+ import './observers-d04d1da9.js';
26
28
  import './resources-8834f920.js';
27
- import './debounce-229b1a22.js';
28
29
  import './browser-d60104bd.js';
29
- import './observers-d04d1da9.js';
30
+ import './debounce-229b1a22.js';
30
31
  import './esri-loader-1b324844.js';
31
32
  import './_commonjsHelpers-0f74c230.js';
32
33
  import './languageUtil-035e7728.js';
33
34
 
35
+ /*!
36
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
37
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
38
+ * v2.4.0
39
+ */
40
+ const IDS = {
41
+ content: "content",
42
+ toggle: "toggle",
43
+ header: "header",
44
+ };
45
+ const CSS$3 = {
46
+ button: "button",
47
+ container: "container",
48
+ content: "content",
49
+ controlContainer: "control-container",
50
+ description: "description",
51
+ header: "header",
52
+ headerContainer: "header-container",
53
+ heading: "heading",
54
+ icon: "icon",
55
+ invalid: "invalid",
56
+ statusIcon: "status-icon",
57
+ summary: "summary",
58
+ title: "title",
59
+ toggle: "toggle",
60
+ toggleIcon: "toggle-icon",
61
+ valid: "valid",
62
+ };
63
+ const SLOTS = {
64
+ icon: "icon",
65
+ control: "control",
66
+ headerMenuActions: "header-menu-actions",
67
+ };
68
+ const ICONS = {
69
+ opened: "chevron-up",
70
+ closed: "chevron-down",
71
+ valid: "check-circle",
72
+ invalid: "exclamation-mark-triangle",
73
+ };
74
+
75
+ const blockCss = ":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);padding:0px;transition-property:margin;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0.215, 0.440, 0.420, 0.880);flex-basis:auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.header{justify-content:flex-start;padding:0px}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto;grid-template-areas:\"handle header control menu\";grid-column:header-start/menu-end;grid-row:1/2}.toggle{margin:0px;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0px;font-family:inherit;outline-color:transparent;text-align:initial;background-color:transparent}.toggle:hover{background-color:var(--calcite-color-foreground-2)}.toggle:focus{outline:2px solid var(--calcite-color-brand);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}calcite-loader[inline]{grid-area:control;align-self:center}calcite-handle{grid-area:handle}.title{margin:0px;padding:0.75rem}.header .title .heading{padding:0px;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-color-text-2);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);word-wrap:break-word;word-break:break-word}.description{margin-block-start:0.125rem;padding:0px;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text-3);word-wrap:break-word;word-break:break-word}.icon{display:flex;margin-inline-start:0.75rem;margin-inline-end:0px}.status-icon.valid{color:var(--calcite-color-status-success)}.status-icon.invalid{color:var(--calcite-color-status-danger)}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.toggle-icon{margin-block:0.75rem;align-self:center;justify-self:end;color:var(--calcite-color-text-3);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);margin-inline-end:0.75rem;margin-inline-start:auto}.toggle:hover .toggle-icon{color:var(--calcite-color-text-1)}.container{position:relative;display:flex;block-size:100%;flex-direction:column}.content{position:relative;min-block-size:0px;flex:1 1 0%}@keyframes in{0%{opacity:0}100%{opacity:1}}.content{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;padding-block:var(--calcite-block-padding, 0.5rem);padding-inline:var(--calcite-block-padding, 0.625rem)}.control-container{margin:0px;display:flex;grid-area:control}calcite-action-menu{grid-area:menu}:host([open]){margin-block:0.5rem}:host([open]) .header .title .heading{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}";
76
+
77
+ const Block = class {
78
+ constructor(hostRef) {
79
+ registerInstance(this, hostRef);
80
+ this.calciteBlockBeforeClose = createEvent(this, "calciteBlockBeforeClose", 6);
81
+ this.calciteBlockBeforeOpen = createEvent(this, "calciteBlockBeforeOpen", 6);
82
+ this.calciteBlockClose = createEvent(this, "calciteBlockClose", 6);
83
+ this.calciteBlockOpen = createEvent(this, "calciteBlockOpen", 6);
84
+ this.calciteBlockToggle = createEvent(this, "calciteBlockToggle", 6);
85
+ this.openTransitionProp = "opacity";
86
+ // --------------------------------------------------------------------------
87
+ //
88
+ // Private Methods
89
+ //
90
+ // --------------------------------------------------------------------------
91
+ this.onHeaderClick = () => {
92
+ this.open = !this.open;
93
+ this.calciteBlockToggle.emit();
94
+ };
95
+ this.setTransitionEl = (el) => {
96
+ this.transitionEl = el;
97
+ };
98
+ this.collapsible = false;
99
+ this.disabled = false;
100
+ this.dragHandle = false;
101
+ this.heading = undefined;
102
+ this.headingLevel = undefined;
103
+ this.loading = false;
104
+ this.open = false;
105
+ this.status = undefined;
106
+ this.description = undefined;
107
+ this.messages = undefined;
108
+ this.messageOverrides = undefined;
109
+ this.overlayPositioning = "absolute";
110
+ this.effectiveLocale = undefined;
111
+ this.defaultMessages = undefined;
112
+ }
113
+ openHandler() {
114
+ onToggleOpenCloseComponent(this);
115
+ }
116
+ onMessagesChange() {
117
+ /* wired up by t9n util */
118
+ }
119
+ //--------------------------------------------------------------------------
120
+ //
121
+ // Public Methods
122
+ //
123
+ //--------------------------------------------------------------------------
124
+ /**
125
+ * Sets focus on the component's first tabbable element.
126
+ *
127
+ */
128
+ async setFocus() {
129
+ await componentFocusable(this);
130
+ focusFirstTabbable(this.el);
131
+ }
132
+ onBeforeOpen() {
133
+ this.calciteBlockBeforeOpen.emit();
134
+ }
135
+ onOpen() {
136
+ this.calciteBlockOpen.emit();
137
+ }
138
+ onBeforeClose() {
139
+ this.calciteBlockBeforeClose.emit();
140
+ }
141
+ onClose() {
142
+ this.calciteBlockClose.emit();
143
+ }
144
+ effectiveLocaleChange() {
145
+ updateMessages(this, this.effectiveLocale);
146
+ }
147
+ // --------------------------------------------------------------------------
148
+ //
149
+ // Lifecycle
150
+ //
151
+ // --------------------------------------------------------------------------
152
+ connectedCallback() {
153
+ connectConditionalSlotComponent(this);
154
+ connectInteractive(this);
155
+ connectLocalized(this);
156
+ connectMessages(this);
157
+ }
158
+ disconnectedCallback() {
159
+ disconnectInteractive(this);
160
+ disconnectLocalized(this);
161
+ disconnectMessages(this);
162
+ disconnectConditionalSlotComponent(this);
163
+ }
164
+ async componentWillLoad() {
165
+ await setUpMessages(this);
166
+ setUpLoadableComponent(this);
167
+ if (this.open) {
168
+ onToggleOpenCloseComponent(this);
169
+ }
170
+ }
171
+ componentDidLoad() {
172
+ setComponentLoaded(this);
173
+ }
174
+ componentDidRender() {
175
+ updateHostInteraction(this);
176
+ }
177
+ // --------------------------------------------------------------------------
178
+ //
179
+ // Render Methods
180
+ //
181
+ // --------------------------------------------------------------------------
182
+ renderScrim() {
183
+ const { loading } = this;
184
+ const defaultSlot = h("slot", null);
185
+ return [loading ? h("calcite-scrim", { loading: loading }) : null, defaultSlot];
186
+ }
187
+ renderIcon() {
188
+ const { loading, messages, status } = this;
189
+ const hasSlottedIcon = !!getSlotted(this.el, SLOTS.icon);
190
+ return loading ? (h("div", { class: CSS$3.icon, key: "loader" }, h("calcite-loader", { inline: true, label: messages.loading }))) : !!status ? (h("div", { class: CSS$3.icon, key: "status-icon" }, h("calcite-icon", { class: {
191
+ [CSS$3.statusIcon]: true,
192
+ [CSS$3.valid]: status == "valid",
193
+ [CSS$3.invalid]: status == "invalid",
194
+ }, icon: ICONS[status], scale: "s" }))) : hasSlottedIcon ? (h("div", { class: CSS$3.icon, key: "icon-slot" }, h("slot", { key: "icon-slot", name: SLOTS.icon }))) : null;
195
+ }
196
+ renderTitle() {
197
+ const { heading, headingLevel, description } = this;
198
+ return heading || description ? (h("div", { class: CSS$3.title }, h(Heading, { class: CSS$3.heading, level: headingLevel }, heading), description ? h("div", { class: CSS$3.description }, description) : null)) : null;
199
+ }
200
+ render() {
201
+ const { collapsible, el, loading, open, heading, messages } = this;
202
+ const toggleLabel = open ? messages.collapse : messages.expand;
203
+ const headerContent = (h("header", { class: CSS$3.header, id: IDS.header }, this.renderIcon(), this.renderTitle()));
204
+ const hasControl = !!getSlotted(el, SLOTS.control);
205
+ const hasMenuActions = !!getSlotted(el, SLOTS.headerMenuActions);
206
+ const collapseIcon = open ? ICONS.opened : ICONS.closed;
207
+ const headerNode = (h("div", { class: CSS$3.headerContainer }, this.dragHandle ? h("calcite-handle", { label: heading }) : null, collapsible ? (h("button", { "aria-controls": IDS.content, "aria-describedby": IDS.header, "aria-expanded": collapsible ? toAriaBoolean(open) : null, class: CSS$3.toggle, id: IDS.toggle, onClick: this.onHeaderClick, title: toggleLabel }, headerContent, h("calcite-icon", { "aria-hidden": "true", class: CSS$3.toggleIcon, icon: collapseIcon, scale: "s" }))) : (headerContent), hasControl ? (h("div", { class: CSS$3.controlContainer }, h("slot", { name: SLOTS.control }))) : null, hasMenuActions ? (h("calcite-action-menu", { label: messages.options, overlayPositioning: this.overlayPositioning }, h("slot", { name: SLOTS.headerMenuActions }))) : null));
208
+ return (h(Host, null, h(InteractiveContainer, { disabled: this.disabled }, h("article", { "aria-busy": toAriaBoolean(loading), class: {
209
+ [CSS$3.container]: true,
210
+ } }, headerNode, h("section", { "aria-labelledby": IDS.toggle, class: CSS$3.content, hidden: !open, id: IDS.content,
211
+ // eslint-disable-next-line react/jsx-sort-props -- ref should be last so node attrs/props are in sync (see https://github.com/Esri/calcite-design-system/pull/6530)
212
+ ref: this.setTransitionEl }, this.renderScrim())))));
213
+ }
214
+ static get assetsDirs() { return ["assets"]; }
215
+ get el() { return getElement(this); }
216
+ static get watchers() { return {
217
+ "open": ["openHandler"],
218
+ "messageOverrides": ["onMessagesChange"],
219
+ "effectiveLocale": ["effectiveLocaleChange"]
220
+ }; }
221
+ };
222
+ Block.style = blockCss;
223
+
224
+ /*!
225
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
226
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
227
+ * v2.4.0
228
+ */
229
+ const HEADING_LEVEL = 2;
230
+ const DATE_PICKER_FORMAT_OPTIONS = { dateStyle: "full" };
231
+
232
+ /*!
233
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
234
+ * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
235
+ * v2.4.0
236
+ */
237
+ /**
238
+ * CLDR cache.
239
+ * Exported for testing purposes.
240
+ *
241
+ * @private
242
+ */
243
+ const translationCache = {};
244
+ /**
245
+ * CLDR request cache.
246
+ * Exported for testing purposes.
247
+ *
248
+ * @private
249
+ */
250
+ const requestCache = {};
251
+ /**
252
+ * Fetch calendar data for a given locale from list of supported languages
253
+ *
254
+ * @param lang
255
+ * @public
256
+ */
257
+ async function getLocaleData(lang) {
258
+ const locale = getSupportedLocale(lang);
259
+ if (translationCache[locale]) {
260
+ return translationCache[locale];
261
+ }
262
+ if (!requestCache[locale]) {
263
+ requestCache[locale] = fetch(getAssetPath(`./assets/date-picker/nls/${locale}.json`))
264
+ .then((resp) => resp.json())
265
+ .catch(() => {
266
+ console.error(`Translations for "${locale}" not found or invalid, falling back to english`);
267
+ return getLocaleData("en");
268
+ });
269
+ }
270
+ const data = await requestCache[locale];
271
+ translationCache[locale] = data;
272
+ return data;
273
+ }
274
+ /**
275
+ * Maps value to valueAsDate
276
+ *
277
+ * @param value
278
+ */
279
+ function getValueAsDateRange(value) {
280
+ return value.map((v, index) => dateFromISO(v, index === 1));
281
+ }
282
+
283
+ const datePickerCss = ":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:inline-block;inline-size:auto;overflow:visible;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-1);vertical-align:top}:host([scale=s]){inline-size:234px;min-inline-size:216px;max-inline-size:380px}:host([scale=m]){inline-size:304px;min-inline-size:272px;max-inline-size:480px}:host([scale=l]){inline-size:370px;min-inline-size:320px;max-inline-size:600px}:host([hidden]){display:none}[hidden]{display:none}";
284
+
285
+ const DatePicker = class {
286
+ constructor(hostRef) {
287
+ registerInstance(this, hostRef);
288
+ this.calciteDatePickerChange = createEvent(this, "calciteDatePickerChange", 6);
289
+ this.calciteDatePickerRangeChange = createEvent(this, "calciteDatePickerRangeChange", 6);
290
+ //--------------------------------------------------------------------------
291
+ //
292
+ // Private Methods
293
+ //
294
+ //--------------------------------------------------------------------------
295
+ this.keyDownHandler = (event) => {
296
+ if (event.key === "Escape") {
297
+ this.resetActiveDates();
298
+ }
299
+ };
300
+ this.monthHeaderSelectChange = (event) => {
301
+ const date = new Date(event.detail);
302
+ if (!this.range) {
303
+ this.activeDate = date;
304
+ }
305
+ else {
306
+ if (this.activeRange === "end") {
307
+ this.activeEndDate = date;
308
+ }
309
+ else {
310
+ this.activeStartDate = date;
311
+ }
312
+ this.mostRecentRangeValue = date;
313
+ }
314
+ };
315
+ this.monthActiveDateChange = (event) => {
316
+ const date = new Date(event.detail);
317
+ if (!this.range) {
318
+ this.activeDate = date;
319
+ }
320
+ else {
321
+ if (this.activeRange === "end") {
322
+ this.activeEndDate = date;
323
+ }
324
+ else {
325
+ this.activeStartDate = date;
326
+ }
327
+ this.mostRecentRangeValue = date;
328
+ }
329
+ };
330
+ this.monthHoverChange = (event) => {
331
+ if (!this.range) {
332
+ this.hoverRange = undefined;
333
+ return;
334
+ }
335
+ const { valueAsDate } = this;
336
+ const start = Array.isArray(valueAsDate) && valueAsDate[0];
337
+ const end = Array.isArray(valueAsDate) && valueAsDate[1];
338
+ const date = new Date(event.detail);
339
+ this.hoverRange = {
340
+ focused: this.activeRange || "start",
341
+ start,
342
+ end,
343
+ };
344
+ if (!this.proximitySelectionDisabled) {
345
+ if (start && end) {
346
+ const startDiff = getDaysDiff(date, start);
347
+ const endDiff = getDaysDiff(date, end);
348
+ if (endDiff > 0) {
349
+ this.hoverRange.end = date;
350
+ this.hoverRange.focused = "end";
351
+ }
352
+ else if (startDiff < 0) {
353
+ this.hoverRange.start = date;
354
+ this.hoverRange.focused = "start";
355
+ }
356
+ else if (startDiff > endDiff) {
357
+ this.hoverRange.start = date;
358
+ this.hoverRange.focused = "start";
359
+ }
360
+ else {
361
+ this.hoverRange.end = date;
362
+ this.hoverRange.focused = "end";
363
+ }
364
+ }
365
+ else {
366
+ if (start) {
367
+ if (date < start) {
368
+ this.hoverRange = {
369
+ focused: "start",
370
+ start: date,
371
+ end: start,
372
+ };
373
+ }
374
+ else {
375
+ this.hoverRange.end = date;
376
+ this.hoverRange.focused = "end";
377
+ }
378
+ }
379
+ }
380
+ }
381
+ else {
382
+ if (!end) {
383
+ if (date < start) {
384
+ this.hoverRange = {
385
+ focused: "start",
386
+ start: date,
387
+ end: start,
388
+ };
389
+ }
390
+ else {
391
+ this.hoverRange.end = date;
392
+ this.hoverRange.focused = "end";
393
+ }
394
+ }
395
+ else {
396
+ this.hoverRange = undefined;
397
+ }
398
+ }
399
+ event.stopPropagation();
400
+ };
401
+ this.monthMouseOutChange = () => {
402
+ if (this.hoverRange) {
403
+ this.hoverRange = undefined;
404
+ }
405
+ };
406
+ this.resetActiveDates = () => {
407
+ const { valueAsDate } = this;
408
+ if (!Array.isArray(valueAsDate) && valueAsDate && valueAsDate !== this.activeDate) {
409
+ this.activeDate = new Date(valueAsDate);
410
+ }
411
+ if (Array.isArray(valueAsDate)) {
412
+ if (valueAsDate[0] && valueAsDate[0] !== this.activeStartDate) {
413
+ this.activeStartDate = new Date(valueAsDate[0]);
414
+ }
415
+ if (valueAsDate[1] && valueAsDate[1] !== this.activeEndDate) {
416
+ this.activeEndDate = new Date(valueAsDate[1]);
417
+ }
418
+ }
419
+ };
420
+ /**
421
+ * Event handler for when the selected date changes
422
+ *
423
+ * @param event
424
+ */
425
+ this.monthDateChange = (event) => {
426
+ const date = new Date(event.detail);
427
+ const isoDate = dateToISO(date);
428
+ if (!this.range && isoDate === dateToISO(this.valueAsDate)) {
429
+ return;
430
+ }
431
+ if (!this.range) {
432
+ this.value = isoDate || "";
433
+ this.valueAsDate = date || null;
434
+ this.activeDate = date || null;
435
+ this.calciteDatePickerChange.emit();
436
+ return;
437
+ }
438
+ const start = this.getStartDate();
439
+ const end = this.getEndDate();
440
+ if (!start || (!end && date < start)) {
441
+ if (start) {
442
+ this.setEndDate(new Date(start));
443
+ }
444
+ if (this.activeRange == "end") {
445
+ this.setEndDate(date);
446
+ }
447
+ else {
448
+ this.setStartDate(date);
449
+ }
450
+ }
451
+ else if (!end) {
452
+ this.setEndDate(date);
453
+ }
454
+ else {
455
+ if (!this.proximitySelectionDisabled) {
456
+ if (this.activeRange) {
457
+ if (this.activeRange == "end") {
458
+ this.setEndDate(date);
459
+ }
460
+ else {
461
+ this.setStartDate(date);
462
+ }
463
+ }
464
+ else {
465
+ const startDiff = getDaysDiff(date, start);
466
+ const endDiff = getDaysDiff(date, end);
467
+ if (endDiff === 0 || startDiff < 0) {
468
+ this.setStartDate(date);
469
+ }
470
+ else if (startDiff === 0 || endDiff < 0) {
471
+ this.setEndDate(date);
472
+ }
473
+ else if (startDiff < endDiff) {
474
+ this.setStartDate(date);
475
+ }
476
+ else {
477
+ this.setEndDate(date);
478
+ }
479
+ }
480
+ }
481
+ else {
482
+ this.setStartDate(date);
483
+ }
484
+ }
485
+ this.calciteDatePickerChange.emit();
486
+ };
487
+ this.activeDate = undefined;
488
+ this.activeRange = undefined;
489
+ this.value = undefined;
490
+ this.headingLevel = undefined;
491
+ this.valueAsDate = undefined;
492
+ this.minAsDate = undefined;
493
+ this.maxAsDate = undefined;
494
+ this.min = undefined;
495
+ this.max = undefined;
496
+ this.numberingSystem = undefined;
497
+ this.scale = "m";
498
+ this.range = false;
499
+ this.proximitySelectionDisabled = false;
500
+ this.messageOverrides = undefined;
501
+ this.messages = undefined;
502
+ this.activeEndDate = undefined;
503
+ this.activeStartDate = undefined;
504
+ this.dateTimeFormat = undefined;
505
+ this.defaultMessages = undefined;
506
+ this.effectiveLocale = "";
507
+ this.endAsDate = undefined;
508
+ this.hoverRange = undefined;
509
+ this.localeData = undefined;
510
+ this.mostRecentRangeValue = undefined;
511
+ this.startAsDate = undefined;
512
+ }
513
+ activeDateWatcher(newActiveDate) {
514
+ if (this.activeRange === "end") {
515
+ this.activeEndDate = newActiveDate;
516
+ }
517
+ }
518
+ valueAsDateWatcher(newValueAsDate) {
519
+ if (this.range && Array.isArray(newValueAsDate)) {
520
+ const { activeStartDate, activeEndDate } = this;
521
+ const newActiveStartDate = newValueAsDate[0];
522
+ const newActiveEndDate = newValueAsDate[1];
523
+ this.activeStartDate = activeStartDate !== newActiveStartDate && newActiveStartDate;
524
+ this.activeEndDate = activeEndDate !== newActiveEndDate && newActiveEndDate;
525
+ }
526
+ else if (newValueAsDate && newValueAsDate !== this.activeDate) {
527
+ this.activeDate = newValueAsDate;
528
+ }
529
+ }
530
+ onMinChanged(min) {
531
+ if (min) {
532
+ this.minAsDate = dateFromISO(min);
533
+ }
534
+ }
535
+ onMaxChanged(max) {
536
+ if (max) {
537
+ this.maxAsDate = dateFromISO(max);
538
+ }
539
+ }
540
+ onMessagesChange() {
541
+ /* wired up by t9n util */
542
+ }
543
+ //--------------------------------------------------------------------------
544
+ //
545
+ // Public Methods
546
+ //
547
+ //--------------------------------------------------------------------------
548
+ /** Sets focus on the component's first focusable element. */
549
+ async setFocus() {
550
+ await componentFocusable(this);
551
+ this.el.focus();
552
+ }
553
+ /**
554
+ * Resets active date state.
555
+ * @internal
556
+ */
557
+ async reset() {
558
+ this.resetActiveDates();
559
+ this.mostRecentRangeValue = undefined;
560
+ }
561
+ // --------------------------------------------------------------------------
562
+ //
563
+ // Lifecycle
564
+ //
565
+ // --------------------------------------------------------------------------
566
+ connectedCallback() {
567
+ connectLocalized(this);
568
+ connectMessages(this);
569
+ if (Array.isArray(this.value)) {
570
+ this.valueAsDate = getValueAsDateRange(this.value);
571
+ }
572
+ else if (this.value) {
573
+ this.valueAsDate = dateFromISO(this.value);
574
+ }
575
+ if (this.min) {
576
+ this.minAsDate = dateFromISO(this.min);
577
+ }
578
+ if (this.max) {
579
+ this.maxAsDate = dateFromISO(this.max);
580
+ }
581
+ }
582
+ disconnectedCallback() {
583
+ disconnectLocalized(this);
584
+ disconnectMessages(this);
585
+ }
586
+ async componentWillLoad() {
587
+ setUpLoadableComponent(this);
588
+ await this.loadLocaleData();
589
+ this.onMinChanged(this.min);
590
+ this.onMaxChanged(this.max);
591
+ await setUpMessages(this);
592
+ }
593
+ componentDidLoad() {
594
+ setComponentLoaded(this);
595
+ }
596
+ render() {
597
+ var _a;
598
+ const date = dateFromRange(this.range && Array.isArray(this.valueAsDate) ? this.valueAsDate[0] : this.valueAsDate, this.minAsDate, this.maxAsDate);
599
+ let activeDate = this.getActiveDate(date, this.minAsDate, this.maxAsDate);
600
+ const endDate = this.range && Array.isArray(this.valueAsDate)
601
+ ? dateFromRange(this.valueAsDate[1], this.minAsDate, this.maxAsDate)
602
+ : null;
603
+ const activeEndDate = this.getActiveEndDate(endDate, this.minAsDate, this.maxAsDate);
604
+ if ((this.activeRange === "end" ||
605
+ (((_a = this.hoverRange) === null || _a === void 0 ? void 0 : _a.focused) === "end" && (!this.proximitySelectionDisabled || endDate))) &&
606
+ activeEndDate) {
607
+ activeDate = activeEndDate;
608
+ }
609
+ if (this.range && this.mostRecentRangeValue) {
610
+ activeDate = this.mostRecentRangeValue;
611
+ }
612
+ const minDate = this.range && this.activeRange
613
+ ? this.activeRange === "start"
614
+ ? this.minAsDate
615
+ : date || this.minAsDate
616
+ : this.minAsDate;
617
+ const maxDate = this.range && this.activeRange
618
+ ? this.activeRange === "start"
619
+ ? endDate || this.maxAsDate
620
+ : this.maxAsDate
621
+ : this.maxAsDate;
622
+ return (h(Host, { onBlur: this.resetActiveDates, onKeyDown: this.keyDownHandler }, this.renderCalendar(activeDate, maxDate, minDate, date, endDate)));
623
+ }
624
+ effectiveLocaleChange() {
625
+ updateMessages(this, this.effectiveLocale);
626
+ }
627
+ valueHandler(value) {
628
+ if (Array.isArray(value)) {
629
+ this.valueAsDate = getValueAsDateRange(value);
630
+ }
631
+ else if (value) {
632
+ this.valueAsDate = dateFromISO(value);
633
+ }
634
+ }
635
+ async loadLocaleData() {
636
+ numberStringFormatter.numberFormatOptions = {
637
+ numberingSystem: this.numberingSystem,
638
+ locale: this.effectiveLocale,
639
+ useGrouping: false,
640
+ };
641
+ this.localeData = await getLocaleData(this.effectiveLocale);
642
+ this.dateTimeFormat = getDateTimeFormat(this.effectiveLocale, DATE_PICKER_FORMAT_OPTIONS);
643
+ }
644
+ /**
645
+ * Render calcite-date-picker-month-header and calcite-date-picker-month
646
+ *
647
+ * @param activeDate
648
+ * @param maxDate
649
+ * @param minDate
650
+ * @param date
651
+ * @param endDate
652
+ */
653
+ renderCalendar(activeDate, maxDate, minDate, date, endDate) {
654
+ return (this.localeData && [
655
+ h("calcite-date-picker-month-header", { activeDate: activeDate, headingLevel: this.headingLevel || HEADING_LEVEL, localeData: this.localeData, max: maxDate, messages: this.messages, min: minDate, onCalciteInternalDatePickerSelect: this.monthHeaderSelectChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date || new Date() }),
656
+ h("calcite-date-picker-month", { activeDate: activeDate, dateTimeFormat: this.dateTimeFormat, endDate: this.range ? endDate : undefined, hoverRange: this.hoverRange, localeData: this.localeData, max: maxDate, min: minDate, onCalciteInternalDatePickerActiveDateChange: this.monthActiveDateChange, onCalciteInternalDatePickerHover: this.monthHoverChange, onCalciteInternalDatePickerMouseOut: this.monthMouseOutChange, onCalciteInternalDatePickerSelect: this.monthDateChange, scale: this.scale, selectedDate: this.activeRange === "end" ? endDate : date, startDate: this.range ? date : undefined }),
657
+ ]);
658
+ }
659
+ getEndDate() {
660
+ return (Array.isArray(this.valueAsDate) && this.valueAsDate[1]) || undefined;
661
+ }
662
+ setEndDate(date) {
663
+ const startDate = this.getStartDate();
664
+ const newEndDate = date ? setEndOfDay(date) : date;
665
+ this.value = [dateToISO(startDate), dateToISO(date)];
666
+ this.valueAsDate = [startDate, date];
667
+ this.mostRecentRangeValue = newEndDate;
668
+ this.calciteDatePickerRangeChange.emit();
669
+ this.activeEndDate = date || null;
670
+ }
671
+ getStartDate() {
672
+ return Array.isArray(this.valueAsDate) && this.valueAsDate[0];
673
+ }
674
+ setStartDate(date) {
675
+ const endDate = this.getEndDate();
676
+ this.value = [dateToISO(date), dateToISO(endDate)];
677
+ this.valueAsDate = [date, endDate];
678
+ this.mostRecentRangeValue = date;
679
+ this.calciteDatePickerRangeChange.emit();
680
+ this.activeStartDate = date || null;
681
+ }
682
+ /**
683
+ * Get an active date using the value, or current date as default
684
+ *
685
+ * @param value
686
+ * @param min
687
+ * @param max
688
+ */
689
+ getActiveDate(value, min, max) {
690
+ return dateFromRange(this.activeDate, min, max) || value || dateFromRange(new Date(), min, max);
691
+ }
692
+ getActiveEndDate(value, min, max) {
693
+ return (dateFromRange(this.activeEndDate, min, max) || value || dateFromRange(new Date(), min, max));
694
+ }
695
+ static get delegatesFocus() { return true; }
696
+ static get assetsDirs() { return ["assets"]; }
697
+ get el() { return getElement(this); }
698
+ static get watchers() { return {
699
+ "activeDate": ["activeDateWatcher"],
700
+ "valueAsDate": ["valueAsDateWatcher"],
701
+ "min": ["onMinChanged"],
702
+ "max": ["onMaxChanged"],
703
+ "messageOverrides": ["onMessagesChange"],
704
+ "effectiveLocale": ["effectiveLocaleChange", "loadLocaleData"],
705
+ "value": ["valueHandler"]
706
+ }; }
707
+ };
708
+ DatePicker.style = datePickerCss;
709
+
34
710
  /*!
35
711
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
36
712
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -2278,4 +2954,4 @@ const InstantAppsSocialShare = class {
2278
2954
  };
2279
2955
  InstantAppsSocialShare.style = instantAppsSocialShareCss;
2280
2956
 
2281
- export { InputDatePicker as calcite_input_date_picker, InstantAppsFilterList as instant_apps_filter_list, InstantAppsSocialShare as instant_apps_social_share };
2957
+ export { Block as calcite_block, DatePicker as calcite_date_picker, InputDatePicker as calcite_input_date_picker, InstantAppsFilterList as instant_apps_filter_list, InstantAppsSocialShare as instant_apps_social_share };