@schukai/monster 4.148.0 → 4.148.2
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/package.json +1 -1
- package/source/components/form/select.mjs +151 -34
- package/source/components/form/util/floating-layout-queue.mjs +38 -18
- package/source/components/form/util/floating-ui.mjs +68 -12
- package/source/data/pathfinder.mjs +44 -6
- package/source/dom/updater.mjs +76 -25
- package/source/types/proxyobserver.mjs +15 -0
- package/source/util/clone.mjs +8 -6
- package/test/cases/components/form/floating-ui.mjs +48 -1
- package/test/cases/components/form/select.mjs +276 -23
- package/test/cases/data/pathfinder.mjs +105 -1
- package/test/cases/dom/updater.mjs +293 -0
- package/test/cases/types/proxyobserver.mjs +52 -0
- package/test/cases/util/clone.mjs +24 -0
|
@@ -43,6 +43,17 @@ const DELIMITER = ".";
|
|
|
43
43
|
*/
|
|
44
44
|
const WILDCARD = "*";
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Path segments that must never be traversed by mutation operations.
|
|
48
|
+
* @private
|
|
49
|
+
* @type {Set<string>}
|
|
50
|
+
*/
|
|
51
|
+
const UNSAFE_MUTATION_PATH_SEGMENTS = new Set([
|
|
52
|
+
"__proto__",
|
|
53
|
+
"constructor",
|
|
54
|
+
"prototype",
|
|
55
|
+
]);
|
|
56
|
+
|
|
46
57
|
/**
|
|
47
58
|
* Pathfinder is a class to find a path to an object.
|
|
48
59
|
*
|
|
@@ -245,7 +256,12 @@ function getValueViaPath(subject, path, check) {
|
|
|
245
256
|
}
|
|
246
257
|
|
|
247
258
|
let parts;
|
|
248
|
-
if (
|
|
259
|
+
if (isArray(path)) {
|
|
260
|
+
if (path.length === 0) {
|
|
261
|
+
return subject;
|
|
262
|
+
}
|
|
263
|
+
parts = [...path];
|
|
264
|
+
} else {
|
|
249
265
|
if (path === "") {
|
|
250
266
|
return subject;
|
|
251
267
|
}
|
|
@@ -263,10 +279,12 @@ function getValueViaPath(subject, path, check) {
|
|
|
263
279
|
let anchor;
|
|
264
280
|
if (subject instanceof Map || subject instanceof WeakMap) {
|
|
265
281
|
anchor = subject.get(current);
|
|
266
|
-
} else if (subject instanceof Set
|
|
282
|
+
} else if (subject instanceof Set) {
|
|
267
283
|
current = parseInt(current);
|
|
268
284
|
validateInteger(current);
|
|
269
285
|
anchor = [...subject]?.[current];
|
|
286
|
+
} else if (subject instanceof WeakSet) {
|
|
287
|
+
throw Error("unsupported action for this data type (WeakSet)");
|
|
270
288
|
} else if (typeof WeakRef === "function" && subject instanceof WeakRef) {
|
|
271
289
|
throw Error("unsupported action for this data type (WeakRef)");
|
|
272
290
|
} else if (isArray(subject)) {
|
|
@@ -318,6 +336,7 @@ function setValueViaPath(subject, path, value) {
|
|
|
318
336
|
if (!(isArray(path) || isString(path))) {
|
|
319
337
|
throw new Error("type error: a path must be a string or an array");
|
|
320
338
|
}
|
|
339
|
+
validateMutationPath(path);
|
|
321
340
|
|
|
322
341
|
let parts;
|
|
323
342
|
if (isArray(path)) {
|
|
@@ -325,7 +344,7 @@ function setValueViaPath(subject, path, value) {
|
|
|
325
344
|
return;
|
|
326
345
|
}
|
|
327
346
|
|
|
328
|
-
parts = path;
|
|
347
|
+
parts = [...path];
|
|
329
348
|
} else {
|
|
330
349
|
parts = path.split(DELIMITER);
|
|
331
350
|
}
|
|
@@ -370,8 +389,10 @@ function setValueViaPath(subject, path, value) {
|
|
|
370
389
|
|
|
371
390
|
if (anchor instanceof Map || anchor instanceof WeakMap) {
|
|
372
391
|
anchor.set(last, value);
|
|
373
|
-
} else if (anchor instanceof Set
|
|
374
|
-
anchor.
|
|
392
|
+
} else if (anchor instanceof Set) {
|
|
393
|
+
anchor.add(value);
|
|
394
|
+
} else if (anchor instanceof WeakSet) {
|
|
395
|
+
throw Error("unsupported action for this data type in setValueViaPath");
|
|
375
396
|
} else if (typeof WeakRef === "function" && anchor instanceof WeakRef) {
|
|
376
397
|
throw Error("unsupported action for this data type in setValueViaPath");
|
|
377
398
|
} else if (isArray(anchor)) {
|
|
@@ -421,6 +442,7 @@ function deleteValueViaPath(subject, path) {
|
|
|
421
442
|
"type error: a path must be a string or an array in deleteValueViaPath",
|
|
422
443
|
);
|
|
423
444
|
}
|
|
445
|
+
validateMutationPath(path);
|
|
424
446
|
|
|
425
447
|
let parts;
|
|
426
448
|
if (isArray(path)) {
|
|
@@ -428,7 +450,7 @@ function deleteValueViaPath(subject, path) {
|
|
|
428
450
|
return;
|
|
429
451
|
}
|
|
430
452
|
|
|
431
|
-
parts = path;
|
|
453
|
+
parts = [...path];
|
|
432
454
|
} else {
|
|
433
455
|
parts = path.split(DELIMITER);
|
|
434
456
|
}
|
|
@@ -455,3 +477,19 @@ function deleteValueViaPath(subject, path) {
|
|
|
455
477
|
delete anchor[last];
|
|
456
478
|
}
|
|
457
479
|
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Reject paths that could mutate an object's prototype chain.
|
|
483
|
+
* @param {string|array} path
|
|
484
|
+
* @return {void}
|
|
485
|
+
* @throws {Error} unsafe mutation path segment
|
|
486
|
+
* @private
|
|
487
|
+
*/
|
|
488
|
+
function validateMutationPath(path) {
|
|
489
|
+
const parts = isArray(path) ? path : path.split(DELIMITER);
|
|
490
|
+
for (const part of parts) {
|
|
491
|
+
if (UNSAFE_MUTATION_PATH_SEGMENTS.has(`${part}`)) {
|
|
492
|
+
throw new Error(`unsafe mutation path segment: ${part}`);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
package/source/dom/updater.mjs
CHANGED
|
@@ -69,7 +69,8 @@ export { Updater, addObjectWithUpdaterToElement };
|
|
|
69
69
|
* @private
|
|
70
70
|
* @type {symbol}
|
|
71
71
|
*/
|
|
72
|
-
const
|
|
72
|
+
const controlEventTimersSymbol = Symbol("controlEventTimers");
|
|
73
|
+
const registeredEventTypesSymbol = Symbol("registeredEventTypes");
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
76
|
* @private
|
|
@@ -87,9 +88,29 @@ const applyChangeSymbol = Symbol("applyChange");
|
|
|
87
88
|
const updaterRootSymbol = Symbol.for("@schukai/monster/dom/@@updater-root");
|
|
88
89
|
const disposedSymbol = Symbol("disposed");
|
|
89
90
|
const subjectObserverSymbol = Symbol("subjectObserver");
|
|
91
|
+
const subjectRevisionSymbol = Symbol("subjectRevision");
|
|
90
92
|
const patchNodeKeySymbol = Symbol("patchNodeKey");
|
|
91
93
|
const queuedSnapshotSymbol = Symbol("queuedSnapshot");
|
|
92
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Tracks every notification request, including requests that Observer deduplicates
|
|
97
|
+
* while its asynchronous callback is already running.
|
|
98
|
+
* @private
|
|
99
|
+
*/
|
|
100
|
+
class UpdaterSubjectObserver extends Observer {
|
|
101
|
+
#onNotification;
|
|
102
|
+
|
|
103
|
+
constructor(callback, onNotification) {
|
|
104
|
+
super(callback);
|
|
105
|
+
this.#onNotification = onNotification;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
update(subject) {
|
|
109
|
+
this.#onNotification();
|
|
110
|
+
return super.update(subject);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
93
114
|
/**
|
|
94
115
|
* The updater class connects an object with the DOM. In this way, structures and contents in the DOM can be
|
|
95
116
|
* programmatically adapted via attributes.
|
|
@@ -165,23 +186,34 @@ class Updater extends Base {
|
|
|
165
186
|
this[pendingDiffsSymbol] = [];
|
|
166
187
|
this[processingSymbol] = false;
|
|
167
188
|
this[disposedSymbol] = false;
|
|
189
|
+
this[subjectRevisionSymbol] = 0;
|
|
168
190
|
this[queuedSnapshotSymbol] = clone(this[internalSymbol].last);
|
|
191
|
+
this[controlEventTimersSymbol] = new Map();
|
|
192
|
+
this[registeredEventTypesSymbol] = new Set();
|
|
193
|
+
|
|
194
|
+
this[subjectObserverSymbol] = new UpdaterSubjectObserver(
|
|
195
|
+
async () => {
|
|
196
|
+
let processedRevision;
|
|
197
|
+
do {
|
|
198
|
+
processedRevision = this[subjectRevisionSymbol];
|
|
199
|
+
if (this[disposedSymbol] === true) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
169
202
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
});
|
|
203
|
+
const real = this[internalSymbol].subject.getRealSubject();
|
|
204
|
+
const diffResult = diff(this[queuedSnapshotSymbol], real);
|
|
205
|
+
if (diffResult.length > 0) {
|
|
206
|
+
const snapshot = clone(real);
|
|
207
|
+
this[queuedSnapshotSymbol] = snapshot;
|
|
208
|
+
this[pendingDiffsSymbol].push({ diffResult, snapshot });
|
|
209
|
+
await this[processQueueSymbol]();
|
|
210
|
+
}
|
|
211
|
+
} while (processedRevision !== this[subjectRevisionSymbol]);
|
|
212
|
+
},
|
|
213
|
+
() => {
|
|
214
|
+
this[subjectRevisionSymbol]++;
|
|
215
|
+
},
|
|
216
|
+
);
|
|
185
217
|
this[internalSymbol].subject.attachObserver(this[subjectObserverSymbol]);
|
|
186
218
|
}
|
|
187
219
|
|
|
@@ -317,6 +349,7 @@ class Updater extends Base {
|
|
|
317
349
|
passive: true,
|
|
318
350
|
},
|
|
319
351
|
);
|
|
352
|
+
this[registeredEventTypesSymbol].add(type);
|
|
320
353
|
}
|
|
321
354
|
|
|
322
355
|
return this;
|
|
@@ -329,12 +362,23 @@ class Updater extends Base {
|
|
|
329
362
|
* @return {Updater}
|
|
330
363
|
*/
|
|
331
364
|
disableEventProcessing() {
|
|
332
|
-
for (const type of this[
|
|
365
|
+
for (const type of this[registeredEventTypesSymbol]) {
|
|
333
366
|
this[internalSymbol].element.removeEventListener(
|
|
334
367
|
type,
|
|
335
368
|
getControlEventHandler.call(this),
|
|
369
|
+
{ capture: true },
|
|
336
370
|
);
|
|
337
371
|
}
|
|
372
|
+
this[registeredEventTypesSymbol].clear();
|
|
373
|
+
|
|
374
|
+
for (const timer of this[controlEventTimersSymbol].values()) {
|
|
375
|
+
try {
|
|
376
|
+
timer.defuse();
|
|
377
|
+
} catch (e) {
|
|
378
|
+
// A timer that already ran no longer has pending work to cancel.
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
this[controlEventTimersSymbol].clear();
|
|
338
382
|
|
|
339
383
|
delete this[internalSymbol].element[updaterRootSymbol];
|
|
340
384
|
|
|
@@ -354,8 +398,6 @@ class Updater extends Base {
|
|
|
354
398
|
this[internalSymbol].subject.detachObserver(this[subjectObserverSymbol]);
|
|
355
399
|
}
|
|
356
400
|
|
|
357
|
-
delete this[timerElementEventHandlerSymbol];
|
|
358
|
-
|
|
359
401
|
return this;
|
|
360
402
|
}
|
|
361
403
|
|
|
@@ -495,21 +537,24 @@ function getControlEventHandler() {
|
|
|
495
537
|
return;
|
|
496
538
|
}
|
|
497
539
|
|
|
498
|
-
|
|
540
|
+
const timers = this[controlEventTimersSymbol];
|
|
541
|
+
let timer = timers.get(element);
|
|
542
|
+
if (timer instanceof DeadMansSwitch) {
|
|
499
543
|
try {
|
|
500
|
-
|
|
544
|
+
timer.touch();
|
|
501
545
|
return;
|
|
502
546
|
} catch (e) {
|
|
503
|
-
delete
|
|
547
|
+
timers.delete(element);
|
|
504
548
|
}
|
|
505
549
|
}
|
|
506
550
|
|
|
507
|
-
|
|
551
|
+
timer = new DeadMansSwitch(50, () => {
|
|
508
552
|
if (
|
|
509
553
|
this[disposedSymbol] === true ||
|
|
510
554
|
!this[internalSymbol].element?.isConnected ||
|
|
511
555
|
!element?.isConnected
|
|
512
556
|
) {
|
|
557
|
+
timers.delete(element);
|
|
513
558
|
return;
|
|
514
559
|
}
|
|
515
560
|
|
|
@@ -517,8 +562,11 @@ function getControlEventHandler() {
|
|
|
517
562
|
retrieveAndSetValue.call(this, element);
|
|
518
563
|
} catch (e) {
|
|
519
564
|
addErrorAttribute(element, e);
|
|
565
|
+
} finally {
|
|
566
|
+
timers.delete(element);
|
|
520
567
|
}
|
|
521
568
|
});
|
|
569
|
+
timers.set(element, timer);
|
|
522
570
|
};
|
|
523
571
|
|
|
524
572
|
return this[symbol];
|
|
@@ -1091,6 +1139,7 @@ function runUpdateContent(container, parts, subject) {
|
|
|
1091
1139
|
value = pipe.run(subject);
|
|
1092
1140
|
} catch (e) {
|
|
1093
1141
|
element.setAttribute(ATTRIBUTE_ERRORMESSAGE, e.message);
|
|
1142
|
+
continue;
|
|
1094
1143
|
}
|
|
1095
1144
|
|
|
1096
1145
|
if (value instanceof HTMLElement) {
|
|
@@ -1529,6 +1578,7 @@ function runUpdateAttributes(container, parts, subject) {
|
|
|
1529
1578
|
}
|
|
1530
1579
|
|
|
1531
1580
|
const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);
|
|
1581
|
+
element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
|
|
1532
1582
|
|
|
1533
1583
|
for (let [, def] of Object.entries(attributes.split(","))) {
|
|
1534
1584
|
def = trimSpaces(def);
|
|
@@ -1544,10 +1594,10 @@ function runUpdateAttributes(container, parts, subject) {
|
|
|
1544
1594
|
|
|
1545
1595
|
let value;
|
|
1546
1596
|
try {
|
|
1547
|
-
element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
|
|
1548
1597
|
value = pipe.run(subject);
|
|
1549
1598
|
} catch (e) {
|
|
1550
1599
|
addErrorAttribute(element, e);
|
|
1600
|
+
continue;
|
|
1551
1601
|
}
|
|
1552
1602
|
|
|
1553
1603
|
if (value === undefined) {
|
|
@@ -1604,6 +1654,7 @@ function runUpdateProperties(container, parts, subject) {
|
|
|
1604
1654
|
}
|
|
1605
1655
|
|
|
1606
1656
|
const properties = element.getAttribute(ATTRIBUTE_UPDATER_PROPERTIES);
|
|
1657
|
+
element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
|
|
1607
1658
|
|
|
1608
1659
|
for (let [, def] of Object.entries(properties.split(","))) {
|
|
1609
1660
|
def = trimSpaces(def);
|
|
@@ -1619,10 +1670,10 @@ function runUpdateProperties(container, parts, subject) {
|
|
|
1619
1670
|
|
|
1620
1671
|
let value;
|
|
1621
1672
|
try {
|
|
1622
|
-
element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
|
|
1623
1673
|
value = pipe.run(subject);
|
|
1624
1674
|
} catch (e) {
|
|
1625
1675
|
addErrorAttribute(element, e);
|
|
1676
|
+
continue;
|
|
1626
1677
|
}
|
|
1627
1678
|
|
|
1628
1679
|
handleInputControlPropertyUpdate.call(this, element, name, value);
|
|
@@ -173,6 +173,10 @@ function getHandler() {
|
|
|
173
173
|
return value;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
if (isNativeObjectWithInternalSlots(value)) {
|
|
177
|
+
return value;
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
// set value as proxy if object or array
|
|
177
181
|
if (isArray(value) || isObject(value)) {
|
|
178
182
|
if (proxy.objectMap.has(value)) {
|
|
@@ -264,3 +268,14 @@ function getHandler() {
|
|
|
264
268
|
|
|
265
269
|
return handler;
|
|
266
270
|
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Native objects with internal slots cannot be used through a transparent Proxy
|
|
274
|
+
* because their prototype methods require the original receiver.
|
|
275
|
+
* @param {*} value
|
|
276
|
+
* @return {boolean}
|
|
277
|
+
* @private
|
|
278
|
+
*/
|
|
279
|
+
function isNativeObjectWithInternalSlots(value) {
|
|
280
|
+
return value instanceof Date || value instanceof Map || value instanceof Set;
|
|
281
|
+
}
|
package/source/util/clone.mjs
CHANGED
|
@@ -135,13 +135,14 @@ function cloneObject(obj) {
|
|
|
135
135
|
validateObject(obj);
|
|
136
136
|
|
|
137
137
|
const fkt = obj?.["constructor"];
|
|
138
|
+
const sourcePrototype = Object.getPrototypeOf(obj);
|
|
138
139
|
|
|
139
140
|
/** Object has clone method */
|
|
140
141
|
if (typeOf(fkt) === "function") {
|
|
141
142
|
const prototype = fkt?.prototype;
|
|
142
143
|
if (typeof prototype === "object") {
|
|
143
144
|
if (
|
|
144
|
-
prototype.hasOwnProperty("getClone") &&
|
|
145
|
+
Object.prototype.hasOwnProperty.call(prototype, "getClone") &&
|
|
145
146
|
typeOf(obj.getClone) === "function"
|
|
146
147
|
) {
|
|
147
148
|
return obj.getClone();
|
|
@@ -149,16 +150,17 @@ function cloneObject(obj) {
|
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
|
|
152
|
-
let copy = {};
|
|
153
|
+
let copy = sourcePrototype === null ? Object.create(null) : {};
|
|
153
154
|
if (
|
|
154
|
-
|
|
155
|
-
typeof
|
|
155
|
+
sourcePrototype !== null &&
|
|
156
|
+
typeof fkt === "function" &&
|
|
157
|
+
typeof fkt.call === "function"
|
|
156
158
|
) {
|
|
157
|
-
copy = new
|
|
159
|
+
copy = new fkt();
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
for (const key in obj) {
|
|
161
|
-
if (!
|
|
163
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
162
164
|
continue;
|
|
163
165
|
}
|
|
164
166
|
|
|
@@ -5,6 +5,7 @@ let expect = chai.expect;
|
|
|
5
5
|
|
|
6
6
|
let resolveClippingBoundaryElement;
|
|
7
7
|
let applyAdaptiveFloatingElementSize;
|
|
8
|
+
let applyFloatingReferenceVisibility;
|
|
8
9
|
let createVisibilityRecoveryConfig;
|
|
9
10
|
let getFloatingVisibleRatio;
|
|
10
11
|
|
|
@@ -19,6 +20,7 @@ describe("form floating-ui boundary resolution", function () {
|
|
|
19
20
|
.then((m) => {
|
|
20
21
|
resolveClippingBoundaryElement = m.resolveClippingBoundaryElement;
|
|
21
22
|
applyAdaptiveFloatingElementSize = m.applyAdaptiveFloatingElementSize;
|
|
23
|
+
applyFloatingReferenceVisibility = m.applyFloatingReferenceVisibility;
|
|
22
24
|
createVisibilityRecoveryConfig = m.createVisibilityRecoveryConfig;
|
|
23
25
|
getFloatingVisibleRatio = m.getFloatingVisibleRatio;
|
|
24
26
|
done();
|
|
@@ -169,7 +171,8 @@ describe("form floating-ui boundary resolution", function () {
|
|
|
169
171
|
|
|
170
172
|
popper.style.maxHeight = "300px";
|
|
171
173
|
content.setAttribute("part", "content");
|
|
172
|
-
content.textContent =
|
|
174
|
+
content.textContent =
|
|
175
|
+
"A long help text that still needs one readable line.";
|
|
173
176
|
content.style.fontSize = "16px";
|
|
174
177
|
content.style.lineHeight = "24px";
|
|
175
178
|
popper.appendChild(content);
|
|
@@ -476,4 +479,48 @@ describe("form floating-ui boundary resolution", function () {
|
|
|
476
479
|
"arrow",
|
|
477
480
|
]);
|
|
478
481
|
});
|
|
482
|
+
|
|
483
|
+
it("should hide a floating element while its reference is clipped", function () {
|
|
484
|
+
const reference = document.createElement("div");
|
|
485
|
+
const popper = document.createElement("div");
|
|
486
|
+
reference.getBoundingClientRect = () => ({
|
|
487
|
+
top: -100,
|
|
488
|
+
left: 10,
|
|
489
|
+
right: 110,
|
|
490
|
+
bottom: -50,
|
|
491
|
+
width: 100,
|
|
492
|
+
height: 50,
|
|
493
|
+
x: 10,
|
|
494
|
+
y: -100,
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
const visible = applyFloatingReferenceVisibility(reference, popper);
|
|
498
|
+
|
|
499
|
+
expect(visible).to.equal(false);
|
|
500
|
+
expect(popper.style.visibility).to.equal("hidden");
|
|
501
|
+
expect(popper.dataset.monsterReferenceHidden).to.equal("true");
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
it("should restore a floating element when its reference is visible again", function () {
|
|
505
|
+
const reference = document.createElement("div");
|
|
506
|
+
const popper = document.createElement("div");
|
|
507
|
+
reference.getBoundingClientRect = () => ({
|
|
508
|
+
top: 10,
|
|
509
|
+
left: 10,
|
|
510
|
+
right: 110,
|
|
511
|
+
bottom: 60,
|
|
512
|
+
width: 100,
|
|
513
|
+
height: 50,
|
|
514
|
+
x: 10,
|
|
515
|
+
y: 10,
|
|
516
|
+
});
|
|
517
|
+
popper.dataset.monsterReferenceHidden = "true";
|
|
518
|
+
popper.style.visibility = "hidden";
|
|
519
|
+
|
|
520
|
+
const visible = applyFloatingReferenceVisibility(reference, popper);
|
|
521
|
+
|
|
522
|
+
expect(visible).to.equal(true);
|
|
523
|
+
expect(popper.style.visibility).to.equal("");
|
|
524
|
+
expect(popper.dataset.monsterReferenceHidden).to.equal(undefined);
|
|
525
|
+
});
|
|
479
526
|
});
|