x4js 1.5.29 → 1.5.32

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/lib/esm/index.mjs CHANGED
@@ -1921,7 +1921,8 @@ var _Component = class extends BaseComponent {
1921
1921
  classes: {},
1922
1922
  dom_events: {},
1923
1923
  uid: _Component.__comp_guid++,
1924
- inrender: false
1924
+ inrender: false,
1925
+ created: false
1925
1926
  };
1926
1927
  if (this.m_props.cls) {
1927
1928
  this.addClass(this.m_props.cls);
@@ -1976,6 +1977,17 @@ var _Component = class extends BaseComponent {
1976
1977
  append(content);
1977
1978
  }
1978
1979
  }
1980
+ removeChild(item) {
1981
+ if (this.m_props.content) {
1982
+ if (!isArray(this.m_props.content)) {
1983
+ this.m_props.content = [this.m_props.content];
1984
+ }
1985
+ this.m_props.content = this.m_props.content.filter((x) => x !== item);
1986
+ }
1987
+ if (this.dom && item.dom) {
1988
+ this.dom.removeChild(item.dom);
1989
+ }
1990
+ }
1979
1991
  /**
1980
1992
  *
1981
1993
  */
@@ -2169,10 +2181,10 @@ var _Component = class extends BaseComponent {
2169
2181
  if (this.m_dom) {
2170
2182
  return this.m_dom.getAttribute(name);
2171
2183
  } else {
2172
- if (!this.m_props.attrs) {
2173
- return void 0;
2184
+ if (name == "id") {
2185
+ return this.m_props.id;
2174
2186
  }
2175
- return this.m_props.attrs[name];
2187
+ return this.m_props.attrs ? this.m_props.attrs[name] : void 0;
2176
2188
  }
2177
2189
  }
2178
2190
  /**
@@ -2403,7 +2415,7 @@ var _Component = class extends BaseComponent {
2403
2415
  for (let e in evt) {
2404
2416
  let handlers = evt[e];
2405
2417
  for (let h of handlers) {
2406
- this.createEvent(e, h);
2418
+ this._createEvent(e, h.listener, h.passive);
2407
2419
  }
2408
2420
  }
2409
2421
  }
@@ -2579,22 +2591,22 @@ var _Component = class extends BaseComponent {
2579
2591
  * this.setDomEvent( 'drag drop', this._handleDrag, this );
2580
2592
  * this.setDomEvent( 'dblclick', this._handleDblClick, this );
2581
2593
  */
2582
- setDomEvent(type, listener) {
2594
+ setDomEvent(type, listener, passive) {
2583
2595
  let _listener = listener;
2584
- this._setDomEvent(type, _listener);
2596
+ this._setDomEvent(type, _listener, passive);
2585
2597
  }
2586
- _setDomEvent(type, listener) {
2598
+ _setDomEvent(type, listener, passive) {
2587
2599
  if (!this.m_iprops.dom_events) {
2588
2600
  this.m_iprops.dom_events = {};
2589
2601
  }
2590
2602
  let listeners = this.m_iprops.dom_events[type];
2591
2603
  if (!listeners) {
2592
- listeners = this.m_iprops.dom_events[type] = [listener];
2604
+ listeners = this.m_iprops.dom_events[type] = [{ listener, passive }];
2593
2605
  } else {
2594
- listeners.push(listener);
2606
+ listeners.push({ listener, passive });
2595
2607
  }
2596
2608
  if (this.m_dom) {
2597
- this.createEvent(type, listener);
2609
+ this._createEvent(type, listener, passive);
2598
2610
  }
2599
2611
  }
2600
2612
  /**
@@ -2618,7 +2630,7 @@ var _Component = class extends BaseComponent {
2618
2630
  * @param name
2619
2631
  * @param handler
2620
2632
  */
2621
- createEvent(name, handler) {
2633
+ _createEvent(name, handler, passive) {
2622
2634
  let _dom = this.m_dom;
2623
2635
  let store = _dom[_x4_el_store];
2624
2636
  if (!store) {
@@ -2633,10 +2645,14 @@ var _Component = class extends BaseComponent {
2633
2645
  _dom["on" + name] = _Component._dispatchUnbubbleEvent;
2634
2646
  } else if (!_Component.__privateEvents[name]) {
2635
2647
  _Component.__privateEvents[name] = true;
2636
- if (passiveEvents[name]) {
2637
- x4document.addEventListener(name, _Component._dispatchEvent, { passive: false, capture: true });
2648
+ if (passive === void 0) {
2649
+ if (passiveEvents[name]) {
2650
+ x4document.addEventListener(name, _Component._dispatchEvent, { passive: false, capture: true });
2651
+ } else {
2652
+ x4document.addEventListener(name, _Component._dispatchEvent, true);
2653
+ }
2638
2654
  } else {
2639
- x4document.addEventListener(name, _Component._dispatchEvent, true);
2655
+ x4document.addEventListener(name, _Component._dispatchEvent, { passive, capture: passive ? true : false });
2640
2656
  }
2641
2657
  }
2642
2658
  if (name === "sizechange") {
@@ -3542,7 +3558,7 @@ var Router = class extends EventSource {
3542
3558
  _getLocation() {
3543
3559
  return this.m_useHash ? "/" + x4document.location.hash.substring(1) : x4document.location.pathname;
3544
3560
  }
3545
- navigate(uri, notify = true) {
3561
+ navigate(uri, notify = true, replace = false) {
3546
3562
  if (!uri.startsWith("/")) {
3547
3563
  uri = "/" + uri;
3548
3564
  }
@@ -3553,10 +3569,13 @@ var Router = class extends EventSource {
3553
3569
  return;
3554
3570
  }
3555
3571
  if (this.m_useHash) {
3556
- while (uri.startsWith("/")) {
3572
+ while (uri.at(0) == "/") {
3557
3573
  uri = uri.substring(1);
3558
3574
  }
3559
- window.history.pushState({}, "", "#" + uri);
3575
+ uri = "#" + uri;
3576
+ }
3577
+ if (replace) {
3578
+ window.history.replaceState({}, "", uri);
3560
3579
  } else {
3561
3580
  window.history.pushState({}, "", uri);
3562
3581
  }
@@ -4780,7 +4799,7 @@ var MenuItem = class extends Component {
4780
4799
  }
4781
4800
  this.setTag("a");
4782
4801
  this.setContent([
4783
- icon < 0 ? null : new Icon({ icon }),
4802
+ icon ? null : new Icon({ icon }),
4784
4803
  new Label({ flex: 1, text }),
4785
4804
  popIco
4786
4805
  ]);
@@ -5316,11 +5335,138 @@ var PopupListView = class extends Popup {
5316
5335
  };
5317
5336
  __name(PopupListView, "PopupListView");
5318
5337
 
5338
+ // src/tooltips.ts
5339
+ var tipTmo;
5340
+ var tooltip;
5341
+ var Tooltip = class extends Component {
5342
+ m_text;
5343
+ set text(text) {
5344
+ this.m_text.text = text;
5345
+ }
5346
+ /** @ignore */
5347
+ render() {
5348
+ this.setClass("@non-maskable", true);
5349
+ this.setContent([
5350
+ new Icon({ icon: "var( --x4-icon-tip )" }),
5351
+ this.m_text = new Label({ text: "help" })
5352
+ ]);
5353
+ }
5354
+ /**
5355
+ * display the menu at a specific position
5356
+ * @param x
5357
+ * @param y
5358
+ */
5359
+ displayAt(x, y, align = "top left") {
5360
+ this.show();
5361
+ let halign = "l", valign = "t";
5362
+ if (align.indexOf("right") >= 0) {
5363
+ halign = "r";
5364
+ }
5365
+ if (align.indexOf("bottom") >= 0) {
5366
+ valign = "b";
5367
+ }
5368
+ let rc = x4document.body.getBoundingClientRect(), rm = this.getBoundingRect();
5369
+ if (halign == "r") {
5370
+ x -= rm.width;
5371
+ }
5372
+ if (valign == "b") {
5373
+ y -= rm.height;
5374
+ }
5375
+ if (x + rm.width > rc.right) {
5376
+ x = rc.right - rm.width;
5377
+ }
5378
+ if (y + rm.height > rc.bottom) {
5379
+ y = rc.bottom - rm.height - 17;
5380
+ }
5381
+ this.setStyle({ left: x, top: y });
5382
+ }
5383
+ };
5384
+ __name(Tooltip, "Tooltip");
5385
+ function initTooltips(cb) {
5386
+ if (isTouchDevice()) {
5387
+ return;
5388
+ }
5389
+ let tipTarget = {
5390
+ target: null,
5391
+ x: 0,
5392
+ y: 0
5393
+ };
5394
+ function handle_mpos(event) {
5395
+ tipTarget.x = event.pageX;
5396
+ tipTarget.y = event.pageY;
5397
+ }
5398
+ __name(handle_mpos, "handle_mpos");
5399
+ function handle_mouse(event) {
5400
+ let target = event.target;
5401
+ let tip = null;
5402
+ tipTarget.x = event.pageX + 10;
5403
+ tipTarget.y = event.pageY + 15;
5404
+ while (target) {
5405
+ tip = target.getAttribute("tip");
5406
+ if (tip) {
5407
+ break;
5408
+ }
5409
+ target = target.parentElement;
5410
+ }
5411
+ if (target == tipTarget.target || tooltip && target == tooltip.dom) {
5412
+ return;
5413
+ }
5414
+ if (!target || !tip) {
5415
+ tipTarget.target = null;
5416
+ if (cb) {
5417
+ cb(null);
5418
+ } else {
5419
+ _hideTip();
5420
+ }
5421
+ return;
5422
+ }
5423
+ tipTarget.target = target;
5424
+ if (cb) {
5425
+ cb(null);
5426
+ } else {
5427
+ _hideTip();
5428
+ }
5429
+ if (cb) {
5430
+ cb(tip);
5431
+ } else {
5432
+ tipTmo = setTimeout(() => {
5433
+ if (tooltip === void 0) {
5434
+ tooltip = new Tooltip({});
5435
+ x4document.body.appendChild(tooltip._build());
5436
+ }
5437
+ tooltip.text = tip;
5438
+ tooltip.displayAt(tipTarget.x + 17, tipTarget.y + 17, "top left");
5439
+ }, 700);
5440
+ }
5441
+ }
5442
+ __name(handle_mouse, "handle_mouse");
5443
+ function _hideTip() {
5444
+ if (tipTmo) {
5445
+ clearTimeout(tipTmo);
5446
+ }
5447
+ if (tooltip) {
5448
+ tooltip.hide();
5449
+ }
5450
+ }
5451
+ __name(_hideTip, "_hideTip");
5452
+ x4document.body.addEventListener("mouseover", handle_mouse);
5453
+ x4document.body.addEventListener("mouseout", handle_mouse);
5454
+ x4document.body.addEventListener("mousemove", handle_mpos);
5455
+ }
5456
+ __name(initTooltips, "initTooltips");
5457
+
5319
5458
  // src/input.ts
5320
5459
  var Input = class extends Component {
5460
+ m_error_tip;
5321
5461
  constructor(props) {
5322
5462
  super(props);
5323
5463
  }
5464
+ componentDisposed() {
5465
+ if (this.m_error_tip) {
5466
+ this.m_error_tip.dispose();
5467
+ }
5468
+ super.componentDisposed();
5469
+ }
5324
5470
  /** @ignore */
5325
5471
  render(props) {
5326
5472
  this.setTag("input");
@@ -5350,6 +5496,22 @@ var Input = class extends Component {
5350
5496
  });
5351
5497
  }
5352
5498
  }
5499
+ showError(text) {
5500
+ if (!this.m_error_tip) {
5501
+ this.m_error_tip = new Tooltip({ cls: "error" });
5502
+ x4document.body.appendChild(this.m_error_tip._build());
5503
+ }
5504
+ let rc = this.getBoundingRect();
5505
+ this.m_error_tip.text = text;
5506
+ this.m_error_tip.displayAt(rc.right, rc.top - 8, "top right");
5507
+ this.addClass("@error");
5508
+ }
5509
+ clearError() {
5510
+ if (this.m_error_tip) {
5511
+ this.m_error_tip.hide();
5512
+ this.removeClass("@error");
5513
+ }
5514
+ }
5353
5515
  getType() {
5354
5516
  return this.m_props.type;
5355
5517
  }
@@ -5357,13 +5519,17 @@ var Input = class extends Component {
5357
5519
  * return the current editor value
5358
5520
  */
5359
5521
  get value() {
5522
+ return this.getValue();
5523
+ }
5524
+ getValue() {
5525
+ const dom = this.dom;
5360
5526
  if (this.dom) {
5361
- this.m_props.value = this.dom.value;
5527
+ this.m_props.value = dom.value;
5362
5528
  }
5363
5529
  if (this.m_props.uppercase) {
5364
5530
  let upper = this.m_props.value.toUpperCase();
5365
- if (this.dom && upper != this.m_props.value) {
5366
- this.dom.value = upper;
5531
+ if (dom && upper != this.m_props.value) {
5532
+ dom.value = upper;
5367
5533
  }
5368
5534
  this.m_props.value = upper;
5369
5535
  }
@@ -5374,6 +5540,9 @@ var Input = class extends Component {
5374
5540
  * @param value - new value to set
5375
5541
  */
5376
5542
  set value(value) {
5543
+ this.setValue(value);
5544
+ }
5545
+ setValue(value) {
5377
5546
  this.m_props.value = value;
5378
5547
  if (this.dom) {
5379
5548
  this.dom.value = value;
@@ -5387,7 +5556,8 @@ var Input = class extends Component {
5387
5556
  if (type) {
5388
5557
  type = type.toLowerCase();
5389
5558
  }
5390
- let value, dom = this.dom;
5559
+ let value;
5560
+ const dom = this.dom;
5391
5561
  if (type === "file") {
5392
5562
  value = [];
5393
5563
  let files = dom.files;
@@ -5406,6 +5576,11 @@ var Input = class extends Component {
5406
5576
  }
5407
5577
  } else if (type === "date") {
5408
5578
  debugger;
5579
+ } else if (type == "number") {
5580
+ value = this.value;
5581
+ if (value.indexOf(",") >= 0) {
5582
+ value = value.replace(",", ".");
5583
+ }
5409
5584
  } else {
5410
5585
  value = this.value;
5411
5586
  }
@@ -5413,6 +5588,7 @@ var Input = class extends Component {
5413
5588
  }
5414
5589
  }
5415
5590
  setStoreValue(v) {
5591
+ this.clearError();
5416
5592
  if (this.m_props.value_hook) {
5417
5593
  return this.m_props.value_hook.set(v);
5418
5594
  } else {
@@ -5813,7 +5989,7 @@ var Calendar = class extends VLayout {
5813
5989
  } else if (type == "year") {
5814
5990
  let min = this.m_props.minDate?.getFullYear() ?? 1900;
5815
5991
  let max = this.m_props.maxDate?.getFullYear() ?? 2037;
5816
- for (let m = min; m < max; m++) {
5992
+ for (let m = max; m >= min; m--) {
5817
5993
  items.push(new MenuItem({
5818
5994
  text: "" + m,
5819
5995
  click: () => {
@@ -5879,132 +6055,11 @@ var PopupCalendar = class extends Popup {
5879
6055
  };
5880
6056
  __name(PopupCalendar, "PopupCalendar");
5881
6057
 
5882
- // src/tooltips.ts
5883
- var tipTmo;
5884
- var tooltip;
5885
- var Tooltip = class extends Component {
5886
- m_text;
5887
- set text(text) {
5888
- this.m_text.text = text;
5889
- }
5890
- /** @ignore */
5891
- render() {
5892
- this.setClass("@non-maskable", true);
5893
- this.setContent([
5894
- new Icon({ icon: "var( --x4-icon-tip )" }),
5895
- this.m_text = new Label({ text: "help" })
5896
- ]);
5897
- }
5898
- /**
5899
- * display the menu at a specific position
5900
- * @param x
5901
- * @param y
5902
- */
5903
- displayAt(x, y, align = "top left") {
5904
- this.show();
5905
- let halign = "l", valign = "t";
5906
- if (align.indexOf("right") >= 0) {
5907
- halign = "r";
5908
- }
5909
- if (align.indexOf("bottom") >= 0) {
5910
- valign = "b";
5911
- }
5912
- let rc = x4document.body.getBoundingClientRect(), rm = this.getBoundingRect();
5913
- if (halign == "r") {
5914
- x -= rm.width;
5915
- }
5916
- if (valign == "b") {
5917
- y -= rm.height;
5918
- }
5919
- if (x + rm.width > rc.right) {
5920
- x = rc.right - rm.width;
5921
- }
5922
- if (y + rm.height > rc.bottom) {
5923
- y = rc.bottom - rm.height - 17;
5924
- }
5925
- this.setStyle({ left: x, top: y });
5926
- }
5927
- };
5928
- __name(Tooltip, "Tooltip");
5929
- function initTooltips(cb) {
5930
- if (isTouchDevice()) {
5931
- return;
5932
- }
5933
- let tipTarget = {
5934
- target: null,
5935
- x: 0,
5936
- y: 0
5937
- };
5938
- function handle_mpos(event) {
5939
- tipTarget.x = event.pageX;
5940
- tipTarget.y = event.pageY;
5941
- }
5942
- __name(handle_mpos, "handle_mpos");
5943
- function handle_mouse(event) {
5944
- let target = event.target;
5945
- let tip = null;
5946
- tipTarget.x = event.pageX + 10;
5947
- tipTarget.y = event.pageY + 15;
5948
- while (target) {
5949
- tip = target.getAttribute("tip");
5950
- if (tip) {
5951
- break;
5952
- }
5953
- target = target.parentElement;
5954
- }
5955
- if (target == tipTarget.target || tooltip && target == tooltip.dom) {
5956
- return;
5957
- }
5958
- if (!target || !tip) {
5959
- tipTarget.target = null;
5960
- if (cb) {
5961
- cb(null);
5962
- } else {
5963
- _hideTip();
5964
- }
5965
- return;
5966
- }
5967
- tipTarget.target = target;
5968
- if (cb) {
5969
- cb(null);
5970
- } else {
5971
- _hideTip();
5972
- }
5973
- if (cb) {
5974
- cb(tip);
5975
- } else {
5976
- tipTmo = setTimeout(() => {
5977
- if (tooltip === void 0) {
5978
- tooltip = new Tooltip({});
5979
- x4document.body.appendChild(tooltip._build());
5980
- }
5981
- tooltip.text = tip;
5982
- tooltip.displayAt(tipTarget.x + 17, tipTarget.y + 17, "top left");
5983
- }, 700);
5984
- }
5985
- }
5986
- __name(handle_mouse, "handle_mouse");
5987
- function _hideTip() {
5988
- if (tipTmo) {
5989
- clearTimeout(tipTmo);
5990
- }
5991
- if (tooltip) {
5992
- tooltip.hide();
5993
- }
5994
- }
5995
- __name(_hideTip, "_hideTip");
5996
- x4document.body.addEventListener("mouseover", handle_mouse);
5997
- x4document.body.addEventListener("mouseout", handle_mouse);
5998
- x4document.body.addEventListener("mousemove", handle_mpos);
5999
- }
6000
- __name(initTooltips, "initTooltips");
6001
-
6002
6058
  // src/textedit.ts
6003
6059
  var reEmail = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
6004
6060
  var TextEdit = class extends Component {
6005
6061
  m_cal_popup;
6006
6062
  m_ui_input;
6007
- m_error_tip;
6008
6063
  constructor(props) {
6009
6064
  super(props);
6010
6065
  this.addClass("@hlayout");
@@ -6016,12 +6071,6 @@ var TextEdit = class extends Component {
6016
6071
  this.focus();
6017
6072
  }
6018
6073
  }
6019
- componentDisposed() {
6020
- if (this.m_error_tip) {
6021
- this.m_error_tip.dispose();
6022
- }
6023
- super.componentDisposed();
6024
- }
6025
6074
  focus() {
6026
6075
  this.m_ui_input.focus();
6027
6076
  }
@@ -6173,29 +6222,28 @@ var TextEdit = class extends Component {
6173
6222
  }
6174
6223
  }
6175
6224
  showError(text) {
6176
- if (!this.m_error_tip) {
6177
- this.m_error_tip = new Tooltip({ cls: "error" });
6178
- x4document.body.appendChild(this.m_error_tip._build());
6179
- }
6180
- let rc = this.m_ui_input.getBoundingRect();
6181
- this.m_error_tip.text = text;
6182
- this.m_error_tip.displayAt(rc.right, rc.top - 8, "top right");
6183
- this.addClass("@error");
6225
+ this.m_ui_input.showError(text);
6184
6226
  }
6185
6227
  clearError() {
6186
- if (this.m_error_tip) {
6187
- this.m_error_tip.hide();
6188
- this.removeClass("@error");
6189
- }
6228
+ this.m_ui_input.clearError();
6190
6229
  }
6191
6230
  get value() {
6231
+ return this.getValue();
6232
+ }
6233
+ getValue() {
6192
6234
  if (this.m_ui_input) {
6193
6235
  return this.m_ui_input.value;
6194
6236
  } else {
6195
6237
  return this.m_props.value;
6196
6238
  }
6197
6239
  }
6240
+ /**
6241
+ *
6242
+ */
6198
6243
  set value(value) {
6244
+ this.setValue(value);
6245
+ }
6246
+ setValue(value) {
6199
6247
  if (this.m_ui_input) {
6200
6248
  this.m_ui_input.value = value;
6201
6249
  } else {
@@ -6411,8 +6459,12 @@ var AutoComplete = class extends TextEdit {
6411
6459
  }
6412
6460
  super.componentDisposed();
6413
6461
  }
6414
- showPopup() {
6415
- this._onChange();
6462
+ showPopup(show = true) {
6463
+ if (show) {
6464
+ this._onChange();
6465
+ } else {
6466
+ this._hidePopup();
6467
+ }
6416
6468
  }
6417
6469
  /**
6418
6470
  * display the popup
@@ -6445,7 +6497,8 @@ var AutoComplete = class extends TextEdit {
6445
6497
  style: {
6446
6498
  fontFamily,
6447
6499
  fontSize
6448
- }
6500
+ },
6501
+ renderItem: props.renderItem
6449
6502
  });
6450
6503
  }
6451
6504
  if (items) {
@@ -6490,6 +6543,9 @@ var AutoComplete = class extends TextEdit {
6490
6543
  }
6491
6544
  this.m_needval = true;
6492
6545
  }
6546
+ isPopupVisible() {
6547
+ return this.m_popvis;
6548
+ }
6493
6549
  };
6494
6550
  __name(AutoComplete, "AutoComplete");
6495
6551
 
@@ -7822,7 +7878,7 @@ var data;
7822
7878
  data2.calc = calc;
7823
7879
  __name(calc, "calc");
7824
7880
  function array(ctor, props) {
7825
- return data2.field({ ...props, type: "array", model: new ctor() });
7881
+ return data2.field({ ...props, type: "array", model: ctor ? new ctor() : null });
7826
7882
  }
7827
7883
  data2.array = array;
7828
7884
  __name(array, "array");
@@ -8059,32 +8115,23 @@ var DataProxy = class extends BaseComponent {
8059
8115
  constructor(props) {
8060
8116
  super(props);
8061
8117
  }
8062
- load(url) {
8118
+ async load(url) {
8063
8119
  if (url) {
8064
8120
  this.m_props.url = url;
8121
+ } else {
8122
+ url = this.m_props.url;
8065
8123
  }
8066
- this._refresh();
8067
- }
8068
- _refresh(delay = 0) {
8069
- const load = /* @__PURE__ */ __name(async () => {
8070
- let url = this.m_props.url;
8071
- if (this.m_props.params) {
8072
- url += "?" + this.m_props.params.join("&");
8073
- }
8074
- const r = await fetch(url);
8075
- if (r.ok) {
8076
- const raw = await r.json();
8077
- let json = raw;
8078
- if (this.m_props.solver) {
8079
- json = this.m_props.solver(json);
8080
- }
8081
- this.emit("change", EvChange(json, raw));
8124
+ if (this.m_props.params) {
8125
+ url += "?" + this.m_props.params.join("&");
8126
+ }
8127
+ const r = await fetch(url);
8128
+ if (r.ok) {
8129
+ const raw = await r.json();
8130
+ let json = raw;
8131
+ if (this.m_props.solver) {
8132
+ json = this.m_props.solver(json);
8082
8133
  }
8083
- }, "load");
8084
- if (delay) {
8085
- setTimeout(load, delay);
8086
- } else {
8087
- load();
8134
+ this.emit("change", EvChange(json, raw));
8088
8135
  }
8089
8136
  }
8090
8137
  };
@@ -8112,18 +8159,20 @@ var DataStore = class extends EventSource {
8112
8159
  this.setData(ev.value);
8113
8160
  } }
8114
8161
  });
8115
- this.m_proxy.load();
8162
+ if (props.autoload != false) {
8163
+ this.m_proxy.load();
8164
+ }
8116
8165
  }
8117
8166
  }
8118
8167
  /**
8119
8168
  *
8120
8169
  * @param records
8121
8170
  */
8122
- load(url) {
8123
- this.m_proxy.load(url);
8171
+ async load(url) {
8172
+ return this.m_proxy.load(url);
8124
8173
  }
8125
- reload() {
8126
- this.m_proxy.load();
8174
+ async reload() {
8175
+ return this.m_proxy.load();
8127
8176
  }
8128
8177
  /**
8129
8178
  * convert raw objects to real records from model
@@ -8577,7 +8626,6 @@ var DataView = class extends BaseComponent {
8577
8626
  *
8578
8627
  */
8579
8628
  forEach(cb) {
8580
- debugger;
8581
8629
  this.m_index.some((index) => {
8582
8630
  let rec = this.m_store.getByIndex(index);
8583
8631
  if (rec) {
@@ -8599,7 +8647,6 @@ var ComboBox = class extends HLayout {
8599
8647
  m_lockchg;
8600
8648
  m_popvis;
8601
8649
  m_selection;
8602
- m_error_tip;
8603
8650
  constructor(props) {
8604
8651
  super(props);
8605
8652
  if (!props.editable) {
@@ -8725,9 +8772,6 @@ var ComboBox = class extends HLayout {
8725
8772
  }
8726
8773
  }
8727
8774
  componentDisposed() {
8728
- if (this.m_error_tip) {
8729
- this.m_error_tip.dispose();
8730
- }
8731
8775
  if (this.m_popup) {
8732
8776
  this.m_popup.close();
8733
8777
  }
@@ -8795,20 +8839,10 @@ var ComboBox = class extends HLayout {
8795
8839
  return true;
8796
8840
  }
8797
8841
  showError(text) {
8798
- if (!this.m_error_tip) {
8799
- this.m_error_tip = new Tooltip({ cls: "error" });
8800
- x4document.body.appendChild(this.m_error_tip._build());
8801
- }
8802
- let rc = this.m_ui_input.getBoundingRect();
8803
- this.m_error_tip.text = text;
8804
- this.m_error_tip.displayAt(rc.right, rc.top - 8, "top right");
8805
- this.addClass("@error");
8842
+ this.m_ui_input.showError(text);
8806
8843
  }
8807
8844
  clearError() {
8808
- if (this.m_error_tip) {
8809
- this.m_error_tip.hide();
8810
- this.removeClass("@error");
8811
- }
8845
+ this.m_ui_input.clearError();
8812
8846
  }
8813
8847
  /** @ignore
8814
8848
  */
@@ -14367,7 +14401,10 @@ var SideBarView = class extends CardView {
14367
14401
  this.m_sidebar.setContent(new VLayout({
14368
14402
  flex: 1,
14369
14403
  cls: "content",
14370
- content: tabs
14404
+ content: [
14405
+ this.m_props.logo,
14406
+ ...tabs
14407
+ ]
14371
14408
  }));
14372
14409
  this.setContent([
14373
14410
  this.m_sidebar,
@@ -14478,7 +14515,7 @@ var SVGItem = class {
14478
14515
  style(name, value) {
14479
14516
  if (value === void 0 || value === "" || value === void 0) {
14480
14517
  this.m_style.delete(name);
14481
- return;
14518
+ return this;
14482
14519
  }
14483
14520
  if (!_x4_unitless[name] && (isNumber(value) || reNumber2.test(value))) {
14484
14521
  value = value + "px";
@@ -14539,18 +14576,22 @@ var SVGItem = class {
14539
14576
  */
14540
14577
  transform(tr) {
14541
14578
  this.attr("transform", tr);
14579
+ return this;
14542
14580
  }
14543
14581
  /**
14544
14582
  *
14545
14583
  */
14546
14584
  rotate(deg, cx, cy) {
14547
14585
  this.transform(`rotate( ${deg} ${cx} ${cy} )`);
14586
+ return this;
14548
14587
  }
14549
14588
  translate(dx, dy) {
14550
14589
  this.transform(`translate( ${dx} ${dy} )`);
14590
+ return this;
14551
14591
  }
14552
14592
  scale(x) {
14553
14593
  this.transform(`scale( ${x} )`);
14594
+ return this;
14554
14595
  }
14555
14596
  };
14556
14597
  __name(SVGItem, "SVGItem");
@@ -14742,6 +14783,11 @@ var SVGGroup = class extends SVGItem {
14742
14783
  this.m_items.push(shape);
14743
14784
  return shape;
14744
14785
  }
14786
+ group() {
14787
+ const group = new SVGGroup();
14788
+ this.m_items.push(group);
14789
+ return group;
14790
+ }
14745
14791
  /**
14746
14792
  *
14747
14793
  * example
@@ -15658,7 +15704,7 @@ function setupWSMessaging(closeCB) {
15658
15704
  __name(setupWSMessaging, "setupWSMessaging");
15659
15705
 
15660
15706
  // src/version.ts
15661
- var x4js_version = "1.5.29";
15707
+ var x4js_version = "1.5.32";
15662
15708
  export {
15663
15709
  AbsLayout,
15664
15710
  Application,