@holoviz/panel 1.2.2-a.2 → 1.2.2-a.3

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.
Files changed (26) hide show
  1. package/dist/bundled/datatabulator/luxon/build/global/luxon.min.js +1 -1
  2. package/dist/bundled/datatabulator/luxon/build/global/luxon.min.js.map +1 -1
  3. package/dist/bundled/notificationarea/panel/1.2.2-a.3/dist/bundled/font-awesome/css/all.min.css +2 -0
  4. package/dist/bundled/panel/1.2.2-a.3/dist/bundled/bootstrap5/css/bootstrap.min.css +2 -0
  5. package/dist/bundled/panel/1.2.2-a.3/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +2 -0
  6. package/dist/bundled/panel/1.2.2-a.3/dist/bundled/font-awesome/css/all.min.css +2 -0
  7. package/dist/bundled/panel/1.2.2-a.3/dist/bundled/jquery/jquery.slim.min.js +2 -0
  8. package/dist/bundled/plotlyplot/panel/1.2.2-a.3/dist/bundled/jquery/jquery.slim.min.js +2 -0
  9. package/dist/lib/models/column.d.ts +3 -0
  10. package/dist/lib/models/column.js +15 -12
  11. package/dist/lib/models/column.js.map +1 -1
  12. package/dist/lib/models/tabulator.d.ts +1 -1
  13. package/dist/lib/models/tabulator.js +18 -11
  14. package/dist/lib/models/tabulator.js.map +1 -1
  15. package/dist/panel.js +41 -30
  16. package/dist/panel.js.map +1 -1
  17. package/dist/panel.json +1 -1
  18. package/dist/panel.min.js +5 -5
  19. package/dist/wheels/{panel-1.2.2a2-py3-none-any.whl → panel-1.2.2a3-py3-none-any.whl} +0 -0
  20. package/package.json +1 -1
  21. package/dist/bundled/notificationarea/panel/1.2.2-a.2/dist/bundled/font-awesome/css/all.min.css +0 -2
  22. package/dist/bundled/panel/1.2.2-a.2/dist/bundled/bootstrap5/css/bootstrap.min.css +0 -2
  23. package/dist/bundled/panel/1.2.2-a.2/dist/bundled/bootstrap5/js/bootstrap.bundle.min.js +0 -2
  24. package/dist/bundled/panel/1.2.2-a.2/dist/bundled/font-awesome/css/all.min.css +0 -2
  25. package/dist/bundled/panel/1.2.2-a.2/dist/bundled/jquery/jquery.slim.min.js +0 -2
  26. package/dist/bundled/plotlyplot/panel/1.2.2-a.2/dist/bundled/jquery/jquery.slim.min.js +0 -2
package/dist/panel.js CHANGED
@@ -60,13 +60,13 @@
60
60
  __esExport("BrowserInfo", browser_1.BrowserInfo);
61
61
  var card_1 = require("c1e57c7e7d") /* ./card */;
62
62
  __esExport("Card", card_1.Card);
63
- var column_1 = require("067b508b04") /* ./column */;
63
+ var column_1 = require("13afd4a31a") /* ./column */;
64
64
  __esExport("Column", column_1.Column);
65
65
  var comm_manager_1 = require("1e66dab844") /* ./comm_manager */;
66
66
  __esExport("CommManager", comm_manager_1.CommManager);
67
67
  var customselect_1 = require("9c8629b48f") /* ./customselect */;
68
68
  __esExport("CustomSelect", customselect_1.CustomSelect);
69
- var tabulator_1 = require("fc45b724c1") /* ./tabulator */;
69
+ var tabulator_1 = require("2ec00301c1") /* ./tabulator */;
70
70
  __esExport("DataTabulator", tabulator_1.DataTabulator);
71
71
  var datetime_picker_1 = require("6658732ce1") /* ./datetime_picker */;
72
72
  __esExport("DatetimePicker", datetime_picker_1.DatetimePicker);
@@ -571,7 +571,7 @@
571
571
  __esModule();
572
572
  const tslib_1 = require("tslib");
573
573
  var _a;
574
- const column_1 = require("067b508b04") /* ./column */;
574
+ const column_1 = require("13afd4a31a") /* ./column */;
575
575
  const DOM = tslib_1.__importStar(require("@bokehjs/core/dom"));
576
576
  class CardView extends column_1.ColumnView {
577
577
  connect_signals() {
@@ -688,7 +688,7 @@
688
688
  }));
689
689
  })();
690
690
  },
691
- "067b508b04": /* models/column.js */ function _(require, module, exports, __esModule, __esExport) {
691
+ "13afd4a31a": /* models/column.js */ function _(require, module, exports, __esModule, __esExport) {
692
692
  __esModule();
693
693
  const tslib_1 = require("tslib");
694
694
  var _a;
@@ -697,13 +697,19 @@
697
697
  class ColumnView extends column_1.ColumnView {
698
698
  connect_signals() {
699
699
  super.connect_signals();
700
- const { children, scroll_button_threshold } = this.model.properties;
700
+ const { children, scroll_position, scroll_button_threshold } = this.model.properties;
701
701
  this.on_change(children, () => this.trigger_auto_scroll());
702
+ this.on_change(scroll_position, () => this.scroll_to_position());
702
703
  this.on_change(scroll_button_threshold, () => this.toggle_scroll_button());
703
704
  }
704
705
  get distance_from_latest() {
705
706
  return this.el.scrollHeight - this.el.scrollTop - this.el.clientHeight;
706
707
  }
708
+ scroll_to_position() {
709
+ requestAnimationFrame(() => {
710
+ this.el.scrollTop = this.model.scroll_position;
711
+ });
712
+ }
707
713
  scroll_to_latest() {
708
714
  // Waits for the child to be rendered before scrolling
709
715
  requestAnimationFrame(() => {
@@ -717,6 +723,9 @@
717
723
  return;
718
724
  this.scroll_to_latest();
719
725
  }
726
+ record_scroll_position() {
727
+ this.model.scroll_position = this.el.scrollTop;
728
+ }
720
729
  toggle_scroll_button() {
721
730
  const threshold = this.model.scroll_button_threshold;
722
731
  const exceeds_threshold = this.distance_from_latest >= threshold;
@@ -727,29 +736,22 @@
727
736
  }
728
737
  render() {
729
738
  super.render();
730
- this.empty();
731
- this._update_stylesheets();
732
- this._update_css_classes();
733
- this._apply_styles();
734
- this._apply_visible();
735
- this.class_list.add(...this.css_classes());
736
739
  this.scroll_down_button_el = DOM.createElement('div', { class: 'scroll-button' });
737
740
  this.shadow_el.appendChild(this.scroll_down_button_el);
738
741
  this.el.addEventListener("scroll", () => {
742
+ this.record_scroll_position();
739
743
  this.toggle_scroll_button();
740
744
  });
741
745
  this.scroll_down_button_el.addEventListener("click", () => {
742
746
  this.scroll_to_latest();
743
747
  });
744
- for (const child_view of this.child_views) {
745
- this.shadow_el.appendChild(child_view.el);
746
- child_view.render();
747
- child_view.after_render();
748
- }
749
748
  }
750
749
  after_render() {
751
750
  super.after_render();
752
751
  requestAnimationFrame(() => {
752
+ if (this.model.scroll_position) {
753
+ this.scroll_to_position();
754
+ }
753
755
  if (this.model.view_latest) {
754
756
  this.scroll_to_latest();
755
757
  }
@@ -771,6 +773,7 @@
771
773
  (() => {
772
774
  _a.prototype.default_view = ColumnView;
773
775
  _a.define(({ Int, Boolean }) => ({
776
+ scroll_position: [Int, 0],
774
777
  auto_scroll_limit: [Int, 0],
775
778
  scroll_button_threshold: [Int, 0],
776
779
  view_latest: [Boolean, false],
@@ -1002,7 +1005,7 @@
1002
1005
  });
1003
1006
  })();
1004
1007
  },
1005
- "fc45b724c1": /* models/tabulator.js */ function _(require, module, exports, __esModule, __esExport) {
1008
+ "2ec00301c1": /* models/tabulator.js */ function _(require, module, exports, __esModule, __esExport) {
1006
1009
  __esModule();
1007
1010
  var _a, _b, _c;
1008
1011
  const dom_1 = require("@bokehjs/core/dom");
@@ -1371,6 +1374,8 @@
1371
1374
  el.classList.add(cls);
1372
1375
  }
1373
1376
  render() {
1377
+ if (this.tabulator != null)
1378
+ this.tabulator.destroy();
1374
1379
  super.render();
1375
1380
  this._initializing = true;
1376
1381
  const container = (0, dom_2.div)({ style: "display: contents;" });
@@ -1525,11 +1530,12 @@
1525
1530
  return Object.assign(Object.assign({}, configuration), { "data": data });
1526
1531
  }
1527
1532
  get child_models() {
1528
- var _d;
1533
+ var _d, _e;
1529
1534
  const children = [];
1530
1535
  for (const idx of this.model.expanded) {
1531
- if ((_d = this.model.children) === null || _d === void 0 ? void 0 : _d.has(idx))
1532
- children.push(this.model.children.get(idx));
1536
+ const child = (_e = (_d = this.model.children).get) === null || _e === void 0 ? void 0 : _e.call(_d, idx);
1537
+ if (child != null)
1538
+ children.push(child);
1533
1539
  }
1534
1540
  return children;
1535
1541
  }
@@ -1551,10 +1557,10 @@
1551
1557
  _render_row(row, resize = true) {
1552
1558
  var _d;
1553
1559
  const index = (_d = row._row) === null || _d === void 0 ? void 0 : _d.data._index;
1554
- if (!this.model.expanded.includes(index) || !this.model.children.has(index))
1560
+ if (!this.model.expanded.includes(index) || this.model.children.get(index) == null)
1555
1561
  return;
1556
1562
  const model = this.model.children.get(index);
1557
- const view = this._child_views.get(model);
1563
+ const view = model == null ? null : this._child_views.get(model);
1558
1564
  if (view == null)
1559
1565
  return;
1560
1566
  const rowEl = row.getElement();
@@ -1564,8 +1570,10 @@
1564
1570
  const viewEl = (0, dom_2.div)({ style: "background-color: " + bg + "; margin-left:" + neg_margin + "; max-width: 100%; overflow-x: hidden;" });
1565
1571
  viewEl.appendChild(view.el);
1566
1572
  rowEl.appendChild(viewEl);
1567
- view.render();
1568
- view.after_render();
1573
+ if (!view.has_finished()) {
1574
+ view.render();
1575
+ view.after_render();
1576
+ }
1569
1577
  if (resize) {
1570
1578
  this._update_children();
1571
1579
  this.tabulator.rowManager.adjustTableSize();
@@ -1578,6 +1586,7 @@
1578
1586
  return "<i>" + icon + "</i>";
1579
1587
  }
1580
1588
  _update_expand(cell) {
1589
+ var _d, _e, _f, _g;
1581
1590
  const index = cell._cell.row.data._index;
1582
1591
  const expanded = [...this.model.expanded];
1583
1592
  const exp_index = expanded.indexOf(index);
@@ -1585,8 +1594,8 @@
1585
1594
  expanded.push(index);
1586
1595
  else {
1587
1596
  const removed = expanded.splice(exp_index, 1)[0];
1588
- if (removed in this.model.children) {
1589
- const model = this.model.children[removed];
1597
+ const model = (_e = (_d = this.model.children).get) === null || _e === void 0 ? void 0 : _e.call(_d, removed);
1598
+ if (model != null) {
1590
1599
  const view = this._child_views.get(model);
1591
1600
  if (view !== undefined && view.el != null)
1592
1601
  (0, dom_1.undisplay)(view.el);
@@ -1597,7 +1606,7 @@
1597
1606
  return;
1598
1607
  let ready = true;
1599
1608
  for (const idx of this.model.expanded) {
1600
- if (!(idx in this.model.children)) {
1609
+ if (((_g = (_f = this.model.children).get) === null || _g === void 0 ? void 0 : _g.call(_f, idx)) == null) {
1601
1610
  ready = false;
1602
1611
  break;
1603
1612
  }
@@ -1801,6 +1810,8 @@
1801
1810
  }
1802
1811
  // Update table
1803
1812
  setData() {
1813
+ if (this._initializing || this._building || !this.tabulator.initialized)
1814
+ return;
1804
1815
  const data = this.getData();
1805
1816
  if (this.model.pagination != null)
1806
1817
  this.tabulator.rowManager.setData(data, true, false);
@@ -1912,7 +1923,7 @@
1912
1923
  }
1913
1924
  }
1914
1925
  setSelection() {
1915
- if (this.tabulator == null || this._initializing || this._selection_updating)
1926
+ if (this.tabulator == null || this._initializing || this._selection_updating || !this.tabulator.initialized)
1916
1927
  return;
1917
1928
  const indices = this.model.source.selected.indices;
1918
1929
  const current_indices = this.tabulator.getSelectedData().map((row) => row._index);
@@ -2036,7 +2047,7 @@
2036
2047
  _c.define(({ Any, Array, Boolean, Nullable, Number, Ref, String }) => ({
2037
2048
  aggregators: [Any, {}],
2038
2049
  buttons: [Any, {}],
2039
- children: [Any, {}],
2050
+ children: [Any, new Map()],
2040
2051
  configuration: [Any, {}],
2041
2052
  columns: [Array(Ref(tables_1.TableColumn)), []],
2042
2053
  download: [Boolean, false],
@@ -19334,5 +19345,5 @@
19334
19345
  }
19335
19346
  exports.initialize_fullscreen_render = initialize_fullscreen_render;
19336
19347
  },
19337
- }, "4e90918c0a", {"index":"4e90918c0a","models/index":"6e19b31aba","models/ace":"7df2008a2e","models/layout":"ea218d1c3c","models/audio":"78153b60aa","models/browser":"6df8bf1ac7","models/card":"c1e57c7e7d","models/column":"067b508b04","models/comm_manager":"1e66dab844","models/customselect":"9c8629b48f","models/tabulator":"fc45b724c1","models/data":"fd9108e30e","models/datetime_picker":"6658732ce1","models/deckgl":"991e3a226c","models/tooltips":"9588ab7c9e","models/echarts":"eded13f5d7","models/event-to-object":"490942d778","models/html":"6b3b0facc2","models/ipywidget":"e3556c1e99","models/json":"66846b828c","models/jsoneditor":"4b8a56c700","models/file_download":"9c15016be8","models/katex":"197cfa57e5","models/location":"00a25cf872","models/mathjax":"46a1770629","models/pdf":"d49a559fbc","models/perspective":"9f0456e5b5","models/player":"c172556ad3","models/plotly":"bb3d0ded66","models/util":"990b5dd5c7","models/progress":"b82925a928","models/quill":"e115225ba2","models/reactive_html":"b969c294f5","models/singleselect":"6b20024bba","models/speech_to_text":"cd0c80cc4c","models/state":"66717cb841","models/tabs":"67a5649f75","models/terminal":"cd4a941f8d","models/text_to_speech":"eb4ae0acfa","models/tooltip_icon":"26ffc3afe8","models/trend":"8f4ab32d74","models/vega":"3b23e1bc5c","models/video":"4ac59b8079","models/videostream":"797fd61298","models/vizzu":"e8339ee57a","models/vtk/index":"c51f25e2a7","models/vtk/vtkjs":"3bce7c9db6","models/vtk/vtklayout":"d7ded264dc","models/vtk/util":"a76a9b7c23","models/vtk/vtkcolorbar":"787f6aeecd","models/vtk/vtkaxes":"7cec459a06","models/vtk/vtkvolume":"c2892117a7","models/vtk/vtksynchronized":"40c4377615","models/vtk/panel_fullscreen_renwin_sync":"877619fe71"}, {});});
19348
+ }, "4e90918c0a", {"index":"4e90918c0a","models/index":"6e19b31aba","models/ace":"7df2008a2e","models/layout":"ea218d1c3c","models/audio":"78153b60aa","models/browser":"6df8bf1ac7","models/card":"c1e57c7e7d","models/column":"13afd4a31a","models/comm_manager":"1e66dab844","models/customselect":"9c8629b48f","models/tabulator":"2ec00301c1","models/data":"fd9108e30e","models/datetime_picker":"6658732ce1","models/deckgl":"991e3a226c","models/tooltips":"9588ab7c9e","models/echarts":"eded13f5d7","models/event-to-object":"490942d778","models/html":"6b3b0facc2","models/ipywidget":"e3556c1e99","models/json":"66846b828c","models/jsoneditor":"4b8a56c700","models/file_download":"9c15016be8","models/katex":"197cfa57e5","models/location":"00a25cf872","models/mathjax":"46a1770629","models/pdf":"d49a559fbc","models/perspective":"9f0456e5b5","models/player":"c172556ad3","models/plotly":"bb3d0ded66","models/util":"990b5dd5c7","models/progress":"b82925a928","models/quill":"e115225ba2","models/reactive_html":"b969c294f5","models/singleselect":"6b20024bba","models/speech_to_text":"cd0c80cc4c","models/state":"66717cb841","models/tabs":"67a5649f75","models/terminal":"cd4a941f8d","models/text_to_speech":"eb4ae0acfa","models/tooltip_icon":"26ffc3afe8","models/trend":"8f4ab32d74","models/vega":"3b23e1bc5c","models/video":"4ac59b8079","models/videostream":"797fd61298","models/vizzu":"e8339ee57a","models/vtk/index":"c51f25e2a7","models/vtk/vtkjs":"3bce7c9db6","models/vtk/vtklayout":"d7ded264dc","models/vtk/util":"a76a9b7c23","models/vtk/vtkcolorbar":"787f6aeecd","models/vtk/vtkaxes":"7cec459a06","models/vtk/vtkvolume":"c2892117a7","models/vtk/vtksynchronized":"40c4377615","models/vtk/panel_fullscreen_renwin_sync":"877619fe71"}, {});});
19338
19349
  //# sourceMappingURL=panel.js.map