lilact 0.27.3 → 0.28.0
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/lilact.development.js +23 -17
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +26 -26
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +26 -26
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +11 -11
- package/docs/classes/components.HTMLComponent.html +11 -11
- package/docs/classes/components.RootComponent.html +11 -11
- package/docs/functions/components.cloneComponent.html +1 -1
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/static/lilact.development.js +23 -17
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +26 -26
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +26 -26
- package/docs/variables/components.cloneElement.html +1 -1
- package/examples/lilact.development.js +23 -17
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +26 -26
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +26 -26
- package/package.json +1 -1
- package/src/components.jsx +20 -15
- package/src/run.jsx +1 -1
|
@@ -2619,7 +2619,7 @@ var ComponentCore = class {
|
|
|
2619
2619
|
}
|
|
2620
2620
|
}
|
|
2621
2621
|
updateElementProps(patch, force = false) {
|
|
2622
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2622
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
2623
2623
|
if (this.entity === "input") {
|
|
2624
2624
|
if (!(patch == null ? void 0 : patch.type)) patch.type = "text";
|
|
2625
2625
|
if (patch.type !== this.element.type) {
|
|
@@ -2634,8 +2634,15 @@ var ComponentCore = class {
|
|
|
2634
2634
|
this.element.value = String(patch.value).slice(0, patch == null ? void 0 : patch.maxLength);
|
|
2635
2635
|
}
|
|
2636
2636
|
} else if (this.entity === "select") {
|
|
2637
|
-
|
|
2638
|
-
|
|
2637
|
+
const s = String(patch.value);
|
|
2638
|
+
if (s !== this.element.value) {
|
|
2639
|
+
this.element.value = s;
|
|
2640
|
+
}
|
|
2641
|
+
} else if (this.entity === "option") {
|
|
2642
|
+
if (((_d = (_c = (_b = (_a = this.container) == null ? void 0 : _a.props) == null ? void 0 : _b.value) == null ? void 0 : _c.constructor) == null ? void 0 : _d.name) === "Array") {
|
|
2643
|
+
patch.selected = this.container.props.value.indexOf(patch.value) !== -1;
|
|
2644
|
+
} else if (typeof ((_f = (_e = this.container) == null ? void 0 : _e.props) == null ? void 0 : _f.value) === "string") {
|
|
2645
|
+
patch.selected = this.container.props.value === patch.value;
|
|
2639
2646
|
}
|
|
2640
2647
|
}
|
|
2641
2648
|
for (let a in this.props) {
|
|
@@ -2653,19 +2660,19 @@ var ComponentCore = class {
|
|
|
2653
2660
|
if (special_attributes.has(al)) continue;
|
|
2654
2661
|
if (patch === this.props || !lilact_default.defaultIsEqual(patch[a], this.props[a]) || force) {
|
|
2655
2662
|
if (events_set.has(al)) {
|
|
2656
|
-
(
|
|
2657
|
-
(
|
|
2663
|
+
(_g = this.event_detachers) != null ? _g : this.event_detachers = {};
|
|
2664
|
+
(_i = (_h = this.event_detachers)[al]) == null ? void 0 : _i.call(_h);
|
|
2658
2665
|
this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, al.substring(2), patch[a]);
|
|
2659
2666
|
} else if (capture_events_set.hasOwnProperty(al)) {
|
|
2660
2667
|
const alc = capture_events_set[al];
|
|
2661
|
-
(
|
|
2662
|
-
(
|
|
2668
|
+
(_j = this.event_detachers) != null ? _j : this.event_detachers = {};
|
|
2669
|
+
(_l = (_k = this.event_detachers)[al]) == null ? void 0 : _l.call(_k);
|
|
2663
2670
|
this.event_detachers[al] = lilact_default.addWrappedEventListener(this.element, alc.substring(2), patch[a], { capture: true });
|
|
2664
2671
|
} else if (a === "style") {
|
|
2665
2672
|
if (typeof patch.style === "string") {
|
|
2666
2673
|
this.element.style = patch.style;
|
|
2667
2674
|
} else {
|
|
2668
|
-
if ((
|
|
2675
|
+
if ((_m = this.props) == null ? void 0 : _m.style) {
|
|
2669
2676
|
if (typeof this.props.style === "string") {
|
|
2670
2677
|
this.element.style = "";
|
|
2671
2678
|
} else {
|
|
@@ -2686,16 +2693,16 @@ var ComponentCore = class {
|
|
|
2686
2693
|
Object.assign(this.element.style, patch.style);
|
|
2687
2694
|
}
|
|
2688
2695
|
} else if (boolean_html_attributes_set.has(a)) {
|
|
2689
|
-
|
|
2690
|
-
if (
|
|
2696
|
+
const v = toBool(patch[a]);
|
|
2697
|
+
if (v !== this.element[a]) {
|
|
2698
|
+
this.element[a] = v;
|
|
2699
|
+
}
|
|
2691
2700
|
} else if (a === "autoFocus") {
|
|
2692
2701
|
this.element["autofocus"] = toBool(patch[a]);
|
|
2693
2702
|
} else if (a === "htmlFor") {
|
|
2694
2703
|
this.element.setAttribute("for", patch[a]);
|
|
2695
|
-
} else {
|
|
2696
|
-
|
|
2697
|
-
this.element.setAttribute(al, patch[a]);
|
|
2698
|
-
}
|
|
2704
|
+
} else if (al !== "value" || ["input", "textarea", "select"].indexOf(this.entity) === -1) {
|
|
2705
|
+
this.element.setAttribute(al, patch[a]);
|
|
2699
2706
|
}
|
|
2700
2707
|
}
|
|
2701
2708
|
}
|
|
@@ -2704,8 +2711,6 @@ var ComponentCore = class {
|
|
|
2704
2711
|
} else {
|
|
2705
2712
|
this.element.onsubmit = void 0;
|
|
2706
2713
|
}
|
|
2707
|
-
if (true) {
|
|
2708
|
-
}
|
|
2709
2714
|
this.updateElementClass(patch);
|
|
2710
2715
|
}
|
|
2711
2716
|
updateElementClass(patch = this.props) {
|
|
@@ -3319,6 +3324,7 @@ var boolean_html_attributes_set = /* @__PURE__ */ new Set([
|
|
|
3319
3324
|
"required",
|
|
3320
3325
|
"checked",
|
|
3321
3326
|
"multiple",
|
|
3327
|
+
"selected",
|
|
3322
3328
|
"hidden",
|
|
3323
3329
|
"open",
|
|
3324
3330
|
"loop",
|
|
@@ -3832,7 +3838,7 @@ function require2(path2) {
|
|
|
3832
3838
|
isInline: false,
|
|
3833
3839
|
isModule: true
|
|
3834
3840
|
});
|
|
3835
|
-
if (module2.loaded && !options.forceUpdate
|
|
3841
|
+
if (module2.loaded && !options.forceUpdate) {
|
|
3836
3842
|
return module2.exports;
|
|
3837
3843
|
}
|
|
3838
3844
|
if (path2.startsWith("#")) {
|