dom-render 1.0.95 → 1.0.96

Sign up to get free protection for your applications and to get access to all the features.
package/DomRenderProxy.js CHANGED
@@ -51,7 +51,8 @@ var EventManager_1 = require("./events/EventManager");
51
51
  var ScriptUtils_1 = require("./utils/script/ScriptUtils");
52
52
  var Types_1 = require("./types/Types");
53
53
  var RawSetType_1 = require("./rawsets/RawSetType");
54
- var DrDictionary_1 = require("./operators/DrDictionary");
54
+ var DrThisProperty_1 = require("./operators/DrThisProperty");
55
+ var RawSetOperatorType_1 = require("./rawsets/RawSetOperatorType");
55
56
  var excludeGetSetPropertys = ['onBeforeReturnGet', 'onBeforeReturnSet', '__domrender_components', '__render', '_DomRender_isFinal', '_domRender_ref', '_rawSets', '_domRender_proxy', '_targets', '_DomRender_origin', '_DomRender_ref', '_DomRender_proxy'];
56
57
  var DomRenderProxy = /** @class */ (function () {
57
58
  function DomRenderProxy(_domRender_origin, target, config) {
@@ -283,6 +284,7 @@ var DomRenderProxy = /** @class */ (function () {
283
284
  // console.log('-------!!!!!', fullPathStr, iterable, data, front, last);
284
285
  new Promise(function (resolve) {
285
286
  var firstPathStr = front_1.slice(1);
287
+ // check dictionary
286
288
  // console.log('-promise-------', firstPathStr, this)
287
289
  var firstTargets = _this._rawSets.get(firstPathStr);
288
290
  var firstTargetDictionary = [];
@@ -290,7 +292,7 @@ var DomRenderProxy = /** @class */ (function () {
290
292
  var _a, _b;
291
293
  // console.log('----forEach---', it);
292
294
  var type = (_b = (_a = it.point.start).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'type');
293
- if (type === 'dictionary') {
295
+ if (type === RawSetOperatorType_1.RawSetOperatorType.DR_THIS_PROPERTY) {
294
296
  firstTargetDictionary.push(it);
295
297
  }
296
298
  });
@@ -300,10 +302,15 @@ var DomRenderProxy = /** @class */ (function () {
300
302
  var skip_1 = false;
301
303
  firstTargetDictionary.forEach(function (it) {
302
304
  var _a, _b;
303
- var keys = (_b = (_a = it.point.start.getAttribute('dictionary-keys')) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
305
+ var startElement = it.point.start;
306
+ var keys = (_b = (_a = startElement.getAttribute(RawSet_1.RawSet.DR_HAS_KEYS_OPTIONNAME)) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
307
+ if (value === undefined) {
308
+ var rawSet = it.getHasRawSet(last_1);
309
+ rawSet === null || rawSet === void 0 ? void 0 : rawSet.remove();
310
+ startElement.setAttribute(RawSet_1.RawSet.DR_HAS_KEYS_OPTIONNAME, keys.filter(function (it) { return it !== last_1; }).join(','));
311
+ }
304
312
  if (!keys.includes(last_1)) {
305
- var raws = DrDictionary_1.DrDictionary.append(_this._domRender_proxy, fullPathStr_1, last_1, it, _this.config);
306
- // console.log('----append---', raws);
313
+ var raws = DrThisProperty_1.DrThisProperty.append(_this._domRender_proxy, fullPathStr_1, last_1, it, _this.config);
307
314
  if (raws) {
308
315
  rawSets_3.push.apply(rawSets_3, raws);
309
316
  }
@@ -315,18 +322,7 @@ var DomRenderProxy = /** @class */ (function () {
315
322
  if (skip_1 === false || rawSets_3.length > 0) {
316
323
  return _this.render(rawSets_3);
317
324
  }
318
- // console.log('rawSets-->#$$$$$$$$$$$', this._rawSets);
319
- // rawSets.forEach(it => this.addRawSet(fullPathStr, it));
320
- // DrDictionary.append(this._domRender_proxy, fullPathStr, it, this.config);
321
- // it.render(this._domRender_proxy, this.config);
322
325
  }
323
- /* if (data instanceof Dictionary) {
324
- const a = this._rawSets.get(firstPathStr);
325
- // a?.forEach(it => {
326
- // if (it.type === RawSetType.TARGET_ATTR)
327
- // })
328
- console.log('dictionary-->', data, last, value, this._rawSets, a);
329
- } else */
330
326
  if (last_1 === 'length' && Array.isArray(data_1)) {
331
327
  var aIterable = _this._rawSets.get(firstPathStr);
332
328
  if (aIterable) {