mol_dump_lib 0.0.847 → 0.0.849
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/node.d.ts +5 -4
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +41 -21
- package/node.js.map +1 -1
- package/node.mjs +41 -21
- package/node.test.js +44 -21
- package/node.test.js.map +1 -1
- package/node.view.tree +5 -4
- package/package.json +1 -1
- package/web.d.ts +5 -4
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +41 -21
- package/web.js.map +1 -1
- package/web.mjs +41 -21
- package/web.test.js +3 -0
- package/web.test.js.map +1 -1
- package/web.view.tree +5 -4
package/web.js
CHANGED
|
@@ -4614,51 +4614,60 @@ var $;
|
|
|
4614
4614
|
|
|
4615
4615
|
;
|
|
4616
4616
|
($.$mol_list) = class $mol_list extends ($.$mol_view) {
|
|
4617
|
-
rows(){
|
|
4618
|
-
return [];
|
|
4619
|
-
}
|
|
4620
4617
|
gap_before(){
|
|
4621
4618
|
return 0;
|
|
4622
4619
|
}
|
|
4623
|
-
|
|
4624
|
-
return 0;
|
|
4625
|
-
}
|
|
4626
|
-
render_visible_only(){
|
|
4627
|
-
return true;
|
|
4628
|
-
}
|
|
4629
|
-
render_over(){
|
|
4630
|
-
return 0;
|
|
4631
|
-
}
|
|
4632
|
-
sub(){
|
|
4633
|
-
return (this.rows());
|
|
4634
|
-
}
|
|
4635
|
-
Empty(){
|
|
4620
|
+
Gap_before(){
|
|
4636
4621
|
const obj = new this.$.$mol_view();
|
|
4622
|
+
(obj.style) = () => ({"paddingTop": (this.gap_before())});
|
|
4637
4623
|
return obj;
|
|
4638
4624
|
}
|
|
4639
|
-
|
|
4625
|
+
Empty(){
|
|
4640
4626
|
const obj = new this.$.$mol_view();
|
|
4641
|
-
(obj.style) = () => ({"paddingTop": (this.gap_before())});
|
|
4642
4627
|
return obj;
|
|
4643
4628
|
}
|
|
4629
|
+
gap_after(){
|
|
4630
|
+
return 0;
|
|
4631
|
+
}
|
|
4644
4632
|
Gap_after(){
|
|
4645
4633
|
const obj = new this.$.$mol_view();
|
|
4646
4634
|
(obj.style) = () => ({"paddingTop": (this.gap_after())});
|
|
4647
4635
|
return obj;
|
|
4648
4636
|
}
|
|
4637
|
+
rows(){
|
|
4638
|
+
return [
|
|
4639
|
+
(this.Gap_before()),
|
|
4640
|
+
(this.Empty()),
|
|
4641
|
+
(this.Gap_after())
|
|
4642
|
+
];
|
|
4643
|
+
}
|
|
4644
|
+
render_visible_only(){
|
|
4645
|
+
return true;
|
|
4646
|
+
}
|
|
4647
|
+
render_over(){
|
|
4648
|
+
return 0.1;
|
|
4649
|
+
}
|
|
4650
|
+
sub(){
|
|
4651
|
+
return (this.rows());
|
|
4652
|
+
}
|
|
4649
4653
|
item_height_min(id){
|
|
4650
4654
|
return 1;
|
|
4651
4655
|
}
|
|
4652
4656
|
item_width_min(id){
|
|
4653
4657
|
return 1;
|
|
4654
4658
|
}
|
|
4659
|
+
view_window_shift(next){
|
|
4660
|
+
if(next !== undefined) return next;
|
|
4661
|
+
return 0;
|
|
4662
|
+
}
|
|
4655
4663
|
view_window(){
|
|
4656
4664
|
return [0, 0];
|
|
4657
4665
|
}
|
|
4658
4666
|
};
|
|
4659
|
-
($mol_mem(($.$mol_list.prototype), "Empty"));
|
|
4660
4667
|
($mol_mem(($.$mol_list.prototype), "Gap_before"));
|
|
4668
|
+
($mol_mem(($.$mol_list.prototype), "Empty"));
|
|
4661
4669
|
($mol_mem(($.$mol_list.prototype), "Gap_after"));
|
|
4670
|
+
($mol_mem(($.$mol_list.prototype), "view_window_shift"));
|
|
4662
4671
|
|
|
4663
4672
|
|
|
4664
4673
|
;
|
|
@@ -4742,7 +4751,15 @@ var $;
|
|
|
4742
4751
|
class $mol_list extends $.$mol_list {
|
|
4743
4752
|
sub() {
|
|
4744
4753
|
const rows = this.rows();
|
|
4745
|
-
|
|
4754
|
+
const next = (rows.length === 0) ? [this.Empty()] : rows;
|
|
4755
|
+
const prev = $mol_mem_cached(() => this.sub());
|
|
4756
|
+
const [start, end] = $mol_mem_cached(() => this.view_window()) ?? [0, 0];
|
|
4757
|
+
if (prev && $mol_mem_cached(() => prev[start] !== next[start])) {
|
|
4758
|
+
const index = $mol_mem_cached(() => next.indexOf(prev[start])) ?? -1;
|
|
4759
|
+
if (index >= 0)
|
|
4760
|
+
this.view_window_shift(index - start);
|
|
4761
|
+
}
|
|
4762
|
+
return next;
|
|
4746
4763
|
}
|
|
4747
4764
|
render_visible_only() {
|
|
4748
4765
|
return this.$.$mol_support_css_overflow_anchor();
|
|
@@ -4757,6 +4774,9 @@ var $;
|
|
|
4757
4774
|
if (next)
|
|
4758
4775
|
return next;
|
|
4759
4776
|
let [min, max] = $mol_mem_cached(() => this.view_window()) ?? [0, 0];
|
|
4777
|
+
const shift = this.view_window_shift();
|
|
4778
|
+
min += shift;
|
|
4779
|
+
max += shift;
|
|
4760
4780
|
let max2 = max = Math.min(max, kids.length);
|
|
4761
4781
|
let min2 = min = Math.max(0, Math.min(min, max - 1));
|
|
4762
4782
|
const anchoring = this.render_visible_only();
|
|
@@ -4900,7 +4920,7 @@ var $;
|
|
|
4900
4920
|
"use strict";
|
|
4901
4921
|
var $;
|
|
4902
4922
|
(function ($) {
|
|
4903
|
-
$mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\tmin-height: 1.5rem;\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
|
|
4923
|
+
$mol_style_attach("mol/list/list.view.css", "[mol_list] {\n\twill-change: contents;\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex-shrink: 0;\n\tmax-width: 100%;\n\t/* display: flex;\n\talign-items: stretch;\n\talign-content: stretch; */\n\ttransition: none;\n\tmin-height: 1.5rem;\n\t/* will-change: contents; */\n}\n\n[mol_list_gap_before] ,\n[mol_list_gap_after] {\n\tdisplay: block !important;\n\tflex: none;\n\ttransition: none;\n\toverflow-anchor: none;\n}\n");
|
|
4904
4924
|
})($ || ($ = {}));
|
|
4905
4925
|
|
|
4906
4926
|
;
|