@esri/solutions-components 0.8.23 → 0.8.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. package/dist/cjs/arcgis-login.cjs.entry.js +1 -1
  2. package/dist/cjs/basemap-gallery_7.cjs.entry.js +1 -1
  3. package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
  4. package/dist/cjs/{calcite-avatar.cjs.entry.js → calcite-avatar_2.cjs.entry.js} +62 -0
  5. package/dist/cjs/calcite-block_5.cjs.entry.js +12 -3
  6. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +419 -0
  7. package/dist/cjs/{calcite-dropdown_4.cjs.entry.js → calcite-dropdown_2.cjs.entry.js} +12 -435
  8. package/dist/cjs/calcite-flow_6.cjs.entry.js +44 -34
  9. package/dist/cjs/card-manager_3.cjs.entry.js +1 -1
  10. package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
  11. package/dist/cjs/crowdsource-reporter.cjs.entry.js +58 -38
  12. package/dist/cjs/feature-list.cjs.entry.js +5 -4
  13. package/dist/cjs/{helpers-9347ad83.js → helpers-618a3f7d.js} +2 -1
  14. package/dist/cjs/instant-apps-create.cjs.entry.js +266 -0
  15. package/dist/cjs/instant-apps-export.cjs.entry.js +31 -16
  16. package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
  17. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +11 -4
  18. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +1 -1
  19. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +1 -1
  20. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +2 -2
  21. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +1 -1
  22. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +45 -9
  23. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +1 -1
  24. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +1 -1
  25. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +168 -0
  26. package/dist/cjs/{languageSwitcher-395021d6.js → languageSwitcher-b9a1485c.js} +3 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  29. package/dist/cjs/resources-fa37e40f.js +26 -0
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/collection/collection-manifest.json +3 -1
  32. package/dist/collection/components/arcgis-login/arcgis-login.js +1 -1
  33. package/dist/collection/components/basemap-gallery/basemap-gallery.js +1 -1
  34. package/dist/collection/components/buffer-tools/buffer-tools.js +1 -1
  35. package/dist/collection/components/card-manager/card-manager.js +1 -1
  36. package/dist/collection/components/create-feature/create-feature.js +9 -2
  37. package/dist/collection/components/create-related-feature/create-related-feature.js +9 -2
  38. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  39. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +58 -47
  40. package/dist/collection/components/feature-details/feature-details.css +4 -4
  41. package/dist/collection/components/feature-details/feature-details.js +62 -18
  42. package/dist/collection/components/feature-list/feature-list.css +2 -0
  43. package/dist/collection/components/feature-list/feature-list.js +22 -3
  44. package/dist/collection/components/layer-list/layer-list.js +6 -13
  45. package/dist/collection/components/public-notification/public-notification.js +3 -3
  46. package/dist/collection/demos/crowdsource-reporter.html +22 -15
  47. package/dist/collection/utils/interfaces.ts +1 -0
  48. package/dist/components/arcgis-login.js +1 -1
  49. package/dist/components/basemap-gallery2.js +1 -1
  50. package/dist/components/buffer-tools2.js +1 -1
  51. package/dist/components/calcite-navigation-user.js +1 -99
  52. package/dist/components/card-manager2.js +1 -1
  53. package/dist/components/create-feature2.js +9 -2
  54. package/dist/components/create-related-feature2.js +9 -2
  55. package/dist/components/crowdsource-manager.js +1 -1
  56. package/dist/components/crowdsource-reporter.js +59 -39
  57. package/dist/components/feature-details2.js +22 -17
  58. package/dist/components/feature-list2.js +6 -4
  59. package/dist/components/helpers.js +3 -2
  60. package/dist/components/instant-apps-ckeditor-wrapper2.js +1 -1
  61. package/dist/components/instant-apps-create.js +317 -0
  62. package/dist/components/instant-apps-export.js +32 -16
  63. package/dist/components/instant-apps-filter-list2.js +6 -1
  64. package/dist/components/instant-apps-header2.js +3 -2
  65. package/dist/components/instant-apps-interactive-legend-classic2.js +12 -5
  66. package/dist/components/instant-apps-interactive-legend-legend-element-caption2.js +2 -2
  67. package/dist/components/instant-apps-landing-page.js +91 -16
  68. package/dist/components/instant-apps-language-translator2.js +3 -1
  69. package/dist/components/instant-apps-sign-in.js +11 -0
  70. package/dist/components/instant-apps-sign-in2.js +243 -0
  71. package/dist/components/instant-apps-social-share2.js +8 -2
  72. package/dist/components/layer-list2.js +6 -13
  73. package/dist/{esm/calcite-navigation-user.entry.js → components/navigation-user.js} +46 -9
  74. package/dist/components/public-notification.js +3 -3
  75. package/dist/esm/arcgis-login.entry.js +1 -1
  76. package/dist/esm/basemap-gallery_7.entry.js +1 -1
  77. package/dist/esm/buffer-tools_3.entry.js +1 -1
  78. package/dist/esm/{calcite-avatar.entry.js → calcite-avatar_2.entry.js} +64 -3
  79. package/dist/esm/calcite-block_5.entry.js +12 -3
  80. package/dist/esm/calcite-color-picker-hex-input_2.entry.js +1 -1
  81. package/dist/esm/calcite-color-picker.entry.js +1 -1
  82. package/dist/esm/calcite-dropdown-group_2.entry.js +414 -0
  83. package/dist/esm/{calcite-dropdown_4.entry.js → calcite-dropdown_2.entry.js} +2 -423
  84. package/dist/esm/calcite-flow_6.entry.js +44 -34
  85. package/dist/esm/card-manager_3.entry.js +1 -1
  86. package/dist/esm/crowdsource-manager.entry.js +1 -1
  87. package/dist/esm/crowdsource-reporter.entry.js +58 -38
  88. package/dist/esm/feature-list.entry.js +5 -4
  89. package/dist/esm/{helpers-a5a81b9d.js → helpers-61b05164.js} +3 -2
  90. package/dist/esm/instant-apps-create.entry.js +262 -0
  91. package/dist/esm/instant-apps-export.entry.js +31 -16
  92. package/dist/esm/instant-apps-header.entry.js +3 -2
  93. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +11 -4
  94. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +1 -1
  95. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +1 -1
  96. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +2 -2
  97. package/dist/esm/instant-apps-interactive-legend.entry.js +1 -1
  98. package/dist/esm/instant-apps-landing-page.entry.js +46 -10
  99. package/dist/esm/instant-apps-language-switcher.entry.js +1 -1
  100. package/dist/esm/instant-apps-language-translator.entry.js +1 -1
  101. package/dist/esm/instant-apps-sign-in.entry.js +164 -0
  102. package/dist/esm/{languageSwitcher-a4a615e4.js → languageSwitcher-d60f03b2.js} +3 -1
  103. package/dist/esm/loader.js +1 -1
  104. package/dist/esm/public-notification.entry.js +3 -3
  105. package/dist/esm/resources-16800cce.js +24 -0
  106. package/dist/esm/solutions-components.js +1 -1
  107. package/dist/esm/{utils-6419e941.js → utils-251cb6de.js} +1 -1
  108. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-create/instant-apps-create.css +150 -0
  109. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-header/instant-apps-header.css +16 -9
  110. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +19 -0
  111. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +98 -0
  112. package/dist/solutions-components/demos/crowdsource-reporter.html +22 -15
  113. package/dist/solutions-components/{p-88495699.entry.js → p-16730f05.entry.js} +1 -1
  114. package/dist/solutions-components/p-1ae3b886.entry.js +17 -0
  115. package/dist/solutions-components/{p-63460d51.entry.js → p-1ff9eb95.entry.js} +1 -1
  116. package/dist/solutions-components/{p-8f6e0ae5.entry.js → p-26eb1225.entry.js} +1 -1
  117. package/dist/solutions-components/{p-3a2e0188.entry.js → p-2c044250.entry.js} +2 -2
  118. package/dist/solutions-components/p-314dc933.entry.js +6 -0
  119. package/dist/solutions-components/p-50741707.entry.js +6 -0
  120. package/dist/solutions-components/p-5b817c98.entry.js +6 -0
  121. package/dist/solutions-components/p-614ebce7.js +6 -0
  122. package/dist/solutions-components/p-686fa7ce.entry.js +6 -0
  123. package/dist/solutions-components/{p-df73649e.entry.js → p-77cd573b.entry.js} +1 -1
  124. package/dist/solutions-components/{p-c95dcdf7.entry.js → p-7883b885.entry.js} +3 -3
  125. package/dist/solutions-components/p-79e2e203.entry.js +6 -0
  126. package/dist/solutions-components/{p-968a6fd8.entry.js → p-7b17e929.entry.js} +1 -1
  127. package/dist/solutions-components/p-80b3eb6b.entry.js +6 -0
  128. package/dist/solutions-components/p-84913712.js +6 -0
  129. package/dist/solutions-components/p-8c500fd7.entry.js +6 -0
  130. package/dist/solutions-components/{p-fe9d6d06.js → p-9f56c02c.js} +1 -1
  131. package/dist/solutions-components/{p-667c022f.entry.js → p-af4be4ce.entry.js} +1 -1
  132. package/dist/solutions-components/p-bb2e669d.entry.js +6 -0
  133. package/dist/solutions-components/p-c2ec0dcc.entry.js +17 -0
  134. package/dist/solutions-components/p-c41997d5.js +11 -0
  135. package/dist/solutions-components/p-c512fcfb.entry.js +6 -0
  136. package/dist/solutions-components/{p-21d6360a.entry.js → p-c7f0e7a8.entry.js} +1 -1
  137. package/dist/solutions-components/{p-9c7d4343.entry.js → p-cd91c3e7.entry.js} +1 -1
  138. package/dist/solutions-components/p-ceba37d3.entry.js +11 -0
  139. package/dist/solutions-components/{p-09b769b7.entry.js → p-d8a15e32.entry.js} +1 -1
  140. package/dist/solutions-components/p-d8da6406.entry.js +6 -0
  141. package/dist/solutions-components/p-da6b3c8a.entry.js +6 -0
  142. package/dist/solutions-components/{p-60f1055e.entry.js → p-e2400b0d.entry.js} +1 -1
  143. package/dist/solutions-components/p-f35cc7ae.entry.js +6 -0
  144. package/dist/solutions-components/solutions-components.esm.js +1 -1
  145. package/dist/solutions-components/utils/interfaces.ts +1 -0
  146. package/dist/types/components/create-feature/create-feature.d.ts +4 -0
  147. package/dist/types/components/create-related-feature/create-related-feature.d.ts +4 -0
  148. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +18 -7
  149. package/dist/types/components/feature-details/feature-details.d.ts +17 -1
  150. package/dist/types/components/feature-list/feature-list.d.ts +4 -0
  151. package/dist/types/components/layer-list/layer-list.d.ts +1 -1
  152. package/dist/types/components.d.ts +25 -2
  153. package/dist/types/preact.d.ts +7 -2
  154. package/dist/types/utils/interfaces.d.ts +1 -0
  155. package/package.json +2 -2
  156. package/dist/cjs/calcite-navigation-user.cjs.entry.js +0 -73
  157. package/dist/solutions-components/p-08a1e120.js +0 -6
  158. package/dist/solutions-components/p-3283660c.entry.js +0 -6
  159. package/dist/solutions-components/p-33647277.entry.js +0 -6
  160. package/dist/solutions-components/p-3af0764f.entry.js +0 -6
  161. package/dist/solutions-components/p-41d288c0.entry.js +0 -6
  162. package/dist/solutions-components/p-599dcc29.js +0 -6
  163. package/dist/solutions-components/p-64b4b579.entry.js +0 -11
  164. package/dist/solutions-components/p-64da5bb8.entry.js +0 -17
  165. package/dist/solutions-components/p-ab96dd27.entry.js +0 -6
  166. package/dist/solutions-components/p-bb0c7be3.entry.js +0 -17
  167. package/dist/solutions-components/p-bb8e3add.entry.js +0 -11
  168. package/dist/solutions-components/p-c36bb8ca.entry.js +0 -6
  169. package/dist/solutions-components/p-cbe166fc.entry.js +0 -6
  170. package/dist/solutions-components/p-eab95aa4.entry.js +0 -6
  171. package/dist/solutions-components/p-f6a1673c.entry.js +0 -6
@@ -13,15 +13,10 @@ import { c as componentFocusable, s as setUpLoadableComponent, a as setComponent
13
13
  import { c as createObserver } from './observers-19e5cb73.js';
14
14
  import { o as onToggleOpenCloseComponent } from './openCloseComponent-04234cea.js';
15
15
  import { g as getIconScale } from './component-960ddabf.js';
16
- import { g as getLocaleComponentStrings } from './locale-a490c4f6.js';
17
- import { d as getMapLayerHash, p as getMapTableHash } from './mapViewUtils-4618ddb8.js';
18
- import { s as state } from './publicNotificationStore-74c7e9f4.js';
16
+ import { C as CSS } from './resources-16800cce.js';
19
17
  import './resources-1febf4c6.js';
20
18
  import './debounce-6e9ade8c.js';
21
19
  import './browser-9897260d.js';
22
- import './esri-loader-2bf735ed.js';
23
- import './interfaces-586e863c.js';
24
- import './index-c06194fa.js';
25
20
 
26
21
  /*!
27
22
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
@@ -427,96 +422,6 @@ const Dropdown = class {
427
422
  };
428
423
  Dropdown.style = CalciteDropdownStyle0;
429
424
 
430
- /*!
431
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
432
- * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
433
- * v2.8.2
434
- */
435
- const CSS = {
436
- container: "container",
437
- containerLink: "container--link",
438
- containerMulti: "container--multi-selection",
439
- containerSingle: "container--single-selection",
440
- containerNone: "container--none-selection",
441
- icon: "dropdown-item-icon",
442
- iconEnd: "dropdown-item-icon-end",
443
- iconStart: "dropdown-item-icon-start",
444
- itemContent: "dropdown-item-content",
445
- link: "dropdown-link",
446
- };
447
-
448
- const dropdownGroupCss = ":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";
449
- const CalciteDropdownGroupStyle0 = dropdownGroupCss;
450
-
451
- const DropdownGroup = class {
452
- constructor(hostRef) {
453
- registerInstance(this, hostRef);
454
- this.calciteInternalDropdownItemChange = createEvent(this, "calciteInternalDropdownItemChange", 6);
455
- this.updateItems = () => {
456
- Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((item) => (item.selectionMode = this.selectionMode));
457
- };
458
- this.mutationObserver = createObserver("mutation", () => this.updateItems());
459
- this.groupTitle = undefined;
460
- this.scale = "m";
461
- this.selectionMode = "single";
462
- }
463
- handlePropsChange() {
464
- this.updateItems();
465
- }
466
- //--------------------------------------------------------------------------
467
- //
468
- // Lifecycle
469
- //
470
- //--------------------------------------------------------------------------
471
- connectedCallback() {
472
- var _a;
473
- this.updateItems();
474
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true });
475
- }
476
- componentWillLoad() {
477
- this.groupPosition = this.getGroupPosition();
478
- }
479
- disconnectedCallback() {
480
- var _a;
481
- (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
482
- }
483
- render() {
484
- const groupTitle = this.groupTitle ? (h("span", { "aria-hidden": "true", class: "dropdown-title" }, this.groupTitle)) : null;
485
- const dropdownSeparator = this.groupPosition > 0 ? h("div", { class: "dropdown-separator", role: "separator" }) : null;
486
- return (h(Host, { key: 'c1b662afcbb612d775cea66edb949d71f5f63167', "aria-label": this.groupTitle, role: "group" }, h("div", { key: 'cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e', class: {
487
- [CSS.container]: true,
488
- [`${CSS.container}--${this.scale}`]: true,
489
- } }, dropdownSeparator, groupTitle, h("slot", { key: '166c8236f3315d2f038f61b0619270d2bd9b344a' }))));
490
- }
491
- //--------------------------------------------------------------------------
492
- //
493
- // Event Listeners
494
- //
495
- //--------------------------------------------------------------------------
496
- updateActiveItemOnChange(event) {
497
- this.requestedDropdownGroup = event.detail.requestedDropdownGroup;
498
- this.requestedDropdownItem = event.detail.requestedDropdownItem;
499
- this.calciteInternalDropdownItemChange.emit({
500
- requestedDropdownGroup: this.requestedDropdownGroup,
501
- requestedDropdownItem: this.requestedDropdownItem,
502
- });
503
- }
504
- //--------------------------------------------------------------------------
505
- //
506
- // Private Methods
507
- //
508
- //--------------------------------------------------------------------------
509
- getGroupPosition() {
510
- return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"), this.el);
511
- }
512
- static get delegatesFocus() { return true; }
513
- get el() { return getElement(this); }
514
- static get watchers() { return {
515
- "selectionMode": ["handlePropsChange"]
516
- }; }
517
- };
518
- DropdownGroup.style = CalciteDropdownGroupStyle0;
519
-
520
425
  const dropdownItemCss = ":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}.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, 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 )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover:not([disabled])) .container,:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-2);color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover:not([disabled])) .container--link .dropdown-link,:host(:active:not([disabled])) .container--link .dropdown-link{color:var(--calcite-color-text-1)}:host(:active:not([disabled])) .container{background-color:var(--calcite-color-foreground-3)}:host(:focus) .container{color:var(--calcite-color-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-color-brand)}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover:not([disabled])) .dropdown-item-icon{color:var(--calcite-color-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-color-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}";
521
426
  const CalciteDropdownItemStyle0 = dropdownItemCss;
522
427
 
@@ -686,330 +591,4 @@ const DropdownItem = class {
686
591
  };
687
592
  DropdownItem.style = CalciteDropdownItemStyle0;
688
593
 
689
- const mapLayerPickerCss = ":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";
690
- const MapLayerPickerStyle0 = mapLayerPickerCss;
691
-
692
- const MapLayerPicker = class {
693
- constructor(hostRef) {
694
- registerInstance(this, hostRef);
695
- this.idsFound = createEvent(this, "idsFound", 7);
696
- this.noLayersFound = createEvent(this, "noLayersFound", 7);
697
- this.layerSelectionChange = createEvent(this, "layerSelectionChange", 7);
698
- //--------------------------------------------------------------------------
699
- //
700
- // Properties (protected)
701
- //
702
- //--------------------------------------------------------------------------
703
- /**
704
- * boolean: When true the default layer has been loaded once and should no longer be used
705
- */
706
- this.defaultLayerHonored = false;
707
- this.appearance = "transparent";
708
- this.defaultLayerId = "";
709
- this.display = "inline-block";
710
- this.enabledLayerIds = [];
711
- this.enabledTableIds = [];
712
- this.height = undefined;
713
- this.isMobile = undefined;
714
- this.mapView = undefined;
715
- this.onlyShowUpdatableLayers = undefined;
716
- this.placeholderIcon = "";
717
- this.selectedIds = [];
718
- this.scale = "m";
719
- this.showTables = undefined;
720
- this.showSingleLayerAsLabel = false;
721
- this.type = "select";
722
- this._hasMultipleLayers = true;
723
- this._hasValidLayers = true;
724
- this._isDropdownOpen = undefined;
725
- this.ids = [];
726
- this.selectedName = "";
727
- this._translations = undefined;
728
- }
729
- //--------------------------------------------------------------------------
730
- //
731
- // Watch handlers
732
- //
733
- //--------------------------------------------------------------------------
734
- /**
735
- * Called each time the mapView prop is changed.
736
- */
737
- async mapViewWatchHandler() {
738
- await this._setLayers();
739
- if (this.ids.length > 0) {
740
- this._hasValidLayers = true;
741
- this._hasMultipleLayers = this.ids.length > 1;
742
- this._setSelectedLayer(this.ids[0]);
743
- }
744
- else {
745
- this._hasValidLayers = false;
746
- this.noLayersFound.emit();
747
- }
748
- }
749
- //--------------------------------------------------------------------------
750
- //
751
- // Functions (lifecycle)
752
- //
753
- //--------------------------------------------------------------------------
754
- /**
755
- * StencilJS: Called once just after the component is first connected to the DOM.
756
- */
757
- async componentWillLoad() {
758
- await this._getTranslations();
759
- await this._setLayers();
760
- if (this.ids.length > 0 || this.selectedIds.length === 1) {
761
- this.layerSelectionChange.emit(this.selectedIds.length === 1 ? [this.selectedIds[0]] : [this.ids[0]]);
762
- }
763
- }
764
- /**
765
- * Renders the component.
766
- */
767
- render() {
768
- const id = "map-layer-picker";
769
- let style = this.height > 0 ? { "height": `${this.height.toString()}px` } : {};
770
- style = Object.assign(Object.assign({}, style), { "display": this.display });
771
- return (h(Host, { key: 'ccb8c7d12a2e631938308380cd4ecd0a1d73c963' }, h("div", { key: 'aa0992de9bab1c5a555d51542c093cc7cb948200', class: "map-layer-picker-container", style: style }, h("div", { key: 'a03bca67eb822b492d34abe53db7d05e6fd7ebdf', class: "map-layer-picker", style: style }, !this._hasValidLayers ? this._getInvalidPlaceholder() :
772
- !this._hasMultipleLayers && this.showSingleLayerAsLabel ? this._getSingleLayerPlaceholder() :
773
- this.type === "combobox" ? this._getCombobox(id) :
774
- this.type === "select" ? this._getSelect(id) : this._getDropdown(id)))));
775
- }
776
- /**
777
- * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
778
- */
779
- async componentDidLoad() {
780
- if (this.ids.length > 0 || this.selectedIds.length === 1) {
781
- const id = this.selectedIds.length === 1 ? this.selectedIds[0] : this.ids[0];
782
- if (this.type === "select") {
783
- this._layerElement.value = id;
784
- }
785
- else if (this.type === "dropdown") {
786
- this.selectedName = Object.keys(this._layerNameHash).indexOf(id) > -1 ?
787
- this._layerNameHash[id].name : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
788
- this._tableNameHash[id].name : "";
789
- }
790
- }
791
- }
792
- //--------------------------------------------------------------------------
793
- //
794
- // Functions (protected)
795
- //
796
- //--------------------------------------------------------------------------
797
- /**
798
- * Create a notice to inform the user that no layers were found
799
- *
800
- * @returns Calcite Notice component with the message
801
- */
802
- _getInvalidPlaceholder() {
803
- return (h("div", null, h("calcite-notice", { class: "height-100", icon: "exclamation-mark-triangle", id: "no-valid-layers", kind: "danger", open: true }, h("div", { slot: "message" }, this._translations.noLayersFound)), h("calcite-tooltip", { label: this._translations.enableEditUpdate, placement: "bottom", "reference-element": "no-valid-layers" }, h("span", null, this._translations.enableEditUpdate))));
804
- }
805
- /**
806
- * Show layer name as a label with icon
807
- *
808
- * @returns Calcite label with the layer name and icon
809
- */
810
- _getSingleLayerPlaceholder() {
811
- return (h("div", { class: "layer-picker-label-container cursor-default" }, h("calcite-icon", { icon: "layers", scale: "s" }), h("calcite-label", { class: "no-bottom-margin padding-start-1" }, this.selectedName)));
812
- }
813
- /**
814
- * Create a list of layers from the map
815
- * Used for selecting a single layer.
816
- *
817
- * @param id the id for the select component used to support the tooltip
818
- *
819
- * @returns Calcite Select component with the ids of the layers from the map
820
- */
821
- _getSelect(id) {
822
- return (h("calcite-select", { id: id, label: "", onCalciteSelectChange: () => this._layerSelectionChange(), ref: (el) => { this._layerElement = el; }, scale: this.scale }, this._getMapLayerOptions()));
823
- }
824
- /**
825
- * Create a list of layer ids from the map
826
- * Used for selecting multiple layers
827
- *
828
- * @param id the id for the combobox component used to support the tooltip
829
- *
830
- * @returns Calcite ComboBox component with the ids of the layers from the map
831
- */
832
- _getCombobox(id) {
833
- return (h("calcite-combobox", { clearDisabled: true, id: id, label: "", onCalciteComboboxChange: () => this._layerSelectionChange(), "placeholder-icon": this.placeholderIcon, ref: (el) => { this._layerElement = el; }, scale: this.scale, "selection-mode": "single" }, this._getMapLayerOptions()));
834
- }
835
- /**
836
- * Hydrate a dropdown component with items to display the layer names
837
- *
838
- * @param id the id for the dropdown component used to support the tooltip
839
- *
840
- * @returns Array of Dropdown items with layer names
841
- */
842
- _getDropdown(id) {
843
- return (h("calcite-dropdown", { class: "layer-picker-dropdown", onCalciteDropdownBeforeClose: () => this._isDropdownOpen = false, onCalciteDropdownBeforeOpen: () => this._isDropdownOpen = true }, this.isMobile ? this._getDropdownButton() : this._getActionDropdownButton(id), h("calcite-dropdown-group", { "selection-mode": "single" }, this._getMapLayerOptions())));
844
- }
845
- /**
846
- * Get the button that will open the dropdown list wrapped in an action
847
- *
848
- * @returns the node for the action and button
849
- */
850
- _getActionDropdownButton(id) {
851
- return (h("calcite-action", { id: id, slot: "trigger", text: "" }, this._getDropdownButton()));
852
- }
853
- /**
854
- * Get the button that will open the dropdown list
855
- *
856
- * @returns the node for the button
857
- */
858
- _getDropdownButton() {
859
- const buttonClass = this.isMobile ? "" : "max-width-350";
860
- const buttonSlot = this.isMobile ? "trigger" : "";
861
- const buttonIcon = this._isDropdownOpen ? "chevron-up" : "chevron-down";
862
- return (h("calcite-button", { alignment: "icon-end-space-between", appearance: this.appearance, class: buttonClass, iconEnd: buttonIcon, iconStart: "layers", kind: "neutral", slot: buttonSlot, width: "full" }, h("div", null, this.selectedName)));
863
- }
864
- /**
865
- * Get the appropriate type of dom nodes for each valid layer or table
866
- *
867
- * @returns Array of dom nodes with the names of the layers and optionally of the tables
868
- */
869
- _getMapLayerOptions() {
870
- return this.ids.reduce((prev, cur) => {
871
- if (this._validLayer(cur)) {
872
- prev.push(this._getItem(cur, "layer"));
873
- }
874
- else if (this._validTable(cur)) {
875
- prev.push(this._getItem(cur, "table"));
876
- }
877
- return prev;
878
- }, []);
879
- }
880
- /**
881
- * Get the appropriate type of dom node for the current layer or table id
882
- *
883
- * @returns A dom node with the name of the layer or table
884
- */
885
- _getItem(id, itemType) {
886
- const item = itemType === "layer" ? this._layerNameHash[id] : this._tableNameHash[id];
887
- const disabled = this.onlyShowUpdatableLayers ? !item.supportsUpdate : false;
888
- const name = item.name;
889
- const selected = this.selectedIds.indexOf(id) > -1;
890
- return this.type === "combobox" ? (h("calcite-combobox-item", { disabled: disabled, selected: selected, textLabel: name, value: id })) :
891
- this.type === "select" ? (h("calcite-option", { disabled: disabled, label: name, selected: selected, value: id })) : (h("calcite-dropdown-group", { class: disabled ? "disabled" : "", selectionMode: disabled ? "none" : "single" }, h("calcite-dropdown-item", { onClick: disabled ? undefined : () => void this._setSelectedLayer(id), selected: selected }, name)));
892
- }
893
- /**
894
- * Store the layer name based on the user selection
895
- */
896
- _setSelectedLayer(id) {
897
- let item;
898
- const hasDefaultLayer = this.defaultLayerId && !this.defaultLayerHonored;
899
- if (hasDefaultLayer) {
900
- item = this._getLayerFromHash(this.defaultLayerId);
901
- this.defaultLayerHonored = item !== undefined;
902
- id = this.defaultLayerHonored ? this.defaultLayerId : id;
903
- }
904
- item = item ? item : this._getLayerFromHash(id);
905
- this.selectedName = item === null || item === void 0 ? void 0 : item.name;
906
- this.selectedIds = [id];
907
- this.layerSelectionChange.emit(this.selectedIds);
908
- }
909
- /**
910
- * Fetch layer hash info for the given id
911
- *
912
- * @returns ILayerHashInfo for the id
913
- */
914
- _getLayerFromHash(id) {
915
- return Object.keys(this._layerNameHash).indexOf(id) > -1 ?
916
- this._layerNameHash[id] : Object.keys(this._tableNameHash).indexOf(id) > -1 ?
917
- this._tableNameHash[id] : undefined;
918
- }
919
- /**
920
- * Fetch the ids of the layers from the map
921
- *
922
- * @returns Promise when the operation has completed
923
- */
924
- async _setLayers() {
925
- if (this.mapView) {
926
- await this._initLayerTableHash();
927
- const layerIds = this.onlyShowUpdatableLayers ?
928
- this._getEditableIds(this._layerNameHash) : Object.keys(this._layerNameHash);
929
- const tableIds = this.showTables ? this.onlyShowUpdatableLayers ?
930
- this._getEditableIds(this._tableNameHash) : Object.keys(this._tableNameHash) : [];
931
- this.ids = [
932
- ...layerIds.reverse().filter(n => { var _a; return ((_a = this.enabledLayerIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledLayerIds.reverse().indexOf(n) > -1 : true; }),
933
- ...tableIds.reverse().filter(n => { var _a; return ((_a = this.enabledTableIds) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.enabledTableIds.reverse().indexOf(n) > -1 : true; }),
934
- ];
935
- this.idsFound.emit({
936
- layerIds,
937
- tableIds
938
- });
939
- }
940
- }
941
- /**
942
- * Fetch the ids of all layers that support edits with the update capability
943
- *
944
- * @returns array of layer ids
945
- */
946
- _getEditableIds(hash) {
947
- return Object.keys(hash).reduce((prev, cur) => {
948
- if (hash[cur].supportsUpdate) {
949
- prev.push(cur);
950
- }
951
- return prev;
952
- }, []);
953
- }
954
- /**
955
- * Create a layer id:title hash for layer name display
956
- *
957
- * @returns Promise when the operation has completed
958
- */
959
- async _initLayerTableHash() {
960
- this._layerNameHash = await getMapLayerHash(this.mapView, this.onlyShowUpdatableLayers);
961
- this._tableNameHash = this.showTables ? await getMapTableHash(this.mapView, this.onlyShowUpdatableLayers) : {};
962
- }
963
- /**
964
- * Evaluate if the id exists in the current hash and verify if it should be excluded
965
- *
966
- * @returns boolean when true the layer will be used in the current layer picker type
967
- */
968
- _validLayer(id) {
969
- var _a;
970
- const name = (_a = this._layerNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
971
- return name && Object.keys(state.managedLayers).indexOf(name) < 0 && (this.enabledLayerIds.length > 0 ?
972
- this.enabledLayerIds.indexOf(id) > -1 : true);
973
- }
974
- /**
975
- * Evaluate if the id exists in the current hash and verify if it should be excluded
976
- *
977
- * @returns boolean when true the table will be used in the current layer picker type
978
- */
979
- _validTable(id) {
980
- var _a;
981
- const name = (_a = this._tableNameHash[id]) === null || _a === void 0 ? void 0 : _a.name;
982
- const validName = name && this.showTables;
983
- return validName ? state.managedTables.indexOf(name) < 0 &&
984
- (this.enabledTableIds.length > 0 ? this.enabledTableIds.indexOf(id) > -1 : true) : validName;
985
- }
986
- /**
987
- * Fetch the ids of the layers from the map
988
- *
989
- * @returns Promise when the operation has completed
990
- */
991
- _layerSelectionChange() {
992
- const ids = Array.isArray(this._layerElement.value) ? this._layerElement.value : [this._layerElement.value];
993
- if (JSON.stringify(ids) !== JSON.stringify([""])) {
994
- this.selectedIds = ids;
995
- this.layerSelectionChange.emit(this.selectedIds);
996
- }
997
- }
998
- /**
999
- * Fetches the component's translations
1000
- *
1001
- * @returns Promise when complete
1002
- * @protected
1003
- */
1004
- async _getTranslations() {
1005
- const messages = await getLocaleComponentStrings(this.el);
1006
- this._translations = messages[0];
1007
- }
1008
- get el() { return getElement(this); }
1009
- static get watchers() { return {
1010
- "mapView": ["mapViewWatchHandler"]
1011
- }; }
1012
- };
1013
- MapLayerPicker.style = MapLayerPickerStyle0;
1014
-
1015
- export { Dropdown as calcite_dropdown, DropdownGroup as calcite_dropdown_group, DropdownItem as calcite_dropdown_item, MapLayerPicker as map_layer_picker };
594
+ export { Dropdown as calcite_dropdown, DropdownItem as calcite_dropdown_item };