mol_dump_lib 0.0.848 → 0.0.850

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/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
- gap_after(){
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
- Gap_before(){
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
- return (rows.length === 0) ? [this.Empty()] : rows;
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,25 +4920,16 @@ 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
  ;
4907
4927
  ($.$mol_speck) = class $mol_speck extends ($.$mol_view) {
4908
- theme(){
4909
- return "$mol_theme_accent";
4910
- }
4911
4928
  value(){
4912
4929
  return null;
4913
4930
  }
4914
- minimal_width(){
4915
- return 12;
4916
- }
4917
- attr(){
4918
- return {...(super.attr()), "mol_theme": (this.theme())};
4919
- }
4920
- style(){
4921
- return {...(super.style()), "minHeight": "1em"};
4931
+ theme(){
4932
+ return "$mol_theme_accent";
4922
4933
  }
4923
4934
  sub(){
4924
4935
  return [(this.value())];
@@ -4950,7 +4961,7 @@ var $;
4950
4961
  "use strict";
4951
4962
  var $;
4952
4963
  (function ($) {
4953
- $mol_style_attach("mol/speck/speck.view.css", "[mol_speck] {\n\tfont-size: .75rem;\n\tborder-radius: 1rem;\n\tmargin: -0.5rem -0.2rem;\n\talign-self: flex-start;\n\tmin-height: 1em;\n\tvertical-align: sub;\n\tpadding: 0 .2rem;\n\tposition: absolute;\n\tz-index: var(--mol_layer_speck);\n\ttext-align: center;\n\tline-height: .9;\n\tdisplay: inline-block;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tuser-select: none;\n\tbox-shadow: 0 0 3px rgba(0,0,0,.5);\n}\n");
4964
+ $mol_style_attach("mol/speck/speck.view.css", "[mol_speck] {\n\tfont-size: .75rem;\n\tborder-radius: 1rem;\n\tmargin: -0.5rem -0.2rem;\n\talign-self: flex-start;\n\tmin-height: 1em;\n\tmin-width: .75rem;\n\tvertical-align: sub;\n\tpadding: 0 .2rem;\n\tposition: absolute;\n\tz-index: var(--mol_layer_speck);\n\ttext-align: center;\n\tline-height: .9;\n\tdisplay: inline-block;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\tuser-select: none;\n\tbox-shadow: 0 0 3px rgba(0,0,0,.5);\n}\n");
4954
4965
  })($ || ($ = {}));
4955
4966
 
4956
4967
  ;