juxscript 1.1.311 → 1.1.313
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare class PageState {
|
|
2
2
|
private _registry;
|
|
3
3
|
private _proxy;
|
|
4
|
+
private _nullProxy;
|
|
4
5
|
static readonly WIRE_EVENTS: readonly ["blur", "focus", "click", "dblclick", "change", "input", "keydown", "keyup", "keypress", "mouseenter", "mouseleave", "mousedown", "mouseup", "submit"];
|
|
5
6
|
constructor();
|
|
6
7
|
private _createComponentProxy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;
|
|
1
|
+
{"version":3,"file":"pageState.d.ts","sourceRoot":"","sources":["../../../lib/state/pageState.ts"],"names":[],"mappings":"AAeA,cAAM,SAAS;IACX,OAAO,CAAC,SAAS,CAA0C;IAC3D,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,UAAU,CAMf;IAEH,MAAM,CAAC,QAAQ,CAAC,WAAW,mKAQhB;;IA+BX,OAAO,CAAC,qBAAqB;IAsH7B,OAAO,CAAC,SAAS;IAkEjB,OAAO,CAAC,UAAU;IAgClB,OAAO,CAAC,YAAY;IAkBpB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,OAAO;IA2Cf,OAAO,CAAC,MAAM;IAmBd,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAGlC;AAID,eAAO,MAAM,SAAS,qBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -6,6 +6,14 @@ let isNotifying = false;
|
|
|
6
6
|
class PageState {
|
|
7
7
|
constructor() {
|
|
8
8
|
this._registry = new Map();
|
|
9
|
+
this._nullProxy = new Proxy({}, {
|
|
10
|
+
get: (_, prop) => {
|
|
11
|
+
if (typeof prop === 'symbol')
|
|
12
|
+
return undefined;
|
|
13
|
+
return undefined;
|
|
14
|
+
},
|
|
15
|
+
set: () => true
|
|
16
|
+
});
|
|
9
17
|
this._proxy = new Proxy({}, {
|
|
10
18
|
get: (_, id) => {
|
|
11
19
|
if (typeof id === 'symbol')
|
|
@@ -22,7 +30,7 @@ class PageState {
|
|
|
22
30
|
return () => Array.from(this._registry.keys());
|
|
23
31
|
const entry = this._registry.get(id);
|
|
24
32
|
if (!entry)
|
|
25
|
-
return
|
|
33
|
+
return this._nullProxy;
|
|
26
34
|
return this._createComponentProxy(id, entry);
|
|
27
35
|
},
|
|
28
36
|
set: (_, id, value) => {
|
|
@@ -124,9 +132,14 @@ class PageState {
|
|
|
124
132
|
}
|
|
125
133
|
}
|
|
126
134
|
else if (prop === 'visible') {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
135
|
+
// Prefer wrapper (hides label + input together), fall back to element
|
|
136
|
+
let target = null;
|
|
137
|
+
if (comp._wrapper instanceof HTMLElement) {
|
|
138
|
+
target = comp._wrapper;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
target = this._findElement(comp);
|
|
142
|
+
}
|
|
130
143
|
if (target) {
|
|
131
144
|
target.style.display = value ? '' : 'none';
|
|
132
145
|
}
|