@arcgis/lumina 4.34.0-next.14 → 4.34.0-next.16
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.
|
@@ -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 */
|
|
@@ -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
|
},
|
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.16",
|
|
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.16",
|
|
26
26
|
"@lit-labs/ssr": "^3.2.2",
|
|
27
27
|
"@lit-labs/ssr-client": "^1.1.7",
|
|
28
28
|
"@lit/context": "^1.1.5",
|