@esri/solutions-components 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) 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/calcite-input-message_5.cjs.entry.js +1342 -18
  4. package/dist/cjs/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-da276a1c.js → downloadUtils-27dbd8b9.js} +205 -1383
  5. package/dist/cjs/{index.es-176629d8.js → index.es-40d341ed.js} +3 -13
  6. package/dist/cjs/layer-table.cjs.entry.js +5 -15
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/public-notification.cjs.entry.js +2 -2
  9. package/dist/cjs/solutions-components.cjs.js +1 -1
  10. package/dist/collection/components/layer-table/layer-table.js +4 -16
  11. package/dist/collection/components/map-search/map-search.js +1 -1
  12. package/dist/collection/components/map-select-tools/map-select-tools.js +42 -38
  13. package/dist/collection/components/pdf-download/pdf-download.js +9 -76
  14. package/dist/collection/components/public-notification/public-notification.js +3 -3
  15. package/dist/collection/components/refine-selection/refine-selection.js +1 -1
  16. package/dist/collection/utils/csvUtils.js +4 -0
  17. package/dist/collection/utils/csvUtils.ts +7 -0
  18. package/dist/collection/utils/downloadUtils.js +181 -0
  19. package/dist/collection/utils/downloadUtils.ts +235 -0
  20. package/dist/collection/utils/interfaces.ts +3 -2
  21. package/dist/collection/utils/pdfUtils.js +7 -0
  22. package/dist/collection/utils/pdfUtils.ts +13 -2
  23. package/dist/components/downloadUtils.js +2279 -0
  24. package/dist/components/index.es.js +1 -1
  25. package/dist/components/layer-table.js +5 -16
  26. package/dist/components/map-layer-picker2.js +1 -1
  27. package/dist/components/map-search.js +1 -1
  28. package/dist/components/map-select-tools2.js +44 -40
  29. package/dist/components/pdf-download2.js +10 -2124
  30. package/dist/components/public-notification.js +3 -3
  31. package/dist/components/queryUtils.js +1 -1
  32. package/dist/components/refine-selection-tools2.js +1 -1
  33. package/dist/components/refine-selection2.js +1 -1
  34. package/dist/esm/buffer-tools_6.entry.js +1 -1
  35. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  36. package/dist/esm/calcite-input-message_5.entry.js +1341 -13
  37. package/dist/esm/{calcite-input-message.calcite-notice.map-select-tools.pdf-download.refine-selection-c6f63458.js → downloadUtils-76e38a94.js} +206 -1381
  38. package/dist/esm/{index.es-54a6f3a3.js → index.es-489f4f08.js} +2 -12
  39. package/dist/esm/layer-table.entry.js +6 -16
  40. package/dist/esm/loader.js +1 -1
  41. package/dist/esm/{mapViewUtils-63e118f8.js → mapViewUtils-02696ab6.js} +1 -1
  42. package/dist/esm/public-notification.entry.js +3 -3
  43. package/dist/esm/solutions-components.js +1 -1
  44. package/dist/solutions-components/{p-cc2e20c8.js → p-1bfd07e3.js} +1 -1
  45. package/dist/solutions-components/{p-117174e8.entry.js → p-335fce8c.entry.js} +1 -1
  46. package/dist/solutions-components/p-4ef94c6b.entry.js +6 -0
  47. package/dist/solutions-components/p-5d27b47d.entry.js +17 -0
  48. package/dist/solutions-components/p-92cb569a.entry.js +6 -0
  49. package/dist/solutions-components/{p-8a0c0935.entry.js → p-a3b60bc9.entry.js} +1 -1
  50. package/dist/solutions-components/{p-1e459361.js → p-bff8aa4e.js} +3 -3
  51. package/dist/solutions-components/p-caa7e7a7.js +437 -0
  52. package/dist/solutions-components/solutions-components.esm.js +1 -1
  53. package/dist/solutions-components/utils/csvUtils.ts +7 -0
  54. package/dist/solutions-components/utils/downloadUtils.ts +235 -0
  55. package/dist/solutions-components/utils/interfaces.ts +3 -2
  56. package/dist/solutions-components/utils/pdfUtils.ts +13 -2
  57. package/dist/types/components/map-select-tools/map-select-tools.d.ts +11 -5
  58. package/dist/types/components/pdf-download/pdf-download.d.ts +0 -18
  59. package/dist/types/utils/downloadUtils.d.ts +40 -0
  60. package/dist/types/utils/interfaces.d.ts +2 -3
  61. package/dist/types/utils/pdfUtils.d.ts +3 -1
  62. package/package.json +1 -1
  63. package/dist/cjs/csvUtils-3a56c6d8.js +0 -54
  64. package/dist/components/csvUtils.js +0 -52
  65. package/dist/esm/csvUtils-23b5418f.js +0 -52
  66. package/dist/solutions-components/p-3069e3b7.js +0 -21
  67. package/dist/solutions-components/p-6d28f991.entry.js +0 -6
  68. package/dist/solutions-components/p-80f5e33c.js +0 -416
  69. package/dist/solutions-components/p-8927862a.entry.js +0 -6
  70. package/dist/solutions-components/p-e69c58e5.entry.js +0 -6
@@ -3,960 +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 { h as highlightFeatures, g as goToSelection, 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
- /**
248
- * boolean: When false the geometries will be used for selection
249
- * When true a list of OIDs will be used
250
- * see https://github.com/Esri/solutions-components/issues/148
251
- */
252
- this._skipGeomQuery = false;
253
- this.bufferColor = [227, 139, 79, 0.8];
254
- this.bufferOutlineColor = [255, 255, 255];
255
- this.enabledLayerIds = [];
256
- this.defaultBufferDistance = undefined;
257
- this.defaultBufferUnit = undefined;
258
- this.geometries = undefined;
259
- this.isUpdate = false;
260
- this.mapView = undefined;
261
- this.searchConfiguration = undefined;
262
- this.selectionSet = undefined;
263
- this.selectLayerView = undefined;
264
- this.showBufferTools = true;
265
- this._layerSelectChecked = undefined;
266
- this._searchTerm = undefined;
267
- this._translations = undefined;
268
- this._workflowType = undefined;
269
- }
270
- //--------------------------------------------------------------------------
271
- //
272
- // Watch handlers
273
- //
274
- //--------------------------------------------------------------------------
275
- /**
276
- * Called each time the geometries prop is changed.
277
- *
278
- * @returns Promise when complete
279
- */
280
- async watchGeometriesHandler(newValue, oldValue) {
281
- if (newValue !== oldValue) {
282
- if (newValue.length > 0) {
283
- if (this._skipGeomQuery) {
284
- void highlightFeatures(this._selectedIds, this.selectLayerView, this.mapView);
285
- }
286
- else {
287
- return this._geomQuery(this.geometries);
288
- }
289
- }
290
- else if (newValue.length === 0) {
291
- return this._clearResults(true, true);
292
- }
293
- }
294
- }
295
- /**
296
- * Called each time the searchConfiguration prop is changed.
297
- *
298
- * @returns Promise when complete
299
- */
300
- async watchSearchConfigurationHandler(newValue, oldValue) {
301
- console.log("watchSearchConfigurationHandler");
302
- console.log("newValue");
303
- console.log(newValue);
304
- console.log("oldValue");
305
- console.log(oldValue);
306
- if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
307
- this._initSearchWidget();
308
- }
309
- }
310
- /**
311
- * Called each time the workflowType prop is changed and emits the workflowTypeChange event.
312
- *
313
- * @returns Promise when complete
314
- */
315
- async workflowTypeHandler(newValue, oldValue) {
316
- if (newValue !== oldValue) {
317
- this.mapView.popup.autoOpenEnabled = ["SELECT", "SKETCH", "REFINE"].indexOf(newValue) < 0;
318
- this.workflowTypeChange.emit(newValue);
319
- }
320
- }
321
- //--------------------------------------------------------------------------
322
- //
323
- // Methods (public)
324
- //
325
- //--------------------------------------------------------------------------
326
- /**
327
- * Clear any selection results
328
- *
329
- * @returns Promise when the results have been cleared
330
- */
331
- async clearSelection() {
332
- return this._clearResults();
333
- }
334
- /**
335
- * Get the new selection set
336
- *
337
- * @returns Promise with the new selection set
338
- */
339
- async getSelection() {
340
- // Allow any non whitespace
341
- if (!/\S+/gm.test(this._selectionLabel)) {
342
- this._selectionLabel = this._getSelectionBaseLabel();
343
- }
344
- const isBaseLabel = this._selectionLabel === this._getSelectionBaseLabel();
345
- return {
346
- id: this.isUpdate ? this.selectionSet.id : Date.now(),
347
- workflowType: this._workflowType,
348
- searchResult: this._searchResult,
349
- buffer: this._bufferGeometry,
350
- distance: this._bufferTools.distance,
351
- download: true,
352
- unit: this._bufferTools.unit,
353
- label: (this._selectionLabel && !isBaseLabel) ?
354
- this._selectionLabel : `${this._selectionLabel} ${this._bufferTools.distance} ${this._bufferTools.unit}`,
355
- selectedIds: this._selectedIds,
356
- layerView: this.selectLayerView,
357
- geometries: this.geometries,
358
- refineSelectLayers: this._refineTools.layerViews,
359
- skipGeomQuery: this._skipGeomQuery
360
- };
361
- }
362
- /**
363
- * Handle changes to the selection sets
364
- */
365
- labelChange(event) {
366
- this._selectionLabel = event.detail;
367
- }
368
- /**
369
- * Handle changes to the search configuration
370
- */
371
- searchConfigurationChangeChanged(event) {
372
- this.searchConfiguration = event.detail;
373
- }
374
- /**
375
- * Listen to changes in the sketch graphics
376
- *
377
- */
378
- sketchGraphicsChange(event) {
379
- this._updateSelection(EWorkflowType.SKETCH, event.detail, this._selectionLabel || this._translations.sketch, true);
380
- }
381
- /**
382
- * Listen to changes in the refine graphics
383
- *
384
- */
385
- refineSelectionGraphicsChange(event) {
386
- const graphics = event.detail.graphics;
387
- this._skipGeomQuery = event.detail.useOIDs;
388
- const oids = Array.isArray(graphics) ? graphics.map(g => g.attributes[g.layer.objectIdField]) : [];
389
- this._updateSelection(EWorkflowType.SELECT, graphics, this._selectionLabel || this._translations.select, !event.detail.useOIDs, oids);
390
- return this._highlightFeatures(oids);
391
- }
392
- //--------------------------------------------------------------------------
393
- //
394
- // Functions (lifecycle)
395
- //
396
- //--------------------------------------------------------------------------
397
- /**
398
- * StencilJS: Called once just after the component is first connected to the DOM.
399
- */
400
- async componentWillLoad() {
401
- await this._getTranslations();
402
- await this._initModules();
403
- }
404
- /**
405
- * StencilJS: Called once just after the component is fully loaded and the first render() occurs.
406
- */
407
- async componentDidLoad() {
408
- return this._init();
409
- }
410
- /**
411
- * Renders the component.
412
- */
413
- render() {
414
- var _a, _b, _c;
415
- const searchEnabled = this._workflowType === EWorkflowType.SEARCH;
416
- const showSearchClass = searchEnabled ? " div-visible-search" : " div-not-visible";
417
- const drawEnabled = this._workflowType === EWorkflowType.SKETCH || this._workflowType === EWorkflowType.SELECT;
418
- const showBufferToolsClass = this.showBufferTools ? "search-distance" : "div-not-visible";
419
- const useSelectClass = this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
420
- const useDrawClass = !this._layerSelectChecked && !searchEnabled ? " div-visible" : " div-not-visible";
421
- const showLayerChoiceClass = searchEnabled ? "div-not-visible" : "div-visible";
422
- 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, layerView: this.selectLayerView, 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)));
423
- }
424
- //--------------------------------------------------------------------------
425
- //
426
- // Functions (protected)
427
- //
428
- //--------------------------------------------------------------------------
429
- /**
430
- * Load esri javascript api modules
431
- *
432
- * @returns Promise resolving when function is done
433
- *
434
- * @protected
435
- */
436
- async _initModules() {
437
- const [GraphicsLayer, Graphic, Search, geometryEngine, FeatureLayer] = await loadModules([
438
- "esri/layers/GraphicsLayer",
439
- "esri/Graphic",
440
- "esri/widgets/Search",
441
- "esri/geometry/geometryEngine",
442
- "esri/layers/FeatureLayer"
443
- ]);
444
- this.GraphicsLayer = GraphicsLayer;
445
- this.Graphic = Graphic;
446
- this.Search = Search;
447
- this._geometryEngine = geometryEngine;
448
- this.FeatureLayer = FeatureLayer;
449
- }
450
- /**
451
- * Initialize the graphics layer, selection set, and search widget
452
- *
453
- * @returns Promise when the operation has completed
454
- */
455
- async _init() {
456
- this._initGraphicsLayer();
457
- this._initSelectionSet();
458
- this._initSearchWidget();
459
- }
460
- /**
461
- * Initialize the state of the component with any stored values in a selection set
462
- *
463
- * @protected
464
- */
465
- _initSelectionSet() {
466
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
467
- if (this.selectionSet) {
468
- this._searchTerm = (_b = (_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.searchResult) === null || _b === void 0 ? void 0 : _b.name;
469
- this._workflowType = (_c = this.selectionSet) === null || _c === void 0 ? void 0 : _c.workflowType;
470
- this._searchResult = (_d = this.selectionSet) === null || _d === void 0 ? void 0 : _d.searchResult;
471
- this._refineSelectLayers = (_e = this.selectionSet) === null || _e === void 0 ? void 0 : _e.refineSelectLayers;
472
- this._selectedIds = (_f = this.selectionSet) === null || _f === void 0 ? void 0 : _f.selectedIds;
473
- this._skipGeomQuery = (_g = this.selectionSet) === null || _g === void 0 ? void 0 : _g.skipGeomQuery;
474
- this.geometries = [
475
- ...((_h = this.selectionSet) === null || _h === void 0 ? void 0 : _h.geometries) || []
476
- ];
477
- // reset selection label base
478
- this._selectionLabel = ((_j = this.selectionSet) === null || _j === void 0 ? void 0 : _j.label) || this._getSelectionBaseLabel();
479
- void goToSelection(this.selectionSet.selectedIds, this.selectionSet.layerView, this.mapView, false);
480
- }
481
- else {
482
- this._workflowType = EWorkflowType.SEARCH;
483
- }
484
- }
485
- /**
486
- * Get the default label base when the user has not provided a value
487
- *
488
- * @protected
489
- */
490
- _getSelectionBaseLabel() {
491
- var _a, _b;
492
- return this._workflowType === EWorkflowType.SKETCH ?
493
- this._translations.sketch : this._workflowType === EWorkflowType.SELECT ?
494
- this._translations.select : this._workflowType === EWorkflowType.SEARCH && this._searchResult ?
495
- (_a = this._searchResult) === null || _a === void 0 ? void 0 : _a.name : (_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.label;
496
- }
497
- /**
498
- * Initialize the search widget
499
- *
500
- * @protected
501
- */
502
- _initSearchWidget() {
503
- console.log("_initSearchWidget");
504
- console.log("this.mapView");
505
- console.log(this.mapView);
506
- console.log("this._searchElement");
507
- console.log(this._searchElement);
508
- if (this.mapView && this._searchElement) {
509
- console.log("this._getSearchConfig");
510
- const searchConfiguration = this._getSearchConfig(this.searchConfiguration, this.mapView);
511
- console.log("searchConfiguration");
512
- console.log(searchConfiguration);
513
- const searchOptions = Object.assign({ view: this.mapView, container: this._searchElement, searchTerm: this._searchTerm }, searchConfiguration);
514
- this._searchWidget = new this.Search(searchOptions);
515
- this._searchWidget.on("search-clear", () => {
516
- void this._clearResults(false);
517
- });
518
- this._searchWidget.on("select-result", (searchResults) => {
519
- var _a;
520
- void this._clearResults(false);
521
- if (searchResults.result) {
522
- this._searchResult = searchResults.result;
523
- 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, true);
524
- }
525
- });
526
- console.log("END search widget init");
527
- }
528
- }
529
- /**
530
- * Initialize the search widget based on user defined configuration
531
- *
532
- * @param searchConfiguration search configuration defined by the user
533
- * @param view the current map view
534
- *
535
- * @protected
536
- */
537
- _getSearchConfig(searchConfiguration, view) {
538
- var _a;
539
- const sources = searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.sources;
540
- if (sources) {
541
- sources.forEach(source => {
542
- var _a, _b, _c;
543
- const isLayerSource = source.hasOwnProperty("layer");
544
- if (isLayerSource) {
545
- const layerSource = source;
546
- const layerFromMap = ((_a = layerSource.layer) === null || _a === void 0 ? void 0 : _a.id)
547
- ? view.map.findLayerById(layerSource.layer.id)
548
- : null;
549
- if (layerFromMap) {
550
- layerSource.layer = layerFromMap;
551
- }
552
- else if ((_b = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _b === void 0 ? void 0 : _b.url) {
553
- layerSource.layer = new this.FeatureLayer((_c = layerSource === null || layerSource === void 0 ? void 0 : layerSource.layer) === null || _c === void 0 ? void 0 : _c.url);
554
- }
555
- }
556
- });
557
- }
558
- (_a = searchConfiguration === null || searchConfiguration === void 0 ? void 0 : searchConfiguration.sources) === null || _a === void 0 ? void 0 : _a.forEach(source => {
559
- const isLocatorSource = source.hasOwnProperty("locator");
560
- if (isLocatorSource) {
561
- const locatorSource = source;
562
- locatorSource.url = locatorSource.url;
563
- delete locatorSource.url;
564
- }
565
- });
566
- return searchConfiguration;
567
- }
568
- /**
569
- * Initialize the graphics layer used to store any buffer grapghics
570
- *
571
- * @protected
572
- */
573
- _initGraphicsLayer() {
574
- const title = this._translations.bufferLayer;
575
- const bufferIndex = this.mapView.map.layers.findIndex((l) => l.title === title);
576
- if (bufferIndex > -1) {
577
- this._bufferGraphicsLayer = this.mapView.map.layers.getItemAt(bufferIndex);
578
- }
579
- else {
580
- this._bufferGraphicsLayer = new this.GraphicsLayer({ title });
581
- state.managedLayers.push(title);
582
- const sketchIndex = this.mapView.map.layers.findIndex((l) => l.title === this._translations.sketchLayer);
583
- if (sketchIndex > -1) {
584
- this.mapView.map.layers.add(this._bufferGraphicsLayer, sketchIndex);
585
- }
586
- else {
587
- this.mapView.map.layers.add(this._bufferGraphicsLayer);
588
- }
589
- }
590
- }
591
- /**
592
- * Store the layer select checked change
593
- *
594
- * @protected
595
- */
596
- _layerSelectChanged() {
597
- this._layerSelectChecked = this._selectFromLayerElement.checked;
598
- this.sketchTypeChange.emit(this._layerSelectChecked ? ESketchType.LAYER : ESketchType.INTERACTIVE);
599
- }
600
- /**
601
- * Store workflow type change
602
- *
603
- * @protected
604
- */
605
- _workflowChange(evt) {
606
- this._workflowType = evt.detail;
607
- }
608
- /**
609
- * Highlight the features in the map
610
- *
611
- * @protected
612
- */
613
- async _highlightFeatures(ids) {
614
- var _a;
615
- (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
616
- if (ids.length > 0) {
617
- state.highlightHandle = await highlightFeatures(ids, this.selectLayerView, this.mapView);
618
- }
619
- this.selectionSetChange.emit(ids.length);
620
- }
621
- /**
622
- * Query the selectLayerView based on any user drawn geometries or buffers
623
- *
624
- * @param geometries Array of geometries used for the selection of ids from the select layer view
625
- *
626
- * @returns Promise when the selection is complete and the graphics have been highlighted
627
- */
628
- async _selectFeatures(geometries) {
629
- this._selectedIds = await queryObjectIds(geometries, this.selectLayerView.layer);
630
- // Add geometries used for selecting features as graphics
631
- this._drawTools.graphics = this.geometries.map(geom => {
632
- var _a, _b, _c;
633
- const props = {
634
- "geometry": geom,
635
- "symbol": geom.type === "point" ?
636
- (_a = this._drawTools) === null || _a === void 0 ? void 0 : _a.pointSymbol : geom.type === "polyline" ?
637
- (_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.polylineSymbol : geom.type === "polygon" ?
638
- (_c = this._drawTools) === null || _c === void 0 ? void 0 : _c.polygonSymbol : undefined
639
- };
640
- return new this.Graphic(props);
641
- });
642
- void this._highlightFeatures(this._selectedIds);
643
- }
644
- /**
645
- * Query the selectLayerView based on any user drawn geometries or buffers
646
- *
647
- * @param evt CustomEvent that contains the result of the buffer
648
- *
649
- * @protected
650
- */
651
- async _bufferComplete(evt) {
652
- var _a, _b;
653
- this._bufferGeometry = Array.isArray(evt.detail) ?
654
- evt.detail[0] : evt.detail;
655
- if (this._bufferGeometry) {
656
- // Create a symbol for rendering the graphic
657
- const symbol = {
658
- type: "simple-fill",
659
- color: this.bufferColor,
660
- outline: {
661
- color: this.bufferOutlineColor,
662
- width: 1
663
- }
664
- };
665
- // Add the geometry and symbol to a new graphic
666
- const polygonGraphic = new this.Graphic({
667
- geometry: this._bufferGeometry,
668
- symbol
669
- });
670
- this._bufferGraphicsLayer.removeAll();
671
- this._bufferGraphicsLayer.add(polygonGraphic);
672
- void this._selectFeatures([this._bufferGeometry]);
673
- void this.mapView.goTo(polygonGraphic.geometry.extent);
674
- }
675
- else {
676
- if (this._bufferGraphicsLayer) {
677
- this._bufferGraphicsLayer.removeAll();
678
- }
679
- if (this._skipGeomQuery || ((_a = this.selectionSet) === null || _a === void 0 ? void 0 : _a.skipGeomQuery)) {
680
- this._selectedIds = (_b = this.selectionSet) === null || _b === void 0 ? void 0 : _b.selectedIds;
681
- void this._highlightFeatures(this._selectedIds);
682
- }
683
- else {
684
- void this._geomQuery(this.geometries);
685
- }
686
- }
687
- }
688
- /**
689
- * Fetch a single geometry for each potential geometry type
690
- *
691
- * @param geometries All current selection geometries
692
- *
693
- * @protected
694
- */
695
- _geomQuery(geometries) {
696
- const queryGeoms = getQueryGeoms(geometries, this._geometryEngine);
697
- return this._selectFeatures(queryGeoms);
698
- }
699
- /**
700
- * Clear all stored values and general state for the component
701
- *
702
- * @param clearSearchWidget Optional boolean for clearing the search widget (default is true)
703
- * @param clearLabel Optional boolean for clearing the search label (default is true)
704
- *
705
- * @protected
706
- */
707
- async _clearResults(clearSearchWidget = true, clearLabel = true) {
708
- var _a, _b;
709
- this._selectedIds = [];
710
- if (clearLabel) {
711
- this._selectionLabel = "";
712
- }
713
- if (this._bufferGraphicsLayer) {
714
- this._bufferGraphicsLayer.removeAll();
715
- }
716
- if (clearSearchWidget && this._searchWidget) {
717
- this._searchWidget.clear();
718
- }
719
- (_a = state.highlightHandle) === null || _a === void 0 ? void 0 : _a.remove();
720
- // for sketch
721
- // checking for clear as it would throw off tests
722
- if ((_b = this._drawTools) === null || _b === void 0 ? void 0 : _b.clear) {
723
- void this._drawTools.clear();
724
- }
725
- this.selectionSetChange.emit(this._selectedIds.length);
726
- }
727
- /**
728
- * Fetch a single geometry for the current geometry type
729
- *
730
- * @param type worflow type
731
- * @param graphics graphics to be used for selection
732
- * @param label selection label
733
- * @param useGeoms indicates if the geometries should be used directly for selections
734
- * @param oids list of IDs to select when useGeoms is false
735
- *
736
- * @protected
737
- */
738
- _updateSelection(type, graphics, label, useGeoms, oids) {
739
- this._selectedIds = oids ? oids : this._selectedIds;
740
- // see https://github.com/Esri/solutions-components/issues/148
741
- this._skipGeomQuery = !useGeoms;
742
- this.geometries = Array.isArray(graphics) ? graphics.map(g => g.geometry) : this.geometries;
743
- this._workflowType = type;
744
- this._selectionLabel = label;
745
- }
746
- /**
747
- * Fetches the component's translations
748
- *
749
- * @protected
750
- */
751
- async _getTranslations() {
752
- const translations = await getLocaleComponentStrings(this.el);
753
- 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);
754
57
  }
755
- get el() { return getElement(this); }
756
- static get watchers() { return {
757
- "geometries": ["watchGeometriesHandler"],
758
- "searchConfiguration": ["watchSearchConfigurationHandler"],
759
- "_workflowType": ["workflowTypeHandler"]
760
- }; }
761
- };
762
- MapSelectTools.style = mapSelectToolsCss;
763
-
764
- const labelFormats = [
765
- {
766
- descriptionPDF: {
767
- labelWidthDisplay: "2-5/8",
768
- labelHeightDisplay: "1",
769
- labelsPerPageDisplay: "30",
770
- averyPartNumber: "*60"
771
- },
772
- labelSpec: {
773
- type: "AVERY",
774
- pageProperties: {
775
- pageType: "ANSI A",
776
- leftMargin: 0.1875,
777
- rightMargin: 0.1875,
778
- topMargin: 0.5,
779
- bottomMargin: 0.5
780
- },
781
- numLabelsAcross: 3,
782
- numLabelsDown: 10,
783
- labelWidth: 2.625,
784
- labelHeight: 1,
785
- horizGapIn: 0.125,
786
- vertGapIn: 0,
787
- labelPadding: 0.1,
788
- fontSizePx: 11,
789
- maxNumLabelLines: 4
790
- }
791
- },
792
- {
793
- descriptionPDF: {
794
- labelWidthDisplay: "4",
795
- labelHeightDisplay: "1",
796
- labelsPerPageDisplay: "20",
797
- averyPartNumber: "*61"
798
- },
799
- labelSpec: {
800
- type: "AVERY",
801
- pageProperties: {
802
- pageType: "ANSI A",
803
- leftMargin: 0.15625,
804
- rightMargin: 0.15625,
805
- topMargin: 0.47637821,
806
- bottomMargin: 0.5
807
- },
808
- numLabelsAcross: 2,
809
- numLabelsDown: 10,
810
- labelWidth: 4,
811
- labelHeight: 1.0025,
812
- horizGapIn: 0.1875,
813
- vertGapIn: 0,
814
- labelPadding: 0.1,
815
- fontSizePx: 11,
816
- maxNumLabelLines: 4
817
- }
818
- },
819
- {
820
- descriptionPDF: {
821
- labelWidthDisplay: "4",
822
- labelHeightDisplay: "1-1/3",
823
- labelsPerPageDisplay: "14",
824
- averyPartNumber: "*62"
825
- },
826
- labelSpec: {
827
- type: "AVERY",
828
- pageProperties: {
829
- pageType: "ANSI A",
830
- leftMargin: 0.15625,
831
- rightMargin: 0.15625,
832
- topMargin: 0.81889808,
833
- bottomMargin: 0.83464612
834
- },
835
- numLabelsAcross: 2,
836
- numLabelsDown: 7,
837
- labelWidth: 4,
838
- labelHeight: 1.3352,
839
- horizGapIn: 0.1875,
840
- vertGapIn: 0,
841
- labelPadding: 0.1,
842
- fontSizePx: 11,
843
- maxNumLabelLines: 6
844
- }
845
- },
846
- {
847
- descriptionPDF: {
848
- labelWidthDisplay: "4",
849
- labelHeightDisplay: "2",
850
- labelsPerPageDisplay: "10",
851
- averyPartNumber: "*63"
852
- },
853
- labelSpec: {
854
- type: "AVERY",
855
- pageProperties: {
856
- pageType: "ANSI A",
857
- leftMargin: 0.15625,
858
- rightMargin: 0.15625,
859
- topMargin: 0.5,
860
- bottomMargin: 0.5
861
- },
862
- numLabelsAcross: 2,
863
- numLabelsDown: 5,
864
- labelWidth: 4,
865
- labelHeight: 2,
866
- horizGapIn: 0.1875,
867
- vertGapIn: 0,
868
- labelPadding: 0.1,
869
- fontSizePx: 12,
870
- maxNumLabelLines: 10
871
- }
872
- },
873
- {
874
- descriptionPDF: {
875
- labelWidthDisplay: "4",
876
- labelHeightDisplay: "3-1/3",
877
- labelsPerPageDisplay: "6",
878
- averyPartNumber: "*64"
879
- },
880
- labelSpec: {
881
- type: "AVERY",
882
- pageProperties: {
883
- pageType: "ANSI A",
884
- leftMargin: 0.15625,
885
- rightMargin: 0.15625,
886
- topMargin: 0.4724412,
887
- bottomMargin: 0.50000027
888
- },
889
- numLabelsAcross: 2,
890
- numLabelsDown: 3,
891
- labelWidth: 4,
892
- labelHeight: 3.342,
893
- horizGapIn: 0.1875,
894
- vertGapIn: 0,
895
- labelPadding: 0.1,
896
- fontSizePx: 14,
897
- maxNumLabelLines: 12
898
- }
899
- },
900
- {
901
- descriptionPDF: {
902
- labelWidthDisplay: "1-3/4",
903
- labelHeightDisplay: "1/2",
904
- labelsPerPageDisplay: "80",
905
- averyPartNumber: "*67"
906
- },
907
- labelSpec: {
908
- type: "AVERY",
909
- pageProperties: {
910
- pageType: "ANSI A",
911
- leftMargin: 0.307086375,
912
- rightMargin: 0.307086375,
913
- topMargin: 0.4724412,
914
- bottomMargin: 0.49606326
915
- },
916
- numLabelsAcross: 4,
917
- numLabelsDown: 20,
918
- labelWidth: 1.75,
919
- labelHeight: 0.50155,
920
- horizGapIn: 0.29527575,
921
- vertGapIn: 0,
922
- labelPadding: 0.1,
923
- fontSizePx: 8,
924
- maxNumLabelLines: 3
925
- }
926
- },
927
- {
928
- descriptionPDF: {
929
- labelWidthDisplay: "1-3/4",
930
- labelHeightDisplay: "2/3",
931
- labelsPerPageDisplay: "60",
932
- averyPartNumber: "*95"
933
- },
934
- labelSpec: {
935
- type: "AVERY",
936
- pageProperties: {
937
- pageType: "ANSI A",
938
- leftMargin: 0.28936983,
939
- rightMargin: 0.28936983,
940
- topMargin: 0.53937037,
941
- bottomMargin: 0.5511814
942
- },
943
- numLabelsAcross: 4,
944
- numLabelsDown: 15,
945
- labelWidth: 1.75,
946
- labelHeight: 0.6605,
947
- horizGapIn: 0.30708678,
948
- vertGapIn: 0,
949
- labelPadding: 0.1,
950
- fontSizePx: 8,
951
- maxNumLabelLines: 4
952
- }
953
- }
954
- ];
955
-
956
- const pdfUtils = /*#__PURE__*/Object.freeze({
957
- __proto__: null,
958
- 'default': labelFormats
959
- });
58
+ }
59
+ //#endregion
960
60
 
961
61
  var _typeof_1 = createCommonjsModule(function (module) {
962
62
  function _typeof(obj) {
@@ -1980,7 +1080,7 @@ function(t){var e=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;n<e;n++
1980
1080
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1981
1081
  * ====================================================================
1982
1082
  */
1983
- function(t){function e(){return (n.canvg?Promise.resolve(n.canvg):import('./index.es-54a6f3a3.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},
1984
1084
  /** ====================================================================
1985
1085
  * @license
1986
1086
  * jsPDF XMP metadata plugin
@@ -2971,6 +2071,8 @@ class PDFLabels {
2971
2071
  * See the License for the specific language governing permissions and
2972
2072
  * limitations under the License.
2973
2073
  */
2074
+ //#endregion
2075
+ //#region Public functions
2974
2076
  /**
2975
2077
  * Exports a PDF of labels.
2976
2078
  *
@@ -2980,6 +2082,8 @@ class PDFLabels {
2980
2082
  function exportPDF(labels, labelPageDescription) {
2981
2083
  _downloadPDFFile(labels, labelPageDescription, `notify-${Date.now().toString()}`);
2982
2084
  }
2085
+ //#endregion
2086
+ //#region Private functions
2983
2087
  /**
2984
2088
  * Downloads the PDF file.
2985
2089
  *
@@ -3000,159 +2104,138 @@ function _downloadPDFFile(labels, labelPageDescription, fileTitle) {
3000
2104
  pdfLib.save();
3001
2105
  });
3002
2106
  });
3003
- }
3004
-
3005
- const pdfDownloadCss = ":host{display:block}";
2107
+ }
2108
+ //#endregion
3006
2109
 
3007
- const PdfDownload = class {
3008
- constructor(hostRef) {
3009
- registerInstance(this, hostRef);
3010
- this.disabled = false;
3011
- this.layerView = undefined;
3012
- this._translations = undefined;
3013
- }
3014
- //--------------------------------------------------------------------------
3015
- //
3016
- // Watch handlers
3017
- //
3018
- //--------------------------------------------------------------------------
3019
- //--------------------------------------------------------------------------
3020
- //
3021
- // Methods (public)
3022
- //
3023
- //--------------------------------------------------------------------------
3024
- /**
3025
- * Downloads csv of mailing labels for the provided list of ids
3026
- *
3027
- * @param ids List of ids to download
3028
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
3029
- * @param addColumnTitle Indicates if column headings should be included in output
3030
- * @returns Promise resolving when function is done
3031
- */
3032
- async downloadCSV(ids, removeDuplicates, addColumnTitle = true) {
3033
- const labels = await this._prepareLabels(ids, removeDuplicates, addColumnTitle);
3034
- return exportCSV(labels);
3035
- }
3036
- /**
3037
- * Downloads pdf of mailing labels for the provided list of ids
3038
- *
3039
- * @param ids List of ids to download
3040
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
3041
- * @returns Promise resolving when function is done
3042
- */
3043
- async downloadPDF(ids, removeDuplicates) {
3044
- const labels = await this._prepareLabels(ids, removeDuplicates);
3045
- const labelPageDescription = this._labelInfoElement.selectedOption.value;
3046
- return exportPDF(labels, labelPageDescription);
3047
- }
3048
- //--------------------------------------------------------------------------
3049
- //
3050
- // Events (public)
3051
- //
3052
- //--------------------------------------------------------------------------
3053
- //--------------------------------------------------------------------------
3054
- //
3055
- // Functions (lifecycle)
3056
- //
3057
- //--------------------------------------------------------------------------
3058
- /**
3059
- * StencilJS: Called once just after the component is first connected to the DOM.
3060
- */
3061
- async componentWillLoad() {
3062
- await this._getTranslations();
3063
- await this._initModules();
3064
- }
3065
- /**
3066
- * Renders the component.
3067
- */
3068
- render() {
3069
- return (h$1(Host, null, h$1("calcite-select", { disabled: this.disabled, label: "", ref: (el) => { this._labelInfoElement = el; } }, this._renderItems())));
3070
- }
3071
- //--------------------------------------------------------------------------
3072
- //
3073
- // Functions (protected)
3074
- //
3075
- //--------------------------------------------------------------------------
3076
- /**
3077
- * Load esri javascript api modules
3078
- *
3079
- * @returns Promise resolving when function is done
3080
- *
3081
- * @protected
3082
- */
3083
- async _initModules() {
3084
- const [intl] = await loadModules([
3085
- "esri/intl"
3086
- ]);
3087
- this._intl = intl;
3088
- }
3089
- /**
3090
- * Converts the text of a custom popup into a multiline label specification; conversion splits text into
3091
- * lines on <br>s, and removes HTML tags. It does not handle Arcade and related records.
3092
- *
3093
- * @param popupInfo Layer's popupInfo structure containing description, fieldInfos, and expressionInfos, e.g.,
3094
- * "<div style='text-align: left;'>{NAME}<br />{STREET}<br />{CITY}, {STATE} {ZIP} <br /></div>"
3095
- * @return Label spec
3096
- */
3097
- _convertPopupToLabelSpec(popupInfo) {
3098
- // Replace <br>, <br/> with |
3099
- popupInfo = popupInfo.replace(/<br\s*\/?>/gi, "|");
3100
- // Remove remaining HTML tags, replace 0xA0 that popup uses for spaces, replace some char representations,
3101
- // and split the label back into individual lines
3102
- let labelSpec = popupInfo
3103
- .replace(/<[\s.]*[^<>]*\/?>/gi, "")
3104
- .replace(/\xA0/gi, " ")
3105
- .replace(/&lt;/gi, "<")
3106
- .replace(/&gt;/gi, ">")
3107
- .replace(/&nbsp;/gi, " ")
3108
- .split("|");
3109
- // Trim lines and remove empties
3110
- labelSpec = labelSpec.map(line => line.trim()).filter(line => line.length > 0);
3111
- return labelSpec;
3112
- }
3113
- ;
3114
- /**
3115
- * Gets the formatted pdf export size text
3116
- *
3117
- * @param labelInfo current user selected label info
3118
- *
3119
- * @returns the pdf label as a string
3120
- * @protected
3121
- */
3122
- _getLabelSizeText(labelInfo) {
3123
- const lNum = labelInfo.descriptionPDF.labelsPerPageDisplay;
3124
- const lSize = `${labelInfo.descriptionPDF.labelWidthDisplay} x ${labelInfo.descriptionPDF.labelHeightDisplay}`;
3125
- return this._translations.pdfLabel.replace("{{n}}", lNum).replace("{{labelSize}}", lSize);
3126
- }
3127
- /**
3128
- * Fetches the component's translations
3129
- *
3130
- * @protected
3131
- */
3132
- async _getTranslations() {
3133
- const translations = await getLocaleComponentStrings(this.el);
3134
- this._translations = translations[0];
3135
- }
3136
- /**
3137
- * Creates labels from items.
3138
- *
3139
- * @param ids List of ids to download
3140
- * @param removeDuplicates When true a single label is generated when multiple featues have a shared address value
3141
- * @param includeHeaderNames Add the label format at the front of the list of generated labels
3142
- * @returns Promise resolving when function is done
3143
- */
3144
- async _prepareLabels(ids, removeDuplicates, includeHeaderNames = false) {
3145
- // Get the attributes of the features to export
3146
- const featureSet = await queryFeaturesByID(ids, this.layerView.layer);
3147
- 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) {
3148
2221
  // What data fields are used in the labels?
3149
2222
  // Example labelFormat: ['{NAME}', '{STREET}', '{CITY}, {STATE} {ZIP}']
3150
- 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) {
3151
2234
  // Convert attributes into an array of labels
3152
- let labels = featuresAttrs.map(featureAttributes => {
2235
+ labels = featuresAttrs.map(featureAttributes => {
3153
2236
  const label = [];
3154
2237
  labelFormat.forEach(labelLineTemplate => {
3155
- const labelLine = this._intl.substitute(labelLineTemplate, featureAttributes).trim();
2238
+ const labelLine = intl.substitute(labelLineTemplate, featureAttributes).trim();
3156
2239
  if (labelLine.length > 0) {
3157
2240
  label.push(labelLine);
3158
2241
  }
@@ -3161,294 +2244,36 @@ const PdfDownload = class {
3161
2244
  })
3162
2245
  // Remove empty labels
3163
2246
  .filter(label => label.length > 0);
3164
- // Remove duplicates
3165
- if (removeDuplicates) {
3166
- const labelsAsStrings = labels.map(label => JSON.stringify(label));
3167
- const uniqueLabels = new Set(labelsAsStrings);
3168
- labels = Array.from(uniqueLabels, labelString => JSON.parse(labelString));
3169
- }
3170
- // Add header names
3171
- if (includeHeaderNames) {
3172
- const headerNames = labelFormat.map(labelFormatLine => labelFormatLine.replace(/\{/g, "").replace(/\}/g, ""));
3173
- labels.unshift(headerNames);
3174
- }
3175
- return Promise.resolve(labels);
3176
2247
  }
3177
- /**
3178
- * Renders the pdf export size options
3179
- *
3180
- * @returns Node array of size options
3181
- *
3182
- * @protected
3183
- */
3184
- _renderItems() {
3185
- const s = pdfUtils;
3186
- const sortedPdfIndo = (s.default || s).sort((a, b) => {
3187
- const _a = parseInt(a.descriptionPDF.labelsPerPageDisplay, 10);
3188
- const _b = parseInt(b.descriptionPDF.labelsPerPageDisplay, 10);
3189
- return _a < _b ? -1 : _a > _b ? 1 : 0;
3190
- });
3191
- return sortedPdfIndo.map((l) => {
3192
- 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}`);
3193
2252
  });
3194
2253
  }
3195
- get el() { return getElement(this); }
3196
- };
3197
- PdfDownload.style = pdfDownloadCss;
3198
-
3199
- const refineSelectionCss = ":host{display:block}";
3200
-
3201
- const RefineSelection = class {
3202
- constructor(hostRef) {
3203
- registerInstance(this, hostRef);
3204
- this.selectionSetsChanged = createEvent(this, "selectionSetsChanged", 7);
3205
- //--------------------------------------------------------------------------
3206
- //
3207
- // Properties (protected)
3208
- //
3209
- //--------------------------------------------------------------------------
3210
- /**
3211
- * boolean: Indicates if any new graphics should be added or removed
3212
- */
3213
- this._addEnabled = true;
3214
- this.addresseeLayer = undefined;
3215
- this.enabledLayerIds = [];
3216
- this.mapView = undefined;
3217
- this.selectionSets = [];
3218
- this.GraphicsLayer = undefined;
3219
- this.SketchViewModel = undefined;
3220
- this._translations = undefined;
3221
- }
3222
- //--------------------------------------------------------------------------
3223
- //
3224
- // Watch handlers
3225
- //
3226
- //--------------------------------------------------------------------------
3227
- /**
3228
- * Called each time the addresseeLayer is changed.
3229
- * Add a new clean refine set for the new addressee layer.
3230
- */
3231
- addresseeLayerWatchHandler() {
3232
- const selectionSets = this.selectionSets.filter(ss => ss.workflowType !== EWorkflowType.REFINE);
3233
- 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));
3234
2259
  }
3235
- /**
3236
- * Handles changes to refine selection ids.
3237
- *
3238
- */
3239
- refineSelectionIdsChange(event) {
3240
- var _a, _b;
3241
- const addIds = ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.addIds) || [];
3242
- const removeIds = ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.removeIds) || [];
3243
- this._updateSelectionSets(removeIds);
3244
- this._updateRefineSelectionSet(addIds, removeIds);
3245
- }
3246
- //--------------------------------------------------------------------------
3247
- //
3248
- // Functions (lifecycle)
3249
- //
3250
- //--------------------------------------------------------------------------
3251
- /**
3252
- * StencilJS: Called once just after the component is first connected to the DOM.
3253
- */
3254
- async componentWillLoad() {
3255
- await this._getTranslations();
3256
- const refineSet = this._getRefineSelectionSet(this.selectionSets);
3257
- if (!refineSet) {
3258
- 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, ""));
3259
2265
  }
3260
- }
3261
- /**
3262
- * Renders the component.
3263
- */
3264
- render() {
3265
- 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())))));
3266
- }
3267
- //--------------------------------------------------------------------------
3268
- //
3269
- // Functions (protected)
3270
- //
3271
- //--------------------------------------------------------------------------
3272
- /**
3273
- * Store the Add/Remove mode
3274
- *
3275
- * @protected
3276
- */
3277
- _modeChanged(evt) {
3278
- this._addEnabled = evt.detail === ESelectionMode.ADD;
3279
- }
3280
- /**
3281
- * Set the refine tools selection mode
3282
- *
3283
- * @protected
3284
- */
3285
- _setSelectionMode(mode) {
3286
- this._refineTools.mode = mode;
3287
- }
3288
- /**
3289
- * Create a list to show the number added/removed/total unique selected
3290
- *
3291
- * @returns the list node
3292
- * @protected
3293
- */
3294
- _getRefineSelectionSetList() {
3295
- const total = getTotal(this.selectionSets);
3296
- const refineSet = this._getRefineSelectionSet(this.selectionSets);
3297
- const numAdded = (refineSet === null || refineSet === void 0 ? void 0 : refineSet.refineIds.addIds.length) || 0;
3298
- const numRemoved = (refineSet === null || refineSet === void 0 ? void 0 : refineSet.refineIds.removeIds.length) || 0;
3299
- 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()) }))];
3300
- }
3301
- /**
3302
- * Fetch the refine selection set
3303
- *
3304
- * @returns the refine selection set
3305
- * @protected
3306
- */
3307
- _getRefineSelectionSet(selectionSets) {
3308
- let refineSelectionSet;
3309
- selectionSets.some(ss => {
3310
- if (ss.workflowType === EWorkflowType.REFINE) {
3311
- refineSelectionSet = ss;
3312
- return true;
3313
- }
3314
- });
3315
- return refineSelectionSet;
3316
- }
3317
- /**
3318
- * Remove ids from existing selection sets.
3319
- * Remove any selection sets than have no selected ids
3320
- * This can update any selection set not just the refine set.
3321
- * We do not do something similar for adds as we will only ever add from refine tools to the single REFINE selection set.
3322
- *
3323
- * @param removeIds the ids to remove
3324
- *
3325
- * @protected
3326
- */
3327
- _updateSelectionSets(removeIds) {
3328
- if (removeIds.length > 0) {
3329
- this.selectionSets = this.selectionSets.reduce((prev, cur) => {
3330
- cur.selectedIds = cur.selectedIds.filter(id => removeIds.indexOf(id) < 0);
3331
- if (cur.selectedIds.length > 0 || cur.workflowType === EWorkflowType.REFINE) {
3332
- prev.push(cur);
2266
+ else {
2267
+ Object.keys(featuresAttrs[0]).forEach(k => {
2268
+ if (featuresAttrs[0].hasOwnProperty(k)) {
2269
+ headerNames.push(k);
3333
2270
  }
3334
- return prev;
3335
- }, []);
3336
- this.selectionSetsChanged.emit(this.selectionSets);
3337
- }
3338
- }
3339
- /**
3340
- * Update the refine selection set with any adds or removes
3341
- *
3342
- * @param addIds any ids to add
3343
- * @param removeIds any ids to remove
3344
- *
3345
- * @returns Promise resolving when function is done
3346
- * @protected
3347
- */
3348
- _updateRefineSelectionSet(addIds, removeIds) {
3349
- const selectionSet = this._getRefineSelectionSet(this.selectionSets);
3350
- this._updateRefineIds(selectionSet, addIds, removeIds);
3351
- this.selectionSetsChanged.emit(this.selectionSets);
3352
- }
3353
- /**
3354
- * Update the ids stored for the refine selection set
3355
- *
3356
- * @param selectionSet the refine selection set
3357
- * @param addIds any ids to add
3358
- * @param removeIds any ids to remove
3359
- *
3360
- * @returns updated selection sets
3361
- * @protected
3362
- */
3363
- _updateRefineIds(selectionSet, addIds, removeIds) {
3364
- // remove ids if they exist in the current add or remove list
3365
- selectionSet.refineIds.addIds = selectionSet.refineIds.addIds.filter(id => removeIds.indexOf(id) < 0);
3366
- selectionSet.refineIds.removeIds = selectionSet.refineIds.removeIds.filter(id => addIds.indexOf(id) < 0);
3367
- const _addIds = [...new Set(selectionSet.refineIds.addIds.concat(addIds))];
3368
- const _removeIds = [...new Set(selectionSet.refineIds.removeIds.concat(removeIds))];
3369
- selectionSet.refineIds = {
3370
- addIds: _addIds.filter(id => _removeIds.indexOf(id) < 0),
3371
- removeIds: _removeIds.filter(id => _addIds.indexOf(id) < 0)
3372
- };
3373
- selectionSet.selectedIds = selectionSet.refineIds.addIds.length > 0 ?
3374
- [...new Set(selectionSet.selectedIds.concat(selectionSet.refineIds.addIds))] :
3375
- selectionSet.selectedIds.filter(id => selectionSet.refineIds.removeIds.indexOf(id) < 0);
3376
- return this.selectionSets.map(ss => {
3377
- return ss.workflowType === EWorkflowType.REFINE ? selectionSet : ss;
3378
- });
3379
- }
3380
- /**
3381
- * Add a new refine selection set
3382
- *
3383
- * @returns updated selection sets
3384
- * @protected
3385
- */
3386
- _initRefineSelectionSet(selectionSets) {
3387
- return [
3388
- ...selectionSets,
3389
- ({
3390
- buffer: undefined,
3391
- distance: 0,
3392
- download: true,
3393
- geometries: [],
3394
- id: Date.now(),
3395
- label: "Refine",
3396
- layerView: this.addresseeLayer,
3397
- refineSelectLayers: [],
3398
- searchResult: undefined,
3399
- selectedIds: [],
3400
- unit: "feet",
3401
- workflowType: EWorkflowType.REFINE,
3402
- refineIds: {
3403
- addIds: [],
3404
- removeIds: []
3405
- },
3406
- redoStack: [],
3407
- undoStack: []
3408
- })
3409
- ];
3410
- }
3411
- /**
3412
- * Fetches the component's translations
3413
- *
3414
- * @protected
3415
- */
3416
- async _getTranslations() {
3417
- const translations = await getLocaleComponentStrings(this.el);
3418
- this._translations = translations[0];
3419
- }
3420
- /** Provides access to protected methods for unit testing.
3421
- *
3422
- * @param methodName Name of protected method to run
3423
- * @param arg1 First argument to forward to method, e.g., for "_modeChanged", `ESelectionMode`
3424
- * @returns
3425
- */
3426
- _testAccess(methodName, arg1) {
3427
- switch (methodName) {
3428
- case "_modeChanged":
3429
- return this._modeChanged(arg1);
3430
- case "_setSelectionMode":
3431
- return this._setSelectionMode(arg1);
3432
- // case "_getRefineSelectionSetList":
3433
- // return this._getRefineSelectionSetList();
3434
- // case "_getRefineSelectionSet":
3435
- // return this._getRefineSelectionSet(arg1);
3436
- // case "_updateSelectionSets":
3437
- // return this._updateSelectionSets(arg1);
3438
- // case "_updateRefineSelectionSet":
3439
- // return this._updateRefineSelectionSet(arg1, arg2);
3440
- // case "_updateRefineIds":
3441
- // return this._updateRefineIds(arg1, arg2, arg3);
3442
- // case "_addRefineSelectionSet":
3443
- // return this._addRefineSelectionSet(arg1, arg2);
2271
+ });
3444
2272
  }
3445
- return null;
2273
+ labels.unshift(headerNames);
3446
2274
  }
3447
- get el() { return getElement(this); }
3448
- static get watchers() { return {
3449
- "addresseeLayer": ["addresseeLayerWatchHandler"]
3450
- }; }
3451
- };
3452
- RefineSelection.style = refineSelectionCss;
2275
+ return Promise.resolve(labels);
2276
+ }
2277
+ //#endregion
3453
2278
 
3454
- 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 };