@leafer/core 1.4.2 → 1.5.0

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/core.cjs CHANGED
@@ -4072,12 +4072,11 @@ function defineDataProcessor(target, key, defaultValue) {
4072
4072
  if (defaultValue === undefined) {
4073
4073
  property.get = function () { return this[computedKey]; };
4074
4074
  }
4075
- else if (typeof defaultValue === 'object') {
4076
- const { clone } = DataHelper;
4075
+ else if (typeof defaultValue === 'function') {
4077
4076
  property.get = function () {
4078
4077
  let v = this[computedKey];
4079
4078
  if (v === undefined)
4080
- this[computedKey] = v = clone(defaultValue);
4079
+ this[computedKey] = v = defaultValue(this.__leaf);
4081
4080
  return v;
4082
4081
  };
4083
4082
  }
@@ -5724,10 +5723,10 @@ exports.Leaf = class Leaf {
5724
5723
  static changeAttr(attrName, defaultValue, fn) {
5725
5724
  fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue);
5726
5725
  }
5727
- static addAttr(attrName, defaultValue, fn) {
5726
+ static addAttr(attrName, defaultValue, fn, helpValue) {
5728
5727
  if (!fn)
5729
5728
  fn = boundsType;
5730
- fn(defaultValue)(this.prototype, attrName);
5729
+ fn(defaultValue, helpValue)(this.prototype, attrName);
5731
5730
  }
5732
5731
  __emitLifeEvent(type) {
5733
5732
  if (this.hasEvent(type))
@@ -6054,7 +6053,7 @@ class LeafLevelList {
6054
6053
  }
6055
6054
  }
6056
6055
 
6057
- const version = "1.4.2";
6056
+ const version = "1.5.0";
6058
6057
 
6059
6058
  exports.AlignHelper = AlignHelper;
6060
6059
  exports.AroundHelper = AroundHelper;