@arcgis/components-utils 4.33.0-next.99 → 4.34.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/array-utils.d.cts +1 -1
- package/dist/array-utils.d.ts +1 -1
- package/dist/css-utils.d.cts +1 -1
- package/dist/css-utils.d.ts +1 -1
- package/dist/deferred.d.cts +9 -4
- package/dist/deferred.d.ts +9 -4
- package/dist/dom.d.cts +8 -8
- package/dist/dom.d.ts +8 -8
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/guid.d.cts +1 -1
- package/dist/guid.d.ts +1 -1
- package/dist/index.cjs +83 -139
- package/dist/index.js +83 -139
- package/dist/intl.d.cts +7 -7
- package/dist/intl.d.ts +7 -7
- package/dist/strings.d.cts +4 -4
- package/dist/strings.d.ts +4 -4
- package/dist/timeouts.d.cts +1 -1
- package/dist/timeouts.d.ts +1 -1
- package/dist/type-guards.d.cts +2 -2
- package/dist/type-guards.d.ts +2 -2
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/url.d.cts +2 -2
- package/dist/url.d.ts +2 -2
- package/package.json +2 -2
package/dist/array-utils.d.cts
CHANGED
|
@@ -2,4 +2,4 @@ import { Nil } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Find a value in an array, and return it's mapped variant.
|
|
4
4
|
*/
|
|
5
|
-
export declare
|
|
5
|
+
export declare const mappedFind: <Item, ReturnType>(array: readonly Item[], callback: (item: Item, index: number) => Nil | ReturnType) => ReturnType | undefined;
|
package/dist/array-utils.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import { Nil } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Find a value in an array, and return it's mapped variant.
|
|
4
4
|
*/
|
|
5
|
-
export declare
|
|
5
|
+
export declare const mappedFind: <Item, ReturnType>(array: readonly Item[], callback: (item: Item, index: number) => Nil | ReturnType) => ReturnType | undefined;
|
package/dist/css-utils.d.cts
CHANGED
|
@@ -12,4 +12,4 @@ import { Nil } from './types';
|
|
|
12
12
|
* This function is not necessary in a Lit package as Lit's `classMap` directive
|
|
13
13
|
* accepts an object
|
|
14
14
|
*/
|
|
15
|
-
export declare
|
|
15
|
+
export declare const classes: (...classes: (Nil | Record<string, boolean> | string[] | string | false)[]) => string;
|
package/dist/css-utils.d.ts
CHANGED
|
@@ -12,4 +12,4 @@ import { Nil } from './types';
|
|
|
12
12
|
* This function is not necessary in a Lit package as Lit's `classMap` directive
|
|
13
13
|
* accepts an object
|
|
14
14
|
*/
|
|
15
|
-
export declare
|
|
15
|
+
export declare const classes: (...classes: (Nil | Record<string, boolean> | string[] | string | false)[]) => string;
|
package/dist/deferred.d.cts
CHANGED
|
@@ -14,17 +14,22 @@ export declare class Deferred<T> {
|
|
|
14
14
|
* The promise that can be awaited.
|
|
15
15
|
*/
|
|
16
16
|
promise: Promise<T>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new deferred promise.
|
|
19
|
+
*/
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
22
|
+
export interface Deferred<T> {
|
|
17
23
|
/**
|
|
18
24
|
* Resolves the promise.
|
|
19
25
|
* @param value The value to resolve the promise with.
|
|
26
|
+
*
|
|
27
|
+
* @privateRemarks
|
|
28
|
+
* Defined as a method to disable covariance checks. Overridden in constructor.
|
|
20
29
|
*/
|
|
21
30
|
resolve(_value: PromiseLike<T> | T): void;
|
|
22
31
|
/**
|
|
23
32
|
* Rejects the promise.
|
|
24
33
|
*/
|
|
25
34
|
reject(_error: unknown): void;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new deferred promise.
|
|
28
|
-
*/
|
|
29
|
-
constructor();
|
|
30
35
|
}
|
package/dist/deferred.d.ts
CHANGED
|
@@ -14,17 +14,22 @@ export declare class Deferred<T> {
|
|
|
14
14
|
* The promise that can be awaited.
|
|
15
15
|
*/
|
|
16
16
|
promise: Promise<T>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new deferred promise.
|
|
19
|
+
*/
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
22
|
+
export interface Deferred<T> {
|
|
17
23
|
/**
|
|
18
24
|
* Resolves the promise.
|
|
19
25
|
* @param value The value to resolve the promise with.
|
|
26
|
+
*
|
|
27
|
+
* @privateRemarks
|
|
28
|
+
* Defined as a method to disable covariance checks. Overridden in constructor.
|
|
20
29
|
*/
|
|
21
30
|
resolve(_value: PromiseLike<T> | T): void;
|
|
22
31
|
/**
|
|
23
32
|
* Rejects the promise.
|
|
24
33
|
*/
|
|
25
34
|
reject(_error: unknown): void;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new deferred promise.
|
|
28
|
-
*/
|
|
29
|
-
constructor();
|
|
30
35
|
}
|
package/dist/dom.d.cts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param callback The callback to invoke when the attributes have been changed.
|
|
8
8
|
* @returns The mutation observer
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const observeAncestorsMutation: (element: Node, attributeFilter: string[], callback: () => void) => (() => void);
|
|
11
11
|
/**
|
|
12
12
|
* Find the closest element that matches the selector.
|
|
13
13
|
* It will traverse the element's ancestors to find the target element.
|
|
@@ -16,7 +16,7 @@ export declare function observeAncestorsMutation(element: Node, attributeFilter:
|
|
|
16
16
|
* @param selector The selector to match.
|
|
17
17
|
* @returns The closest element that matches the selector or null if not found.
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare const closestElement: (base: Element, selector: string) => Element | null;
|
|
20
20
|
/**
|
|
21
21
|
* Use the Calcite mode to determine the theme of the element.
|
|
22
22
|
* It will traverse the element's ancestors to find the theme.
|
|
@@ -24,13 +24,13 @@ export declare function closestElement(base: Element, selector: string): Element
|
|
|
24
24
|
* @param base The element to start the search from.
|
|
25
25
|
* @returns The theme of the element, either "light" or "dark", "light" is the default.
|
|
26
26
|
*/
|
|
27
|
-
export declare
|
|
27
|
+
export declare const getElementTheme: (base: Element) => "dark" | "light";
|
|
28
28
|
/**
|
|
29
29
|
* Get direction property of closest element.
|
|
30
30
|
* @param el The element to start the search from.
|
|
31
31
|
* @returns The direction of the element, either "ltr" | "rtl", "ltr" is the default.
|
|
32
32
|
*/
|
|
33
|
-
export declare
|
|
33
|
+
export declare const getElementDir: (el: HTMLElement) => "ltr" | "rtl";
|
|
34
34
|
/**
|
|
35
35
|
* Get the attribute value from the element.
|
|
36
36
|
* It will traverse the element's ancestors to find the attribute.
|
|
@@ -42,11 +42,11 @@ export declare function getElementDir(el: HTMLElement): "ltr" | "rtl";
|
|
|
42
42
|
* @param fallbackValue The fallback value if the attribute is not found.
|
|
43
43
|
* @returns The attribute value or the fallback value if the attribute is not found.
|
|
44
44
|
*/
|
|
45
|
-
export declare
|
|
45
|
+
export declare const getElementAttribute: (el: Element, prop: string, fallbackValue: string) => string;
|
|
46
46
|
export interface FocusableElement extends HTMLElement {
|
|
47
47
|
setFocus?: () => Promise<void>;
|
|
48
48
|
}
|
|
49
|
-
export declare
|
|
49
|
+
export declare const focusElement: (el: FocusableElement | undefined) => Promise<void>;
|
|
50
50
|
/**
|
|
51
51
|
* Set the focus on the element that matches the selector.
|
|
52
52
|
* It will traverse the element's ancestors to find the target element.
|
|
@@ -60,6 +60,6 @@ export declare function focusElement(el: FocusableElement | undefined): Promise<
|
|
|
60
60
|
* REFACTOR: this is doing too much. break it into separate find element and focus
|
|
61
61
|
* element utilities
|
|
62
62
|
*/
|
|
63
|
-
export declare
|
|
63
|
+
export declare const setFocusOnElement: (ref: (Element & {
|
|
64
64
|
componentOnReady?: () => Promise<void>;
|
|
65
|
-
}) | null | undefined, selector: string)
|
|
65
|
+
}) | null | undefined, selector: string) => void;
|
package/dist/dom.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param callback The callback to invoke when the attributes have been changed.
|
|
8
8
|
* @returns The mutation observer
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const observeAncestorsMutation: (element: Node, attributeFilter: string[], callback: () => void) => (() => void);
|
|
11
11
|
/**
|
|
12
12
|
* Find the closest element that matches the selector.
|
|
13
13
|
* It will traverse the element's ancestors to find the target element.
|
|
@@ -16,7 +16,7 @@ export declare function observeAncestorsMutation(element: Node, attributeFilter:
|
|
|
16
16
|
* @param selector The selector to match.
|
|
17
17
|
* @returns The closest element that matches the selector or null if not found.
|
|
18
18
|
*/
|
|
19
|
-
export declare
|
|
19
|
+
export declare const closestElement: (base: Element, selector: string) => Element | null;
|
|
20
20
|
/**
|
|
21
21
|
* Use the Calcite mode to determine the theme of the element.
|
|
22
22
|
* It will traverse the element's ancestors to find the theme.
|
|
@@ -24,13 +24,13 @@ export declare function closestElement(base: Element, selector: string): Element
|
|
|
24
24
|
* @param base The element to start the search from.
|
|
25
25
|
* @returns The theme of the element, either "light" or "dark", "light" is the default.
|
|
26
26
|
*/
|
|
27
|
-
export declare
|
|
27
|
+
export declare const getElementTheme: (base: Element) => "dark" | "light";
|
|
28
28
|
/**
|
|
29
29
|
* Get direction property of closest element.
|
|
30
30
|
* @param el The element to start the search from.
|
|
31
31
|
* @returns The direction of the element, either "ltr" | "rtl", "ltr" is the default.
|
|
32
32
|
*/
|
|
33
|
-
export declare
|
|
33
|
+
export declare const getElementDir: (el: HTMLElement) => "ltr" | "rtl";
|
|
34
34
|
/**
|
|
35
35
|
* Get the attribute value from the element.
|
|
36
36
|
* It will traverse the element's ancestors to find the attribute.
|
|
@@ -42,11 +42,11 @@ export declare function getElementDir(el: HTMLElement): "ltr" | "rtl";
|
|
|
42
42
|
* @param fallbackValue The fallback value if the attribute is not found.
|
|
43
43
|
* @returns The attribute value or the fallback value if the attribute is not found.
|
|
44
44
|
*/
|
|
45
|
-
export declare
|
|
45
|
+
export declare const getElementAttribute: (el: Element, prop: string, fallbackValue: string) => string;
|
|
46
46
|
export interface FocusableElement extends HTMLElement {
|
|
47
47
|
setFocus?: () => Promise<void>;
|
|
48
48
|
}
|
|
49
|
-
export declare
|
|
49
|
+
export declare const focusElement: (el: FocusableElement | undefined) => Promise<void>;
|
|
50
50
|
/**
|
|
51
51
|
* Set the focus on the element that matches the selector.
|
|
52
52
|
* It will traverse the element's ancestors to find the target element.
|
|
@@ -60,6 +60,6 @@ export declare function focusElement(el: FocusableElement | undefined): Promise<
|
|
|
60
60
|
* REFACTOR: this is doing too much. break it into separate find element and focus
|
|
61
61
|
* element utilities
|
|
62
62
|
*/
|
|
63
|
-
export declare
|
|
63
|
+
export declare const setFocusOnElement: (ref: (Element & {
|
|
64
64
|
componentOnReady?: () => Promise<void>;
|
|
65
|
-
}) | null | undefined, selector: string)
|
|
65
|
+
}) | null | undefined, selector: string) => void;
|
package/dist/errors.d.cts
CHANGED
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
* packages, simpler alternatives are provided:
|
|
16
16
|
* https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare const isEsriInternalEnv: () => boolean;
|
|
19
19
|
/**
|
|
20
20
|
* Calls a sync method and catch any errors. Returns undefined if error occurred.
|
|
21
21
|
*
|
|
22
22
|
* Can also provide a thisContext and rest arguments
|
|
23
23
|
*/
|
|
24
|
-
export declare
|
|
24
|
+
export declare const safeCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => ReturnType<Callback> | void;
|
|
25
25
|
/**
|
|
26
26
|
* Calls an async method and catch any errors. Returns undefined if error occurred.
|
|
27
27
|
*
|
|
28
28
|
* Can also provide a thisContext and rest arguments
|
|
29
29
|
*/
|
|
30
|
-
export declare
|
|
30
|
+
export declare const safeAsyncCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => Promise<Awaited<ReturnType<Callback>> | void>;
|
package/dist/errors.d.ts
CHANGED
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
* packages, simpler alternatives are provided:
|
|
16
16
|
* https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
|
|
17
17
|
*/
|
|
18
|
-
export declare
|
|
18
|
+
export declare const isEsriInternalEnv: () => boolean;
|
|
19
19
|
/**
|
|
20
20
|
* Calls a sync method and catch any errors. Returns undefined if error occurred.
|
|
21
21
|
*
|
|
22
22
|
* Can also provide a thisContext and rest arguments
|
|
23
23
|
*/
|
|
24
|
-
export declare
|
|
24
|
+
export declare const safeCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => ReturnType<Callback> | void;
|
|
25
25
|
/**
|
|
26
26
|
* Calls an async method and catch any errors. Returns undefined if error occurred.
|
|
27
27
|
*
|
|
28
28
|
* Can also provide a thisContext and rest arguments
|
|
29
29
|
*/
|
|
30
|
-
export declare
|
|
30
|
+
export declare const safeAsyncCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => Promise<Awaited<ReturnType<Callback>> | void>;
|
package/dist/guid.d.cts
CHANGED
package/dist/guid.d.ts
CHANGED