@esri/solutions-components 0.3.9 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/assets/t9n/public-notification/resources.json +0 -2
  2. package/dist/assets/t9n/public-notification/resources_en.json +0 -2
  3. package/dist/cjs/buffer-tools_6.cjs.entry.js +5 -2
  4. package/dist/cjs/calcite-input-message_5.cjs.entry.js +1342 -18
  5. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-cd8ad61e.js → downloadUtils-27dbd8b9.js} +205 -1337
  6. package/dist/cjs/{index.es-e89ba2a1.js → index.es-40d341ed.js} +3 -13
  7. package/dist/cjs/layer-table.cjs.entry.js +5 -15
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/public-notification.cjs.entry.js +23 -2
  10. package/dist/cjs/solutions-components.cjs.js +1 -1
  11. package/dist/collection/components/layer-table/layer-table.js +4 -16
  12. package/dist/collection/components/map-search/map-search.js +1 -1
  13. package/dist/collection/components/map-select-tools/map-select-tools.js +73 -17
  14. package/dist/collection/components/pdf-download/pdf-download.js +9 -76
  15. package/dist/collection/components/public-notification/public-notification.js +45 -3
  16. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  17. package/dist/collection/components/refine-selection-tools/refine-selection-tools.js +13 -5
  18. package/dist/collection/demos/buffer-tools.html +1 -1
  19. package/dist/collection/utils/csvUtils.js +4 -0
  20. package/dist/collection/utils/csvUtils.ts +7 -0
  21. package/dist/collection/utils/downloadUtils.js +181 -0
  22. package/dist/collection/utils/downloadUtils.ts +235 -0
  23. package/dist/collection/utils/interfaces.ts +8 -1
  24. package/dist/collection/utils/pdfUtils.js +7 -0
  25. package/dist/collection/utils/pdfUtils.ts +13 -2
  26. package/dist/components/downloadUtils.js +2279 -0
  27. package/dist/components/index.es.js +1 -1
  28. package/dist/components/layer-table.js +5 -16
  29. package/dist/components/map-layer-picker2.js +1 -1
  30. package/dist/components/map-search.js +1 -1
  31. package/dist/components/map-select-tools2.js +69 -19
  32. package/dist/components/pdf-download2.js +10 -2124
  33. package/dist/components/public-notification.js +24 -3
  34. package/dist/components/queryUtils.js +1 -1
  35. package/dist/components/refine-selection-tools2.js +6 -3
  36. package/dist/components/refine-selection2.js +1 -1
  37. package/dist/esm/buffer-tools_6.entry.js +6 -3
  38. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  39. package/dist/esm/calcite-input-message_5.entry.js +1341 -13
  40. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-ddd74bd6.js → downloadUtils-76e38a94.js} +206 -1335
  41. package/dist/esm/{index.es-8edafdb2.js → index.es-489f4f08.js} +2 -12
  42. package/dist/esm/layer-table.entry.js +6 -16
  43. package/dist/esm/loader.js +1 -1
  44. package/dist/esm/{mapViewUtils-63e118f8.js → mapViewUtils-02696ab6.js} +1 -1
  45. package/dist/esm/public-notification.entry.js +24 -3
  46. package/dist/esm/solutions-components.js +1 -1
  47. package/dist/solutions-components/demos/buffer-tools.html +1 -1
  48. package/dist/solutions-components/{p-cc2e20c8.js → p-1bfd07e3.js} +1 -1
  49. package/dist/solutions-components/{p-117174e8.entry.js → p-335fce8c.entry.js} +1 -1
  50. package/dist/solutions-components/p-4ef94c6b.entry.js +6 -0
  51. package/dist/solutions-components/p-5d27b47d.entry.js +17 -0
  52. package/dist/solutions-components/p-92cb569a.entry.js +6 -0
  53. package/dist/solutions-components/{p-2a96314a.entry.js → p-a3b60bc9.entry.js} +2 -2
  54. package/dist/solutions-components/{p-98884f44.js → p-bff8aa4e.js} +3 -3
  55. package/dist/solutions-components/p-caa7e7a7.js +437 -0
  56. package/dist/solutions-components/solutions-components.esm.js +1 -1
  57. package/dist/solutions-components/utils/csvUtils.ts +7 -0
  58. package/dist/solutions-components/utils/downloadUtils.ts +235 -0
  59. package/dist/solutions-components/utils/interfaces.ts +8 -1
  60. package/dist/solutions-components/utils/pdfUtils.ts +13 -2
  61. package/dist/types/components/json-editor/assets/monaco-editor/monaco.d.ts +8262 -0
  62. package/dist/types/components/map-select-tools/map-select-tools.d.ts +19 -1
  63. package/dist/types/components/pdf-download/pdf-download.d.ts +0 -18
  64. package/dist/types/components/public-notification/public-notification.d.ts +10 -0
  65. package/dist/types/components/refine-selection-tools/refine-selection-tools.d.ts +2 -2
  66. package/dist/types/components.d.ts +6 -2
  67. package/dist/types/preact.d.ts +2 -1
  68. package/dist/types/utils/downloadUtils.d.ts +40 -0
  69. package/dist/types/utils/interfaces.d.ts +6 -2
  70. package/dist/types/utils/pdfUtils.d.ts +3 -1
  71. package/package.json +1 -1
  72. package/dist/cjs/csvUtils-3a56c6d8.js +0 -54
  73. package/dist/components/csvUtils.js +0 -52
  74. package/dist/esm/csvUtils-23b5418f.js +0 -52
  75. package/dist/solutions-components/p-15f9b0a0.entry.js +0 -6
  76. package/dist/solutions-components/p-238db156.js +0 -416
  77. package/dist/solutions-components/p-3069e3b7.js +0 -21
  78. package/dist/solutions-components/p-6d28f991.entry.js +0 -6
  79. package/dist/solutions-components/p-c5341977.entry.js +0 -6
@@ -3,914 +3,60 @@
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, h as h$1, H as Host, g as getElement, c as createEvent, a as getAssetPath } from './index-c246d90e.js';
7
- import { s as setRequestedIcon, g as getElementProp, a as getSlotted } from './dom-3bdc69ee.js';
8
- import { S as StatusIcons } from './interfaces-4ae145eb.js';
9
- import { c as connectConditionalSlotComponent, d as disconnectConditionalSlotComponent } from './conditionalSlot-d09506c4.js';
10
- import { l as loadModules } from './loadModules-649aedac.js';
11
- import { g as goToSelection, h as highlightFeatures, d as queryObjectIds, e as getQueryGeoms, q as queryFeaturesByID } from './mapViewUtils-63e118f8.js';
12
- import { E as EWorkflowType, f as ESelectionMode, g as ERefineMode, c as ESketchType } from './interfaces-d0d83efa.js';
13
- import { s as state } from './publicNotificationStore-b9daaee4.js';
14
- import { g as getLocaleComponentStrings } from './locale-4a87aff1.js';
15
- import { e as exportCSV } from './csvUtils-23b5418f.js';
16
6
  import { c as createCommonjsModule, g as getDefaultExportFromCjs } from './_commonjsHelpers-d5f9d613.js';
17
- import { a as getSelectionIds, g as getTotal } from './publicNotificationUtils-5cb5a607.js';
18
-
19
- /*!
20
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
21
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
22
- * v1.0.0-beta.97
23
- */
24
- var StatusIconDefaults;
25
- (function (StatusIconDefaults) {
26
- StatusIconDefaults["valid"] = "check-circle";
27
- StatusIconDefaults["invalid"] = "exclamation-mark-triangle";
28
- StatusIconDefaults["idle"] = "information";
29
- })(StatusIconDefaults || (StatusIconDefaults = {}));
30
-
31
- const inputMessageCss = "@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([active][scale=m]),:host([active][scale=l]){--calcite-input-message-spacing-value:0.25rem}:host{visibility:hidden;box-sizing:border-box;display:flex;block-size:0px;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active]){visibility:visible;block-size:auto;opacity:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([active][scale=m]),:host([active][scale=l]){-webkit-margin-before:var(--calcite-input-message-spacing-value);margin-block-start:var(--calcite-input-message-spacing-value)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-ui-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-ui-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-ui-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-ui-brand)}:host([status][active]){color:var(--calcite-ui-text-1)}:host([status][scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([status][scale=m]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([status][scale=l]){-webkit-margin-before:0.25rem;margin-block-start:0.25rem;font-size:var(--calcite-font-size--1);line-height:1rem}";
32
-
33
- const InputMessage = class {
34
- constructor(hostRef) {
35
- registerInstance(this, hostRef);
36
- //--------------------------------------------------------------------------
37
- //
38
- // Properties
39
- //
40
- //--------------------------------------------------------------------------
41
- /** When `true`, the component is active. */
42
- this.active = false;
43
- /** Specifies the size of the component. */
44
- this.scale = "m";
45
- /** Specifies the status of the input field, which determines message and icons. */
46
- this.status = "idle";
47
- }
48
- handleIconEl() {
49
- this.requestedIcon = setRequestedIcon(StatusIconDefaults, this.icon, this.status);
50
- }
51
- //--------------------------------------------------------------------------
52
- //
53
- // Lifecycle
54
- //
55
- //--------------------------------------------------------------------------
56
- connectedCallback() {
57
- this.status = getElementProp(this.el, "status", this.status);
58
- this.scale = getElementProp(this.el, "scale", this.scale);
59
- this.requestedIcon = setRequestedIcon(StatusIconDefaults, this.icon, this.status);
60
- }
61
- render() {
62
- const hidden = !this.active;
63
- return (h$1(Host, { "calcite-hydrated-hidden": hidden }, this.renderIcon(this.requestedIcon), h$1("slot", null)));
64
- }
65
- //--------------------------------------------------------------------------
66
- //
67
- // Private Methods
68
- //
69
- //--------------------------------------------------------------------------
70
- renderIcon(iconName) {
71
- if (iconName) {
72
- return h$1("calcite-icon", { class: "calcite-input-message-icon", icon: iconName, scale: "s" });
73
- }
74
- }
75
- get el() { return getElement(this); }
76
- static get watchers() { return {
77
- "status": ["handleIconEl"],
78
- "icon": ["handleIconEl"]
79
- }; }
80
- };
81
- InputMessage.style = inputMessageCss;
82
-
83
- /*!
84
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
85
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
86
- * v1.0.0-beta.97
87
- */
88
- const TEXT = {
89
- close: "Close"
90
- };
91
- const SLOTS = {
92
- title: "title",
93
- message: "message",
94
- link: "link",
95
- actionsEnd: "actions-end"
96
- };
97
- const CSS = {
98
- actionsEnd: "actions-end",
99
- close: "notice-close",
100
- container: "container",
101
- content: "notice-content",
102
- icon: "notice-icon"
103
- };
104
-
105
- const noticeCss = "@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([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;-webkit-border-start:0px solid;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);-webkit-margin-end:var(--calcite-notice-spacing-token-small);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){-webkit-padding-start:var(--calcite-notice-spacing-token-large);padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([color=blue]) .container{border-color:var(--calcite-ui-brand)}:host([color=blue]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([color=red]) .container{border-color:var(--calcite-ui-danger)}:host([color=red]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([color=yellow]) .container{border-color:var(--calcite-ui-warning)}:host([color=yellow]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([color=green]) .container{border-color:var(--calcite-ui-success)}:host([color=green]) .container .notice-icon{color:var(--calcite-ui-success)}";
106
-
107
- const Notice = class {
108
- constructor(hostRef) {
109
- registerInstance(this, hostRef);
110
- this.calciteNoticeClose = createEvent(this, "calciteNoticeClose", 6);
111
- this.calciteNoticeOpen = createEvent(this, "calciteNoticeOpen", 6);
112
- //--------------------------------------------------------------------------
113
- //
114
- // Properties
115
- //
116
- //---------------------------------------------------------------------------
117
- /**
118
- * When `true`, the component is active.
119
- *
120
- * @deprecated Use `open` instead.
121
- */
122
- this.active = false;
123
- /** When `true`, the component is visible. */
124
- this.open = false;
125
- /** The color for the component's top border and icon. */
126
- this.color = "blue";
127
- /**
128
- * When `true`, a close button is added to the component.
129
- *
130
- * @deprecated use `closable` instead.
131
- */
132
- this.dismissible = false;
133
- /** When `true`, a close button is added to the component. */
134
- this.closable = false;
135
- /**
136
- * Accessible name for the close button.
137
- *
138
- * @default "Close"
139
- */
140
- this.intlClose = TEXT.close;
141
- /** Specifies the size of the component. */
142
- this.scale = "m";
143
- /** Specifies the width of the component. */
144
- this.width = "auto";
145
- //--------------------------------------------------------------------------
146
- //
147
- // Private Methods
148
- //
149
- //--------------------------------------------------------------------------
150
- this.close = () => {
151
- this.open = false;
152
- this.calciteNoticeClose.emit();
153
- };
154
- }
155
- activeHandler(value) {
156
- this.open = value;
157
- }
158
- openHandler(value) {
159
- this.active = value;
160
- }
161
- handleDismissible(value) {
162
- this.closable = value;
163
- }
164
- handleClosable(value) {
165
- this.dismissible = value;
166
- }
167
- updateRequestedIcon() {
168
- this.requestedIcon = setRequestedIcon(StatusIcons, this.icon, this.color);
169
- }
170
- //--------------------------------------------------------------------------
171
- //
172
- // Lifecycle
173
- //
174
- //--------------------------------------------------------------------------
175
- connectedCallback() {
176
- connectConditionalSlotComponent(this);
177
- const isOpen = this.active || this.open;
178
- if (isOpen) {
179
- this.activeHandler(isOpen);
180
- this.openHandler(isOpen);
181
- }
182
- if (this.dismissible) {
183
- this.handleDismissible(this.dismissible);
184
- }
185
- if (this.closable) {
186
- this.handleClosable(this.closable);
187
- }
188
- }
189
- disconnectedCallback() {
190
- disconnectConditionalSlotComponent(this);
191
- }
192
- componentWillLoad() {
193
- this.requestedIcon = setRequestedIcon(StatusIcons, this.icon, this.color);
194
- }
195
- render() {
196
- const { el } = this;
197
- const closeButton = (h$1("button", { "aria-label": this.intlClose, class: CSS.close, onClick: this.close, ref: (el) => (this.closeButton = el) }, h$1("calcite-icon", { icon: "x", scale: this.scale === "l" ? "m" : "s" })));
198
- const hasActionEnd = getSlotted(el, SLOTS.actionsEnd);
199
- return (h$1("div", { class: CSS.container }, this.requestedIcon ? (h$1("div", { class: CSS.icon }, h$1("calcite-icon", { icon: this.requestedIcon, scale: this.scale === "l" ? "m" : "s" }))) : null, h$1("div", { class: CSS.content }, h$1("slot", { name: SLOTS.title }), h$1("slot", { name: SLOTS.message }), h$1("slot", { name: SLOTS.link })), hasActionEnd ? (h$1("div", { class: CSS.actionsEnd }, h$1("slot", { name: SLOTS.actionsEnd }))) : null, this.closable ? closeButton : null));
200
- }
201
- //--------------------------------------------------------------------------
202
- //
203
- // Public Methods
204
- //
205
- //--------------------------------------------------------------------------
206
- /** Sets focus on the component. */
207
- async setFocus() {
208
- const noticeLinkEl = this.el.querySelector("calcite-link");
209
- if (!this.closeButton && !noticeLinkEl) {
210
- return;
211
- }
212
- if (noticeLinkEl) {
213
- noticeLinkEl.setFocus();
214
- }
215
- else if (this.closeButton) {
216
- this.closeButton.focus();
217
- }
218
- }
219
- get el() { return getElement(this); }
220
- static get watchers() { return {
221
- "active": ["activeHandler"],
222
- "open": ["openHandler"],
223
- "dismissible": ["handleDismissible"],
224
- "closable": ["handleClosable"],
225
- "icon": ["updateRequestedIcon"],
226
- "color": ["updateRequestedIcon"]
227
- }; }
228
- };
229
- Notice.style = noticeCss;
230
-
231
- const mapSelectToolsCss = ":host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:\"1rem\" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}";
7
+ import { a as getAssetPath } from './index-c246d90e.js';
8
+ import { l as loadModules } from './loadModules-649aedac.js';
9
+ import { b as queryFeaturesByID } from './mapViewUtils-02696ab6.js';
232
10
 
233
- const MapSelectTools = class {
234
- constructor(hostRef) {
235
- registerInstance(this, hostRef);
236
- this.selectionSetChange = createEvent(this, "selectionSetChange", 7);
237
- this.sketchTypeChange = createEvent(this, "sketchTypeChange", 7);
238
- this.workflowTypeChange = createEvent(this, "workflowTypeChange", 7);
239
- /**
240
- * number[]: the oids of the selected features
241
- */
242
- this._selectedIds = [];
243
- /**
244
- * string: A label to help uniquely identify the selection set
245
- */
246
- this._selectionLabel = "";
247
- this.bufferColor = [227, 139, 79, 0.8];
248
- this.bufferOutlineColor = [255, 255, 255];
249
- this.enabledLayerIds = [];
250
- this.defaultBufferDistance = undefined;
251
- this.defaultBufferUnit = undefined;
252
- this.geometries = undefined;
253
- this.isUpdate = false;
254
- this.mapView = undefined;
255
- this.searchConfiguration = undefined;
256
- this.selectionSet = undefined;
257
- this.selectLayerView = undefined;
258
- this.showBufferTools = true;
259
- this._layerSelectChecked = undefined;
260
- this._searchTerm = undefined;
261
- this._translations = undefined;
262
- this._workflowType = undefined;
263
- }
264
- //--------------------------------------------------------------------------
265
- //
266
- // Watch handlers
267
- //
268
- //--------------------------------------------------------------------------
269
- /**
270
- * Called each time the geometries prop is changed.
271
- *
272
- * @returns Promise when complete
273
- */
274
- async watchGeometriesHandler(newValue, oldValue) {
275
- if (newValue !== oldValue) {
276
- if (newValue.length > 0) {
277
- return this._geomQuery(this.geometries);
278
- }
279
- else if (newValue.length === 0) {
280
- return this._clearResults(true, true);
281
- }
282
- }
283
- }
284
- /**
285
- * Called each time the searchConfiguration prop is changed.
286
- *
287
- * @returns Promise when complete
288
- */
289
- async watchSearchConfigurationHandler(newValue, oldValue) {
290
- if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
291
- this._initSearchWidget();
292
- }
293
- }
294
- /**
295
- * Called each time the workflowType prop is changed and emits the workflowTypeChange event.
296
- *
297
- * @returns Promise when complete
298
- */
299
- async workflowTypeHandler(newValue, oldValue) {
300
- if (newValue !== oldValue) {
301
- this.mapView.popup.autoOpenEnabled = ["SELECT", "SKETCH", "REFINE"].indexOf(newValue) < 0;
302
- this.workflowTypeChange.emit(newValue);
303
- }
304
- }
305
- //--------------------------------------------------------------------------
306
- //
307
- // Methods (public)
308
- //
309
- //--------------------------------------------------------------------------
310
- /**
311
- * Clear any selection results
312
- *
313
- * @returns Promise when the results have been cleared
314
- */
315
- async clearSelection() {
316
- return this._clearResults();
317
- }
318
- /**
319
- * Get the new selection set
320
- *
321
- * @returns Promise with the new selection set
322
- */
323
- async getSelection() {
324
- // Allow any non whitespace
325
- if (!/\S+/gm.test(this._selectionLabel)) {
326
- this._selectionLabel = this._getSelectionBaseLabel();
327
- }
328
- const isBaseLabel = this._selectionLabel === this._getSelectionBaseLabel();
329
- return {
330
- id: this.isUpdate ? this.selectionSet.id : Date.now(),
331
- workflowType: this._workflowType,
332
- searchResult: this._searchResult,
333
- buffer: this._bufferGeometry,
334
- distance: this._bufferTools.distance,
335
- download: true,
336
- unit: this._bufferTools.unit,
337
- label: (this._selectionLabel && !isBaseLabel) ?
338
- this._selectionLabel : `${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,
339
- selectedIds: this._selectedIds,
340
- layerView: this.selectLayerView,
341
- geometries: this.geometries,
342
- refineSelectLayers: this._refineTools.layerViews
343
- };
344
- }
345
- /**
346
- * Handle changes to the selection sets
347
- */
348
- labelChange(event) {
349
- this._selectionLabel = event.detail;
350
- }
351
- /**
352
- * Listen to changes in the sketch graphics
353
- *
354
- */
355
- sketchGraphicsChange(event) {
356
- this._updateSelection(EWorkflowType.SKETCH, event.detail, this._selectionLabel || this._translations.sketch);
357
- }
358
- /**
359
- * Listen to changes in the refine graphics
360
- *
361
- */
362
- refineSelectionGraphicsChange(event) {
363
- const graphics = event.detail;
364
- this._updateSelection(EWorkflowType.SELECT, graphics, this._selectionLabel || this._translations.select);
365
- // Using OIDs to avoid issue with points
366
- const oids = Array.isArray(graphics) ? graphics.map(g => g.attributes[g.layer.objectIdField]) : [];
367
- return this._highlightFeatures(oids);
368
- }
369
- //--------------------------------------------------------------------------
370
- //
371
- // Functions (lifecycle)
372
- //
373
- //--------------------------------------------------------------------------
374
- /**
375
- * StencilJS: Called once just after the component is first connected to the DOM.
376
- */
377
- async componentWillLoad() {
378
- await this._getTranslations();
379
- await this._initModules();
380
- }
381
- /**
382
- * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
383
- */
384
- async componentDidLoad() {
385
- return this._init();
386
- }
387
- /**
388
- * Renders the component.
389
- */
390
- render() {
391
- var _a, _b, _c;
392
- const searchEnabled = this._workflowType === EWorkflowType.SEARCH;
393
- const showSearchClass = searchEnabled ? " div-visible-search" : " div-not-visible";
394
- const drawEnabled = this._workflowType === EWorkflowType.SKETCH || this._workflowType === EWorkflowType.SELECT;
395
- const showBufferToolsClass = this.showBufferTools ? "search-distance" : "div-not-visible";
396
- const useSelectClass = this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
397
- const useDrawClass = !this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
398
- const showLayerChoiceClass = searchEnabled ? "div-not-visible" : "div-visible";
399
- return (h$1(Host, null, h$1("div", { class: "padding-bottom-1" }, h$1("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._workflowChange(evt) }, h$1("calcite-radio-group-item", { checked: searchEnabled, class: "w-50 end-border", value: EWorkflowType.SEARCH }, this._translations.search), h$1("calcite-radio-group-item", { checked: drawEnabled, class: "w-50", value: EWorkflowType.SKETCH }, this._translations.sketch))), h$1("div", { class: showSearchClass }, h$1("div", { class: "search-widget", ref: (el) => { this._searchElement = el; } })), h$1("div", { class: showLayerChoiceClass }, h$1("calcite-label", { layout: "inline" }, h$1("calcite-checkbox", { checked: ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.workflowType) === EWorkflowType.SELECT, onCalciteCheckboxChange: () => this._layerSelectChanged(), ref: (el) => this._selectFromLayerElement = el }), "Use layer features")), h$1("div", { class: useDrawClass }, h$1("map-draw-tools", { active: true, border: true, mapView: this.mapView, ref: (el) => { this._drawTools = el; } })), h$1("div", { class: useSelectClass }, h$1("refine-selection-tools", { active: true, border: true, enabledLayerIds: this.enabledLayerIds, layerViews: this._refineSelectLayers, mapView: this.mapView, mode: ESelectionMode.ADD, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.SUBSET })), h$1("calcite-label", { class: showBufferToolsClass }, this._translations.searchDistance, h$1("buffer-tools", { distance: ((_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.distance) || this.defaultBufferDistance, geometries: this.geometries, onBufferComplete: (evt) => this._bufferComplete(evt), ref: (el) => this._bufferTools = el, unit: ((_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.unit) || this.defaultBufferUnit })), h$1("slot", null)));
400
- }
401
- //--------------------------------------------------------------------------
402
- //
403
- // Functions (protected)
404
- //
405
- //--------------------------------------------------------------------------
406
- /**
407
- * Load esri javascript api modules
408
- *
409
- * @returns Promise resolving when function is done
410
- *
411
- * @protected
412
- */
413
- async _initModules() {
414
- const [GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await loadModules([
415
- "esri/layers/GraphicsLayer",
416
- "esri/Graphic",
417
- "esri/widgets/Search",
418
- "esri/geometry/geometryEngine",
419
- "esri/layers/FeatureLayer"
420
- ]);
421
- this.GraphicsLayer = GraphicsLayer;
422
- this.Graphic = Graphic;
423
- this.Search = Search;
424
- this._geometryEngine = geometryEngine;
425
- this.FeatureLayer = FeatureLayer;
426
- }
427
- /**
428
- * Initialize the graphics layer, selection set, and search widget
429
- *
430
- * @returns Promise when the operation has completed
431
- */
432
- async _init() {
433
- this._initGraphicsLayer();
434
- this._initSelectionSet();
435
- this._initSearchWidget();
436
- }
437
- /**
438
- * Initialize the state of the component with any stored values in a selection set
439
- *
440
- * @protected
441
- */
442
- _initSelectionSet() {
443
- var _a, _b, _c, _d, _e, _f, _g;
444
- if (this.selectionSet) {
445
- this._searchTerm = (_b = (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.searchResult) === null || _b === void 0 ? void 0 : _b.name;
446
- this._workflowType = (_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.workflowType;
447
- this._searchResult = (_d = this.selectionSet) === null || _d === void 0 ? void 0 : _d.searchResult;
448
- this._refineSelectLayers = (_e = this.selectionSet) === null || _e === void 0 ? void 0 : _e.refineSelectLayers;
449
- this.geometries = [
450
- ...(_f = this.selectionSet) === null || _f === void 0 ? void 0 : _f.geometries
451
- ];
452
- // reset selection label base
453
- this._selectionLabel = ((_g = this.selectionSet) === null || _g === void 0 ? void 0 : _g.label) || this._getSelectionBaseLabel();
454
- void goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
455
- }
456
- else {
457
- this._workflowType = EWorkflowType.SEARCH;
458
- }
459
- }
460
- /**
461
- * Get the default label base when the user has not provided a value
462
- *
463
- * @protected
464
- */
465
- _getSelectionBaseLabel() {
466
- var _a, _b;
467
- return this._workflowType === EWorkflowType.SKETCH ?
468
- this._translations.sketch : this._workflowType === EWorkflowType.SELECT ?
469
- this._translations.select : this._workflowType === EWorkflowType.SEARCH && this._searchResult ?
470
- (_a = this._searchResult) === null || _a === void 0 ? void 0 : _a.name : (_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.label;
471
- }
472
- /**
473
- * Initialize the search widget
474
- *
475
- * @protected
476
- */
477
- _initSearchWidget() {
478
- if (this.mapView && this._searchElement) {
479
- const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
480
- const searchOptions = Object.assign({ view: this.mapView, container: this._searchElement, searchTerm: this._searchTerm }, searchConfiguration);
481
- this._searchWidget = new this.Search(searchOptions);
482
- this._searchWidget.on("search-clear", () => {
483
- void this._clearResults(false);
484
- });
485
- this._searchWidget.on("select-result", (searchResults) => {
486
- var _a;
487
- void this._clearResults(false);
488
- if (searchResults.result) {
489
- this._searchResult = searchResults.result;
490
- this._updateSelection(EWorkflowType.SEARCH, [searchResults.result.feature], (_a = searchResults === null || searchResults === void 0 ? void 0 : searchResults.result) === null || _a === void 0 ? void 0 : _a.name);
491
- }
492
- });
493
- }
494
- }
495
- /**
496
- * Initialize the search widget based on user defined configuration
497
- *
498
- * @param searchConfiguration search configuration defined by the user
499
- * @param view the current map view
500
- *
501
- * @protected
502
- */
503
- _getSearchConfig(searchConfiguration, view) {
504
- var _a;
505
- const sources = searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.sources;
506
- if (sources) {
507
- sources.forEach(source => {
508
- var _a, _b, _c;
509
- const isLayerSource = source.hasOwnProperty("layer");
510
- if (isLayerSource) {
511
- const layerSource = source;
512
- const layerFromMap = ((_a = layerSource.layer) === null || _a === void 0 ? void 0 : _a.id)
513
- ? view.map.findLayerById(layerSource.layer.id)
514
- : null;
515
- if (layerFromMap) {
516
- layerSource.layer = layerFromMap;
517
- }
518
- else if ((_b = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _b === void 0 ? void 0 : _b.url) {
519
- layerSource.layer = new this.FeatureLayer((_c = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _c === void 0 ? void 0 : _c.url);
520
- }
521
- }
522
- });
523
- }
524
- (_a = searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.sources) === null || _a === void 0 ? void 0 : _a.forEach(source => {
525
- const isLocatorSource = source.hasOwnProperty("locator");
526
- if (isLocatorSource) {
527
- const locatorSource = source;
528
- locatorSource.url = locatorSource.url;
529
- delete locatorSource.url;
530
- }
531
- });
532
- return searchConfiguration;
533
- }
534
- /**
535
- * Initialize the graphics layer used to store any buffer grapghics
536
- *
537
- * @protected
538
- */
539
- _initGraphicsLayer() {
540
- const title = this._translations.bufferLayer;
541
- const bufferIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
542
- if (bufferIndex > -1) {
543
- this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
544
- }
545
- else {
546
- this._bufferGraphicsLayer = new this.GraphicsLayer({ title });
547
- state.managedLayers.push(title);
548
- const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
549
- if (sketchIndex > -1) {
550
- this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
551
- }
552
- else {
553
- this.mapView.map.layers.add(this._bufferGraphicsLayer);
554
- }
555
- }
556
- }
557
- /**
558
- * Store the layer select checked change
559
- *
560
- * @protected
561
- */
562
- _layerSelectChanged() {
563
- this._layerSelectChecked = this._selectFromLayerElement.checked;
564
- this.sketchTypeChange.emit(this._layerSelectChecked ? ESketchType.LAYER : ESketchType.INTERACTIVE);
565
- }
566
- /**
567
- * Store workflow type change
568
- *
569
- * @protected
570
- */
571
- _workflowChange(evt) {
572
- this._workflowType = evt.detail;
573
- }
574
- /**
575
- * Highlight the features in the map
576
- *
577
- * @protected
578
- */
579
- async _highlightFeatures(ids) {
580
- var _a;
581
- (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
582
- if (ids.length > 0) {
583
- state.highlightHandle = await highlightFeatures(ids, this.selectLayerView, this.mapView);
584
- }
585
- this.selectionSetChange.emit(ids.length);
586
- }
587
- /**
588
- * Query the selectLayerView based on any user drawn geometries or buffers
589
- *
590
- * @param geometries Array of geometries used for the selection of ids from the select layer view
591
- *
592
- * @returns Promise when the selection is complete and the graphics have been highlighted
593
- */
594
- async _selectFeatures(geometries) {
595
- this._selectedIds = await queryObjectIds(geometries, this.selectLayerView.layer);
596
- // Add geometries used for selecting features as graphics
597
- this._drawTools.graphics = this.geometries.map(geom => {
598
- var _a, _b, _c;
599
- const props = {
600
- "geometry": geom,
601
- "symbol": geom.type === "point" ?
602
- (_a = this._drawTools) === null || _a === void 0 ? void 0 : _a.pointSymbol : geom.type === "polyline" ?
603
- (_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.polylineSymbol : geom.type === "polygon" ?
604
- (_c = this._drawTools) === null || _c === void 0 ? void 0 : _c.polygonSymbol : undefined
605
- };
606
- return new this.Graphic(props);
607
- });
608
- void this._highlightFeatures(this._selectedIds);
609
- }
610
- /**
611
- * Query the selectLayerView based on any user drawn geometries or buffers
612
- *
613
- * @param evt CustomEvent that contains the result of the buffer
614
- *
615
- * @protected
616
- */
617
- async _bufferComplete(evt) {
618
- this._bufferGeometry = Array.isArray(evt.detail) ?
619
- evt.detail[0] : evt.detail;
620
- if (this._bufferGeometry) {
621
- // Create a symbol for rendering the graphic
622
- const symbol = {
623
- type: "simple-fill",
624
- color: this.bufferColor,
625
- outline: {
626
- color: this.bufferOutlineColor,
627
- width: 1
628
- }
629
- };
630
- // Add the geometry and symbol to a new graphic
631
- const polygonGraphic = new this.Graphic({
632
- geometry: this._bufferGeometry,
633
- symbol
634
- });
635
- this._bufferGraphicsLayer.removeAll();
636
- this._bufferGraphicsLayer.add(polygonGraphic);
637
- void this._selectFeatures([this._bufferGeometry]);
638
- void this.mapView.goTo(polygonGraphic.geometry.extent);
639
- }
640
- else {
641
- if (this._bufferGraphicsLayer) {
642
- this._bufferGraphicsLayer.removeAll();
643
- }
644
- void this._geomQuery(this.geometries);
645
- }
646
- }
647
- /**
648
- * Fetch a single geometry for each potential geometry type
649
- *
650
- * @param geometries All current selection geometries
651
- *
652
- * @protected
653
- */
654
- _geomQuery(geometries) {
655
- const queryGeoms = getQueryGeoms(geometries, this._geometryEngine);
656
- return this._selectFeatures(queryGeoms);
657
- }
658
- /**
659
- * Clear all stored values and general state for the component
660
- *
661
- * @param clearSearchWidget Optional boolean for clearing the search widget (default is true)
662
- * @param clearLabel Optional boolean for clearing the search label (default is true)
663
- *
664
- * @protected
665
- */
666
- async _clearResults(clearSearchWidget = true, clearLabel = true) {
667
- var _a, _b;
668
- this._selectedIds = [];
669
- if (clearLabel) {
670
- this._selectionLabel = "";
671
- }
672
- if (this._bufferGraphicsLayer) {
673
- this._bufferGraphicsLayer.removeAll();
674
- }
675
- if (clearSearchWidget && this._searchWidget) {
676
- this._searchWidget.clear();
677
- }
678
- (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
679
- // for sketch
680
- // checking for clear as it would throw off tests
681
- if ((_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.clear) {
682
- void this._drawTools.clear();
683
- }
684
- this.selectionSetChange.emit(this._selectedIds.length);
685
- }
686
- /**
687
- * Fetch a single geometry for the current geometry type
688
- *
689
- * @param type worflow type
690
- * @param graphics graphics to be used for selection
691
- * @param label selection label
692
- *
693
- * @protected
694
- */
695
- _updateSelection(type, graphics, label) {
696
- this.geometries = Array.isArray(graphics) ? graphics.map(g => g.geometry) : this.geometries;
697
- this._workflowType = type;
698
- this._selectionLabel = label;
699
- }
700
- /**
701
- * Fetches the component's translations
702
- *
703
- * @protected
704
- */
705
- async _getTranslations() {
706
- const translations = await getLocaleComponentStrings(this.el);
707
- this._translations = translations[0];
11
+ /** @license
12
+ * Copyright 2022 Esri
13
+ *
14
+ * Licensed under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ */
26
+ //#region Public functions
27
+ /**
28
+ * Export a csv of the attributes from the features that match the provided ids
29
+ *
30
+ * @param labels Labels to write
31
+ */
32
+ function exportCSV(labels) {
33
+ // Format values to string so it doesn't get tripped up when a value has a comma
34
+ // another option could be to export with a different delimiter
35
+ const outputLines = labels.map(label => Object.values(label).map(v => `"${v}"`).join(",") + "\r\n");
36
+ _downloadCSVFile(outputLines, `notify-${Date.now().toString()}`);
37
+ }
38
+ //#endregion
39
+ //#region Private functions
40
+ /**
41
+ * Download the CSV file
42
+ *
43
+ * @param outputLines Lines of output to write to file
44
+ * @param fileTitle Title (without file extension) to use for file; defaults to "export"
45
+ *
46
+ * @see {@link https://medium.com/@danny.pule/export-json-to-csv-file-using-javascript-a0b7bc5b00d2}
47
+ */
48
+ function _downloadCSVFile(outputLines, fileTitle) {
49
+ const link = document.createElement("a");
50
+ if (link.download !== undefined) {
51
+ link.href = URL.createObjectURL(new Blob(outputLines, { type: "text/csv;charset=utf-8;" }));
52
+ link.download = `${fileTitle}.csv` || "export.csv";
53
+ link.style.visibility = "hidden";
54
+ document.body.appendChild(link);
55
+ link.click();
56
+ document.body.removeChild(link);
708
57
  }
709
- get el() { return getElement(this); }
710
- static get watchers() { return {
711
- "geometries": ["watchGeometriesHandler"],
712
- "searchConfiguration": ["watchSearchConfigurationHandler"],
713
- "_workflowType": ["workflowTypeHandler"]
714
- }; }
715
- };
716
- MapSelectTools.style = mapSelectToolsCss;
717
-
718
- const labelFormats = [
719
- {
720
- descriptionPDF: {
721
- labelWidthDisplay: "2-5/8",
722
- labelHeightDisplay: "1",
723
- labelsPerPageDisplay: "30",
724
- averyPartNumber: "*60"
725
- },
726
- labelSpec: {
727
- type: "AVERY",
728
- pageProperties: {
729
- pageType: "ANSI A",
730
- leftMargin: 0.1875,
731
- rightMargin: 0.1875,
732
- topMargin: 0.5,
733
- bottomMargin: 0.5
734
- },
735
- numLabelsAcross: 3,
736
- numLabelsDown: 10,
737
- labelWidth: 2.625,
738
- labelHeight: 1,
739
- horizGapIn: 0.125,
740
- vertGapIn: 0,
741
- labelPadding: 0.1,
742
- fontSizePx: 11,
743
- maxNumLabelLines: 4
744
- }
745
- },
746
- {
747
- descriptionPDF: {
748
- labelWidthDisplay: "4",
749
- labelHeightDisplay: "1",
750
- labelsPerPageDisplay: "20",
751
- averyPartNumber: "*61"
752
- },
753
- labelSpec: {
754
- type: "AVERY",
755
- pageProperties: {
756
- pageType: "ANSI A",
757
- leftMargin: 0.15625,
758
- rightMargin: 0.15625,
759
- topMargin: 0.47637821,
760
- bottomMargin: 0.5
761
- },
762
- numLabelsAcross: 2,
763
- numLabelsDown: 10,
764
- labelWidth: 4,
765
- labelHeight: 1.0025,
766
- horizGapIn: 0.1875,
767
- vertGapIn: 0,
768
- labelPadding: 0.1,
769
- fontSizePx: 11,
770
- maxNumLabelLines: 4
771
- }
772
- },
773
- {
774
- descriptionPDF: {
775
- labelWidthDisplay: "4",
776
- labelHeightDisplay: "1-1/3",
777
- labelsPerPageDisplay: "14",
778
- averyPartNumber: "*62"
779
- },
780
- labelSpec: {
781
- type: "AVERY",
782
- pageProperties: {
783
- pageType: "ANSI A",
784
- leftMargin: 0.15625,
785
- rightMargin: 0.15625,
786
- topMargin: 0.81889808,
787
- bottomMargin: 0.83464612
788
- },
789
- numLabelsAcross: 2,
790
- numLabelsDown: 7,
791
- labelWidth: 4,
792
- labelHeight: 1.3352,
793
- horizGapIn: 0.1875,
794
- vertGapIn: 0,
795
- labelPadding: 0.1,
796
- fontSizePx: 11,
797
- maxNumLabelLines: 6
798
- }
799
- },
800
- {
801
- descriptionPDF: {
802
- labelWidthDisplay: "4",
803
- labelHeightDisplay: "2",
804
- labelsPerPageDisplay: "10",
805
- averyPartNumber: "*63"
806
- },
807
- labelSpec: {
808
- type: "AVERY",
809
- pageProperties: {
810
- pageType: "ANSI A",
811
- leftMargin: 0.15625,
812
- rightMargin: 0.15625,
813
- topMargin: 0.5,
814
- bottomMargin: 0.5
815
- },
816
- numLabelsAcross: 2,
817
- numLabelsDown: 5,
818
- labelWidth: 4,
819
- labelHeight: 2,
820
- horizGapIn: 0.1875,
821
- vertGapIn: 0,
822
- labelPadding: 0.1,
823
- fontSizePx: 12,
824
- maxNumLabelLines: 10
825
- }
826
- },
827
- {
828
- descriptionPDF: {
829
- labelWidthDisplay: "4",
830
- labelHeightDisplay: "3-1/3",
831
- labelsPerPageDisplay: "6",
832
- averyPartNumber: "*64"
833
- },
834
- labelSpec: {
835
- type: "AVERY",
836
- pageProperties: {
837
- pageType: "ANSI A",
838
- leftMargin: 0.15625,
839
- rightMargin: 0.15625,
840
- topMargin: 0.4724412,
841
- bottomMargin: 0.50000027
842
- },
843
- numLabelsAcross: 2,
844
- numLabelsDown: 3,
845
- labelWidth: 4,
846
- labelHeight: 3.342,
847
- horizGapIn: 0.1875,
848
- vertGapIn: 0,
849
- labelPadding: 0.1,
850
- fontSizePx: 14,
851
- maxNumLabelLines: 12
852
- }
853
- },
854
- {
855
- descriptionPDF: {
856
- labelWidthDisplay: "1-3/4",
857
- labelHeightDisplay: "1/2",
858
- labelsPerPageDisplay: "80",
859
- averyPartNumber: "*67"
860
- },
861
- labelSpec: {
862
- type: "AVERY",
863
- pageProperties: {
864
- pageType: "ANSI A",
865
- leftMargin: 0.307086375,
866
- rightMargin: 0.307086375,
867
- topMargin: 0.4724412,
868
- bottomMargin: 0.49606326
869
- },
870
- numLabelsAcross: 4,
871
- numLabelsDown: 20,
872
- labelWidth: 1.75,
873
- labelHeight: 0.50155,
874
- horizGapIn: 0.29527575,
875
- vertGapIn: 0,
876
- labelPadding: 0.1,
877
- fontSizePx: 8,
878
- maxNumLabelLines: 3
879
- }
880
- },
881
- {
882
- descriptionPDF: {
883
- labelWidthDisplay: "1-3/4",
884
- labelHeightDisplay: "2/3",
885
- labelsPerPageDisplay: "60",
886
- averyPartNumber: "*95"
887
- },
888
- labelSpec: {
889
- type: "AVERY",
890
- pageProperties: {
891
- pageType: "ANSI A",
892
- leftMargin: 0.28936983,
893
- rightMargin: 0.28936983,
894
- topMargin: 0.53937037,
895
- bottomMargin: 0.5511814
896
- },
897
- numLabelsAcross: 4,
898
- numLabelsDown: 15,
899
- labelWidth: 1.75,
900
- labelHeight: 0.6605,
901
- horizGapIn: 0.30708678,
902
- vertGapIn: 0,
903
- labelPadding: 0.1,
904
- fontSizePx: 8,
905
- maxNumLabelLines: 4
906
- }
907
- }
908
- ];
909
-
910
- const pdfUtils = /*#__PURE__*/Object.freeze({
911
- __proto__: null,
912
- 'default': labelFormats
913
- });
58
+ }
59
+ //#endregion
914
60
 
915
61
  var _typeof_1 = createCommonjsModule(function (module) {
916
62
  function _typeof(obj) {
@@ -1934,7 +1080,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
1934
1080
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1935
1081
  * ====================================================================
1936
1082
  */
1937
- function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-8edafdb2.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
1083
+ function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-489f4f08.js')).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}E.API.addSvgAsImage=function(t,r,n,i,o,s,c,u){if(isNaN(r)||isNaN(n))throw a.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(o))throw a.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var h=document.createElement("canvas");h.width=i,h.height=o;var l=h.getContext("2d");l.fillStyle="#fff",l.fillRect(0,0,h.width,h.height);var f={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},d=this;return e().then((function(e){return e.fromString(l,t,f)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(f)})).then((function(){d.addImage(h.toDataURL("image/jpeg",1),r,n,i,o,c,u);}))};}(),E.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var i=0;i<this.internal.pages[n].length;i++)this.internal.pages[n][i]=this.internal.pages[n][i].replace(e,r);return this},E.API.viewerPreferences=function(e,r){var n;e=e||{},r=r||!1;var i,a,o,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},c=Object.keys(s),u=[],h=0,l=0,f=0;function d(t,e){var r,n=!1;for(r=0;r<t.length;r+=1)t[r]===e&&(n=!0);return n}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,"reset"===e||!0===r){var p=c.length;for(f=0;f<p;f+=1)n[c[f]].value=n[c[f]].defaultValue,n[c[f]].explicitSet=!1;}if("object"===t(e))for(a in e)if(o=e[a],d(c,a)&&void 0!==o){if("boolean"===n[a].type&&"boolean"==typeof o)n[a].value=o;else if("name"===n[a].type&&d(n[a].valueSet,o))n[a].value=o;else if("integer"===n[a].type&&Number.isInteger(o))n[a].value=o;else if("array"===n[a].type){for(h=0;h<o.length;h+=1)if(i=!0,1===o[h].length&&"number"==typeof o[h][0])u.push(String(o[h]-1));else if(o[h].length>1){for(l=0;l<o[h].length;l+=1)"number"!=typeof o[h][l]&&(i=!1);!0===i&&u.push([o[h][0]-1,o[h][1]-1].join(" "));}n[a].value="["+u.join(" ")+"]";}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0;}return !1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,e=[];for(t in n)!0===n[t].explicitSet&&("name"===n[t].type?e.push("/"+t+" /"+n[t].value):e.push("/"+t+" "+n[t].value));0!==e.length&&this.internal.write("/ViewerPreferences\n<<\n"+e.join("\n")+"\n>>");})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},
1938
1084
  /** ====================================================================
1939
1085
  * @license
1940
1086
  * jsPDF XMP metadata plugin
@@ -2925,6 +2071,8 @@ class PDFLabels {
2925
2071
  * See the License for the specific language governing permissions and
2926
2072
  * limitations under the License.
2927
2073
  */
2074
+ //#endregion
2075
+ //#region Public functions
2928
2076
  /**
2929
2077
  * Exports a PDF of labels.
2930
2078
  *
@@ -2934,6 +2082,8 @@ class PDFLabels {
2934
2082
  function exportPDF(labels, labelPageDescription) {
2935
2083
  _downloadPDFFile(labels, labelPageDescription, `notify-${Date.now().toString()}`);
2936
2084
  }
2085
+ //#endregion
2086
+ //#region Private functions
2937
2087
  /**
2938
2088
  * Downloads the PDF file.
2939
2089
  *
@@ -2954,159 +2104,138 @@ function _downloadPDFFile(labels, labelPageDescription, fileTitle) {
2954
2104
  pdfLib.save();
2955
2105
  });
2956
2106
  });
2957
- }
2958
-
2959
- const pdfDownloadCss = ":host{display:block}";
2107
+ }
2108
+ //#endregion
2960
2109
 
2961
- const PdfDownload = class {
2962
- constructor(hostRef) {
2963
- registerInstance(this, hostRef);
2964
- this.disabled = false;
2965
- this.layerView = undefined;
2966
- this._translations = undefined;
2967
- }
2968
- //--------------------------------------------------------------------------
2969
- //
2970
- // Watch handlers
2971
- //
2972
- //--------------------------------------------------------------------------
2973
- //--------------------------------------------------------------------------
2974
- //
2975
- // Methods (public)
2976
- //
2977
- //--------------------------------------------------------------------------
2978
- /**
2979
- * Downloads csv of mailing labels for the provided list of ids
2980
- *
2981
- * @param ids List of ids to download
2982
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
2983
- * @param addColumnTitle Indicates if column headings should be included in output
2984
- * @returns Promise resolving when function is done
2985
- */
2986
- async downloadCSV(ids, removeDuplicates, addColumnTitle = true) {
2987
- const labels = await this._prepareLabels(ids, removeDuplicates, addColumnTitle);
2988
- return exportCSV(labels);
2989
- }
2990
- /**
2991
- * Downloads pdf of mailing labels for the provided list of ids
2992
- *
2993
- * @param ids List of ids to download
2994
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
2995
- * @returns Promise resolving when function is done
2996
- */
2997
- async downloadPDF(ids, removeDuplicates) {
2998
- const labels = await this._prepareLabels(ids, removeDuplicates);
2999
- const labelPageDescription = this._labelInfoElement.selectedOption.value;
3000
- return exportPDF(labels, labelPageDescription);
3001
- }
3002
- //--------------------------------------------------------------------------
3003
- //
3004
- // Events (public)
3005
- //
3006
- //--------------------------------------------------------------------------
3007
- //--------------------------------------------------------------------------
3008
- //
3009
- // Functions (lifecycle)
3010
- //
3011
- //--------------------------------------------------------------------------
3012
- /**
3013
- * StencilJS: Called once just after the component is first connected to the DOM.
3014
- */
3015
- async componentWillLoad() {
3016
- await this._getTranslations();
3017
- await this._initModules();
3018
- }
3019
- /**
3020
- * Renders the component.
3021
- */
3022
- render() {
3023
- return (h$1(Host, null, h$1("calcite-select", { disabled: this.disabled, label: "", ref: (el) => { this._labelInfoElement = el; } }, this._renderItems())));
3024
- }
3025
- //--------------------------------------------------------------------------
3026
- //
3027
- // Functions (protected)
3028
- //
3029
- //--------------------------------------------------------------------------
3030
- /**
3031
- * Load esri javascript api modules
3032
- *
3033
- * @returns Promise resolving when function is done
3034
- *
3035
- * @protected
3036
- */
3037
- async _initModules() {
3038
- const [intl] = await loadModules([
3039
- "esri/intl"
3040
- ]);
3041
- this._intl = intl;
3042
- }
3043
- /**
3044
- * Converts the text of a custom popup into a multiline label specification; conversion splits text into
3045
- * lines on <br>s, and removes HTML tags. It does not handle Arcade and related records.
3046
- *
3047
- * @param popupInfo Layer's popupInfo structure containing description, fieldInfos, and expressionInfos, e.g.,
3048
- * "<div style='text-align: left;'>{NAME}<br />{STREET}<br />{CITY}, {STATE} {ZIP} <br /></div>"
3049
- * @return Label spec
3050
- */
3051
- _convertPopupToLabelSpec(popupInfo) {
3052
- // Replace <br>, <br/> with |
3053
- popupInfo = popupInfo.replace(/<br\s*\/?>/gi, "|");
3054
- // Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, replace some char representations,
3055
- // and split the label back into individual lines
3056
- let labelSpec = popupInfo
3057
- .replace(/<[\s.]*[^<>]*\/?>/gi, "")
3058
- .replace(/\xA0/gi, " ")
3059
- .replace(/&lt;/gi, "<")
3060
- .replace(/&gt;/gi, ">")
3061
- .replace(/&nbsp;/gi, " ")
3062
- .split("|");
3063
- // Trim lines and remove empties
3064
- labelSpec = labelSpec.map(line => line.trim()).filter(line => line.length > 0);
3065
- return labelSpec;
3066
- }
3067
- ;
3068
- /**
3069
- * Gets the formatted pdf export size text
3070
- *
3071
- * @param labelInfo current user selected label info
3072
- *
3073
- * @returns the pdf label as a string
3074
- * @protected
3075
- */
3076
- _getLabelSizeText(labelInfo) {
3077
- const lNum = labelInfo.descriptionPDF.labelsPerPageDisplay;
3078
- const lSize = `${labelInfo.descriptionPDF.labelWidthDisplay} x ${labelInfo.descriptionPDF.labelHeightDisplay}`;
3079
- return this._translations.pdfLabel.replace("{{n}}", lNum).replace("{{labelSize}}", lSize);
3080
- }
3081
- /**
3082
- * Fetches the component's translations
3083
- *
3084
- * @protected
3085
- */
3086
- async _getTranslations() {
3087
- const translations = await getLocaleComponentStrings(this.el);
3088
- this._translations = translations[0];
3089
- }
3090
- /**
3091
- * Creates labels from items.
3092
- *
3093
- * @param ids List of ids to download
3094
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
3095
- * @param includeHeaderNames Add the label format at the front of the list of generated labels
3096
- * @returns Promise resolving when function is done
3097
- */
3098
- async _prepareLabels(ids, removeDuplicates, includeHeaderNames = false) {
3099
- // Get the attributes of the features to export
3100
- const featureSet = await queryFeaturesByID(ids, this.layerView.layer);
3101
- const featuresAttrs = featureSet.features.map(f => f.attributes);
2110
+ /** @license
2111
+ * Copyright 2022 Esri
2112
+ *
2113
+ * Licensed under the Apache License, Version 2.0 (the "License");
2114
+ * you may not use this file except in compliance with the License.
2115
+ * You may obtain a copy of the License at
2116
+ *
2117
+ * http://www.apache.org/licenses/LICENSE-2.0
2118
+ *
2119
+ * Unless required by applicable law or agreed to in writing, software
2120
+ * distributed under the License is distributed on an "AS IS" BASIS,
2121
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2122
+ * See the License for the specific language governing permissions and
2123
+ * limitations under the License.
2124
+ */
2125
+ //#endregion
2126
+ //#region Public functions
2127
+ /**
2128
+ * Downloads csv of mailing labels for the provided list of ids
2129
+ *
2130
+ * @param layer Layer providing features and attributes for download
2131
+ * @param ids List of ids to download
2132
+ * @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
2133
+ * all attributes are exported
2134
+ * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
2135
+ * @param addColumnTitle Indicates if column headings should be included in output
2136
+ * @returns Promise resolving when function is done
2137
+ */
2138
+ async function downloadCSV(layer, ids, formatUsingLayerPopup, removeDuplicates = false, addColumnTitle = false) {
2139
+ const labels = await _prepareLabels(layer, ids, removeDuplicates, formatUsingLayerPopup, addColumnTitle);
2140
+ exportCSV(labels);
2141
+ return Promise.resolve();
2142
+ }
2143
+ /**
2144
+ * Downloads csv of mailing labels for the provided list of ids
2145
+ *
2146
+ * @param layer Layer providing features and attributes for download
2147
+ * @param ids List of ids to download
2148
+ * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
2149
+ * @param labelPageDescription Provides PDF page layout info
2150
+ * @returns Promise resolving when function is done
2151
+ */
2152
+ async function downloadPDF(layer, ids, removeDuplicates, labelPageDescription) {
2153
+ const labels = await _prepareLabels(layer, ids, removeDuplicates);
2154
+ exportPDF(labels, labelPageDescription);
2155
+ return Promise.resolve();
2156
+ }
2157
+ //#endregion
2158
+ //#region Private functions
2159
+ /**
2160
+ * Converts a set of fieldInfos into template lines.
2161
+ *
2162
+ * @param fieldInfos Layer's fieldInfos structure
2163
+ * @return Label spec
2164
+ */
2165
+ function _convertPopupFieldsToLabelSpec(fieldInfos) {
2166
+ const labelSpec = [];
2167
+ // Every visible attribute is used
2168
+ fieldInfos.forEach(fieldInfo => {
2169
+ if (fieldInfo.visible) {
2170
+ labelSpec.push(`{${fieldInfo.fieldName}}`);
2171
+ }
2172
+ });
2173
+ return labelSpec;
2174
+ }
2175
+ /**
2176
+ * Converts the text of a custom popup into a multiline label specification; conversion splits text into
2177
+ * lines on <br>s, and removes HTML tags. It does not handle Arcade and related records.
2178
+ *
2179
+ * @param popupInfo Layer's popupInfo structure containing description, fieldInfos, and expressionInfos, e.g.,
2180
+ * "<div style='text-align: left;'>{NAME}<br />{STREET}<br />{CITY}, {STATE} {ZIP} <br /></div>"
2181
+ * @return Label spec
2182
+ */
2183
+ function _convertPopupTextToLabelSpec(popupInfo) {
2184
+ // Replace <br>, <br/> with |
2185
+ popupInfo = popupInfo.replace(/<br\s*\/?>/gi, "|");
2186
+ // Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, replace some char representations,
2187
+ // and split the label back into individual lines
2188
+ let labelSpec = popupInfo
2189
+ .replace(/<[\s.]*[^<>]*\/?>/gi, "")
2190
+ .replace(/\xA0/gi, " ")
2191
+ .replace(/&lt;/gi, "<")
2192
+ .replace(/&gt;/gi, ">")
2193
+ .replace(/&nbsp;/gi, " ")
2194
+ .split("|");
2195
+ // Trim lines and remove empties
2196
+ labelSpec = labelSpec.map(line => line.trim()).filter(line => line.length > 0);
2197
+ return labelSpec;
2198
+ }
2199
+ /**
2200
+ * Creates labels from items.
2201
+ *
2202
+ * @param layer Layer from which to fetch features
2203
+ * @param ids List of ids to download
2204
+ * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
2205
+ * @param formatUsingLayerPopup When true, the layer's popup is used to choose attributes for each column; when false,
2206
+ * all attributes are exported
2207
+ * @param includeHeaderNames Add the label format at the front of the list of generated labels
2208
+ * @returns Promise resolving when function is done
2209
+ */
2210
+ async function _prepareLabels(layer, ids, removeDuplicates = true, formatUsingLayerPopup = true, includeHeaderNames = false) {
2211
+ var _a, _b, _c, _d;
2212
+ const [intl] = await loadModules([
2213
+ "esri/intl"
2214
+ ]);
2215
+ // Get the attributes of the features to export
2216
+ const featureSet = await queryFeaturesByID(ids, layer);
2217
+ const featuresAttrs = featureSet.features.map(f => f.attributes);
2218
+ // Get the label formatting, if any
2219
+ let labelFormat;
2220
+ if (layer.popupEnabled) {
3102
2221
  // What data fields are used in the labels?
3103
2222
  // Example labelFormat: ['{NAME}', '{STREET}', '{CITY}, {STATE} {ZIP}']
3104
- const labelFormat = this._convertPopupToLabelSpec(this.layerView.layer.popupTemplate.content[0].text);
2223
+ if (formatUsingLayerPopup && ((_b = (_a = layer.popupTemplate) === null || _a === void 0 ? void 0 : _a.content[0]) === null || _b === void 0 ? void 0 : _b.type) === "fields") {
2224
+ labelFormat = _convertPopupFieldsToLabelSpec(layer.popupTemplate.fieldInfos);
2225
+ }
2226
+ else if (formatUsingLayerPopup && ((_d = (_c = layer.popupTemplate) === null || _c === void 0 ? void 0 : _c.content[0]) === null || _d === void 0 ? void 0 : _d.type) === "text") {
2227
+ labelFormat = _convertPopupTextToLabelSpec(layer.popupTemplate.content[0].text);
2228
+ }
2229
+ }
2230
+ // Apply the label format
2231
+ let labels;
2232
+ // eslint-disable-next-line unicorn/prefer-ternary
2233
+ if (labelFormat) {
3105
2234
  // Convert attributes into an array of labels
3106
- let labels = featuresAttrs.map(featureAttributes => {
2235
+ labels = featuresAttrs.map(featureAttributes => {
3107
2236
  const label = [];
3108
2237
  labelFormat.forEach(labelLineTemplate => {
3109
- const labelLine = this._intl.substitute(labelLineTemplate, featureAttributes).trim();
2238
+ const labelLine = intl.substitute(labelLineTemplate, featureAttributes).trim();
3110
2239
  if (labelLine.length > 0) {
3111
2240
  label.push(labelLine);
3112
2241
  }
@@ -3115,294 +2244,36 @@ const PdfDownload = class {
3115
2244
  })
3116
2245
  // Remove empty labels
3117
2246
  .filter(label => label.length > 0);
3118
- // Remove duplicates
3119
- if (removeDuplicates) {
3120
- const labelsAsStrings = labels.map(label => JSON.stringify(label));
3121
- const uniqueLabels = new Set(labelsAsStrings);
3122
- labels = Array.from(uniqueLabels, labelString => JSON.parse(labelString));
3123
- }
3124
- // Add header names
3125
- if (includeHeaderNames) {
3126
- const headerNames = labelFormat.map(labelFormatLine => labelFormatLine.replace(/\{/g, "").replace(/\}/g, ""));
3127
- labels.unshift(headerNames);
3128
- }
3129
- return Promise.resolve(labels);
3130
2247
  }
3131
- /**
3132
- * Renders the pdf export size options
3133
- *
3134
- * @returns Node array of size options
3135
- *
3136
- * @protected
3137
- */
3138
- _renderItems() {
3139
- const s = pdfUtils;
3140
- const sortedPdfIndo = (s.default || s).sort((a, b) => {
3141
- const _a = parseInt(a.descriptionPDF.labelsPerPageDisplay, 10);
3142
- const _b = parseInt(b.descriptionPDF.labelsPerPageDisplay, 10);
3143
- return _a < _b ? -1 : _a > _b ? 1 : 0;
3144
- });
3145
- return sortedPdfIndo.map((l) => {
3146
- return (h$1("calcite-option", { value: l }, this._getLabelSizeText(l)));
2248
+ else {
2249
+ // Export all attributes
2250
+ labels = featuresAttrs.map(featureAttributes => {
2251
+ return Object.values(featureAttributes).map(attribute => `${attribute}`);
3147
2252
  });
3148
2253
  }
3149
- get el() { return getElement(this); }
3150
- };
3151
- PdfDownload.style = pdfDownloadCss;
3152
-
3153
- const refineSelectionCss = ":host{display:block}";
3154
-
3155
- const RefineSelection = class {
3156
- constructor(hostRef) {
3157
- registerInstance(this, hostRef);
3158
- this.selectionSetsChanged = createEvent(this, "selectionSetsChanged", 7);
3159
- //--------------------------------------------------------------------------
3160
- //
3161
- // Properties (protected)
3162
- //
3163
- //--------------------------------------------------------------------------
3164
- /**
3165
- * boolean: Indicates if any new graphics should be added or removed
3166
- */
3167
- this._addEnabled = true;
3168
- this.addresseeLayer = undefined;
3169
- this.enabledLayerIds = [];
3170
- this.mapView = undefined;
3171
- this.selectionSets = [];
3172
- this.GraphicsLayer = undefined;
3173
- this.SketchViewModel = undefined;
3174
- this._translations = undefined;
3175
- }
3176
- //--------------------------------------------------------------------------
3177
- //
3178
- // Watch handlers
3179
- //
3180
- //--------------------------------------------------------------------------
3181
- /**
3182
- * Called each time the addresseeLayer is changed.
3183
- * Add a new clean refine set for the new addressee layer.
3184
- */
3185
- addresseeLayerWatchHandler() {
3186
- const selectionSets = this.selectionSets.filter(ss => ss.workflowType !== EWorkflowType.REFINE);
3187
- this.selectionSets = this._initRefineSelectionSet(selectionSets);
2254
+ // Remove duplicates
2255
+ if (removeDuplicates) {
2256
+ const labelsAsStrings = labels.map(label => JSON.stringify(label));
2257
+ const uniqueLabels = new Set(labelsAsStrings);
2258
+ labels = Array.from(uniqueLabels, labelString => JSON.parse(labelString));
3188
2259
  }
3189
- /**
3190
- * Handles changes to refine selection ids.
3191
- *
3192
- */
3193
- refineSelectionIdsChange(event) {
3194
- var _a, _b;
3195
- const addIds = ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.addIds) || [];
3196
- const removeIds = ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.removeIds) || [];
3197
- this._updateSelectionSets(removeIds);
3198
- this._updateRefineSelectionSet(addIds, removeIds);
3199
- }
3200
- //--------------------------------------------------------------------------
3201
- //
3202
- // Functions (lifecycle)
3203
- //
3204
- //--------------------------------------------------------------------------
3205
- /**
3206
- * StencilJS: Called once just after the component is first connected to the DOM.
3207
- */
3208
- async componentWillLoad() {
3209
- await this._getTranslations();
3210
- const refineSet = this._getRefineSelectionSet(this.selectionSets);
3211
- if (!refineSet) {
3212
- this.selectionSets = this._initRefineSelectionSet(this.selectionSets);
2260
+ // Add header names
2261
+ if (includeHeaderNames) {
2262
+ let headerNames = [];
2263
+ if (labelFormat) {
2264
+ headerNames = labelFormat.map(labelFormatLine => labelFormatLine.replace(/\{/g, "").replace(/\}/g, ""));
3213
2265
  }
3214
- }
3215
- /**
3216
- * Renders the component.
3217
- */
3218
- render() {
3219
- return (h$1(Host, null, h$1("div", { class: "padding-1" }, h$1("div", null, h$1("calcite-radio-group", { class: "w-100", onCalciteRadioGroupChange: (evt) => this._modeChanged(evt) }, h$1("calcite-radio-group-item", { checked: this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.ADD), value: ESelectionMode.ADD }, this._translations.add), h$1("calcite-radio-group-item", { checked: !this._addEnabled, class: "w-50", onClick: () => this._setSelectionMode(ESelectionMode.REMOVE), value: ESelectionMode.REMOVE }, this._translations.remove)), h$1("refine-selection-tools", { border: true, enabledLayerIds: this.enabledLayerIds, ids: getSelectionIds(this.selectionSets), layerViews: [this.addresseeLayer], mapView: this.mapView, mode: this._addEnabled ? ESelectionMode.ADD : ESelectionMode.REMOVE, ref: (el) => { this._refineTools = el; }, refineMode: ERefineMode.ALL, refineSelectionSet: this._getRefineSelectionSet(this.selectionSets), useLayerPicker: false })), h$1("br", null), (h$1("calcite-list", { class: "list-border" }, this._getRefineSelectionSetList())))));
3220
- }
3221
- //--------------------------------------------------------------------------
3222
- //
3223
- // Functions (protected)
3224
- //
3225
- //--------------------------------------------------------------------------
3226
- /**
3227
- * Store the Add/Remove mode
3228
- *
3229
- * @protected
3230
- */
3231
- _modeChanged(evt) {
3232
- this._addEnabled = evt.detail === ESelectionMode.ADD;
3233
- }
3234
- /**
3235
- * Set the refine tools selection mode
3236
- *
3237
- * @protected
3238
- */
3239
- _setSelectionMode(mode) {
3240
- this._refineTools.mode = mode;
3241
- }
3242
- /**
3243
- * Create a list to show the number added/removed/total unique selected
3244
- *
3245
- * @returns the list node
3246
- * @protected
3247
- */
3248
- _getRefineSelectionSetList() {
3249
- const total = getTotal(this.selectionSets);
3250
- const refineSet = this._getRefineSelectionSet(this.selectionSets);
3251
- const numAdded = (refineSet === null || refineSet === void 0 ? void 0 : refineSet.refineIds.addIds.length) || 0;
3252
- const numRemoved = (refineSet === null || refineSet === void 0 ? void 0 : refineSet.refineIds.removeIds.length) || 0;
3253
- return [(h$1("calcite-list-item", { label: this._translations.featuresAdded.replace("{{n}}", numAdded.toString()) })), (h$1("calcite-list-item", { label: this._translations.featuresRemoved.replace("{{n}}", numRemoved.toString()) })), (h$1("calcite-list-item", { label: this._translations.totalSelected.replace("{{n}}", total.toString()) }))];
3254
- }
3255
- /**
3256
- * Fetch the refine selection set
3257
- *
3258
- * @returns the refine selection set
3259
- * @protected
3260
- */
3261
- _getRefineSelectionSet(selectionSets) {
3262
- let refineSelectionSet;
3263
- selectionSets.some(ss => {
3264
- if (ss.workflowType === EWorkflowType.REFINE) {
3265
- refineSelectionSet = ss;
3266
- return true;
3267
- }
3268
- });
3269
- return refineSelectionSet;
3270
- }
3271
- /**
3272
- * Remove ids from existing selection sets.
3273
- * Remove any selection sets than have no selected ids
3274
- * This can update any selection set not just the refine set.
3275
- * We do not do something similar for adds as we will only ever add from refine tools to the single REFINE selection set.
3276
- *
3277
- * @param removeIds the ids to remove
3278
- *
3279
- * @protected
3280
- */
3281
- _updateSelectionSets(removeIds) {
3282
- if (removeIds.length > 0) {
3283
- this.selectionSets = this.selectionSets.reduce((prev, cur) => {
3284
- cur.selectedIds = cur.selectedIds.filter(id => removeIds.indexOf(id) < 0);
3285
- if (cur.selectedIds.length > 0 || cur.workflowType === EWorkflowType.REFINE) {
3286
- prev.push(cur);
2266
+ else {
2267
+ Object.keys(featuresAttrs[0]).forEach(k => {
2268
+ if (featuresAttrs[0].hasOwnProperty(k)) {
2269
+ headerNames.push(k);
3287
2270
  }
3288
- return prev;
3289
- }, []);
3290
- this.selectionSetsChanged.emit(this.selectionSets);
3291
- }
3292
- }
3293
- /**
3294
- * Update the refine selection set with any adds or removes
3295
- *
3296
- * @param addIds any ids to add
3297
- * @param removeIds any ids to remove
3298
- *
3299
- * @returns Promise resolving when function is done
3300
- * @protected
3301
- */
3302
- _updateRefineSelectionSet(addIds, removeIds) {
3303
- const selectionSet = this._getRefineSelectionSet(this.selectionSets);
3304
- this._updateRefineIds(selectionSet, addIds, removeIds);
3305
- this.selectionSetsChanged.emit(this.selectionSets);
3306
- }
3307
- /**
3308
- * Update the ids stored for the refine selection set
3309
- *
3310
- * @param selectionSet the refine selection set
3311
- * @param addIds any ids to add
3312
- * @param removeIds any ids to remove
3313
- *
3314
- * @returns updated selection sets
3315
- * @protected
3316
- */
3317
- _updateRefineIds(selectionSet, addIds, removeIds) {
3318
- // remove ids if they exist in the current add or remove list
3319
- selectionSet.refineIds.addIds = selectionSet.refineIds.addIds.filter(id => removeIds.indexOf(id) < 0);
3320
- selectionSet.refineIds.removeIds = selectionSet.refineIds.removeIds.filter(id => addIds.indexOf(id) < 0);
3321
- const _addIds = [...new Set(selectionSet.refineIds.addIds.concat(addIds))];
3322
- const _removeIds = [...new Set(selectionSet.refineIds.removeIds.concat(removeIds))];
3323
- selectionSet.refineIds = {
3324
- addIds: _addIds.filter(id => _removeIds.indexOf(id) < 0),
3325
- removeIds: _removeIds.filter(id => _addIds.indexOf(id) < 0)
3326
- };
3327
- selectionSet.selectedIds = selectionSet.refineIds.addIds.length > 0 ?
3328
- [...new Set(selectionSet.selectedIds.concat(selectionSet.refineIds.addIds))] :
3329
- selectionSet.selectedIds.filter(id => selectionSet.refineIds.removeIds.indexOf(id) < 0);
3330
- return this.selectionSets.map(ss => {
3331
- return ss.workflowType === EWorkflowType.REFINE ? selectionSet : ss;
3332
- });
3333
- }
3334
- /**
3335
- * Add a new refine selection set
3336
- *
3337
- * @returns updated selection sets
3338
- * @protected
3339
- */
3340
- _initRefineSelectionSet(selectionSets) {
3341
- return [
3342
- ...selectionSets,
3343
- ({
3344
- buffer: undefined,
3345
- distance: 0,
3346
- download: true,
3347
- geometries: [],
3348
- id: Date.now(),
3349
- label: "Refine",
3350
- layerView: this.addresseeLayer,
3351
- refineSelectLayers: [],
3352
- searchResult: undefined,
3353
- selectedIds: [],
3354
- unit: "feet",
3355
- workflowType: EWorkflowType.REFINE,
3356
- refineIds: {
3357
- addIds: [],
3358
- removeIds: []
3359
- },
3360
- redoStack: [],
3361
- undoStack: []
3362
- })
3363
- ];
3364
- }
3365
- /**
3366
- * Fetches the component's translations
3367
- *
3368
- * @protected
3369
- */
3370
- async _getTranslations() {
3371
- const translations = await getLocaleComponentStrings(this.el);
3372
- this._translations = translations[0];
3373
- }
3374
- /** Provides access to protected methods for unit testing.
3375
- *
3376
- * @param methodName Name of protected method to run
3377
- * @param arg1 First argument to forward to method, e.g., for "_modeChanged", `ESelectionMode`
3378
- * @returns
3379
- */
3380
- _testAccess(methodName, arg1) {
3381
- switch (methodName) {
3382
- case "_modeChanged":
3383
- return this._modeChanged(arg1);
3384
- case "_setSelectionMode":
3385
- return this._setSelectionMode(arg1);
3386
- // case "_getRefineSelectionSetList":
3387
- // return this._getRefineSelectionSetList();
3388
- // case "_getRefineSelectionSet":
3389
- // return this._getRefineSelectionSet(arg1);
3390
- // case "_updateSelectionSets":
3391
- // return this._updateSelectionSets(arg1);
3392
- // case "_updateRefineSelectionSet":
3393
- // return this._updateRefineSelectionSet(arg1, arg2);
3394
- // case "_updateRefineIds":
3395
- // return this._updateRefineIds(arg1, arg2, arg3);
3396
- // case "_addRefineSelectionSet":
3397
- // return this._addRefineSelectionSet(arg1, arg2);
2271
+ });
3398
2272
  }
3399
- return null;
2273
+ labels.unshift(headerNames);
3400
2274
  }
3401
- get el() { return getElement(this); }
3402
- static get watchers() { return {
3403
- "addresseeLayer": ["addresseeLayerWatchHandler"]
3404
- }; }
3405
- };
3406
- RefineSelection.style = refineSelectionCss;
2275
+ return Promise.resolve(labels);
2276
+ }
2277
+ //#endregion
3407
2278
 
3408
- export { InputMessage as I, MapSelectTools as M, Notice as N, PdfDownload as P, RefineSelection as R, _typeof_1 as _ };
2279
+ export { _typeof_1 as _, downloadPDF as a, downloadCSV as d };