@marko/runtime-tags 0.3.40 → 0.3.42
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/common/types.d.ts +1 -2
- package/dist/debug/dom.js +34 -37
- package/dist/debug/dom.mjs +34 -37
- package/dist/debug/html.js +36 -32
- package/dist/debug/html.mjs +36 -32
- package/dist/dom.js +35 -19
- package/dist/dom.mjs +35 -19
- package/dist/html.js +34 -22
- package/dist/html.mjs +34 -22
- package/dist/translator/index.js +1 -2
- package/package.json +1 -1
package/dist/common/types.d.ts
CHANGED
package/dist/debug/dom.js
CHANGED
|
@@ -140,9 +140,8 @@ function stringifyClassObject(name, value2) {
|
|
|
140
140
|
function styleValue(value2) {
|
|
141
141
|
return toDelimitedString(value2, ";", stringifyStyleObject);
|
|
142
142
|
}
|
|
143
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
144
143
|
function stringifyStyleObject(name, value2) {
|
|
145
|
-
return value2 || value2 === 0 ? `${name}:${typeof value2 === "number" && value2 &&
|
|
144
|
+
return value2 || value2 === 0 ? `${name}:${typeof value2 === "number" && value2 && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
|
|
146
145
|
}
|
|
147
146
|
function toDelimitedString(val, delimiter, stringify) {
|
|
148
147
|
switch (typeof val) {
|
|
@@ -468,12 +467,10 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
|
468
467
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
469
468
|
const checkedChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
470
469
|
if (checkedChange) {
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
const newValue = el.checked;
|
|
471
|
+
el.checked = !newValue;
|
|
472
|
+
checkedChange(newValue);
|
|
473
473
|
run();
|
|
474
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
475
|
-
el.checked = !el.checked;
|
|
476
|
-
}
|
|
477
474
|
}
|
|
478
475
|
});
|
|
479
476
|
}
|
|
@@ -494,14 +491,20 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
|
494
491
|
const checkedValueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
495
492
|
if (checkedValueChange) {
|
|
496
493
|
const oldValue = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
494
|
+
const newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
495
|
+
if (el.name && el.type[0] === "r") {
|
|
496
|
+
for (const radio of el.getRootNode().querySelectorAll(
|
|
497
|
+
`[type=radio][name=${CSS.escape(el.name)}]`
|
|
498
|
+
)) {
|
|
499
|
+
if (radio.form === el.form) {
|
|
500
|
+
radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} else {
|
|
503
504
|
el.checked = !el.checked;
|
|
504
505
|
}
|
|
506
|
+
checkedValueChange(newValue);
|
|
507
|
+
run();
|
|
505
508
|
}
|
|
506
509
|
});
|
|
507
510
|
}
|
|
@@ -530,16 +533,14 @@ function controllable_input_value_effect(scope, nodeAccessor) {
|
|
|
530
533
|
syncControllable(el, "input", hasValueChanged, (ev) => {
|
|
531
534
|
const valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
532
535
|
if (valueChange) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
+
const newValue = el.value;
|
|
537
|
+
inputType = ev?.inputType;
|
|
538
|
+
setValueAndUpdateSelection(
|
|
539
|
+
el,
|
|
540
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
541
|
+
);
|
|
542
|
+
valueChange(newValue);
|
|
536
543
|
run();
|
|
537
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
538
|
-
setValueAndUpdateSelection(
|
|
539
|
-
el,
|
|
540
|
-
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
541
|
-
);
|
|
542
|
-
}
|
|
543
544
|
inputType = "";
|
|
544
545
|
}
|
|
545
546
|
});
|
|
@@ -566,18 +567,16 @@ function controllable_select_value_effect(scope, nodeAccessor) {
|
|
|
566
567
|
const onChange = () => {
|
|
567
568
|
const valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
568
569
|
if (valueChange) {
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
570
|
+
const newValue = Array.isArray(
|
|
571
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
572
|
+
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
|
573
|
+
setSelectOptions(
|
|
574
|
+
el,
|
|
575
|
+
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
576
|
+
valueChange
|
|
572
577
|
);
|
|
578
|
+
valueChange(newValue);
|
|
573
579
|
run();
|
|
574
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
575
|
-
setSelectOptions(
|
|
576
|
-
el,
|
|
577
|
-
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
578
|
-
valueChange
|
|
579
|
-
);
|
|
580
|
-
}
|
|
581
580
|
}
|
|
582
581
|
};
|
|
583
582
|
if (!el._) {
|
|
@@ -633,12 +632,10 @@ function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
|
|
633
632
|
() => {
|
|
634
633
|
const openChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
635
634
|
if (openChange && hasChanged()) {
|
|
636
|
-
|
|
637
|
-
|
|
635
|
+
const newValue = el.open;
|
|
636
|
+
el.open = !newValue;
|
|
637
|
+
openChange(newValue);
|
|
638
638
|
run();
|
|
639
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
640
|
-
el.open = !el.open;
|
|
641
|
-
}
|
|
642
639
|
}
|
|
643
640
|
}
|
|
644
641
|
);
|
package/dist/debug/dom.mjs
CHANGED
|
@@ -54,9 +54,8 @@ function stringifyClassObject(name, value2) {
|
|
|
54
54
|
function styleValue(value2) {
|
|
55
55
|
return toDelimitedString(value2, ";", stringifyStyleObject);
|
|
56
56
|
}
|
|
57
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
58
57
|
function stringifyStyleObject(name, value2) {
|
|
59
|
-
return value2 || value2 === 0 ? `${name}:${typeof value2 === "number" && value2 &&
|
|
58
|
+
return value2 || value2 === 0 ? `${name}:${typeof value2 === "number" && value2 && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
|
|
60
59
|
}
|
|
61
60
|
function toDelimitedString(val, delimiter, stringify) {
|
|
62
61
|
switch (typeof val) {
|
|
@@ -382,12 +381,10 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
|
382
381
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
383
382
|
const checkedChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
384
383
|
if (checkedChange) {
|
|
385
|
-
|
|
386
|
-
|
|
384
|
+
const newValue = el.checked;
|
|
385
|
+
el.checked = !newValue;
|
|
386
|
+
checkedChange(newValue);
|
|
387
387
|
run();
|
|
388
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
389
|
-
el.checked = !el.checked;
|
|
390
|
-
}
|
|
391
388
|
}
|
|
392
389
|
});
|
|
393
390
|
}
|
|
@@ -408,14 +405,20 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
|
408
405
|
const checkedValueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
409
406
|
if (checkedValueChange) {
|
|
410
407
|
const oldValue = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
408
|
+
const newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
409
|
+
if (el.name && el.type[0] === "r") {
|
|
410
|
+
for (const radio of el.getRootNode().querySelectorAll(
|
|
411
|
+
`[type=radio][name=${CSS.escape(el.name)}]`
|
|
412
|
+
)) {
|
|
413
|
+
if (radio.form === el.form) {
|
|
414
|
+
radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
} else {
|
|
417
418
|
el.checked = !el.checked;
|
|
418
419
|
}
|
|
420
|
+
checkedValueChange(newValue);
|
|
421
|
+
run();
|
|
419
422
|
}
|
|
420
423
|
});
|
|
421
424
|
}
|
|
@@ -444,16 +447,14 @@ function controllable_input_value_effect(scope, nodeAccessor) {
|
|
|
444
447
|
syncControllable(el, "input", hasValueChanged, (ev) => {
|
|
445
448
|
const valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
446
449
|
if (valueChange) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
+
const newValue = el.value;
|
|
451
|
+
inputType = ev?.inputType;
|
|
452
|
+
setValueAndUpdateSelection(
|
|
453
|
+
el,
|
|
454
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
455
|
+
);
|
|
456
|
+
valueChange(newValue);
|
|
450
457
|
run();
|
|
451
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
452
|
-
setValueAndUpdateSelection(
|
|
453
|
-
el,
|
|
454
|
-
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
455
|
-
);
|
|
456
|
-
}
|
|
457
458
|
inputType = "";
|
|
458
459
|
}
|
|
459
460
|
});
|
|
@@ -480,18 +481,16 @@ function controllable_select_value_effect(scope, nodeAccessor) {
|
|
|
480
481
|
const onChange = () => {
|
|
481
482
|
const valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
482
483
|
if (valueChange) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
const newValue = Array.isArray(
|
|
485
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
486
|
+
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
|
487
|
+
setSelectOptions(
|
|
488
|
+
el,
|
|
489
|
+
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
490
|
+
valueChange
|
|
486
491
|
);
|
|
492
|
+
valueChange(newValue);
|
|
487
493
|
run();
|
|
488
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
489
|
-
setSelectOptions(
|
|
490
|
-
el,
|
|
491
|
-
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
492
|
-
valueChange
|
|
493
|
-
);
|
|
494
|
-
}
|
|
495
494
|
}
|
|
496
495
|
};
|
|
497
496
|
if (!el._) {
|
|
@@ -547,12 +546,10 @@ function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
|
|
547
546
|
() => {
|
|
548
547
|
const openChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
549
548
|
if (openChange && hasChanged()) {
|
|
550
|
-
|
|
551
|
-
|
|
549
|
+
const newValue = el.open;
|
|
550
|
+
el.open = !newValue;
|
|
551
|
+
openChange(newValue);
|
|
552
552
|
run();
|
|
553
|
-
if (scope[nodeAccessor + "=" /* ControlledType */] === 6 /* Pending */) {
|
|
554
|
-
el.open = !el.open;
|
|
555
|
-
}
|
|
556
553
|
}
|
|
557
554
|
}
|
|
558
555
|
);
|
package/dist/debug/html.js
CHANGED
|
@@ -114,9 +114,8 @@ function stringifyClassObject(name, value) {
|
|
|
114
114
|
function styleValue(value) {
|
|
115
115
|
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
116
116
|
}
|
|
117
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
118
117
|
function stringifyStyleObject(name, value) {
|
|
119
|
-
return value || value === 0 ? `${name}:${typeof value === "number" && value &&
|
|
118
|
+
return value || value === 0 ? `${name}:${typeof value === "number" && value && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
|
|
120
119
|
}
|
|
121
120
|
function toDelimitedString(val, delimiter, stringify) {
|
|
122
121
|
switch (typeof val) {
|
|
@@ -646,15 +645,11 @@ function writeRoot(state, root) {
|
|
|
646
645
|
if (writeProp(state, root, null, "")) {
|
|
647
646
|
const rootRef = state.refs.get(root);
|
|
648
647
|
if (rootRef) {
|
|
649
|
-
ensureId(state, rootRef);
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
if (assigned.delete(rootRef)) {
|
|
653
|
-
assigned.add(rootRef);
|
|
654
|
-
writeAssigned(state);
|
|
655
|
-
} else {
|
|
648
|
+
const rootId = ensureId(state, rootRef);
|
|
649
|
+
if (assigned.size) {
|
|
650
|
+
assigned.delete(rootRef);
|
|
656
651
|
writeAssigned(state);
|
|
657
|
-
buf.push("," + rootRef.
|
|
652
|
+
buf.push("," + rootRef.assigns + rootId);
|
|
658
653
|
}
|
|
659
654
|
}
|
|
660
655
|
result = "(";
|
|
@@ -674,8 +669,10 @@ function writeRoot(state, root) {
|
|
|
674
669
|
}
|
|
675
670
|
function writeAssigned(state) {
|
|
676
671
|
for (const valueRef of state.assigned) {
|
|
677
|
-
|
|
678
|
-
|
|
672
|
+
if (valueRef.assigns || valueRef.init) {
|
|
673
|
+
state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id));
|
|
674
|
+
valueRef.init = "";
|
|
675
|
+
}
|
|
679
676
|
}
|
|
680
677
|
}
|
|
681
678
|
function writeProp(state, val, parent, accessor) {
|
|
@@ -743,6 +740,7 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
743
740
|
state.refs.set(val, fnRef);
|
|
744
741
|
if (scopeRef) {
|
|
745
742
|
if (isCircular(parent, scopeRef)) {
|
|
743
|
+
state.assigned.add(parent);
|
|
746
744
|
state.assigned.add(fnRef);
|
|
747
745
|
fnRef.init = access + "(" + ensureId(state, scopeRef) + ")";
|
|
748
746
|
fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=";
|
|
@@ -756,6 +754,7 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
756
754
|
const scopeRef2 = parent && state.refs.get(scope);
|
|
757
755
|
const scopeId = scopeRef2 && ensureId(state, scopeRef2);
|
|
758
756
|
if (scopeId && assigns !== state.assigned.size) {
|
|
757
|
+
state.assigned.add(parent);
|
|
759
758
|
state.assigned.add(fnRef);
|
|
760
759
|
fnRef.init = access + "(" + scopeId + ")";
|
|
761
760
|
fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=";
|
|
@@ -1271,26 +1270,31 @@ function writeObjectProps(state, val, ref) {
|
|
|
1271
1270
|
}
|
|
1272
1271
|
}
|
|
1273
1272
|
if (hasSymbolIterator(val)) {
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1273
|
+
const iterArr = [...val];
|
|
1274
|
+
switch (iterArr.length) {
|
|
1275
|
+
case 0:
|
|
1276
|
+
state.buf.push(sep + "*[Symbol.iterator](){}");
|
|
1277
|
+
break;
|
|
1278
|
+
case 1:
|
|
1279
|
+
state.buf.push(
|
|
1280
|
+
sep + "*[Symbol.iterator](){yield " + (iterArr[0] === val ? "this" : ensureId(state, ref)) + "}"
|
|
1281
|
+
);
|
|
1282
|
+
break;
|
|
1283
|
+
default: {
|
|
1284
|
+
const iterRef = new Reference(
|
|
1285
|
+
ref,
|
|
1286
|
+
null,
|
|
1287
|
+
state.flush,
|
|
1288
|
+
null,
|
|
1289
|
+
nextRefAccess(state)
|
|
1290
|
+
);
|
|
1291
|
+
state.buf.push(sep + "*[(" + iterRef.id + "=");
|
|
1292
|
+
writeArray(state, iterArr, iterRef);
|
|
1293
|
+
state.buf.push(",Symbol.iterator)](){yield*" + iterRef.id + "}");
|
|
1294
|
+
break;
|
|
1295
|
+
}
|
|
1293
1296
|
}
|
|
1297
|
+
sep = ",";
|
|
1294
1298
|
}
|
|
1295
1299
|
return sep;
|
|
1296
1300
|
}
|
|
@@ -2328,7 +2332,7 @@ function controllable_input_checkedValue(scopeId, nodeAccessor, checkedValue, ch
|
|
|
2328
2332
|
1 /* InputCheckedValue */,
|
|
2329
2333
|
scopeId,
|
|
2330
2334
|
nodeAccessor,
|
|
2331
|
-
|
|
2335
|
+
checkedValue,
|
|
2332
2336
|
checkedValueChange
|
|
2333
2337
|
);
|
|
2334
2338
|
}
|
package/dist/debug/html.mjs
CHANGED
|
@@ -32,9 +32,8 @@ function stringifyClassObject(name, value) {
|
|
|
32
32
|
function styleValue(value) {
|
|
33
33
|
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
34
34
|
}
|
|
35
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
36
35
|
function stringifyStyleObject(name, value) {
|
|
37
|
-
return value || value === 0 ? `${name}:${typeof value === "number" && value &&
|
|
36
|
+
return value || value === 0 ? `${name}:${typeof value === "number" && value && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
|
|
38
37
|
}
|
|
39
38
|
function toDelimitedString(val, delimiter, stringify) {
|
|
40
39
|
switch (typeof val) {
|
|
@@ -564,15 +563,11 @@ function writeRoot(state, root) {
|
|
|
564
563
|
if (writeProp(state, root, null, "")) {
|
|
565
564
|
const rootRef = state.refs.get(root);
|
|
566
565
|
if (rootRef) {
|
|
567
|
-
ensureId(state, rootRef);
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
if (assigned.delete(rootRef)) {
|
|
571
|
-
assigned.add(rootRef);
|
|
572
|
-
writeAssigned(state);
|
|
573
|
-
} else {
|
|
566
|
+
const rootId = ensureId(state, rootRef);
|
|
567
|
+
if (assigned.size) {
|
|
568
|
+
assigned.delete(rootRef);
|
|
574
569
|
writeAssigned(state);
|
|
575
|
-
buf.push("," + rootRef.
|
|
570
|
+
buf.push("," + rootRef.assigns + rootId);
|
|
576
571
|
}
|
|
577
572
|
}
|
|
578
573
|
result = "(";
|
|
@@ -592,8 +587,10 @@ function writeRoot(state, root) {
|
|
|
592
587
|
}
|
|
593
588
|
function writeAssigned(state) {
|
|
594
589
|
for (const valueRef of state.assigned) {
|
|
595
|
-
|
|
596
|
-
|
|
590
|
+
if (valueRef.assigns || valueRef.init) {
|
|
591
|
+
state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id));
|
|
592
|
+
valueRef.init = "";
|
|
593
|
+
}
|
|
597
594
|
}
|
|
598
595
|
}
|
|
599
596
|
function writeProp(state, val, parent, accessor) {
|
|
@@ -661,6 +658,7 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
661
658
|
state.refs.set(val, fnRef);
|
|
662
659
|
if (scopeRef) {
|
|
663
660
|
if (isCircular(parent, scopeRef)) {
|
|
661
|
+
state.assigned.add(parent);
|
|
664
662
|
state.assigned.add(fnRef);
|
|
665
663
|
fnRef.init = access + "(" + ensureId(state, scopeRef) + ")";
|
|
666
664
|
fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=";
|
|
@@ -674,6 +672,7 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
674
672
|
const scopeRef2 = parent && state.refs.get(scope);
|
|
675
673
|
const scopeId = scopeRef2 && ensureId(state, scopeRef2);
|
|
676
674
|
if (scopeId && assigns !== state.assigned.size) {
|
|
675
|
+
state.assigned.add(parent);
|
|
677
676
|
state.assigned.add(fnRef);
|
|
678
677
|
fnRef.init = access + "(" + scopeId + ")";
|
|
679
678
|
fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=";
|
|
@@ -1189,26 +1188,31 @@ function writeObjectProps(state, val, ref) {
|
|
|
1189
1188
|
}
|
|
1190
1189
|
}
|
|
1191
1190
|
if (hasSymbolIterator(val)) {
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1191
|
+
const iterArr = [...val];
|
|
1192
|
+
switch (iterArr.length) {
|
|
1193
|
+
case 0:
|
|
1194
|
+
state.buf.push(sep + "*[Symbol.iterator](){}");
|
|
1195
|
+
break;
|
|
1196
|
+
case 1:
|
|
1197
|
+
state.buf.push(
|
|
1198
|
+
sep + "*[Symbol.iterator](){yield " + (iterArr[0] === val ? "this" : ensureId(state, ref)) + "}"
|
|
1199
|
+
);
|
|
1200
|
+
break;
|
|
1201
|
+
default: {
|
|
1202
|
+
const iterRef = new Reference(
|
|
1203
|
+
ref,
|
|
1204
|
+
null,
|
|
1205
|
+
state.flush,
|
|
1206
|
+
null,
|
|
1207
|
+
nextRefAccess(state)
|
|
1208
|
+
);
|
|
1209
|
+
state.buf.push(sep + "*[(" + iterRef.id + "=");
|
|
1210
|
+
writeArray(state, iterArr, iterRef);
|
|
1211
|
+
state.buf.push(",Symbol.iterator)](){yield*" + iterRef.id + "}");
|
|
1212
|
+
break;
|
|
1213
|
+
}
|
|
1211
1214
|
}
|
|
1215
|
+
sep = ",";
|
|
1212
1216
|
}
|
|
1213
1217
|
return sep;
|
|
1214
1218
|
}
|
|
@@ -2246,7 +2250,7 @@ function controllable_input_checkedValue(scopeId, nodeAccessor, checkedValue, ch
|
|
|
2246
2250
|
1 /* InputCheckedValue */,
|
|
2247
2251
|
scopeId,
|
|
2248
2252
|
nodeAccessor,
|
|
2249
|
-
|
|
2253
|
+
checkedValue,
|
|
2250
2254
|
checkedValueChange
|
|
2251
2255
|
);
|
|
2252
2256
|
}
|
package/dist/dom.js
CHANGED
|
@@ -121,9 +121,8 @@ function stringifyClassObject(name, value2) {
|
|
|
121
121
|
function styleValue(value2) {
|
|
122
122
|
return toDelimitedString(value2, ";", stringifyStyleObject);
|
|
123
123
|
}
|
|
124
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
125
124
|
function stringifyStyleObject(name, value2) {
|
|
126
|
-
return value2 || value2 === 0 ? `${name}:${typeof value2 == "number" && value2 &&
|
|
125
|
+
return value2 || value2 === 0 ? `${name}:${typeof value2 == "number" && value2 && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
|
|
127
126
|
}
|
|
128
127
|
function toDelimitedString(val, delimiter, stringify) {
|
|
129
128
|
switch (typeof val) {
|
|
@@ -333,7 +332,10 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
|
333
332
|
let el = scope[nodeAccessor];
|
|
334
333
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
335
334
|
let checkedChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
336
|
-
|
|
335
|
+
if (checkedChange) {
|
|
336
|
+
let newValue = el.checked;
|
|
337
|
+
el.checked = !newValue, checkedChange(newValue), run();
|
|
338
|
+
}
|
|
337
339
|
});
|
|
338
340
|
}
|
|
339
341
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
|
@@ -350,10 +352,15 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
|
350
352
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
351
353
|
let checkedValueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
352
354
|
if (checkedValueChange) {
|
|
353
|
-
let oldValue = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
355
|
+
let oldValue = scope[nodeAccessor + ":" /* ControlledValue */], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
356
|
+
if (el.name && el.type[0] === "r")
|
|
357
|
+
for (let radio of el.getRootNode().querySelectorAll(
|
|
358
|
+
`[type=radio][name=${CSS.escape(el.name)}]`
|
|
359
|
+
))
|
|
360
|
+
radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
361
|
+
else
|
|
362
|
+
el.checked = !el.checked;
|
|
363
|
+
checkedValueChange(newValue), run();
|
|
357
364
|
}
|
|
358
365
|
});
|
|
359
366
|
}
|
|
@@ -365,10 +372,13 @@ function controllable_input_value_effect(scope, nodeAccessor) {
|
|
|
365
372
|
let el = scope[nodeAccessor];
|
|
366
373
|
isResuming && (scope[nodeAccessor + ":" /* ControlledValue */] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
|
367
374
|
let valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
368
|
-
|
|
369
|
-
el
|
|
370
|
-
|
|
371
|
-
|
|
375
|
+
if (valueChange) {
|
|
376
|
+
let newValue = el.value;
|
|
377
|
+
inputType = ev?.inputType, setValueAndUpdateSelection(
|
|
378
|
+
el,
|
|
379
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
380
|
+
), valueChange(newValue), run(), inputType = "";
|
|
381
|
+
}
|
|
372
382
|
});
|
|
373
383
|
}
|
|
374
384
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
@@ -384,13 +394,16 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
|
384
394
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
|
385
395
|
let el = scope[nodeAccessor], onChange = () => {
|
|
386
396
|
let valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
el,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
397
|
+
if (valueChange) {
|
|
398
|
+
let newValue = Array.isArray(
|
|
399
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
400
|
+
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
|
401
|
+
setSelectOptions(
|
|
402
|
+
el,
|
|
403
|
+
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
404
|
+
valueChange
|
|
405
|
+
), valueChange(newValue), run();
|
|
406
|
+
}
|
|
394
407
|
};
|
|
395
408
|
el._ || new MutationObserver(() => {
|
|
396
409
|
let value2 = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
@@ -426,7 +439,10 @@ function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
|
|
426
439
|
hasChanged,
|
|
427
440
|
() => {
|
|
428
441
|
let openChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
429
|
-
openChange && hasChanged()
|
|
442
|
+
if (openChange && hasChanged()) {
|
|
443
|
+
let newValue = el.open;
|
|
444
|
+
el.open = !newValue, openChange(newValue), run();
|
|
445
|
+
}
|
|
430
446
|
}
|
|
431
447
|
);
|
|
432
448
|
}
|
package/dist/dom.mjs
CHANGED
|
@@ -38,9 +38,8 @@ function stringifyClassObject(name, value2) {
|
|
|
38
38
|
function styleValue(value2) {
|
|
39
39
|
return toDelimitedString(value2, ";", stringifyStyleObject);
|
|
40
40
|
}
|
|
41
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
42
41
|
function stringifyStyleObject(name, value2) {
|
|
43
|
-
return value2 || value2 === 0 ? `${name}:${typeof value2 == "number" && value2 &&
|
|
42
|
+
return value2 || value2 === 0 ? `${name}:${typeof value2 == "number" && value2 && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value2 + "px" : value2}` : "";
|
|
44
43
|
}
|
|
45
44
|
function toDelimitedString(val, delimiter, stringify) {
|
|
46
45
|
switch (typeof val) {
|
|
@@ -250,7 +249,10 @@ function controllable_input_checked_effect(scope, nodeAccessor) {
|
|
|
250
249
|
let el = scope[nodeAccessor];
|
|
251
250
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
252
251
|
let checkedChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
253
|
-
|
|
252
|
+
if (checkedChange) {
|
|
253
|
+
let newValue = el.checked;
|
|
254
|
+
el.checked = !newValue, checkedChange(newValue), run();
|
|
255
|
+
}
|
|
254
256
|
});
|
|
255
257
|
}
|
|
256
258
|
function controllable_input_checkedValue(scope, nodeAccessor, checkedValue, checkedValueChange, value2) {
|
|
@@ -267,10 +269,15 @@ function controllable_input_checkedValue_effect(scope, nodeAccessor) {
|
|
|
267
269
|
syncControllable(el, "input", hasCheckboxChanged, () => {
|
|
268
270
|
let checkedValueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
269
271
|
if (checkedValueChange) {
|
|
270
|
-
let oldValue = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
let oldValue = scope[nodeAccessor + ":" /* ControlledValue */], newValue = Array.isArray(oldValue) ? updateList(oldValue, el.value, el.checked) : el.checked ? el.value : void 0;
|
|
273
|
+
if (el.name && el.type[0] === "r")
|
|
274
|
+
for (let radio of el.getRootNode().querySelectorAll(
|
|
275
|
+
`[type=radio][name=${CSS.escape(el.name)}]`
|
|
276
|
+
))
|
|
277
|
+
radio.form === el.form && (radio.checked = Array.isArray(oldValue) ? oldValue.includes(radio.value) : oldValue === radio.value);
|
|
278
|
+
else
|
|
279
|
+
el.checked = !el.checked;
|
|
280
|
+
checkedValueChange(newValue), run();
|
|
274
281
|
}
|
|
275
282
|
});
|
|
276
283
|
}
|
|
@@ -282,10 +289,13 @@ function controllable_input_value_effect(scope, nodeAccessor) {
|
|
|
282
289
|
let el = scope[nodeAccessor];
|
|
283
290
|
isResuming && (scope[nodeAccessor + ":" /* ControlledValue */] = el.defaultValue), syncControllable(el, "input", hasValueChanged, (ev) => {
|
|
284
291
|
let valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
285
|
-
|
|
286
|
-
el
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
if (valueChange) {
|
|
293
|
+
let newValue = el.value;
|
|
294
|
+
inputType = ev?.inputType, setValueAndUpdateSelection(
|
|
295
|
+
el,
|
|
296
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
297
|
+
), valueChange(newValue), run(), inputType = "";
|
|
298
|
+
}
|
|
289
299
|
});
|
|
290
300
|
}
|
|
291
301
|
function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
@@ -301,13 +311,16 @@ function controllable_select_value(scope, nodeAccessor, value2, valueChange) {
|
|
|
301
311
|
function controllable_select_value_effect(scope, nodeAccessor) {
|
|
302
312
|
let el = scope[nodeAccessor], onChange = () => {
|
|
303
313
|
let valueChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
el,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
314
|
+
if (valueChange) {
|
|
315
|
+
let newValue = Array.isArray(
|
|
316
|
+
scope[nodeAccessor + ":" /* ControlledValue */]
|
|
317
|
+
) ? Array.from(el.selectedOptions, toValueProp) : el.value;
|
|
318
|
+
setSelectOptions(
|
|
319
|
+
el,
|
|
320
|
+
scope[nodeAccessor + ":" /* ControlledValue */],
|
|
321
|
+
valueChange
|
|
322
|
+
), valueChange(newValue), run();
|
|
323
|
+
}
|
|
311
324
|
};
|
|
312
325
|
el._ || new MutationObserver(() => {
|
|
313
326
|
let value2 = scope[nodeAccessor + ":" /* ControlledValue */];
|
|
@@ -343,7 +356,10 @@ function controllable_detailsOrDialog_open_effect(scope, nodeAccessor) {
|
|
|
343
356
|
hasChanged,
|
|
344
357
|
() => {
|
|
345
358
|
let openChange = scope[nodeAccessor + ";" /* ControlledHandler */];
|
|
346
|
-
openChange && hasChanged()
|
|
359
|
+
if (openChange && hasChanged()) {
|
|
360
|
+
let newValue = el.open;
|
|
361
|
+
el.open = !newValue, openChange(newValue), run();
|
|
362
|
+
}
|
|
347
363
|
}
|
|
348
364
|
);
|
|
349
365
|
}
|
package/dist/html.js
CHANGED
|
@@ -99,9 +99,8 @@ function stringifyClassObject(name, value) {
|
|
|
99
99
|
function styleValue(value) {
|
|
100
100
|
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
101
101
|
}
|
|
102
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
103
102
|
function stringifyStyleObject(name, value) {
|
|
104
|
-
return value || value === 0 ? `${name}:${typeof value == "number" && value &&
|
|
103
|
+
return value || value === 0 ? `${name}:${typeof value == "number" && value && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
|
|
105
104
|
}
|
|
106
105
|
function toDelimitedString(val, delimiter, stringify) {
|
|
107
106
|
switch (typeof val) {
|
|
@@ -479,7 +478,11 @@ function writeRoot(state, root) {
|
|
|
479
478
|
let { buf, assigned } = state, hadBuf = buf.length !== 0, result = "";
|
|
480
479
|
if (hadBuf && buf.push(","), writeProp(state, root, null, "")) {
|
|
481
480
|
let rootRef = state.refs.get(root);
|
|
482
|
-
|
|
481
|
+
if (rootRef) {
|
|
482
|
+
let rootId = ensureId(state, rootRef);
|
|
483
|
+
assigned.size && (assigned.delete(rootRef), writeAssigned(state), buf.push("," + rootRef.assigns + rootId));
|
|
484
|
+
}
|
|
485
|
+
result = "(", buf.push(")");
|
|
483
486
|
} else
|
|
484
487
|
hadBuf && (buf.pop(), writeAssigned(state)), result = "{", buf.push("}");
|
|
485
488
|
for (let chunk of buf)
|
|
@@ -488,7 +491,7 @@ function writeRoot(state, root) {
|
|
|
488
491
|
}
|
|
489
492
|
function writeAssigned(state) {
|
|
490
493
|
for (let valueRef of state.assigned)
|
|
491
|
-
state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id)), valueRef.init = "";
|
|
494
|
+
(valueRef.assigns || valueRef.init) && (state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id)), valueRef.init = "");
|
|
492
495
|
}
|
|
493
496
|
function writeProp(state, val, parent, accessor) {
|
|
494
497
|
switch (typeof val) {
|
|
@@ -530,13 +533,13 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
530
533
|
);
|
|
531
534
|
if (state.refs.set(val, fnRef), scopeRef) {
|
|
532
535
|
if (isCircular(parent, scopeRef))
|
|
533
|
-
return state.assigned.add(fnRef), fnRef.init = access + "(" + ensureId(state, scopeRef) + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=", !1;
|
|
536
|
+
return state.assigned.add(parent), state.assigned.add(fnRef), fnRef.init = access + "(" + ensureId(state, scopeRef) + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=", !1;
|
|
534
537
|
state.buf.push(access + "(" + ensureId(state, scopeRef) + ")");
|
|
535
538
|
} else {
|
|
536
539
|
let pos = state.buf.push(""), assigns = state.assigned.size;
|
|
537
540
|
writeProp(state, scope, parent, "");
|
|
538
541
|
let scopeRef2 = parent && state.refs.get(scope), scopeId = scopeRef2 && ensureId(state, scopeRef2);
|
|
539
|
-
scopeId && assigns !== state.assigned.size ? (state.assigned.add(fnRef), fnRef.init = access + "(" + scopeId + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=") : (state.buf[pos - 2] += access + "(", state.buf.push(")"));
|
|
542
|
+
scopeId && assigns !== state.assigned.size ? (state.assigned.add(parent), state.assigned.add(fnRef), fnRef.init = access + "(" + scopeId + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=") : (state.buf[pos - 2] += access + "(", state.buf.push(")"));
|
|
540
543
|
}
|
|
541
544
|
} else
|
|
542
545
|
state.buf.push(access);
|
|
@@ -821,21 +824,30 @@ function writeObjectProps(state, val, ref) {
|
|
|
821
824
|
escapedKey
|
|
822
825
|
) ? sep = "," : state.buf.pop();
|
|
823
826
|
}
|
|
824
|
-
if (hasSymbolIterator(val)
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
827
|
+
if (hasSymbolIterator(val)) {
|
|
828
|
+
let iterArr = [...val];
|
|
829
|
+
switch (iterArr.length) {
|
|
830
|
+
case 0:
|
|
831
|
+
state.buf.push(sep + "*[Symbol.iterator](){}");
|
|
832
|
+
break;
|
|
833
|
+
case 1:
|
|
834
|
+
state.buf.push(
|
|
835
|
+
sep + "*[Symbol.iterator](){yield " + (iterArr[0] === val ? "this" : ensureId(state, ref)) + "}"
|
|
836
|
+
);
|
|
837
|
+
break;
|
|
838
|
+
default: {
|
|
839
|
+
let iterRef = new Reference(
|
|
840
|
+
ref,
|
|
841
|
+
null,
|
|
842
|
+
state.flush,
|
|
843
|
+
null,
|
|
844
|
+
nextRefAccess(state)
|
|
845
|
+
);
|
|
846
|
+
state.buf.push(sep + "*[(" + iterRef.id + "="), writeArray(state, iterArr, iterRef), state.buf.push(",Symbol.iterator)](){yield*" + iterRef.id + "}");
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
sep = ",";
|
|
839
851
|
}
|
|
840
852
|
return sep;
|
|
841
853
|
}
|
|
@@ -1503,7 +1515,7 @@ function controllable_input_checkedValue(scopeId, nodeAccessor, checkedValue, ch
|
|
|
1503
1515
|
1 /* InputCheckedValue */,
|
|
1504
1516
|
scopeId,
|
|
1505
1517
|
nodeAccessor,
|
|
1506
|
-
|
|
1518
|
+
checkedValue,
|
|
1507
1519
|
checkedValueChange
|
|
1508
1520
|
), (multiple ? checkedValue.includes(value) : checkedValue === value) ? valueAttr + " checked" : valueAttr;
|
|
1509
1521
|
}
|
package/dist/html.mjs
CHANGED
|
@@ -20,9 +20,8 @@ function stringifyClassObject(name, value) {
|
|
|
20
20
|
function styleValue(value) {
|
|
21
21
|
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
22
22
|
}
|
|
23
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
24
23
|
function stringifyStyleObject(name, value) {
|
|
25
|
-
return value || value === 0 ? `${name}:${typeof value == "number" && value &&
|
|
24
|
+
return value || value === 0 ? `${name}:${typeof value == "number" && value && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name) ? value + "px" : value}` : "";
|
|
26
25
|
}
|
|
27
26
|
function toDelimitedString(val, delimiter, stringify) {
|
|
28
27
|
switch (typeof val) {
|
|
@@ -400,7 +399,11 @@ function writeRoot(state, root) {
|
|
|
400
399
|
let { buf, assigned } = state, hadBuf = buf.length !== 0, result = "";
|
|
401
400
|
if (hadBuf && buf.push(","), writeProp(state, root, null, "")) {
|
|
402
401
|
let rootRef = state.refs.get(root);
|
|
403
|
-
|
|
402
|
+
if (rootRef) {
|
|
403
|
+
let rootId = ensureId(state, rootRef);
|
|
404
|
+
assigned.size && (assigned.delete(rootRef), writeAssigned(state), buf.push("," + rootRef.assigns + rootId));
|
|
405
|
+
}
|
|
406
|
+
result = "(", buf.push(")");
|
|
404
407
|
} else
|
|
405
408
|
hadBuf && (buf.pop(), writeAssigned(state)), result = "{", buf.push("}");
|
|
406
409
|
for (let chunk of buf)
|
|
@@ -409,7 +412,7 @@ function writeRoot(state, root) {
|
|
|
409
412
|
}
|
|
410
413
|
function writeAssigned(state) {
|
|
411
414
|
for (let valueRef of state.assigned)
|
|
412
|
-
state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id)), valueRef.init = "";
|
|
415
|
+
(valueRef.assigns || valueRef.init) && (state.buf.push("," + valueRef.assigns + (valueRef.init || valueRef.id)), valueRef.init = "");
|
|
413
416
|
}
|
|
414
417
|
function writeProp(state, val, parent, accessor) {
|
|
415
418
|
switch (typeof val) {
|
|
@@ -451,13 +454,13 @@ function writeRegistered(state, val, parent, accessor, { access, scope }) {
|
|
|
451
454
|
);
|
|
452
455
|
if (state.refs.set(val, fnRef), scopeRef) {
|
|
453
456
|
if (isCircular(parent, scopeRef))
|
|
454
|
-
return state.assigned.add(fnRef), fnRef.init = access + "(" + ensureId(state, scopeRef) + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=", !1;
|
|
457
|
+
return state.assigned.add(parent), state.assigned.add(fnRef), fnRef.init = access + "(" + ensureId(state, scopeRef) + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=", !1;
|
|
455
458
|
state.buf.push(access + "(" + ensureId(state, scopeRef) + ")");
|
|
456
459
|
} else {
|
|
457
460
|
let pos = state.buf.push(""), assigns = state.assigned.size;
|
|
458
461
|
writeProp(state, scope, parent, "");
|
|
459
462
|
let scopeRef2 = parent && state.refs.get(scope), scopeId = scopeRef2 && ensureId(state, scopeRef2);
|
|
460
|
-
scopeId && assigns !== state.assigned.size ? (state.assigned.add(fnRef), fnRef.init = access + "(" + scopeId + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=") : (state.buf[pos - 2] += access + "(", state.buf.push(")"));
|
|
463
|
+
scopeId && assigns !== state.assigned.size ? (state.assigned.add(parent), state.assigned.add(fnRef), fnRef.init = access + "(" + scopeId + ")", fnRef.assigns += ensureId(state, parent) + toAccess(accessor) + "=") : (state.buf[pos - 2] += access + "(", state.buf.push(")"));
|
|
461
464
|
}
|
|
462
465
|
} else
|
|
463
466
|
state.buf.push(access);
|
|
@@ -742,21 +745,30 @@ function writeObjectProps(state, val, ref) {
|
|
|
742
745
|
escapedKey
|
|
743
746
|
) ? sep = "," : state.buf.pop();
|
|
744
747
|
}
|
|
745
|
-
if (hasSymbolIterator(val)
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
748
|
+
if (hasSymbolIterator(val)) {
|
|
749
|
+
let iterArr = [...val];
|
|
750
|
+
switch (iterArr.length) {
|
|
751
|
+
case 0:
|
|
752
|
+
state.buf.push(sep + "*[Symbol.iterator](){}");
|
|
753
|
+
break;
|
|
754
|
+
case 1:
|
|
755
|
+
state.buf.push(
|
|
756
|
+
sep + "*[Symbol.iterator](){yield " + (iterArr[0] === val ? "this" : ensureId(state, ref)) + "}"
|
|
757
|
+
);
|
|
758
|
+
break;
|
|
759
|
+
default: {
|
|
760
|
+
let iterRef = new Reference(
|
|
761
|
+
ref,
|
|
762
|
+
null,
|
|
763
|
+
state.flush,
|
|
764
|
+
null,
|
|
765
|
+
nextRefAccess(state)
|
|
766
|
+
);
|
|
767
|
+
state.buf.push(sep + "*[(" + iterRef.id + "="), writeArray(state, iterArr, iterRef), state.buf.push(",Symbol.iterator)](){yield*" + iterRef.id + "}");
|
|
768
|
+
break;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
sep = ",";
|
|
760
772
|
}
|
|
761
773
|
return sep;
|
|
762
774
|
}
|
|
@@ -1424,7 +1436,7 @@ function controllable_input_checkedValue(scopeId, nodeAccessor, checkedValue, ch
|
|
|
1424
1436
|
1 /* InputCheckedValue */,
|
|
1425
1437
|
scopeId,
|
|
1426
1438
|
nodeAccessor,
|
|
1427
|
-
|
|
1439
|
+
checkedValue,
|
|
1428
1440
|
checkedValueChange
|
|
1429
1441
|
), (multiple ? checkedValue.includes(value) : checkedValue === value) ? valueAttr + " checked" : valueAttr;
|
|
1430
1442
|
}
|
package/dist/translator/index.js
CHANGED
|
@@ -229,9 +229,8 @@ function stringifyClassObject(name2, value) {
|
|
|
229
229
|
function styleValue(value) {
|
|
230
230
|
return toDelimitedString(value, ";", stringifyStyleObject);
|
|
231
231
|
}
|
|
232
|
-
var NON_DIMENSIONAL = /^(--|ta|or|li|z)|n-c|i(do|nk|m|t)|w$|we/;
|
|
233
232
|
function stringifyStyleObject(name2, value) {
|
|
234
|
-
return value || value === 0 ? `${name2}:${typeof value === "number" && value &&
|
|
233
|
+
return value || value === 0 ? `${name2}:${typeof value === "number" && value && !/^(--|ta|or|li|z)|cou|nk|it|ag|we|do|w$/.test(name2) ? value + "px" : value}` : "";
|
|
235
234
|
}
|
|
236
235
|
function toDelimitedString(val, delimiter, stringify) {
|
|
237
236
|
switch (typeof val) {
|