@arcgis/lumina 5.2.0-next.2 → 5.2.0-next.21
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/{ControllerManager-DpJfvft9.js → ControllerManager-4cSEnB5Y.js} +12 -8
- package/dist/{Controller-Cer_6Z29.js → GenericController-C8NSb50b.js} +59 -23
- package/dist/LitElement.d.ts +179 -250
- package/dist/PublicLitElement.d.ts +64 -30
- package/dist/config.d.ts +22 -16
- package/dist/context.d.ts +24 -24
- package/dist/controllers/Controller.d.ts +106 -139
- package/dist/controllers/ControllerInternals.d.ts +33 -25
- package/dist/controllers/ControllerManager.d.ts +40 -61
- package/dist/controllers/GenericController.d.ts +26 -0
- package/dist/controllers/accessor/index.d.ts +6 -4
- package/dist/controllers/accessor/index.js +23 -5
- package/dist/controllers/accessor/reEmitEvent.d.ts +6 -3
- package/dist/controllers/accessor/store.d.ts +21 -14
- package/dist/controllers/accessor/useAccessor.d.ts +86 -68
- package/dist/controllers/functional.d.ts +11 -4
- package/dist/controllers/index.d.ts +35 -36
- package/dist/controllers/index.js +5 -7
- package/dist/controllers/load.d.ts +3 -2
- package/dist/controllers/proxyExports.d.ts +6 -5
- package/dist/controllers/toFunction.d.ts +4 -2
- package/dist/controllers/trackKey.d.ts +9 -4
- package/dist/controllers/trackPropKey.d.ts +8 -2
- package/dist/controllers/trackPropertyKey.d.ts +11 -6
- package/dist/controllers/types.d.ts +99 -170
- package/dist/controllers/useDirection.d.ts +5 -6
- package/dist/controllers/useMedia.d.ts +3 -2
- package/dist/controllers/usePropertyChange.d.ts +9 -10
- package/dist/controllers/useSlottableRequest.d.ts +15 -10
- package/dist/controllers/useT9n.d.ts +44 -38
- package/dist/controllers/useWatchAttributes.d.ts +6 -3
- package/dist/controllers/utils.d.ts +13 -5
- package/dist/createEvent.d.ts +32 -32
- package/dist/decorators.d.ts +16 -9
- package/dist/formAssociatedUtils.d.ts +5 -47
- package/dist/globalTypes/importMeta.d.ts +18 -10
- package/dist/globalTypes/index.d.ts +6 -4
- package/dist/globalTypes/jsxGlobals.d.ts +36 -23
- package/dist/globalTypes/loadLitCss.d.ts +61 -40
- package/dist/globalTypes/viteEnv.d.ts +60 -26
- package/dist/hmrSupport.d.ts +24 -28
- package/dist/index.d.ts +17 -16
- package/dist/index.js +27 -7
- package/dist/jsx/baseTypes.d.ts +26 -26
- package/dist/jsx/directives.d.ts +30 -42
- package/dist/jsx/generatedTypes.d.ts +3002 -2923
- package/dist/jsx/types.d.ts +214 -171
- package/dist/jsx/utils.d.ts +19 -14
- package/dist/lazyLoad.d.ts +31 -110
- package/dist/makeRuntime.d.ts +104 -127
- package/dist/{proxyExports-BkN6hND0.js → proxyExports-ZRLty8oJ.js} +1 -1
- package/dist/render.d.ts +4 -2
- package/dist/utils.d.ts +9 -14
- package/dist/wrappersUtils.d.ts +25 -26
- package/package.json +7 -4
- package/dist/devOnlyDetectIncorrectLazyUsages.d.ts +0 -14
- package/dist/lifecycleSupport.d.ts +0 -8
- package/dist/tests/wrappersUtils.typeTest.d.ts +0 -1
|
@@ -1,187 +1,116 @@
|
|
|
1
|
-
import { IHandle } from
|
|
2
|
-
import {
|
|
3
|
-
import { LitElement } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated use LitElement instead
|
|
14
|
-
*/
|
|
15
|
-
export type BaseComponent = Omit<LitElement, "componentOnReady"> & {
|
|
16
|
-
autoDestroyDisabled?: boolean;
|
|
17
|
-
destroy?: () => Promise<void>;
|
|
18
|
-
};
|
|
1
|
+
import type { IHandle } from "@arcgis/toolkit/type";
|
|
2
|
+
import type { ReactiveController, PropertyDeclaration, PropertyValues } from "lit";
|
|
3
|
+
import type { LitElement } from "../LitElement.js";
|
|
4
|
+
|
|
5
|
+
export interface TrackKeyResolution {
|
|
6
|
+
readonly key: string;
|
|
7
|
+
readonly host: BaseController | LitElement;
|
|
8
|
+
/** True if property is decorated with a `@state()` or `@property()` decorator */
|
|
9
|
+
readonly isReactive: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
19
12
|
/**
|
|
20
13
|
* Helper utility to get component type from a controller. Can be used in
|
|
21
|
-
* "implements"
|
|
14
|
+
* "implements".
|
|
15
|
+
*
|
|
16
|
+
* TypeScript detects errors even without `Use<typeof useHomeViewModel>`, but Use
|
|
17
|
+
* makes errors display in a more readable format.
|
|
18
|
+
*
|
|
22
19
|
* @example
|
|
20
|
+
* ```ts
|
|
23
21
|
* const useHomeViewModel = makeViewModelController(newWidgetsHomeHomeViewModel);
|
|
24
22
|
* export class Home extends LitElement implements Use<typeof useHomeViewModel> {
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* TypeScript detects errors even without Use<typeof useHomeViewModel>, but Use
|
|
28
|
-
* makes errors display in a more readable format
|
|
23
|
+
* ```
|
|
29
24
|
*/
|
|
30
25
|
export type Use<Callback extends (component: any) => unknown> = Parameters<Callback>[0];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
26
|
+
|
|
27
|
+
/** Base API for a controller. Compatible with Lit's Reactive controllers */
|
|
34
28
|
export type ControllerLifecycleMethods = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
* These members are added to the component instance by ControllerManager.
|
|
79
|
-
*
|
|
80
|
-
* @deprecated use LitElement instead
|
|
81
|
-
*/
|
|
82
|
-
export type ControllerHost = {
|
|
83
|
-
/**
|
|
84
|
-
* Adds a controller to the host, which connects the controller's lifecycle
|
|
85
|
-
* methods to the host's lifecycle.
|
|
86
|
-
*/
|
|
87
|
-
addController(controller: BaseController): void;
|
|
88
|
-
addController(controller: ReactiveController): void;
|
|
89
|
-
/**
|
|
90
|
-
* Removes a controller from the host.
|
|
91
|
-
*/
|
|
92
|
-
removeController(controller: BaseController): void;
|
|
93
|
-
removeController(controller: ReactiveController): void;
|
|
94
|
-
/**
|
|
95
|
-
* Requests a host update which is processed asynchronously. The update can
|
|
96
|
-
* be waited on via the `updateComplete` property.
|
|
97
|
-
*
|
|
98
|
-
* @remarks
|
|
99
|
-
* It is recommended to provide the property name describing what property
|
|
100
|
-
* triggered the update - property name will be provided to the willUpdate()
|
|
101
|
-
* lifecycle hook, giving it the ability to react to the change.
|
|
102
|
-
*
|
|
103
|
-
* @see https://lit.dev/docs/api/ReactiveElement/#ReactiveElement.requestUpdate
|
|
104
|
-
*/
|
|
105
|
-
requestUpdate: (name?: PropertyKey, oldValue?: unknown, options?: PropertyDeclaration) => void;
|
|
106
|
-
readonly updateComplete: ReactiveControllerHost["updateComplete"];
|
|
29
|
+
readonly hostConnected?: ReactiveController["hostConnected"];
|
|
30
|
+
readonly hostDisconnected?: ReactiveController["hostDisconnected"];
|
|
31
|
+
hostLoad?(): Promise<void> | void;
|
|
32
|
+
hostLoaded?(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Called during the client-side host update, just before the host calls
|
|
35
|
+
* its own update.
|
|
36
|
+
*
|
|
37
|
+
* Code in `update()` can depend on the DOM as it is not called in
|
|
38
|
+
* server-side rendering.
|
|
39
|
+
*
|
|
40
|
+
* @param changes
|
|
41
|
+
*/
|
|
42
|
+
hostUpdate?(changes: PropertyValues): void;
|
|
43
|
+
/**
|
|
44
|
+
* Called after a host update, just before the host calls firstUpdated and
|
|
45
|
+
* updated. It is not called in server-side rendering.
|
|
46
|
+
*
|
|
47
|
+
* @param changes
|
|
48
|
+
*/
|
|
49
|
+
hostUpdated?(changes: PropertyValues): void;
|
|
50
|
+
/**
|
|
51
|
+
* Called when the component is finally being destroyed (rather than
|
|
52
|
+
* temporary disconnected from the DOM)
|
|
53
|
+
*/
|
|
54
|
+
hostDestroy?(): void;
|
|
55
|
+
/**
|
|
56
|
+
* lifecycle() is a convenience higher-level callback that:
|
|
57
|
+
* - calls the provided callback right away the first time if
|
|
58
|
+
* connectedCallback has already happened once
|
|
59
|
+
* - otherwise, calls it on connectedCallback
|
|
60
|
+
* - calls the callback on each future connectedCallback
|
|
61
|
+
* - if you returned a function, or an object like {remove:()=>void}, that
|
|
62
|
+
* function will be called on the next disconnectedCallback
|
|
63
|
+
*
|
|
64
|
+
* This is a bit like `useEffect(callback, [])` in React
|
|
65
|
+
*/
|
|
66
|
+
hostLifecycle?(): (() => void)[] | IHandle | IHandle[] | (() => void) | undefined | void;
|
|
67
|
+
/**
|
|
68
|
+
* Called after component.removeComponent(controller) was called on this
|
|
69
|
+
* controller
|
|
70
|
+
*/
|
|
71
|
+
controllerRemoved?(): void;
|
|
107
72
|
};
|
|
73
|
+
|
|
108
74
|
/**
|
|
109
75
|
* A symbol is used to mark providers/controllers on a component instance.
|
|
110
76
|
* This helps to distinguish them from regular properties.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
111
79
|
*/
|
|
112
|
-
export
|
|
80
|
+
export const controllerSymbol: unique symbol;
|
|
81
|
+
|
|
113
82
|
/**
|
|
114
83
|
* Adding an optional symbol to satisfy TypeScript
|
|
115
84
|
* "type Controller has no properties in common with BaseController"
|
|
116
85
|
*/
|
|
117
|
-
export type BaseController = ControllerLifecycleMethods
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
* }
|
|
149
|
-
* ```
|
|
150
|
-
*/
|
|
151
|
-
readonly readOnly?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Short for "changed"
|
|
154
|
-
*
|
|
155
|
-
* Temporary set during a setter to track whether property is considered
|
|
156
|
-
* changed.
|
|
157
|
-
* @private
|
|
158
|
-
*/
|
|
159
|
-
c?: boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Short for "descriptor"
|
|
162
|
-
*
|
|
163
|
-
* Stores a reference to the property getter and setter. This is overwritten
|
|
164
|
-
* in useAccessor to proxy the get/set through the Accessor instance.
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
d?: PropertyDescriptor;
|
|
168
|
-
/**
|
|
169
|
-
* The positional index of the Accessor controller to which this property is
|
|
170
|
-
* bound.
|
|
171
|
-
* @private
|
|
172
|
-
*/
|
|
173
|
-
i?: number;
|
|
174
|
-
};
|
|
175
|
-
/** @private */
|
|
176
|
-
export type AccessorObservableLike = {
|
|
177
|
-
/**
|
|
178
|
-
* A callback that will be called in the setter if the value hasChanged to
|
|
179
|
-
* integrate with Accessor's reactivity notification system.
|
|
180
|
-
*/
|
|
181
|
-
notify: () => void;
|
|
182
|
-
};
|
|
183
|
-
/** @private */
|
|
184
|
-
export type ReactiveTrackingTarget = {
|
|
185
|
-
clear: () => void;
|
|
186
|
-
destroy: () => void;
|
|
187
|
-
};
|
|
86
|
+
export type BaseController = ControllerLifecycleMethods;
|
|
87
|
+
|
|
88
|
+
/** Property declaration with additional `reaDonly` option (handled by Controllers) */
|
|
89
|
+
export interface LuminaPropertyDeclaration extends PropertyDeclaration {
|
|
90
|
+
/**
|
|
91
|
+
* Declare a property that can't be modified by the developer.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* \@property({ readOnly: true })
|
|
96
|
+
* myReadonlyProp = 'initialValue';
|
|
97
|
+
* ```
|
|
98
|
+
* @example
|
|
99
|
+
* Inside the component code, you can overwrite the readOnly property like so:
|
|
100
|
+
* ```ts
|
|
101
|
+
* bypassReadOnly(() => {
|
|
102
|
+
* this.myReadonlyProp = 'newValue';
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
* @example
|
|
106
|
+
* Alternatively, you can declare a readOnly prop like so:
|
|
107
|
+
*
|
|
108
|
+
* ```ts
|
|
109
|
+
* \@property()
|
|
110
|
+
* get myReadonlyProp(): string {
|
|
111
|
+
* return 'someValue';
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
readonly readOnly?: boolean;
|
|
116
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
type Direction = "ltr" | "rtl";
|
|
1
|
+
export type Direction = "ltr" | "rtl";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Finds the closest "dir" attribute to current component and returns it's value.
|
|
4
5
|
* Watches for changes to "dir" and will re-render your component if needed.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Design decisions: https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987
|
|
7
|
+
* @see https://webgis.esri.com/references/lumina/controllers/useDirection
|
|
8
|
+
* @see [Design decisions](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987)
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
10
|
+
export function useDirection(): Direction;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* whether user asked to use reduced motion, or whether the screen size is above
|
|
4
4
|
* certain threshold).
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* @param query
|
|
7
|
+
* @see https://webgis.esri.com/references/lumina/controllers/useMedia
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
+
export function useMedia(query: string): boolean;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
2
|
-
import { LitElement } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}>;
|
|
1
|
+
import type { EventEmitter } from "../createEvent.js";
|
|
2
|
+
import type { LitElement } from "../LitElement.js";
|
|
3
|
+
|
|
4
|
+
/** @param toWatch */
|
|
5
|
+
export type PropertyChangeController<Component extends LitElement> = <ToWatch extends keyof Component>(...toWatch: ToWatch[]) => EventEmitter<{ name: ToWatch & string; }>;
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Let user easily set watchers for component properties.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
+
* @param component
|
|
11
|
+
* @see [Documentation](https://webgis.esri.com/references/lumina/controllers/usePropertyChange)
|
|
10
12
|
*/
|
|
11
|
-
export
|
|
12
|
-
/** Needed for typings only */
|
|
13
|
-
_component?: LitElement) => PropertyChangeController<Component>;
|
|
14
|
-
export {};
|
|
13
|
+
export function usePropertyChange<Component extends LitElement>(component?: LitElement): PropertyChangeController<Component>;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { EventEmitter } from
|
|
2
|
-
import { LitElement } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import type { EventEmitter } from "../createEvent.js";
|
|
2
|
+
import type { LitElement } from "../LitElement.js";
|
|
3
|
+
|
|
4
|
+
export interface SlottableRequestDetail {
|
|
5
|
+
name: string;
|
|
6
|
+
slotName: string;
|
|
7
|
+
data: unknown;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type WatchedProps<Component extends LitElement, ToWatch extends readonly (keyof Component)[]> = Pick<Component, ToWatch[number]>;
|
|
11
|
+
|
|
9
12
|
/**
|
|
10
13
|
* Watches host properties and emits slottable request details when the
|
|
11
14
|
* requested slot details are added, removed, or changed.
|
|
12
15
|
*
|
|
16
|
+
* @param component
|
|
17
|
+
* @param watch
|
|
18
|
+
* @param getDetailsBySlotName
|
|
13
19
|
* @example
|
|
14
20
|
* ```ts
|
|
15
21
|
* const slottableRequest = useSlottableRequest(this, ["item"], ({ item }) => {
|
|
@@ -18,5 +24,4 @@ type WatchedProps<Component extends LitElement, ToWatch extends readonly (keyof
|
|
|
18
24
|
* return details;
|
|
19
25
|
* });
|
|
20
26
|
*/
|
|
21
|
-
export
|
|
22
|
-
export {};
|
|
27
|
+
export function useSlottableRequest<Component extends LitElement, const ToWatch extends readonly (keyof Component)[], Detail extends SlottableRequestDetail>(component: Component, watch: ToWatch, getDetailsBySlotName: (component: WatchedProps<Component, ToWatch>) => ReadonlyMap<string, Detail>): EventEmitter<Detail>;
|
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
import { GenericT9nStrings, LocaleObserverResult } from
|
|
1
|
+
import type { GenericT9nStrings, LocaleObserverResult } from "@arcgis/toolkit/intl";
|
|
2
|
+
|
|
2
3
|
export type T9nMeta<T9nStrings extends GenericT9nStrings> = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
*/
|
|
20
|
-
_original?: T9nStrings;
|
|
4
|
+
_lang: LocaleObserverResult["lang"];
|
|
5
|
+
_t9nLocale: LocaleObserverResult["t9nLocale"];
|
|
6
|
+
_loading: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The "_overrides" property won't actually exist at runtime and exists only
|
|
9
|
+
* to simplify typing like so:
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Type of the messageOverrides is set automatically based on _overrides:
|
|
14
|
+
* \@property() messageOverrides?: typeof this.messages._overrides;
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
_overrides: DeepPartial<T9nStrings>;
|
|
18
|
+
/** If messageOverrides are in effect, this will contain original strings */
|
|
19
|
+
_original?: T9nStrings;
|
|
21
20
|
};
|
|
22
|
-
|
|
21
|
+
|
|
22
|
+
export type DeepPartial<T> = T extends object ? {
|
|
23
23
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
24
24
|
} : T;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
|
|
26
|
+
export interface Options {
|
|
27
|
+
/**
|
|
28
|
+
* The name of the bundle to fetch. By default, lowercase tag-name of the
|
|
29
|
+
* component without the "arcgis-" part
|
|
30
|
+
*
|
|
31
|
+
* Set to null if the component has no localization strings, but you still
|
|
32
|
+
* wish to use `useT9n` to get the locale information.
|
|
33
|
+
*/
|
|
34
|
+
readonly name?: string | null;
|
|
35
|
+
/** @default false */
|
|
36
|
+
readonly blocking?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
30
39
|
export interface UseT9n {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly blocking?: false;
|
|
36
|
-
}): Partial<Strings> & T9nMeta<Strings>;
|
|
40
|
+
/** @param options */
|
|
41
|
+
<Strings extends GenericT9nStrings>(options: Options & { readonly blocking: true; }): Strings & T9nMeta<Strings>;
|
|
42
|
+
/** @param options */
|
|
43
|
+
<Strings extends GenericT9nStrings>(options?: Options & { readonly blocking?: false; }): Partial<Strings> & T9nMeta<Strings>;
|
|
37
44
|
}
|
|
45
|
+
|
|
38
46
|
/**
|
|
39
47
|
* Load component's localization strings.
|
|
40
48
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* Design decisions
|
|
44
|
-
*
|
|
45
|
-
* - https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987
|
|
49
|
+
* @param getAssetPath
|
|
50
|
+
* @see [Documentation](https://webgis.esri.com/references/lumina/controllers/useT9n)
|
|
51
|
+
* @see [Design decisions 1](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/969)
|
|
52
|
+
* @see [Design decisions 2](https://devtopia.esri.com/WebGIS/arcgis-web-components/discussions/987)
|
|
46
53
|
*/
|
|
47
|
-
export
|
|
48
|
-
export {};
|
|
54
|
+
export function makeT9nController(getAssetPath: (path: string) => string): UseT9n;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Controller } from
|
|
1
|
+
import type { Controller } from "./Controller.js";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* Watch when given attributes change on the component element.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* @param attributes
|
|
7
|
+
* @param callback
|
|
8
|
+
* @see https://webgis.esri.com/references/lumina/controllers/useWatchAttributes
|
|
6
9
|
*/
|
|
7
|
-
export
|
|
10
|
+
export function useWatchAttributes<T extends string>(attributes: readonly T[], callback: (newValue: string | null, oldValue: string | null, attribute: T) => void): Controller;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { LitElement } from
|
|
2
|
-
import { ControllerLifecycleMethods } from
|
|
3
|
-
|
|
1
|
+
import type { LitElement } from "../LitElement.js";
|
|
2
|
+
import type { ControllerLifecycleMethods } from "./types.js";
|
|
3
|
+
|
|
4
|
+
/** @param value */
|
|
5
|
+
export function isController(value: unknown): value is ControllerLifecycleMethods;
|
|
6
|
+
|
|
4
7
|
/**
|
|
5
8
|
* Checks if the argument is a promise by checking if it has a `then` method.
|
|
9
|
+
*
|
|
10
|
+
* @param arg
|
|
6
11
|
*/
|
|
7
|
-
export
|
|
12
|
+
export function isPromise<T>(arg: Promise<T> | T): arg is Promise<T>;
|
|
13
|
+
|
|
8
14
|
/**
|
|
9
15
|
* Get the number of controllers current component has. Can be used to get a
|
|
10
16
|
* unique id for each controller.
|
|
17
|
+
*
|
|
18
|
+
* @param component
|
|
11
19
|
*/
|
|
12
|
-
export
|
|
20
|
+
export function getControllersCount(component: LitElement): number;
|
package/dist/createEvent.d.ts
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/** An event emitter object. */
|
|
2
|
+
export interface EventEmitter<T = void> {
|
|
3
|
+
/** @param payload */
|
|
4
|
+
emit(payload: T): CustomEvent<T>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
7
|
/**
|
|
8
8
|
* While these defaults don't match DOM defaults (all false), they match
|
|
9
9
|
* Stencil and Shoelace defaults. Also, they make more sense for our
|
|
10
10
|
* usage (i.e why would you want events to not be cancelable by default?)
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
12
|
+
export interface EventOptions {
|
|
13
|
+
/**
|
|
14
|
+
* A Boolean indicating whether the event bubbles up through the DOM or not.
|
|
15
|
+
*
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
bubbles?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* A Boolean indicating whether the event is cancelable. Defaults to `true`,
|
|
21
|
+
* unlike the DOM's default of `false`, as that is the desired behavior most
|
|
22
|
+
* of the time.
|
|
23
|
+
*
|
|
24
|
+
* @default true
|
|
25
|
+
*/
|
|
26
|
+
cancelable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A Boolean value indicating whether or not the event can bubble across the
|
|
29
|
+
* boundary between the shadow DOM and the regular DOM.
|
|
30
|
+
*
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
composed?: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
36
|
/**
|
|
37
37
|
* Creates an event emitter.
|
|
38
38
|
* Events emitted by your component will be included in the documentation.
|
|
39
39
|
*
|
|
40
|
+
* @param options
|
|
40
41
|
* @example
|
|
41
42
|
* Declaring an event whose payload is of type `number`:
|
|
42
43
|
*
|
|
@@ -45,6 +46,5 @@ export declare const createEventFactory: <T = void>(eventName?: string, options?
|
|
|
45
46
|
* arcgisClick = createEvent<number>();
|
|
46
47
|
* }
|
|
47
48
|
* ```
|
|
48
|
-
*
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export const createEvent: <T = void>(options?: EventOptions) => EventEmitter<T>;
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { LuminaPropertyDeclaration } from
|
|
2
|
-
|
|
1
|
+
import type { LuminaPropertyDeclaration } from "./controllers/types.js";
|
|
2
|
+
|
|
3
|
+
export { state } from "lit/decorators/state.js";
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* A class field or accessor decorator which creates a reactive property that
|
|
5
7
|
* reflects a corresponding attribute value. When a decorated property is set
|
|
@@ -22,15 +24,14 @@ export { state } from 'lit/decorators/state.js';
|
|
|
22
24
|
* needed, state properties can be initialized via public properties to
|
|
23
25
|
* facilitate complex interactions.
|
|
24
26
|
*
|
|
27
|
+
* @param options
|
|
25
28
|
* @example
|
|
26
|
-
*
|
|
27
29
|
* ```ts
|
|
28
30
|
* class MyElement {
|
|
29
31
|
* \@property()
|
|
30
32
|
* clicked = false;
|
|
31
33
|
* }
|
|
32
34
|
* ```
|
|
33
|
-
*
|
|
34
35
|
* @example
|
|
35
36
|
* Declaring a readOnly property:
|
|
36
37
|
*
|
|
@@ -41,15 +42,21 @@ export { state } from 'lit/decorators/state.js';
|
|
|
41
42
|
* }
|
|
42
43
|
* ```
|
|
43
44
|
*/
|
|
44
|
-
export
|
|
45
|
-
|
|
45
|
+
export const property: (options?: Omit<LuminaPropertyDeclaration, "state">) => PropertyDecorator;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param target
|
|
49
|
+
* @param propertyKey
|
|
50
|
+
* @param descriptor
|
|
51
|
+
*/
|
|
52
|
+
export type CustomMethodDecorator<T> = (target: unknown, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
|
|
53
|
+
|
|
46
54
|
/**
|
|
47
55
|
* The `@method()` decorator is used to expose methods on the public API.
|
|
48
56
|
* Class methods decorated with the `@method()` decorator can be called directly
|
|
49
57
|
* from the element, meaning they are intended to be callable from the outside.
|
|
50
58
|
*
|
|
51
|
-
* @remarks
|
|
52
59
|
* This decorator does not exist at runtime and is only used as a hint for the
|
|
53
|
-
* compiler to
|
|
60
|
+
* compiler to expose the methods in NPM and CDN builds.
|
|
54
61
|
*/
|
|
55
|
-
export
|
|
62
|
+
export const method: () => CustomMethodDecorator<(...args: never[]) => any>;
|