@azrico/webobject 1.5.55 → 1.5.57

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.
@@ -235,6 +235,7 @@ export declare class SimpleObject extends MapableObject {
235
235
  set isArchived(v: boolean);
236
236
  get isDeleted(): boolean;
237
237
  get isLocked(): boolean;
238
+ get objectColor(): string;
238
239
  set isLocked(v: boolean);
239
240
  set isDeleted(v: boolean);
240
241
  get d(): Partial<this>;
@@ -36,11 +36,15 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
36
36
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
37
37
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
38
38
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
39
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
39
40
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
40
41
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
41
42
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
42
43
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
44
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
45
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
43
46
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
47
+ var _objectColor = /*#__PURE__*/new WeakMap();
44
48
  var _SimpleObject_brand = /*#__PURE__*/new WeakSet();
45
49
  var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject) {
46
50
  function SimpleObject() {
@@ -78,6 +82,7 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
78
82
  _defineProperty(_this, "__saveResultType", void 0);
79
83
  //init function
80
84
  _defineProperty(_this, "__initialized", void 0);
85
+ _classPrivateFieldInitSpec(_this, _objectColor, void 0);
81
86
  //id in the database
82
87
  _defineProperty(_this, "_id", "");
83
88
  //sequence key (usually managed by the database)
@@ -963,6 +968,15 @@ var SimpleObject = exports.SimpleObject = /*#__PURE__*/function (_MapableObject)
963
968
  set: function set(v) {
964
969
  this._locked = v;
965
970
  }
971
+ }, {
972
+ key: "objectColor",
973
+ get: function get() {
974
+ if (!_classPrivateFieldGet(_objectColor, this) || _classPrivateFieldGet(_objectColor, this) === "#000000") {
975
+ var lastid = this.getID();
976
+ if (!lastid) _classPrivateFieldSet(_objectColor, this, "#000000");else _classPrivateFieldSet(_objectColor, this, (0, _string.string_to_color)(lastid));
977
+ }
978
+ return _classPrivateFieldGet(_objectColor, this);
979
+ }
966
980
  }, {
967
981
  key: "d",
968
982
  get: function get() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.5.55",
3
+ "version": "1.5.57",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",