@esri/solutions-components 0.6.6 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. package/dist/cjs/basemap-gallery_4.cjs.entry.js +622 -0
  2. package/dist/cjs/card-manager_4.cjs.entry.js +91 -37
  3. package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -2
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/solutions-components.cjs.js +2 -2
  6. package/dist/collection/collection-manifest.json +3 -1
  7. package/dist/collection/components/basemap-gallery/basemap-gallery.css +19 -0
  8. package/dist/collection/components/basemap-gallery/basemap-gallery.js +166 -0
  9. package/dist/collection/components/basemap-gallery/test/basemap-gallery.e2e.js +29 -0
  10. package/dist/collection/components/basemap-gallery/test/basemap-gallery.spec.js +37 -0
  11. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +43 -2
  12. package/dist/collection/components/layer-table/layer-table.js +99 -30
  13. package/dist/collection/components/map-card/map-card.css +0 -7
  14. package/dist/collection/components/map-card/map-card.js +12 -7
  15. package/dist/collection/components/map-search/map-search.css +24 -0
  16. package/dist/collection/components/map-search/map-search.js +321 -0
  17. package/dist/collection/components/map-search/test/map-search.e2e.js +29 -0
  18. package/dist/collection/components/map-search/test/map-search.spec.js +37 -0
  19. package/dist/collection/components/map-tools/map-tools.js +139 -14
  20. package/dist/collection/demos/crowdsource-manager.html +3 -3
  21. package/dist/collection/utils/interfaces.ts +2 -0
  22. package/dist/components/action-bar.js +1 -0
  23. package/dist/components/action-group.js +1 -0
  24. package/dist/components/action-menu.js +1 -0
  25. package/dist/components/action.js +1 -0
  26. package/dist/components/alert.js +1 -0
  27. package/dist/components/avatar.js +1 -0
  28. package/dist/components/basemap-gallery.d.ts +11 -0
  29. package/dist/components/basemap-gallery.js +11 -0
  30. package/dist/components/basemap-gallery2.js +118 -0
  31. package/dist/components/buffer-tools2.js +1 -0
  32. package/dist/components/button.js +1 -0
  33. package/dist/components/calcite-accordion-item.js +1 -0
  34. package/dist/components/calcite-accordion.js +1 -0
  35. package/dist/components/calcite-action-pad.js +1 -0
  36. package/dist/components/calcite-block-section.js +1 -0
  37. package/dist/components/calcite-block.js +1 -0
  38. package/dist/components/calcite-card.js +1 -0
  39. package/dist/components/calcite-chip-group.js +1 -0
  40. package/dist/components/calcite-color-picker.js +1 -0
  41. package/dist/components/calcite-combobox-item-group.js +1 -0
  42. package/dist/components/calcite-fab.js +1 -0
  43. package/dist/components/calcite-flow-item.js +1 -0
  44. package/dist/components/calcite-flow.js +1 -0
  45. package/dist/components/calcite-inline-editable.js +1 -0
  46. package/dist/components/calcite-input-date-picker.js +1 -0
  47. package/dist/components/calcite-input-time-picker.js +1 -0
  48. package/dist/components/calcite-input-time-zone.js +1 -0
  49. package/dist/components/calcite-list-item-group.js +1 -0
  50. package/dist/components/calcite-menu-item.js +1 -0
  51. package/dist/components/calcite-modal.js +1 -0
  52. package/dist/components/calcite-navigation-logo.js +1 -0
  53. package/dist/components/calcite-navigation-user.js +1 -0
  54. package/dist/components/calcite-navigation.js +1 -0
  55. package/dist/components/calcite-option-group.js +1 -0
  56. package/dist/components/calcite-pagination.js +1 -0
  57. package/dist/components/calcite-pick-list-group.js +1 -0
  58. package/dist/components/calcite-pick-list.js +1 -0
  59. package/dist/components/calcite-radio-button-group.js +1 -0
  60. package/dist/components/calcite-radio-button.js +1 -0
  61. package/dist/components/calcite-rating.js +1 -0
  62. package/dist/components/calcite-shell-center-row.js +1 -0
  63. package/dist/components/calcite-sortable-list.js +1 -0
  64. package/dist/components/calcite-split-button.js +1 -0
  65. package/dist/components/calcite-stepper-item.js +1 -0
  66. package/dist/components/calcite-stepper.js +1 -0
  67. package/dist/components/calcite-text-area.js +1 -0
  68. package/dist/components/calcite-tile-select-group.js +1 -0
  69. package/dist/components/calcite-tile-select.js +1 -0
  70. package/dist/components/calcite-tip-group.js +1 -0
  71. package/dist/components/calcite-tip-manager.js +1 -0
  72. package/dist/components/calcite-tip.js +1 -0
  73. package/dist/components/card-manager2.js +1 -0
  74. package/dist/components/checkbox.js +1 -0
  75. package/dist/components/chip.js +1 -0
  76. package/dist/components/color-picker-hex-input.js +1 -0
  77. package/dist/components/color-picker-swatch.js +1 -0
  78. package/dist/components/combobox-item.js +1 -0
  79. package/dist/components/combobox.js +1 -0
  80. package/dist/components/crowdsource-manager.js +95 -78
  81. package/dist/components/crowdsource-reporter.js +1 -0
  82. package/dist/components/date-picker-day.js +1 -0
  83. package/dist/components/date-picker-month-header.js +1 -0
  84. package/dist/components/date-picker-month.js +1 -0
  85. package/dist/components/date-picker.js +1 -0
  86. package/dist/components/deduct-calculator2.js +1 -0
  87. package/dist/components/dropdown-group.js +1 -0
  88. package/dist/components/dropdown-item.js +1 -0
  89. package/dist/components/dropdown.js +1 -0
  90. package/dist/components/edit-card2.js +1 -0
  91. package/dist/components/esri-loader.js +301 -0
  92. package/dist/components/filter2.js +1 -0
  93. package/dist/components/graph.js +1 -0
  94. package/dist/components/handle.js +1 -0
  95. package/dist/components/icon.js +1 -0
  96. package/dist/components/index.d.ts +6 -0
  97. package/dist/components/index.js +1 -1
  98. package/dist/components/info-card2.js +1 -0
  99. package/dist/components/input-message.js +1 -0
  100. package/dist/components/input-number.js +1 -0
  101. package/dist/components/input-text.js +1 -0
  102. package/dist/components/input.js +1 -0
  103. package/dist/components/json-editor2.js +1 -0
  104. package/dist/components/label2.js +1 -0
  105. package/dist/components/layer-table2.js +83 -31
  106. package/dist/components/layout-manager2.js +1 -0
  107. package/dist/components/link.js +1 -0
  108. package/dist/components/list-item.js +1 -0
  109. package/dist/components/list-item2.js +1 -0
  110. package/dist/components/list.js +1 -0
  111. package/dist/components/loadModules.js +1 -1
  112. package/dist/components/loader.js +1 -0
  113. package/dist/components/locale.js +2 -295
  114. package/dist/components/map-card2.js +61 -42
  115. package/dist/components/map-draw-tools2.js +1 -0
  116. package/dist/components/map-layer-picker2.js +1 -0
  117. package/dist/components/map-picker2.js +1 -0
  118. package/dist/components/map-search.d.ts +11 -0
  119. package/dist/components/map-search.js +11 -0
  120. package/dist/components/map-search2.js +201 -0
  121. package/dist/components/map-select-tools2.js +1 -0
  122. package/dist/components/map-tools2.js +141 -30
  123. package/dist/components/menu.js +1 -0
  124. package/dist/components/notice.js +1 -0
  125. package/dist/components/option.js +1 -0
  126. package/dist/components/panel.js +1 -0
  127. package/dist/components/pci-calculator.js +1 -0
  128. package/dist/components/pdf-download2.js +1 -0
  129. package/dist/components/pick-list-item.js +1 -0
  130. package/dist/components/popover.js +1 -0
  131. package/dist/components/progress.js +1 -0
  132. package/dist/components/public-notification.js +1 -0
  133. package/dist/components/refine-selection2.js +1 -0
  134. package/dist/components/scrim.js +1 -0
  135. package/dist/components/segmented-control-item.js +1 -0
  136. package/dist/components/segmented-control.js +1 -0
  137. package/dist/components/select.js +1 -0
  138. package/dist/components/shell-panel.js +1 -0
  139. package/dist/components/shell.js +1 -0
  140. package/dist/components/slider.js +1 -0
  141. package/dist/components/solution-configuration.js +1 -0
  142. package/dist/components/solution-contents2.js +1 -0
  143. package/dist/components/solution-item-details2.js +1 -0
  144. package/dist/components/solution-item-icon2.js +1 -0
  145. package/dist/components/solution-item-sharing2.js +1 -0
  146. package/dist/components/solution-item2.js +1 -0
  147. package/dist/components/solution-organization-variables2.js +1 -0
  148. package/dist/components/solution-resource-item2.js +1 -0
  149. package/dist/components/solution-spatial-ref2.js +1 -0
  150. package/dist/components/solution-template-data2.js +1 -0
  151. package/dist/components/solution-variables2.js +1 -0
  152. package/dist/components/stack.js +1 -0
  153. package/dist/components/store-manager.js +1 -0
  154. package/dist/components/switch.js +1 -0
  155. package/dist/components/tab-nav.js +1 -0
  156. package/dist/components/tab-title.js +1 -0
  157. package/dist/components/tab.js +1 -0
  158. package/dist/components/tabs.js +1 -0
  159. package/dist/components/tile.js +1 -0
  160. package/dist/components/time-picker.js +1 -0
  161. package/dist/components/tooltip.js +1 -0
  162. package/dist/components/tree-item.js +1 -0
  163. package/dist/components/tree.js +1 -0
  164. package/dist/components/value-list-item.js +1 -0
  165. package/dist/components/value-list.js +1 -0
  166. package/dist/esm/basemap-gallery_4.entry.js +615 -0
  167. package/dist/esm/card-manager_4.entry.js +91 -37
  168. package/dist/esm/crowdsource-manager.entry.js +4 -2
  169. package/dist/esm/loader.js +1 -1
  170. package/dist/esm/polyfills/core-js.js +11 -0
  171. package/dist/esm/polyfills/dom.js +79 -0
  172. package/dist/esm/polyfills/es5-html-element.js +1 -0
  173. package/dist/esm/polyfills/index.js +34 -0
  174. package/dist/esm/polyfills/system.js +6 -0
  175. package/dist/esm/solutions-components.js +2 -2
  176. package/dist/solutions-components/demos/crowdsource-manager.html +3 -3
  177. package/dist/solutions-components/p-55aefaa8.entry.js +6 -0
  178. package/dist/solutions-components/p-5b5a6ac8.entry.js +6 -0
  179. package/dist/solutions-components/p-a6c85bd7.entry.js +6 -0
  180. package/dist/solutions-components/solutions-components.esm.js +1 -1
  181. package/dist/solutions-components/utils/interfaces.ts +2 -0
  182. package/dist/types/components/basemap-gallery/basemap-gallery.d.ts +64 -0
  183. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +9 -1
  184. package/dist/types/components/layer-table/layer-table.d.ts +24 -2
  185. package/dist/types/components/map-card/map-card.d.ts +10 -2
  186. package/dist/types/components/map-search/map-search.d.ts +107 -0
  187. package/dist/types/components/map-tools/map-tools.d.ts +68 -5
  188. package/dist/types/components.d.ts +122 -0
  189. package/dist/types/preact.d.ts +4 -0
  190. package/dist/types/stencil-public-runtime.d.ts +2 -0
  191. package/dist/types/utils/interfaces.d.ts +2 -0
  192. package/package.json +1 -1
  193. package/dist/cjs/map-picker_2.cjs.entry.js +0 -264
  194. package/dist/esm/map-picker_2.entry.js +0 -259
  195. package/dist/solutions-components/p-1990d9c8.entry.js +0 -6
  196. package/dist/solutions-components/p-40bde8b2.entry.js +0 -6
  197. package/dist/solutions-components/p-b921aa1a.entry.js +0 -6
@@ -0,0 +1,301 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
7
+
8
+ var esriLoader = createCommonjsModule(function (module, exports) {
9
+ (function (global, factory) {
10
+ factory(exports) ;
11
+ }(commonjsGlobal, (function (exports) {
12
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
13
+ * Apache-2.0 */
14
+ var isBrowser = typeof window !== 'undefined';
15
+ // allow consuming libraries to provide their own Promise implementations
16
+ var utils = {
17
+ Promise: isBrowser ? window['Promise'] : undefined
18
+ };
19
+
20
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
21
+ * Apache-2.0 */
22
+ var DEFAULT_VERSION = '4.22';
23
+ var NEXT = 'next';
24
+ function parseVersion(version) {
25
+ if (version.toLowerCase() === NEXT) {
26
+ return NEXT;
27
+ }
28
+ var match = version && version.match(/^(\d)\.(\d+)/);
29
+ return match && {
30
+ major: parseInt(match[1], 10),
31
+ minor: parseInt(match[2], 10)
32
+ };
33
+ }
34
+ /**
35
+ * Get the CDN url for a given version
36
+ *
37
+ * @param version Ex: '4.22' or '3.39'. Defaults to the latest 4.x version.
38
+ */
39
+ function getCdnUrl(version) {
40
+ if (version === void 0) { version = DEFAULT_VERSION; }
41
+ return "https://js.arcgis.com/" + version + "/";
42
+ }
43
+ /**
44
+ * Get the CDN url for a the CSS for a given version and/or theme
45
+ *
46
+ * @param version Ex: '4.22', '3.39', or 'next'. Defaults to the latest 4.x version.
47
+ */
48
+ function getCdnCssUrl(version) {
49
+ if (version === void 0) { version = DEFAULT_VERSION; }
50
+ var baseUrl = getCdnUrl(version);
51
+ var parsedVersion = parseVersion(version);
52
+ if (parsedVersion !== NEXT && parsedVersion.major === 3) {
53
+ // NOTE: at 3.11 the CSS moved from the /js folder to the root
54
+ var path = parsedVersion.minor <= 10 ? 'js/' : '';
55
+ return "" + baseUrl + path + "esri/css/esri.css";
56
+ }
57
+ else {
58
+ // assume 4.x
59
+ return baseUrl + "esri/themes/light/main.css";
60
+ }
61
+ }
62
+
63
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
64
+ * Apache-2.0 */
65
+ function createStylesheetLink(href) {
66
+ var link = document.createElement('link');
67
+ link.rel = 'stylesheet';
68
+ link.href = href;
69
+ return link;
70
+ }
71
+ function insertLink(link, before) {
72
+ if (before) {
73
+ // the link should be inserted before a specific node
74
+ var beforeNode = document.querySelector(before);
75
+ beforeNode.parentNode.insertBefore(link, beforeNode);
76
+ }
77
+ else {
78
+ // append the link to then end of the head tag
79
+ document.head.appendChild(link);
80
+ }
81
+ }
82
+ // check if the css url has been injected or added manually
83
+ function getCss(url) {
84
+ return document.querySelector("link[href*=\"" + url + "\"]");
85
+ }
86
+ function getCssUrl(urlOrVersion) {
87
+ return !urlOrVersion || parseVersion(urlOrVersion)
88
+ // if it's a valid version string return the CDN URL
89
+ ? getCdnCssUrl(urlOrVersion)
90
+ // otherwise assume it's a URL and return that
91
+ : urlOrVersion;
92
+ }
93
+ // lazy load the CSS needed for the ArcGIS API
94
+ function loadCss(urlOrVersion, before) {
95
+ var url = getCssUrl(urlOrVersion);
96
+ var link = getCss(url);
97
+ if (!link) {
98
+ // create & load the css link
99
+ link = createStylesheetLink(url);
100
+ insertLink(link, before);
101
+ }
102
+ return link;
103
+ }
104
+
105
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
106
+ * Apache-2.0 */
107
+ var defaultOptions = {};
108
+ function createScript(url) {
109
+ var script = document.createElement('script');
110
+ script.type = 'text/javascript';
111
+ script.src = url;
112
+ script.setAttribute('data-esri-loader', 'loading');
113
+ return script;
114
+ }
115
+ // add a one-time load handler to script
116
+ // and optionally add a one time error handler as well
117
+ function handleScriptLoad(script, callback, errback) {
118
+ var onScriptError;
119
+ if (errback) {
120
+ // set up an error handler as well
121
+ onScriptError = handleScriptError(script, errback);
122
+ }
123
+ var onScriptLoad = function () {
124
+ // pass the script to the callback
125
+ callback(script);
126
+ // remove this event listener
127
+ script.removeEventListener('load', onScriptLoad, false);
128
+ if (onScriptError) {
129
+ // remove the error listener as well
130
+ script.removeEventListener('error', onScriptError, false);
131
+ }
132
+ };
133
+ script.addEventListener('load', onScriptLoad, false);
134
+ }
135
+ // add a one-time error handler to the script
136
+ function handleScriptError(script, callback) {
137
+ var onScriptError = function (e) {
138
+ // reject the promise and remove this event listener
139
+ callback(e.error || new Error("There was an error attempting to load " + script.src));
140
+ // remove this event listener
141
+ script.removeEventListener('error', onScriptError, false);
142
+ };
143
+ script.addEventListener('error', onScriptError, false);
144
+ return onScriptError;
145
+ }
146
+ // allow the user to configure default script options rather than passing options to `loadModules` each time
147
+ function setDefaultOptions(options) {
148
+ if (options === void 0) { options = {}; }
149
+ defaultOptions = options;
150
+ }
151
+ // get the script injected by this library
152
+ function getScript() {
153
+ return document.querySelector('script[data-esri-loader]');
154
+ }
155
+ // has ArcGIS API been loaded on the page yet?
156
+ function isLoaded() {
157
+ var globalRequire = window['require'];
158
+ // .on() ensures that it's Dojo's AMD loader
159
+ return globalRequire && globalRequire.on;
160
+ }
161
+ // load the ArcGIS API on the page
162
+ function loadScript(options) {
163
+ if (options === void 0) { options = {}; }
164
+ // we would have liked to use spread like { ...defaultOptions, ...options }
165
+ // but TS would inject a polyfill that would require use to configure rollup w content: 'window'
166
+ // if we have another occasion to use spread, let's do that and replace this for...in
167
+ var opts = {};
168
+ [defaultOptions, options].forEach(function (obj) {
169
+ for (var prop in obj) {
170
+ if (Object.prototype.hasOwnProperty.call(obj, prop)) {
171
+ opts[prop] = obj[prop];
172
+ }
173
+ }
174
+ });
175
+ // URL to load
176
+ var version = opts.version;
177
+ var url = opts.url || getCdnUrl(version);
178
+ return new utils.Promise(function (resolve, reject) {
179
+ var script = getScript();
180
+ if (script) {
181
+ // the API is already loaded or in the process of loading...
182
+ // NOTE: have to test against scr attribute value, not script.src
183
+ // b/c the latter will return the full url for relative paths
184
+ var src = script.getAttribute('src');
185
+ if (src !== url) {
186
+ // potentially trying to load a different version of the API
187
+ reject(new Error("The ArcGIS API for JavaScript is already loaded (" + src + ")."));
188
+ }
189
+ else {
190
+ if (isLoaded()) {
191
+ // the script has already successfully loaded
192
+ resolve(script);
193
+ }
194
+ else {
195
+ // wait for the script to load and then resolve
196
+ handleScriptLoad(script, resolve, reject);
197
+ }
198
+ }
199
+ }
200
+ else {
201
+ if (isLoaded()) {
202
+ // the API has been loaded by some other means
203
+ // potentially trying to load a different version of the API
204
+ reject(new Error("The ArcGIS API for JavaScript is already loaded."));
205
+ }
206
+ else {
207
+ // this is the first time attempting to load the API
208
+ var css = opts.css;
209
+ if (css) {
210
+ var useVersion = css === true;
211
+ // load the css before loading the script
212
+ loadCss(useVersion ? version : css, opts.insertCssBefore);
213
+ }
214
+ // create a script object whose source points to the API
215
+ script = createScript(url);
216
+ // _currentUrl = url;
217
+ // once the script is loaded...
218
+ handleScriptLoad(script, function () {
219
+ // update the status of the script
220
+ script.setAttribute('data-esri-loader', 'loaded');
221
+ // return the script
222
+ resolve(script);
223
+ }, reject);
224
+ // load the script
225
+ document.body.appendChild(script);
226
+ }
227
+ }
228
+ });
229
+ }
230
+
231
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
232
+ * Apache-2.0 */
233
+ // wrap Dojo's require() in a promise
234
+ function requireModules(modules) {
235
+ return new utils.Promise(function (resolve, reject) {
236
+ // If something goes wrong loading the esri/dojo scripts, reject with the error.
237
+ var errorHandler = window['require'].on('error', reject);
238
+ window['require'](modules, function () {
239
+ var args = [];
240
+ for (var _i = 0; _i < arguments.length; _i++) {
241
+ args[_i] = arguments[_i];
242
+ }
243
+ // remove error handler
244
+ errorHandler.remove();
245
+ // Resolve with the parameters from dojo require as an array.
246
+ resolve(args);
247
+ });
248
+ });
249
+ }
250
+ // returns a promise that resolves with an array of the required modules
251
+ // also will attempt to lazy load the ArcGIS API if it has not already been loaded
252
+ function loadModules(modules, loadScriptOptions) {
253
+ if (loadScriptOptions === void 0) { loadScriptOptions = {}; }
254
+ if (!isLoaded()) {
255
+ // script is not yet loaded, is it in the process of loading?
256
+ var script = getScript();
257
+ var src = script && script.getAttribute('src');
258
+ if (!loadScriptOptions.url && src) {
259
+ // script is still loading and user did not specify a URL
260
+ // in this case we want to default to the URL that's being loaded
261
+ // instead of defaulting to the latest 4.x URL
262
+ loadScriptOptions.url = src;
263
+ }
264
+ // attempt to load the script then load the modules
265
+ return loadScript(loadScriptOptions).then(function () { return requireModules(modules); });
266
+ }
267
+ else {
268
+ // script is already loaded, just load the modules
269
+ return requireModules(modules);
270
+ }
271
+ }
272
+
273
+ /*
274
+ Copyright (c) 2017 Esri
275
+ Licensed under the Apache License, Version 2.0 (the "License");
276
+ you may not use this file except in compliance with the License.
277
+ You may obtain a copy of the License at
278
+ http://www.apache.org/licenses/LICENSE-2.0
279
+ Unless required by applicable law or agreed to in writing, software
280
+ distributed under the License is distributed on an "AS IS" BASIS,
281
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
282
+ See the License for the specific language governing permissions and
283
+ limitations under the License.
284
+ */
285
+ // re-export the functions that are part of the public API
286
+
287
+ exports.utils = utils;
288
+ exports.loadModules = loadModules;
289
+ exports.getScript = getScript;
290
+ exports.isLoaded = isLoaded;
291
+ exports.loadScript = loadScript;
292
+ exports.setDefaultOptions = setDefaultOptions;
293
+ exports.loadCss = loadCss;
294
+
295
+ Object.defineProperty(exports, '__esModule', { value: true });
296
+
297
+ })));
298
+ //# sourceMappingURL=esri-loader.js.map
299
+ });
300
+
301
+ export { esriLoader as e };
@@ -209,5 +209,6 @@ function defineCustomElement() {
209
209
  break;
210
210
  } });
211
211
  }
212
+ defineCustomElement();
212
213
 
213
214
  export { Filter as F, defineCustomElement as d };
@@ -245,5 +245,6 @@ function defineCustomElement() {
245
245
  break;
246
246
  } });
247
247
  }
248
+ defineCustomElement();
248
249
 
249
250
  export { Graph as G, defineCustomElement as d };
@@ -190,5 +190,6 @@ function defineCustomElement() {
190
190
  break;
191
191
  } });
192
192
  }
193
+ defineCustomElement();
193
194
 
194
195
  export { Handle as H, defineCustomElement as d };
@@ -190,5 +190,6 @@ function defineCustomElement() {
190
190
  break;
191
191
  } });
192
192
  }
193
+ defineCustomElement();
193
194
 
194
195
  export { Icon as I, defineCustomElement as d };
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Get the base path to where the assets can be found. Use "setAssetPath(path)"
3
+ * if the path needs to be customized.
4
+ */
5
+ export declare const getAssetPath: (path: string) => string;
6
+
1
7
  /**
2
8
  * Used to manually set the base path where assets can be found.
3
9
  * If the script is used as "module", it's recommended to use "import.meta.url",
@@ -4,7 +4,7 @@
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
6
  import { d as darkMode, a as autoMode } from './resources.js';
7
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
7
+ export { getAssetPath, setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
8
8
 
9
9
  /*!
10
10
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
@@ -269,5 +269,6 @@ function defineCustomElement() {
269
269
  break;
270
270
  } });
271
271
  }
272
+ defineCustomElement();
272
273
 
273
274
  export { InfoCard as I, defineCustomElement as d };
@@ -86,5 +86,6 @@ function defineCustomElement() {
86
86
  break;
87
87
  } });
88
88
  }
89
+ defineCustomElement();
89
90
 
90
91
  export { InputMessage as I, defineCustomElement as d };
@@ -640,5 +640,6 @@ function defineCustomElement() {
640
640
  break;
641
641
  } });
642
642
  }
643
+ defineCustomElement();
643
644
 
644
645
  export { InputNumber as I, defineCustomElement as d };
@@ -405,5 +405,6 @@ function defineCustomElement() {
405
405
  break;
406
406
  } });
407
407
  }
408
+ defineCustomElement();
408
409
 
409
410
  export { InputText as I, defineCustomElement as d };
@@ -735,5 +735,6 @@ function defineCustomElement() {
735
735
  break;
736
736
  } });
737
737
  }
738
+ defineCustomElement();
738
739
 
739
740
  export { Input as I, defineCustomElement as d };
@@ -436,5 +436,6 @@ function defineCustomElement() {
436
436
  break;
437
437
  } });
438
438
  }
439
+ defineCustomElement();
439
440
 
440
441
  export { JsonEditor as J, defineCustomElement as d };
@@ -73,5 +73,6 @@ function defineCustomElement() {
73
73
  break;
74
74
  } });
75
75
  }
76
+ defineCustomElement();
76
77
 
77
78
  export { Label as L, defineCustomElement as d };
@@ -44,6 +44,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
44
44
  * number[]: A list of all IDs for the current layer
45
45
  */
46
46
  this._allIds = [];
47
+ /**
48
+ * bool: When true the table is being sorted
49
+ */
50
+ this._tableSorting = false;
47
51
  /**
48
52
  * Store a reference to the table node after it's first created
49
53
  * and initializes the FeatureTable
@@ -54,15 +58,16 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
54
58
  */
55
59
  this.onTableNodeCreate = (node) => {
56
60
  this._tableNode = node;
57
- this._getTable(node);
58
61
  };
59
62
  this.mapView = undefined;
63
+ this.showNewestFirst = undefined;
60
64
  this.zoomAndScrollToSelected = undefined;
61
65
  this._alertOpen = false;
62
66
  this._fetchingData = false;
63
67
  this._layer = undefined;
64
68
  this._selectedIndexes = [];
65
69
  this._showOnlySelected = false;
70
+ this._sortActive = false;
66
71
  this._translations = undefined;
67
72
  }
68
73
  //--------------------------------------------------------------------------
@@ -77,7 +82,6 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
77
82
  this._fetchingData = true;
78
83
  const mapLayerIds = await getMapLayerIds(this.mapView);
79
84
  this._layer = await getLayer(this.mapView, mapLayerIds[0]);
80
- this._resetTable();
81
85
  this.reactiveUtils.on(() => this.mapView, "click", (event) => {
82
86
  void this._mapClicked(event);
83
87
  });
@@ -88,9 +92,17 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
88
92
  */
89
93
  async _layerWatchHandler() {
90
94
  this._fetchingData = true;
91
- this._resetTable();
95
+ await this._resetTable();
92
96
  this._fetchingData = false;
93
97
  }
98
+ /**
99
+ * When sortActive is false the user has not defined a sort and we should use the default sort
100
+ */
101
+ async _sortActiveWatchHandler() {
102
+ if (!this._sortActive) {
103
+ await this._sortTable();
104
+ }
105
+ }
94
106
  //--------------------------------------------------------------------------
95
107
  //
96
108
  // Methods (public)
@@ -195,31 +207,39 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
195
207
  *
196
208
  * @returns void
197
209
  */
198
- _getTable(node) {
210
+ async _getTable(node) {
199
211
  if (this._layer) {
200
- this._table = new this.FeatureTable({
201
- layer: this._layer,
202
- view: this.mapView,
203
- //editingEnabled: this._editEnabled,
204
- highlightEnabled: true,
205
- multiSortEnabled: false,
206
- visibleElements: {
207
- header: false,
208
- menu: false
209
- },
210
- container: node
211
- });
212
- this._table.highlightIds.on("change", () => {
213
- this._selectedIndexes = this._table.highlightIds.toArray();
214
- if (this._showOnlySelected) {
215
- if (this._selectedIndexes.length > 0) {
216
- this._table.filterBySelection();
217
- }
218
- else {
219
- this._toggleShowSelected();
220
- }
221
- }
222
- this.featureSelectionChange.emit(this._selectedIndexes);
212
+ await this._layer.when(async () => {
213
+ this._table = new this.FeatureTable({
214
+ layer: this._layer,
215
+ view: this.mapView,
216
+ //editingEnabled: this._editEnabled,
217
+ highlightEnabled: true,
218
+ multiSortEnabled: false,
219
+ visibleElements: {
220
+ header: false,
221
+ menu: false
222
+ },
223
+ container: node
224
+ });
225
+ await this._table.when(async () => {
226
+ this._table.highlightIds.on("change", () => {
227
+ this._selectedIndexes = this._table.highlightIds.toArray();
228
+ if (this._showOnlySelected) {
229
+ if (this._selectedIndexes.length > 0) {
230
+ this._table.filterBySelection();
231
+ }
232
+ else {
233
+ this._toggleShowSelected();
234
+ }
235
+ }
236
+ this.featureSelectionChange.emit(this._selectedIndexes);
237
+ });
238
+ this.reactiveUtils.watch(() => this._table.activeSortOrders, (sortOrders) => {
239
+ var _a, _b;
240
+ this._sortActive = sortOrders.length > 0 && ((_a = sortOrders[0]) === null || _a === void 0 ? void 0 : _a.direction) === "asc" || ((_b = sortOrders[0]) === null || _b === void 0 ? void 0 : _b.direction) === "desc";
241
+ });
242
+ });
223
243
  });
224
244
  }
225
245
  }
@@ -228,9 +248,10 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
228
248
  *
229
249
  * @returns void
230
250
  */
231
- _resetTable() {
251
+ async _resetTable() {
232
252
  if (this._layer && this._table) {
233
253
  this._clearSelection();
254
+ this._allIds = [];
234
255
  this.featureSelectionChange.emit(this._selectedIndexes);
235
256
  this._table.layer = this._layer;
236
257
  this._editEnabled = this._layer.editingEnabled;
@@ -238,6 +259,26 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
238
259
  this._table.editingEnabled = this._editEnabled;
239
260
  this._table.clearSelectionFilter();
240
261
  this._showOnlySelected = false;
262
+ this._sortActive = false;
263
+ await this._sortTable();
264
+ }
265
+ }
266
+ /**
267
+ * Sort the objectid field in descending order
268
+ *
269
+ * @returns void
270
+ */
271
+ async _sortTable() {
272
+ if (this._table && this._layer && !this._sortActive) {
273
+ if (!this._tableSorting && this.showNewestFirst) {
274
+ this._tableSorting = true;
275
+ await this._table.when(async () => {
276
+ await this._layer.when(async () => {
277
+ this._table.sortColumn(this._layer.objectIdField, "desc");
278
+ this._tableSorting = false;
279
+ });
280
+ });
281
+ }
241
282
  }
242
283
  }
243
284
  /**
@@ -416,14 +457,21 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
416
457
  const id = evt.detail[0];
417
458
  if (id !== this._layer.id || this._allIds.length === 0) {
418
459
  this._fetchingData = true;
419
- this._table.highlightIds.removeAll();
420
460
  this._layer = await getLayer(this.mapView, id);
421
461
  this._allIds = await queryAllIds(this._layer);
462
+ if (!this._table) {
463
+ await this._getTable(this._tableNode);
464
+ }
465
+ await this._table.when(() => {
466
+ this._table.highlightIds.removeAll();
467
+ });
422
468
  this._selectedIndexes = [];
423
469
  this._table.layer = this._layer;
424
470
  this._table.render();
425
- this._fetchingData = false;
426
471
  }
472
+ this._sortActive = false;
473
+ await this._sortTable();
474
+ this._fetchingData = false;
427
475
  }
428
476
  /**
429
477
  * Fetches the component's translations
@@ -438,17 +486,20 @@ const LayerTable = /*@__PURE__*/ proxyCustomElement(class LayerTable extends HTM
438
486
  get el() { return this; }
439
487
  static get watchers() { return {
440
488
  "mapView": ["mapViewWatchHandler"],
441
- "_layer": ["_layerWatchHandler"]
489
+ "_layer": ["_layerWatchHandler"],
490
+ "_sortActive": ["_sortActiveWatchHandler"]
442
491
  }; }
443
492
  static get style() { return layerTableCss; }
444
493
  }, [0, "layer-table", {
445
494
  "mapView": [16],
495
+ "showNewestFirst": [4, "show-newest-first"],
446
496
  "zoomAndScrollToSelected": [4, "zoom-and-scroll-to-selected"],
447
497
  "_alertOpen": [32],
448
498
  "_fetchingData": [32],
449
499
  "_layer": [32],
450
500
  "_selectedIndexes": [32],
451
501
  "_showOnlySelected": [32],
502
+ "_sortActive": [32],
452
503
  "_translations": [32],
453
504
  "getSelectedGraphics": [64]
454
505
  }, [[8, "selectionChanged", "selectionChanged"]]]);
@@ -580,5 +631,6 @@ function defineCustomElement() {
580
631
  break;
581
632
  } });
582
633
  }
634
+ defineCustomElement();
583
635
 
584
636
  export { LayerTable as L, defineCustomElement as d };
@@ -131,5 +131,6 @@ function defineCustomElement() {
131
131
  break;
132
132
  } });
133
133
  }
134
+ defineCustomElement();
134
135
 
135
136
  export { LayoutManager as L, defineCustomElement as d };
@@ -133,5 +133,6 @@ function defineCustomElement() {
133
133
  break;
134
134
  } });
135
135
  }
136
+ defineCustomElement();
136
137
 
137
138
  export { Link as L, defineCustomElement as d };
@@ -82,6 +82,7 @@ function defineCustomElement$1() {
82
82
  break;
83
83
  } });
84
84
  }
85
+ defineCustomElement$1();
85
86
 
86
87
  const ListItem = ListItem$1;
87
88
  const defineCustomElement = defineCustomElement$1;
@@ -446,5 +446,6 @@ function defineCustomElement() {
446
446
  break;
447
447
  } });
448
448
  }
449
+ defineCustomElement();
449
450
 
450
451
  export { ListItem as L, defineCustomElement as d };
@@ -547,5 +547,6 @@ function defineCustomElement() {
547
547
  break;
548
548
  } });
549
549
  }
550
+ defineCustomElement();
550
551
 
551
552
  export { List as L, defineCustomElement as d };
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import { e as esriLoader } from './locale.js';
6
+ import { e as esriLoader } from './esri-loader.js';
7
7
 
8
8
  /** @license
9
9
  * Copyright 2022 Esri
@@ -94,5 +94,6 @@ function defineCustomElement() {
94
94
  break;
95
95
  } });
96
96
  }
97
+ defineCustomElement();
97
98
 
98
99
  export { Loader as L, defineCustomElement as d };