@arcgis/lumina 4.34.0-next.3 → 4.34.0-next.30
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.
|
@@ -22,6 +22,7 @@ class AccessorController extends GenericController {
|
|
|
22
22
|
constructor(component, createInstance) {
|
|
23
23
|
super(component);
|
|
24
24
|
this.Y = /* @__PURE__ */ new Map();
|
|
25
|
+
this.A = void 0;
|
|
25
26
|
this.#exportsObservable = createObservable();
|
|
26
27
|
const that = this;
|
|
27
28
|
that.#createInstance = createInstance;
|
|
@@ -107,9 +108,12 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
107
108
|
) {
|
|
108
109
|
return value;
|
|
109
110
|
}
|
|
111
|
+
const accessorController = component.M[accessorControllerIndex];
|
|
112
|
+
accessorController.A = propertyName;
|
|
110
113
|
return trackKey(
|
|
111
114
|
component,
|
|
112
115
|
(resolved) => {
|
|
116
|
+
accessorController.A = void 0;
|
|
113
117
|
if (resolved !== void 0) {
|
|
114
118
|
const propName = resolved.key;
|
|
115
119
|
boundProperties.set(propertyName, propName);
|
|
@@ -120,15 +124,15 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
120
124
|
if (!(propertyName in instance)) {
|
|
121
125
|
throw new Error(`"${propertyName}" does not exist on the accessor instance`);
|
|
122
126
|
}
|
|
123
|
-
const
|
|
127
|
+
const accessorController2 = component.M[accessorControllerIndex];
|
|
124
128
|
if (descriptor.i !== void 0 && descriptor.i !== accessorControllerIndex) {
|
|
125
|
-
console.error(component.M[descriptor.i],
|
|
129
|
+
console.error(component.M[descriptor.i], accessorController2);
|
|
126
130
|
throw Error(
|
|
127
131
|
`Expected property "${propName}" to be bound to the controller at index ${descriptor.i}, but tried to bind it to a controller at index ${accessorControllerIndex}. Double check whether you are calling useAccessor() conditionally in a way that is not supported.`
|
|
128
132
|
);
|
|
129
133
|
}
|
|
130
|
-
if (
|
|
131
|
-
console.error(
|
|
134
|
+
if (accessorController2 !== accessorControllerRef.deref()) {
|
|
135
|
+
console.error(accessorController2);
|
|
132
136
|
throw Error(
|
|
133
137
|
`Expected controller at index ${accessorControllerIndex} to be instance of useAccessor but it is not.`
|
|
134
138
|
);
|
|
@@ -156,13 +160,6 @@ const makeBinderProxy = (component, accessorControllerRef, accessorControllerInd
|
|
|
156
160
|
},
|
|
157
161
|
value
|
|
158
162
|
);
|
|
159
|
-
},
|
|
160
|
-
set(_target, propertyName, newValue) {
|
|
161
|
-
if (boundProperties.has(propertyName) || // But some properties may be never bound, yet set in the constructor - let them through
|
|
162
|
-
newValue !== (instance[propertyName] ?? void 0)) {
|
|
163
|
-
instance[propertyName] = newValue;
|
|
164
|
-
}
|
|
165
|
-
return true;
|
|
166
163
|
}
|
|
167
164
|
});
|
|
168
165
|
const watchBoundProperty = (controllerRef, descriptor, propertyName, propName, shouldFlipBoolean, _handle) => _handle = watch(
|
|
@@ -199,7 +196,10 @@ const bindPropToProperty = (descriptor, accessorControllerIndex, propertyName, s
|
|
|
199
196
|
return shouldFlipBoolean ? !value : value;
|
|
200
197
|
};
|
|
201
198
|
descriptor.d.set = function(newValue) {
|
|
202
|
-
this.M[accessorControllerIndex]
|
|
199
|
+
const accessorController = this.M[accessorControllerIndex];
|
|
200
|
+
if (accessorController.A !== propertyName) {
|
|
201
|
+
accessorController.exports[propertyName] = shouldFlipBoolean ? !newValue : newValue;
|
|
202
|
+
}
|
|
203
203
|
};
|
|
204
204
|
};
|
|
205
205
|
const getAccessorControllerBoundProperties = (controller) => controller.Y;
|
|
@@ -212,10 +212,15 @@ const reCreateAccessor = (instance, component) => {
|
|
|
212
212
|
console.error("Unable to resolve the useAccessor controller from the provided value");
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
|
-
const createStore = (
|
|
215
|
+
const createStore = (initializer) => {
|
|
216
216
|
const SubClass = class extends Accessor {
|
|
217
217
|
};
|
|
218
|
-
|
|
218
|
+
const defaultValues = typeof initializer === "function" ? initializer() : initializer;
|
|
219
|
+
const descriptors = Object.getOwnPropertyDescriptors(defaultValues);
|
|
220
|
+
for (const [key, descriptor] of Object.entries(descriptors)) {
|
|
221
|
+
Object.defineProperty(SubClass.prototype, key, descriptor);
|
|
222
|
+
property()(SubClass.prototype, key);
|
|
223
|
+
}
|
|
219
224
|
const State = subclass()(SubClass);
|
|
220
225
|
return new State();
|
|
221
226
|
};
|
|
@@ -2,7 +2,7 @@ import { default as Accessor } from '@arcgis/core/core/Accessor.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* See https://qawebgis.esri.com/components/lumina/controllers/useAccessor#createstore-utility
|
|
4
4
|
*/
|
|
5
|
-
export declare const createStore: <T extends Record<string, unknown>>(
|
|
5
|
+
export declare const createStore: <T extends Record<string, unknown>>(initializer: T | (() => T)) => __esri.Accessor & T;
|
|
6
6
|
/** @deprecated Use {@link createStore} instead */
|
|
7
7
|
export declare const createLegacyStore: <T extends Record<string, unknown>>(defaultState: T | (() => T)) => ObservableMap<T>;
|
|
8
8
|
/** @deprecated Use {@link createStore} instead */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GenericController } from '../Controller';
|
|
2
2
|
import { LitElement } from '../../LitElement';
|
|
3
3
|
type Requires<Props, Accessor extends __esri.Accessor, OmitProps extends string = never> = LitElement & Omit<Pick<Accessor, keyof Accessor & keyof Props>, AlwaysOmit | OmitProps> & {
|
|
4
4
|
autoDestroyDisabled: boolean;
|
|
@@ -46,6 +46,8 @@ export declare class AccessorController<Props, Accessor extends __esri.Accessor,
|
|
|
46
46
|
* @private
|
|
47
47
|
*/
|
|
48
48
|
_boundAccessorProperties: Map<string & keyof Accessor, string>;
|
|
49
|
+
/** @private */
|
|
50
|
+
_currentlyBindingPropertyName?: string;
|
|
49
51
|
/**
|
|
50
52
|
* (development only) Allow these props to mismatch the name of the Accessor's
|
|
51
53
|
* property to avoid collisions
|
|
@@ -61,8 +63,11 @@ export declare class AccessorController<Props, Accessor extends __esri.Accessor,
|
|
|
61
63
|
hostConnected(): void;
|
|
62
64
|
hostDestroy(): void;
|
|
63
65
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
type MinimalAccessorController = Pick<AccessorController<never, __esri.Accessor>, "_currentlyBindingPropertyName" | "exports"> & {
|
|
67
|
+
component: LitElement;
|
|
68
|
+
};
|
|
69
|
+
export declare const makeBinderProxy: (component: LitElement, accessorControllerRef: WeakRef<MinimalAccessorController & {
|
|
70
|
+
constructor: MinimalAccessorController["constructor"] & {
|
|
66
71
|
devOnly$allowedPropNameMismatches?: ReadonlySet<string>;
|
|
67
72
|
};
|
|
68
73
|
}>, accessorControllerIndex: number, instance: __esri.Accessor, boundProperties: Map<string, string>) => unknown;
|
|
@@ -127,7 +127,7 @@ const useDirection = () => makeController((component, controller) => {
|
|
|
127
127
|
(resolved) => {
|
|
128
128
|
if (resolved?.key === "dir") {
|
|
129
129
|
throw new Error(
|
|
130
|
-
|
|
130
|
+
"Do not assign this controller to a prop called `dir` as that will overwrite the HTMLElement's built-in `dir` attribute - component should not be setting the `dir` attribute on itself. Instead, assign this controller to a property called `direction`."
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
133
|
},
|
|
@@ -511,6 +511,7 @@ export interface AriaAttributes {
|
|
|
511
511
|
* @see aria-controls
|
|
512
512
|
*/
|
|
513
513
|
["aria-owns"]?: string;
|
|
514
|
+
ariaActiveDescendantElement?: Element;
|
|
514
515
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAtomic) */
|
|
515
516
|
ariaAtomic?: boolean | "false" | "true";
|
|
516
517
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaAutoComplete) */
|
|
@@ -529,14 +530,19 @@ export interface AriaAttributes {
|
|
|
529
530
|
ariaColIndex?: number | string;
|
|
530
531
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaColSpan) */
|
|
531
532
|
ariaColSpan?: number | string;
|
|
533
|
+
ariaControlsElements?: Element[];
|
|
532
534
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaCurrent) */
|
|
533
535
|
ariaCurrent?: boolean | "date" | "false" | "location" | "page" | "step" | "time" | "true";
|
|
536
|
+
ariaDescribedByElements?: Element[];
|
|
534
537
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDescription) */
|
|
535
538
|
ariaDescription?: string;
|
|
539
|
+
ariaDetailsElements?: Element[];
|
|
536
540
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaDisabled) */
|
|
537
541
|
ariaDisabled?: boolean | "false" | "true";
|
|
542
|
+
ariaErrorMessageElement?: Element;
|
|
538
543
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaExpanded) */
|
|
539
544
|
ariaExpanded?: boolean | "false" | "true";
|
|
545
|
+
ariaFlowToElements?: Element[];
|
|
540
546
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHasPopup) */
|
|
541
547
|
ariaHasPopup?: boolean | "dialog" | "false" | "grid" | "listbox" | "menu" | "tree" | "true";
|
|
542
548
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaHidden) */
|
|
@@ -550,6 +556,7 @@ export interface AriaAttributes {
|
|
|
550
556
|
ariaKeyShortcuts?: string;
|
|
551
557
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLabel) */
|
|
552
558
|
ariaLabel?: string;
|
|
559
|
+
ariaLabelledByElements?: Element[];
|
|
553
560
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLevel) */
|
|
554
561
|
ariaLevel?: number | string;
|
|
555
562
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaLive) */
|
|
@@ -562,6 +569,7 @@ export interface AriaAttributes {
|
|
|
562
569
|
ariaMultiSelectable?: boolean | "false" | "true";
|
|
563
570
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaOrientation) */
|
|
564
571
|
ariaOrientation?: "horizontal" | "vertical";
|
|
572
|
+
ariaOwnsElements?: Element[];
|
|
565
573
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPlaceholder) */
|
|
566
574
|
ariaPlaceholder?: string;
|
|
567
575
|
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Element/ariaPosInSet) */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/lumina",
|
|
3
|
-
"version": "4.34.0-next.
|
|
3
|
+
"version": "4.34.0-next.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@arcgis/components-utils": "4.34.0-next.
|
|
25
|
+
"@arcgis/components-utils": "4.34.0-next.30",
|
|
26
26
|
"@lit-labs/ssr": "^3.2.2",
|
|
27
27
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
28
28
|
"@lit/context": "^1.1.5",
|