@arcgis/components-utils 4.34.0-next.60 → 4.34.0-next.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +57 -400
- package/dist/index.d.cts +173 -15
- package/dist/index.d.ts +173 -15
- package/dist/index.js +48 -397
- package/dist/index.legacy.js +89 -0
- package/package.json +4 -3
- package/dist/array-utils.d.cts +0 -5
- package/dist/array-utils.d.ts +0 -5
- package/dist/css-utils.d.cts +0 -15
- package/dist/css-utils.d.ts +0 -15
- package/dist/deferred.d.cts +0 -35
- package/dist/deferred.d.ts +0 -35
- package/dist/dom.d.cts +0 -75
- package/dist/dom.d.ts +0 -75
- package/dist/errors.d.cts +0 -30
- package/dist/errors.d.ts +0 -30
- package/dist/guid.d.cts +0 -5
- package/dist/guid.d.ts +0 -5
- package/dist/intl.d.cts +0 -91
- package/dist/intl.d.ts +0 -91
- package/dist/preamble.d.cts +0 -17
- package/dist/preamble.d.ts +0 -17
- package/dist/strings.d.cts +0 -29
- package/dist/strings.d.ts +0 -29
- package/dist/tests/utils.d.cts +0 -1
- package/dist/tests/utils.d.ts +0 -1
- package/dist/text.d.cts +0 -7
- package/dist/text.d.ts +0 -7
- package/dist/timeouts.d.cts +0 -7
- package/dist/timeouts.d.ts +0 -7
- package/dist/type-guards.d.cts +0 -12
- package/dist/type-guards.d.ts +0 -12
- package/dist/types.d.cts +0 -30
- package/dist/types.d.ts +0 -30
- package/dist/ui.d.cts +0 -8
- package/dist/ui.d.ts +0 -8
- package/dist/url.d.cts +0 -14
- package/dist/url.d.ts +0 -14
package/dist/index.cjs
CHANGED
|
@@ -1,403 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
};
|
|
60
|
-
const observeAncestorsMutation = (element, attributeFilter, callback) => {
|
|
61
|
-
const subscribe = observe(attributeFilter).subscribe;
|
|
62
|
-
return subscribe((mutations) => {
|
|
63
|
-
const matched = mutations.some((mutation) => inTargetElement(element, mutation.target));
|
|
64
|
-
if (matched) {
|
|
65
|
-
callback();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const observers = {};
|
|
70
|
-
const observe = (attributeFilter) => {
|
|
71
|
-
const attributes = attributeFilter.join(",");
|
|
72
|
-
const previousObserver = observers[attributes];
|
|
73
|
-
if (previousObserver !== void 0) {
|
|
74
|
-
return previousObserver;
|
|
75
|
-
}
|
|
76
|
-
const subscribers = /* @__PURE__ */ new Set();
|
|
77
|
-
const mutationObserver = new MutationObserver((mutations) => subscribers.forEach((callback) => callback(mutations)));
|
|
78
|
-
if (globalThis.document) {
|
|
79
|
-
mutationObserver.observe(document.documentElement, {
|
|
80
|
-
attributes: true,
|
|
81
|
-
attributeFilter,
|
|
82
|
-
subtree: true
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
const observer = {
|
|
86
|
-
subscribe: (callback) => {
|
|
87
|
-
subscribers.add(callback);
|
|
88
|
-
return () => {
|
|
89
|
-
subscribers.delete(callback);
|
|
90
|
-
if (subscribers.size === 0) {
|
|
91
|
-
mutationObserver.disconnect();
|
|
92
|
-
observers[attributes] = void 0;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
observers[attributes] = observer;
|
|
98
|
-
return observer;
|
|
99
|
-
};
|
|
100
|
-
const closestElement = (base, selector) => {
|
|
101
|
-
let currentElement = base;
|
|
102
|
-
while (currentElement) {
|
|
103
|
-
const element = currentElement.closest?.(selector);
|
|
104
|
-
if (element) {
|
|
105
|
-
return element;
|
|
106
|
-
}
|
|
107
|
-
const rootElement = currentElement.getRootNode?.();
|
|
108
|
-
if (rootElement === globalThis.document) {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
currentElement = rootElement.host;
|
|
112
|
-
}
|
|
113
|
-
return null;
|
|
114
|
-
};
|
|
115
|
-
const getElementTheme = (base) => {
|
|
116
|
-
const themeElement = closestElement(base, ":is(.calcite-mode-light, .calcite-mode-dark)");
|
|
117
|
-
return themeElement?.classList.contains("calcite-mode-dark") ? "dark" : "light";
|
|
118
|
-
};
|
|
119
|
-
const getElementDir = (el) => getElementAttribute(el, "dir", "ltr");
|
|
120
|
-
const getElementAttribute = (el, prop, fallbackValue) => {
|
|
121
|
-
const closest = closestElement(el, `[${prop}]`);
|
|
122
|
-
return closest?.getAttribute(prop) ?? fallbackValue;
|
|
123
|
-
};
|
|
124
|
-
const isElement = (ref) => ref.nodeType === Node.ELEMENT_NODE;
|
|
125
|
-
const hasSetFocus = (ref) => typeof ref.setFocus === "function";
|
|
126
|
-
const setFocus = (ref, selector = "") => {
|
|
127
|
-
if (!isElement(ref)) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
if (ref.matches(selector)) {
|
|
131
|
-
if (hasSetFocus(ref)) {
|
|
132
|
-
setTimeout(() => void ref.setFocus(), 0);
|
|
133
|
-
}
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
for (const child of ref.children) {
|
|
137
|
-
if (setFocus(child, selector)) {
|
|
138
|
-
return true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const shadowRoot = ref.shadowRoot;
|
|
142
|
-
if (shadowRoot) {
|
|
143
|
-
for (const child of shadowRoot.children) {
|
|
144
|
-
if (setFocus(child, selector)) {
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return false;
|
|
150
|
-
};
|
|
151
|
-
const focusElement = async (el) => {
|
|
152
|
-
if (el == null) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (hasSetFocus(el)) {
|
|
156
|
-
await el.setFocus();
|
|
157
|
-
} else {
|
|
158
|
-
el.focus();
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const setFocusOnElement = (ref, selector) => {
|
|
162
|
-
if (!ref?.shadowRoot) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (ref.hasAttribute("hydrated") || ref.hasAttribute("calcite-hydrated")) {
|
|
166
|
-
setFocus(ref, selector);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
void Promise.resolve(ref.componentOnReady?.()).then(() => setFocus(ref, selector));
|
|
170
|
-
};
|
|
171
|
-
function unsafeGetModeName(el) {
|
|
172
|
-
const closestElWithMode = closestElement(el, `.calcite-mode-dark, .calcite-mode-light, .calcite-mode-auto`);
|
|
173
|
-
return closestElWithMode?.classList.contains("calcite-mode-dark") || closestElWithMode?.classList.contains("calcite-mode-auto") && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
174
|
-
}
|
|
175
|
-
const isEsriInternalEnv = () => (
|
|
176
|
-
/*
|
|
177
|
-
* `globalThis.` is important here. Some bundlers remove the `typeof process`
|
|
178
|
-
* checks, but don't remove the usages of undefined variables - this can cause
|
|
179
|
-
* runtime error. By adding `globalThis.`, we avoid having `typeof process`
|
|
180
|
-
* check removed by the bundler.
|
|
181
|
-
* This does meant tree-shaking won't happen for the isEsriInternalEnv()
|
|
182
|
-
* check, but this is ok since this check is meant to always be behind the
|
|
183
|
-
* development/test guard.
|
|
184
|
-
* See https://devtopia.esri.com/WebGIS/arcgis-web-components/pull/2087#issuecomment-5152454
|
|
185
|
-
*/
|
|
186
|
-
typeof globalThis.process === "object" && !!process.env.ESRI_INTERNAL
|
|
187
|
-
);
|
|
188
|
-
const safeCall = (callback, thisContext, ...rest) => {
|
|
189
|
-
try {
|
|
190
|
-
return callback?.call(thisContext, ...rest);
|
|
191
|
-
} catch (error) {
|
|
192
|
-
console.error(error, callback);
|
|
193
|
-
}
|
|
194
|
-
return void 0;
|
|
195
|
-
};
|
|
196
|
-
const safeAsyncCall = async (callback, thisContext, ...rest) => {
|
|
197
|
-
try {
|
|
198
|
-
const result = callback?.call(thisContext, ...rest);
|
|
199
|
-
return await result;
|
|
200
|
-
} catch (error) {
|
|
201
|
-
console.error(error, callback);
|
|
202
|
-
}
|
|
203
|
-
return void 0;
|
|
204
|
-
};
|
|
205
|
-
const gen = (count) => {
|
|
206
|
-
let out = "";
|
|
207
|
-
for (let i = 0; i < count; i++) {
|
|
208
|
-
out += ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
209
|
-
}
|
|
210
|
-
return out;
|
|
211
|
-
};
|
|
212
|
-
const generateGuid = () => [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
|
|
213
|
-
const supportedLocalesArray = "ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(
|
|
214
|
-
","
|
|
215
|
-
);
|
|
216
|
-
const supportedLocales = /* @__PURE__ */ new Set(supportedLocalesArray);
|
|
217
|
-
const defaultLocale = "en";
|
|
218
|
-
const localeEquivalencies = {
|
|
219
|
-
// We use `pt-PT` as it will have the same translations as `pt`, which has no corresponding bundle
|
|
220
|
-
pt: "pt-PT",
|
|
221
|
-
// We support both 'nb' and 'no' (BCP 47) for Norwegian but only `no` has corresponding bundle
|
|
222
|
-
nb: "no",
|
|
223
|
-
// We support both 'nn' and 'no' (BCP 47) for Norwegian but only `no` has corresponding bundle
|
|
224
|
-
// See https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/4667
|
|
225
|
-
nn: "no",
|
|
226
|
-
// We use `zh-CN` as base translation for chinese locales which has no corresponding bundle.
|
|
227
|
-
zh: "zh-CN"
|
|
228
|
-
};
|
|
229
|
-
const fetchT9nStringsBundle = async (locale, assetsPath, prefix = "") => {
|
|
230
|
-
const path = `${assetsPath}/${prefix}`;
|
|
231
|
-
const filePath = `${path}${locale}.json`;
|
|
232
|
-
t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
|
|
233
|
-
return await t9nStringsCache[filePath];
|
|
234
|
-
};
|
|
235
|
-
const t9nStringsCache = {};
|
|
236
|
-
const fetchBundle = async (locale, path) => {
|
|
237
|
-
const filePath = `${path}${locale}.json`;
|
|
238
|
-
try {
|
|
239
|
-
const response = await fetch(filePath);
|
|
240
|
-
if (response.ok) {
|
|
241
|
-
return await response.json();
|
|
242
|
-
}
|
|
243
|
-
} catch (error) {
|
|
244
|
-
if (process.env.NODE_ENV !== "production") {
|
|
245
|
-
const is404ViteFallback = String(error).includes(`Unexpected token '<', "<!doctype "... is not valid JSON`);
|
|
246
|
-
if (is404ViteFallback) {
|
|
247
|
-
console.error(`[404] Localization strings not found at ${filePath}`);
|
|
248
|
-
} else {
|
|
249
|
-
console.error(`Error fetching localization strings at ${filePath}`, error);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
console.error(error);
|
|
253
|
-
}
|
|
254
|
-
return {};
|
|
255
|
-
}
|
|
256
|
-
if (locale === defaultLocale) {
|
|
257
|
-
return {};
|
|
258
|
-
}
|
|
259
|
-
return await fetchBundle(defaultLocale, path);
|
|
260
|
-
};
|
|
261
|
-
const getElementLocales = (element) => {
|
|
262
|
-
const lang = getElementAttribute(element, "lang", globalThis.navigator?.language || defaultLocale);
|
|
263
|
-
return { lang, t9nLocale: normalizeLocale(lang) };
|
|
264
|
-
};
|
|
265
|
-
const normalizeLocale = (locale) => {
|
|
266
|
-
const [rawLanguageCode, regionCode] = locale.split("-");
|
|
267
|
-
const languageCode = rawLanguageCode.toLowerCase();
|
|
268
|
-
let normalizedLocale = languageCode;
|
|
269
|
-
if (regionCode) {
|
|
270
|
-
normalizedLocale = `${languageCode}-${regionCode.toUpperCase()}`;
|
|
271
|
-
}
|
|
272
|
-
normalizedLocale = localeEquivalencies[normalizedLocale] ?? normalizedLocale;
|
|
273
|
-
if (supportedLocales.has(normalizedLocale)) {
|
|
274
|
-
return normalizedLocale;
|
|
275
|
-
}
|
|
276
|
-
if (regionCode) {
|
|
277
|
-
return normalizeLocale(languageCode);
|
|
278
|
-
}
|
|
279
|
-
return defaultLocale;
|
|
280
|
-
};
|
|
281
|
-
const startLocaleObserver = (element, getAssetsPath, onUpdated, assetName) => {
|
|
282
|
-
let result = void 0;
|
|
283
|
-
const callback = () => updateComponentLocaleState(element, getAssetsPath(), assetName).then((newResult) => {
|
|
284
|
-
if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
|
|
285
|
-
onUpdated(newResult);
|
|
286
|
-
}
|
|
287
|
-
result = newResult;
|
|
288
|
-
}).catch(console.error);
|
|
289
|
-
queueMicrotask(callback);
|
|
290
|
-
return observeAncestorsMutation(element, ["lang"], callback);
|
|
291
|
-
};
|
|
292
|
-
const updateComponentLocaleState = async (element, assetsPath, assetName = element.localName.split("-").slice(1).join("-")) => {
|
|
293
|
-
const { lang, t9nLocale } = getElementLocales(element);
|
|
294
|
-
const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
|
|
295
|
-
const prefix = `messages.`;
|
|
296
|
-
const t9nStrings = (
|
|
297
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
298
|
-
assetName === null ? {} : await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix)
|
|
299
|
-
);
|
|
300
|
-
return { lang, t9nLocale, t9nStrings };
|
|
301
|
-
};
|
|
302
|
-
const blurb = "All material copyright Esri, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/{minorVersion}/esri/copyright.txt for details.\nv{version}";
|
|
303
|
-
const extractMinorVersion = (version) => {
|
|
304
|
-
const [major, minor] = version.split(".");
|
|
305
|
-
return `${major}.${minor}`;
|
|
306
|
-
};
|
|
307
|
-
const getPreamble = (version) => blurb.replace("{minorVersion}", extractMinorVersion(version)).replace("{version}", version);
|
|
308
|
-
const doubleQuote = '"';
|
|
309
|
-
const singleQuote = "'";
|
|
310
|
-
const repeatString = (value, n) => new Array(n + 1).join(value);
|
|
311
|
-
const quoteString = (value) => {
|
|
312
|
-
let quote = doubleQuote;
|
|
313
|
-
let alternateQuote = singleQuote;
|
|
314
|
-
const avoidEscape = value.includes(quote) && !value.includes(alternateQuote);
|
|
315
|
-
if (avoidEscape) {
|
|
316
|
-
alternateQuote = doubleQuote;
|
|
317
|
-
quote = singleQuote;
|
|
318
|
-
}
|
|
319
|
-
const alternateEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${alternateQuote})+)`, "gu");
|
|
320
|
-
value = value.replace(
|
|
321
|
-
alternateEscape,
|
|
322
|
-
(_, boundaryChar, leadingEscapedSlashes, escapedQuoteChars) => (
|
|
323
|
-
// We divide the escapedQuoteChars by 2 since there are 2 characters in each escaped part ('\\"'.length === 2)
|
|
324
|
-
boundaryChar + leadingEscapedSlashes + repeatString(alternateQuote, escapedQuoteChars.length / 2)
|
|
325
|
-
)
|
|
326
|
-
);
|
|
327
|
-
const quoteEscape = new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${quote}+)`, "gu");
|
|
328
|
-
value = value.replace(
|
|
329
|
-
quoteEscape,
|
|
330
|
-
(_, boundaryChar, leadingEscapedSlashes, quoteChars) => boundaryChar + leadingEscapedSlashes + repeatString(`\\${quote}`, quoteChars.length)
|
|
331
|
-
);
|
|
332
|
-
return quote + value + quote;
|
|
333
|
-
};
|
|
334
|
-
const createFilterExpression = (filterWord) => {
|
|
335
|
-
const sanitizedWord = filterWord ? filterWord.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu, "\\$&") : "^.*$";
|
|
336
|
-
return new RegExp(sanitizedWord, "i");
|
|
337
|
-
};
|
|
338
|
-
const setValuesInString = (message, values = {}) => (message ?? "").replace(/\{(?<valueName>.*?)\}/gu, (match, valueName) => values[valueName] ?? match);
|
|
339
|
-
const addLTRMark = (value) => (
|
|
340
|
-
// Make sure the string value is LTR. This prevent issues with RTL language used in LTR containers.
|
|
341
|
-
`${value ?? ""}`
|
|
342
|
-
);
|
|
343
|
-
const kebabToPascal = (string) => string.split("-").map(capitalize).join("");
|
|
344
|
-
const camelToKebab = (string) => string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : "-"}${upper.toLowerCase()}`);
|
|
345
|
-
const upperBeforeLower = /[A-Z]+(?![a-z])|[A-Z]/gu;
|
|
346
|
-
const capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|
|
347
|
-
const uncapitalize = (string) => string.charAt(0).toLowerCase() + string.slice(1);
|
|
348
|
-
const camelToHuman = (string) => capitalize(string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : " "}${upper}`));
|
|
349
|
-
const devToolsAwareTimeout = (callback, timeout) => {
|
|
350
|
-
const interval = timeout > longTimeoutThreshold ? longTimeoutInterval : timeout / shortTimeoutIntervals;
|
|
351
|
-
let elapsed = 0;
|
|
352
|
-
const reference = setInterval(() => {
|
|
353
|
-
elapsed += interval;
|
|
354
|
-
if (elapsed >= timeout) {
|
|
355
|
-
clearInterval(reference);
|
|
356
|
-
callback();
|
|
357
|
-
}
|
|
358
|
-
}, interval);
|
|
359
|
-
return reference;
|
|
360
|
-
};
|
|
361
|
-
const longTimeoutThreshold = 4e3;
|
|
362
|
-
const longTimeoutInterval = 2e3;
|
|
363
|
-
const shortTimeoutIntervals = 4;
|
|
364
|
-
const isNotNull = (item) => item !== null;
|
|
365
|
-
const isNotUndefined = (item) => item !== void 0;
|
|
366
|
-
const identity = (value) => value;
|
|
367
|
-
const debounce = (func, waitFor = 100) => {
|
|
368
|
-
let timeout;
|
|
369
|
-
return (...args) => {
|
|
370
|
-
const later = () => {
|
|
371
|
-
clearTimeout(timeout);
|
|
372
|
-
func(...args);
|
|
373
|
-
};
|
|
374
|
-
clearTimeout(timeout);
|
|
375
|
-
timeout = setTimeout(later, waitFor);
|
|
376
|
-
};
|
|
377
|
-
};
|
|
378
|
-
const hasSameOrigin = (url1, url2, ignoreProtocol = false) => {
|
|
379
|
-
if (!url1 || !url2) {
|
|
380
|
-
return false;
|
|
381
|
-
}
|
|
382
|
-
const url1Obj = new URL(url1);
|
|
383
|
-
const url2Obj = new URL(url2);
|
|
384
|
-
if (!ignoreProtocol && url1Obj.protocol !== url2Obj.protocol) {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
if (url1Obj.host == null || url2Obj.host == null) {
|
|
388
|
-
return false;
|
|
389
|
-
}
|
|
390
|
-
return url1Obj.host.toLowerCase() === url2Obj.host.toLowerCase() && url1Obj.port === url2Obj.port;
|
|
391
|
-
};
|
|
392
|
-
const isURL = (url) => {
|
|
393
|
-
try {
|
|
394
|
-
new URL(url);
|
|
395
|
-
return true;
|
|
396
|
-
} catch (e) {
|
|
397
|
-
return false;
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
exports.Deferred = Deferred;
|
|
3
|
+
const array = require("@arcgis/toolkit/array");
|
|
4
|
+
const dom = require("@arcgis/toolkit/dom");
|
|
5
|
+
const promise = require("@arcgis/toolkit/promise");
|
|
6
|
+
const error = require("@arcgis/toolkit/error");
|
|
7
|
+
const string = require("@arcgis/toolkit/string");
|
|
8
|
+
const intl = require("@arcgis/toolkit/intl");
|
|
9
|
+
const predicate = require("@arcgis/toolkit/predicate");
|
|
10
|
+
const _function = require("@arcgis/toolkit/function");
|
|
11
|
+
const url = require("@arcgis/toolkit/url");
|
|
12
|
+
const mappedFind = array.mappedFind;
|
|
13
|
+
const classes = dom.classes;
|
|
14
|
+
const devToolsAwareTimeout = promise.devToolsAwareTimeout;
|
|
15
|
+
const observeAncestorsMutation = dom.observeAncestorsMutation;
|
|
16
|
+
const closestElement = dom.getClosestElement;
|
|
17
|
+
const getElementTheme = dom.unsafeGetCalciteModeName;
|
|
18
|
+
const getElementDir = dom.unsafeGetElementDirection;
|
|
19
|
+
const getElementAttribute = dom.getElementAttribute;
|
|
20
|
+
const focusElement = dom.focusElement;
|
|
21
|
+
const unsafeGetModeName = dom.unsafeGetCalciteModeName;
|
|
22
|
+
const isEsriInternalEnv = error.isEsriInternalEnv;
|
|
23
|
+
const safeCall = error.safeCall;
|
|
24
|
+
const safeAsyncCall = error.safeAsyncCall;
|
|
25
|
+
const generateGuid = string.generateGuid;
|
|
26
|
+
const extractMinorVersion = string.getMinorVersion;
|
|
27
|
+
const getPreamble = string.getPreamble;
|
|
28
|
+
const quoteString = string.quoteString;
|
|
29
|
+
const createFilterExpression = string.createFilterExpression;
|
|
30
|
+
const addLTRMark = string.addLtrMark;
|
|
31
|
+
const kebabToPascal = string.kebabToPascal;
|
|
32
|
+
const camelToKebab = string.camelToKebab;
|
|
33
|
+
const camelToHuman = string.camelToHuman;
|
|
34
|
+
const capitalize = string.capitalize;
|
|
35
|
+
const uncapitalize = string.uncapitalize;
|
|
36
|
+
const supportedLocales = intl.supportedLocales;
|
|
37
|
+
const defaultLocale = intl.defaultLocale;
|
|
38
|
+
const fetchT9nStringsBundle = intl.fetchT9nStringsBundle;
|
|
39
|
+
const getElementLocales = intl.getElementLocale;
|
|
40
|
+
const normalizeLocale = intl.normalizeLocale;
|
|
41
|
+
const startLocaleObserver = intl.startLocaleObserver;
|
|
42
|
+
const isNotNull = predicate.isNotNull;
|
|
43
|
+
const isNotUndefined = predicate.isNotUndefined;
|
|
44
|
+
const debounce = _function.debounce;
|
|
45
|
+
const identity = _function.identity;
|
|
46
|
+
const hasSameOrigin = url.hasSameOrigin;
|
|
47
|
+
const isURL = url.isURL;
|
|
48
|
+
Object.defineProperty(exports, "setFocusOnElement", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: () => dom.setFocusOnElement
|
|
51
|
+
});
|
|
52
|
+
Object.defineProperty(exports, "Deferred", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: () => promise.Deferred
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "setValuesInString", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: () => string.setValuesInString
|
|
59
|
+
});
|
|
401
60
|
exports.addLTRMark = addLTRMark;
|
|
402
61
|
exports.camelToHuman = camelToHuman;
|
|
403
62
|
exports.camelToKebab = camelToKebab;
|
|
@@ -430,8 +89,6 @@ exports.observeAncestorsMutation = observeAncestorsMutation;
|
|
|
430
89
|
exports.quoteString = quoteString;
|
|
431
90
|
exports.safeAsyncCall = safeAsyncCall;
|
|
432
91
|
exports.safeCall = safeCall;
|
|
433
|
-
exports.setFocusOnElement = setFocusOnElement;
|
|
434
|
-
exports.setValuesInString = setValuesInString;
|
|
435
92
|
exports.startLocaleObserver = startLocaleObserver;
|
|
436
93
|
exports.supportedLocales = supportedLocales;
|
|
437
94
|
exports.uncapitalize = uncapitalize;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,173 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { mappedFind as _mappedFind } from '@arcgis/toolkit/dist/array';
|
|
2
|
+
import { classes as _classes, observeAncestorsMutation as _observeAncestorsMutation, getClosestElement, unsafeGetElementDirection, getElementAttribute as _getElementAttribute, FocusableElement as _FocusableElement, focusElement as _focusElement, unsafeGetCalciteModeName } from '@arcgis/toolkit/dist/dom';
|
|
3
|
+
import { devToolsAwareTimeout as _devToolsAwareTimeout } from '@arcgis/toolkit/dist/promise';
|
|
4
|
+
import { isEsriInternalEnv as _isEsriInternalEnv, safeCall as _safeCall, safeAsyncCall as _safeAsyncCall } from '@arcgis/toolkit/dist/error';
|
|
5
|
+
import { generateGuid as _generateGuid, getMinorVersion, getPreamble as _getPreamble, quoteString as _quoteString, createFilterExpression as _createFilterExpression, addLtrMark, kebabToPascal as _kebabToPascal, camelToKebab as _camelToKebab, camelToHuman as _camelToHuman, capitalize as _capitalize, uncapitalize as _uncapitalize } from '@arcgis/toolkit/dist/string';
|
|
6
|
+
import { GenericT9nStrings as _GenericT9nStrings, supportedLocales as _supportedLocales, SupportedLocale as _SupportedLocale, defaultLocale as _defaultLocale, fetchT9nStringsBundle as _fetchT9nStringsBundle, getElementLocale, normalizeLocale as _normalizeLocale, LocaleObserverResult, startLocaleObserver as _startLocaleObserver } from '@arcgis/toolkit/dist/intl';
|
|
7
|
+
import { isNotNull as _isNotNull, isNotUndefined as _isNotUndefined } from '@arcgis/toolkit/dist/predicate';
|
|
8
|
+
import { debounce as _debounce, identity as _identity } from '@arcgis/toolkit/dist/function';
|
|
9
|
+
import { hasSameOrigin as _hasSameOrigin, isURL as _isUrl } from '@arcgis/toolkit/dist/url';
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Import from `@arcgis/toolkit/dist/array` instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare const mappedFind: typeof _mappedFind;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Import from `@arcgis/toolkit/dist/dom` instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare const classes: typeof _classes;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Import from `@arcgis/toolkit/dist/promise` instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const devToolsAwareTimeout: typeof _devToolsAwareTimeout;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Import from `@arcgis/toolkit/dist/promise` instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare const observeAncestorsMutation: typeof _observeAncestorsMutation;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Import { getClosestElement } from `@arcgis/toolkit/dist/dom` instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare const closestElement: typeof getClosestElement;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Import { unsafeGetCalciteModeName } from `@arcgis/toolkit/dist/dom` instead.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getElementTheme: typeof unsafeGetCalciteModeName;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Import from `@arcgis/toolkit/dist/dom` instead.
|
|
36
|
+
*/
|
|
37
|
+
export declare const getElementDir: typeof unsafeGetElementDirection;
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Import from `@arcgis/toolkit/dist/dom` instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare const getElementAttribute: typeof _getElementAttribute;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Import from `@arcgis/toolkit/dist/dom` instead.
|
|
44
|
+
*/
|
|
45
|
+
export type FocusableElement = _FocusableElement;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Import from `@arcgis/toolkit/dist/dom` instead.
|
|
48
|
+
*/
|
|
49
|
+
export declare const focusElement: typeof _focusElement;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Import { unsafeGetCalciteModeName } from `@arcgis/toolkit/dist/dom` instead.
|
|
52
|
+
*/
|
|
53
|
+
export declare const unsafeGetModeName: typeof unsafeGetCalciteModeName;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Import from `@arcgis/toolkit/dist/error` instead
|
|
56
|
+
*/
|
|
57
|
+
export declare const isEsriInternalEnv: typeof _isEsriInternalEnv;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Import from `@arcgis/toolkit/dist/error` instead.
|
|
60
|
+
*/
|
|
61
|
+
export declare const safeCall: typeof _safeCall;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Import from `@arcgis/toolkit/dist/error` instead.
|
|
64
|
+
*/
|
|
65
|
+
export declare const safeAsyncCall: typeof _safeAsyncCall;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
68
|
+
*/
|
|
69
|
+
export declare const generateGuid: typeof _generateGuid;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Import { getMinorVersion } from `@arcgis/toolkit/dist/string` instead.
|
|
72
|
+
*/
|
|
73
|
+
export declare const extractMinorVersion: typeof getMinorVersion;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
76
|
+
*/
|
|
77
|
+
export declare const getPreamble: typeof _getPreamble;
|
|
78
|
+
/**
|
|
79
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
80
|
+
*/
|
|
81
|
+
export declare const quoteString: typeof _quoteString;
|
|
82
|
+
/**
|
|
83
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
84
|
+
*/
|
|
85
|
+
export declare const createFilterExpression: typeof _createFilterExpression;
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated Import { addLtrMark } from `@arcgis/toolkit/dist/string` instead.
|
|
88
|
+
*/
|
|
89
|
+
export declare const addLTRMark: typeof addLtrMark;
|
|
90
|
+
/**
|
|
91
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
92
|
+
*/
|
|
93
|
+
export declare const kebabToPascal: typeof _kebabToPascal;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
96
|
+
*/
|
|
97
|
+
export declare const camelToKebab: typeof _camelToKebab;
|
|
98
|
+
/**
|
|
99
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
100
|
+
*/
|
|
101
|
+
export declare const camelToHuman: typeof _camelToHuman;
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
104
|
+
*/
|
|
105
|
+
export declare const capitalize: typeof _capitalize;
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated Import from `@arcgis/toolkit/dist/string` instead.
|
|
108
|
+
*/
|
|
109
|
+
export declare const uncapitalize: typeof _uncapitalize;
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
112
|
+
*/
|
|
113
|
+
export declare const supportedLocales: typeof _supportedLocales;
|
|
114
|
+
/**
|
|
115
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
116
|
+
*/
|
|
117
|
+
export type SupportedLocale = _SupportedLocale;
|
|
118
|
+
/**
|
|
119
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
120
|
+
*/
|
|
121
|
+
export declare const defaultLocale: typeof _defaultLocale;
|
|
122
|
+
/**
|
|
123
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
124
|
+
*/
|
|
125
|
+
export declare const fetchT9nStringsBundle: typeof _fetchT9nStringsBundle;
|
|
126
|
+
/**
|
|
127
|
+
* @deprecated Import { getElementLocale } from `@arcgis/toolkit/dist/intl` instead.
|
|
128
|
+
*/
|
|
129
|
+
export declare const getElementLocales: typeof getElementLocale;
|
|
130
|
+
/**
|
|
131
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
132
|
+
*/
|
|
133
|
+
export declare const normalizeLocale: typeof _normalizeLocale;
|
|
134
|
+
/**
|
|
135
|
+
* @deprecated Import type { LocaleObserverResult } from `@arcgis/toolkit/dist/intl` instead.
|
|
136
|
+
*/
|
|
137
|
+
export type LocaleObserver = LocaleObserverResult;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
140
|
+
*/
|
|
141
|
+
export declare const startLocaleObserver: typeof _startLocaleObserver;
|
|
142
|
+
/**
|
|
143
|
+
* @deprecated Import from `@arcgis/toolkit/dist/intl` instead.
|
|
144
|
+
*/
|
|
145
|
+
export type GenericT9nStrings = _GenericT9nStrings;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Import from `@arcgis/toolkit/dist/predicate` instead.
|
|
148
|
+
*/
|
|
149
|
+
export declare const isNotNull: typeof _isNotNull;
|
|
150
|
+
/**
|
|
151
|
+
* @deprecated Import from `@arcgis/toolkit/dist/predicate` instead.
|
|
152
|
+
*/
|
|
153
|
+
export declare const isNotUndefined: typeof _isNotUndefined;
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Import from `@arcgis/toolkit/dist/function` instead.
|
|
156
|
+
*/
|
|
157
|
+
export declare const debounce: typeof _debounce;
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated Import from `@arcgis/toolkit/dist/function` instead.
|
|
160
|
+
*/
|
|
161
|
+
export declare const identity: typeof _identity;
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated Import from `@arcgis/toolkit/dist/url` instead.
|
|
164
|
+
*/
|
|
165
|
+
export declare const hasSameOrigin: typeof _hasSameOrigin;
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated Import from `@arcgis/toolkit/dist/url` instead.
|
|
168
|
+
*/
|
|
169
|
+
export declare const isURL: typeof _isUrl;
|
|
170
|
+
export { setValuesInString } from '@arcgis/toolkit/dist/string';
|
|
171
|
+
export { Deferred } from '@arcgis/toolkit/dist/promise';
|
|
172
|
+
export { setFocusOnElement } from '@arcgis/toolkit/dist/dom';
|
|
173
|
+
export type { IHandle, Nil } from '@arcgis/toolkit/dist/type';
|