@livinglogic/livingapi 1.9.0 → 1.10.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livinglogic/livingapi",
3
- "version": "1.9.0",
3
+ "version": "1.10.1",
4
4
  "description": "Javascript version of the LivingAPI classes of LivingApps",
5
5
  "repository": {
6
6
  "type": "git",
package/src/livingapi.js CHANGED
@@ -1209,6 +1209,8 @@ export class Field extends Base
1209
1209
  this._writable = true;
1210
1210
  this._visible = true;
1211
1211
  this._required = null;
1212
+ this._top = null;
1213
+ this._left = null;
1212
1214
  }
1213
1215
 
1214
1216
  [ul4.symbols.type]()
@@ -1302,6 +1304,40 @@ export class Field extends Base
1302
1304
  this.errors = [];
1303
1305
  }
1304
1306
 
1307
+ get top()
1308
+ {
1309
+ return this._top ?? this.control.top;
1310
+ }
1311
+
1312
+ set top(value)
1313
+ {
1314
+ this._top = value;
1315
+ if (this._in_form())
1316
+ this._dom_root.style.top = this.top + "px";
1317
+ }
1318
+
1319
+ get left()
1320
+ {
1321
+ return this._left ?? this.control.left;
1322
+ }
1323
+
1324
+ set left(value)
1325
+ {
1326
+ this._left = value;
1327
+ if (this._in_form())
1328
+ this._dom_root.style.left = this.left + "px";
1329
+ }
1330
+
1331
+ get width()
1332
+ {
1333
+ return this.control.width;
1334
+ }
1335
+
1336
+ get height()
1337
+ {
1338
+ return this.control.width;
1339
+ }
1340
+
1305
1341
  search(searchvalue)
1306
1342
  {
1307
1343
  return this.control.search(this.value, searchvalue);
@@ -1498,7 +1534,7 @@ export class Field extends Base
1498
1534
  s += " is_dirty()=True";
1499
1535
  if (this.errors.length > 0)
1500
1536
  s += " has_errors()=True";
1501
- s += ">"
1537
+ s += ">";
1502
1538
  return s;
1503
1539
  }
1504
1540
 
@@ -1514,13 +1550,25 @@ export class Field extends Base
1514
1550
  this.writable = ul4._bool(value);
1515
1551
  else if (name === "required")
1516
1552
  this.required = ul4._bool(value);
1553
+ else if (name === "top")
1554
+ {
1555
+ if (value !== null && (typeof(value) !== "number"))
1556
+ throw new ul4.ArgumentError("top must be None or an int");
1557
+ this.top = value;
1558
+ }
1559
+ else if (name === "left")
1560
+ {
1561
+ if (value !== null && (typeof(value) !== "number"))
1562
+ throw new ul4.ArgumentError("left must be None or an int");
1563
+ this.left = value;
1564
+ }
1517
1565
  else
1518
1566
  super[ul4.symbols.setattr](name, value);
1519
1567
  }
1520
1568
  };
1521
1569
 
1522
1570
  Field.prototype._ul4onattrs = ["control", "record", "label", "value", "errors", "_visible", "_enabled", "_writable", "_required"];
1523
- Field.prototype._ul4attrs = new Set(["control", "record", "label", "value", "errors", "visible", "enabled", "writable", "required"]);
1571
+ Field.prototype._ul4attrs = new Set(["control", "record", "label", "value", "errors", "visible", "enabled", "writable", "required", "top", "left", "width", "height"]);
1524
1572
  Field.prototype._inputevent = "input";
1525
1573
 
1526
1574