dom-render 1.0.90 → 1.0.92

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.
Files changed (49) hide show
  1. package/DomRender.js +5 -1
  2. package/DomRenderProxy.d.ts +1 -1
  3. package/DomRenderProxy.js +121 -63
  4. package/README.MD +15 -3
  5. package/components/ComponentSet.d.ts +5 -2
  6. package/components/ComponentSet.js +2 -3
  7. package/configs/Config.d.ts +5 -0
  8. package/configs/TargetElement.d.ts +1 -1
  9. package/dist/bundle.js +1337 -968
  10. package/events/EventManager.js +1 -0
  11. package/operators/Dr.d.ts +7 -3
  12. package/operators/Dr.js +64 -25
  13. package/operators/DrAppender.d.ts +7 -3
  14. package/operators/DrAppender.js +70 -28
  15. package/operators/DrFor.d.ts +7 -3
  16. package/operators/DrFor.js +67 -25
  17. package/operators/DrForOf.d.ts +7 -3
  18. package/operators/DrForOf.js +70 -28
  19. package/operators/DrForm.d.ts +7 -3
  20. package/operators/DrForm.js +93 -55
  21. package/operators/DrIf.d.ts +7 -3
  22. package/operators/DrIf.js +71 -35
  23. package/operators/DrInnerHTML.d.ts +7 -3
  24. package/operators/DrInnerHTML.js +62 -23
  25. package/operators/DrInnerText.d.ts +7 -3
  26. package/operators/DrInnerText.js +60 -21
  27. package/operators/DrPre.d.ts +6 -3
  28. package/operators/DrPre.js +49 -6
  29. package/operators/DrRepeat.d.ts +7 -3
  30. package/operators/DrRepeat.js +67 -25
  31. package/operators/DrTargetAttr.d.ts +6 -3
  32. package/operators/DrTargetAttr.js +72 -29
  33. package/operators/DrTargetElement.d.ts +6 -3
  34. package/operators/DrTargetElement.js +86 -64
  35. package/operators/DrThis.d.ts +4 -3
  36. package/operators/DrThis.js +77 -33
  37. package/operators/OperatorExecuter.d.ts +49 -0
  38. package/operators/OperatorExecuter.js +89 -0
  39. package/operators/OperatorExecuterAttrRequire.d.ts +8 -0
  40. package/operators/OperatorExecuterAttrRequire.js +79 -0
  41. package/package.json +1 -1
  42. package/rawsets/RawSet.d.ts +4 -4
  43. package/rawsets/RawSet.js +460 -317
  44. package/routers/HashRouter.js +1 -1
  45. package/routers/PathRouter.js +1 -1
  46. package/routers/Router.d.ts +3 -0
  47. package/routers/Router.js +10 -0
  48. package/operators/OperatorRender.d.ts +0 -45
  49. package/operators/OperatorRender.js +0 -21
@@ -14,49 +14,93 @@ var __extends = (this && this.__extends) || (function () {
14
14
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
15
  };
16
16
  })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
17
53
  Object.defineProperty(exports, "__esModule", { value: true });
18
54
  exports.DrThis = void 0;
19
- var OperatorRender_1 = require("./OperatorRender");
20
- var ScriptUtils_1 = require("../utils/script/ScriptUtils");
55
+ var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
21
56
  var RawSet_1 = require("../rawsets/RawSet");
22
57
  var ComponentSet_1 = require("../components/ComponentSet");
58
+ var OperatorExecuter_1 = require("./OperatorExecuter");
23
59
  var DrThis = /** @class */ (function (_super) {
24
60
  __extends(DrThis, _super);
25
61
  function DrThis() {
26
62
  return _super !== null && _super.apply(this, arguments) || this;
27
63
  }
28
- DrThis.prototype.execRender = function () {
29
- var _a;
30
- var _b, _c, _d, _e, _f;
31
- if (this.elementSource.attrs.drThis) {
32
- var r = ScriptUtils_1.ScriptUtils.evalReturn(this.elementSource.attrs.drThis, this.source.obj);
33
- // const isStrip = ScriptUtils.eval(`if (${this.elementSource.attrs.drStripOption ?? 'false'}) { return true; } else { return false; }`, this.source.obj);
34
- // console.log('isStrip', isStrip)
35
- if (r) {
36
- if (r instanceof ComponentSet_1.ComponentSet) {
37
- if (this.rawSet.data) {
38
- var destroyOptions = (_c = (_b = this.elementSource.attrs.drDestroyOption) === null || _b === void 0 ? void 0 : _b.split(',')) !== null && _c !== void 0 ? _c : [];
39
- RawSet_1.RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
40
- }
41
- this.rawSet.data = r;
42
- var componentBody = RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, "".concat(this.elementSource.attrs.drThis, ".obj"), (_d = this.elementSource.attrs.drVarOption) !== null && _d !== void 0 ? _d : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, r);
43
- this.returnContainer.fag.append(componentBody);
44
- this.afterCallBack.onThisComponentSetCallBacks.push(r);
45
- }
46
- else {
47
- this.returnContainer.fag.append(RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, this.elementSource.attrs.drThis, (_e = this.elementSource.attrs.drVarOption) !== null && _e !== void 0 ? _e : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config));
64
+ DrThis.prototype.executeAttrRequire = function (attr) {
65
+ var _a, _b, _c, _d, _e;
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ var destroyOptions, componentBody, _f, _g, rr;
68
+ var _h;
69
+ return __generator(this, function (_j) {
70
+ switch (_j.label) {
71
+ case 0:
72
+ if (!(attr && this.elementSource.attrs.drThis)) return [3 /*break*/, 5];
73
+ if (!(attr instanceof ComponentSet_1.ComponentSet)) return [3 /*break*/, 2];
74
+ if (this.rawSet.data) {
75
+ destroyOptions = (_b = (_a = this.elementSource.attrs.drDestroyOption) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
76
+ RawSet_1.RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
77
+ }
78
+ this.rawSet.data = attr;
79
+ return [4 /*yield*/, RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, "".concat(this.elementSource.attrs.drThis).concat(attr.config.objPath ? ('.' + attr.config.objPath) : ''), (_c = this.elementSource.attrs.drVarOption) !== null && _c !== void 0 ? _c : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, attr)];
80
+ case 1:
81
+ componentBody = _j.sent();
82
+ this.returnContainer.fag.append(componentBody);
83
+ this.afterCallBack.onThisComponentSetCallBacks.push(attr);
84
+ return [3 /*break*/, 4];
85
+ case 2:
86
+ _g = (_f = this.returnContainer.fag).append;
87
+ return [4 /*yield*/, RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, this.elementSource.attrs.drThis, (_d = this.elementSource.attrs.drVarOption) !== null && _d !== void 0 ? _d : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config)];
88
+ case 3:
89
+ _g.apply(_f, [_j.sent()]);
90
+ _j.label = 4;
91
+ case 4:
92
+ rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
93
+ (_e = this.elementSource.element.parentNode) === null || _e === void 0 ? void 0 : _e.replaceChild(this.returnContainer.fag, this.elementSource.element);
94
+ (_h = this.returnContainer.raws).push.apply(_h, rr);
95
+ return [3 /*break*/, 6];
96
+ case 5:
97
+ this.elementSource.element.remove();
98
+ _j.label = 6;
99
+ case 6: return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
48
100
  }
49
- var rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
50
- (_f = this.elementSource.element.parentNode) === null || _f === void 0 ? void 0 : _f.replaceChild(this.returnContainer.fag, this.elementSource.element);
51
- (_a = this.returnContainer.raws).push.apply(_a, rr);
52
- }
53
- else {
54
- this.elementSource.element.remove();
55
- }
56
- return OperatorRender_1.ExecuteState.EXECUTE;
57
- }
58
- return OperatorRender_1.ExecuteState.NO_EXECUTE;
101
+ });
102
+ });
59
103
  };
60
104
  return DrThis;
61
- }(OperatorRender_1.OperatorRender));
105
+ }(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
62
106
  exports.DrThis = DrThis;
@@ -0,0 +1,49 @@
1
+ import { AttrInitCallBack } from '../rawsets/AttrInitCallBack';
2
+ import { ElementInitCallBack } from '../rawsets/ElementInitCallBack';
3
+ import { ComponentSet } from '../components/ComponentSet';
4
+ import { RawSet } from '../rawsets/RawSet';
5
+ import { Render } from '../rawsets/Render';
6
+ import { Attrs } from '../rawsets/Attrs';
7
+ import { Config } from '../configs/Config';
8
+ export declare type OperatorAround = {
9
+ beforeAttr?: (value: string | null | undefined, opratorExecutor: OperatorExecuter) => string | null | undefined;
10
+ before?: (data: any, opratorExecutor: OperatorExecuter) => any;
11
+ after?: (data: any, opratorExecutor: OperatorExecuter) => void;
12
+ };
13
+ export declare enum ExecuteState {
14
+ EXECUTE = 0,
15
+ NO_EXECUTE = 1,
16
+ STOP = 2
17
+ }
18
+ export declare type AfterCallBack = {
19
+ onAttrInitCallBacks: AttrInitCallBack[];
20
+ onElementInitCallBacks: ElementInitCallBack[];
21
+ onThisComponentSetCallBacks: ComponentSet[];
22
+ };
23
+ export declare type ReturnContainer = {
24
+ raws: RawSet[];
25
+ fag: DocumentFragment;
26
+ };
27
+ export declare type ElementSource = {
28
+ element: Element;
29
+ attrs: Attrs;
30
+ attr?: string | null;
31
+ attrName?: string | undefined;
32
+ };
33
+ export declare type Source = {
34
+ config: Config;
35
+ operatorAround?: OperatorAround;
36
+ obj: any;
37
+ };
38
+ export declare abstract class OperatorExecuter<T = any> {
39
+ rawSet: RawSet;
40
+ render: Render;
41
+ returnContainer: ReturnContainer;
42
+ elementSource: ElementSource;
43
+ source: Source;
44
+ afterCallBack: AfterCallBack;
45
+ startingExecute: boolean;
46
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack, startingExecute?: boolean);
47
+ start(): Promise<ExecuteState>;
48
+ abstract execute(value: T): Promise<ExecuteState>;
49
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.OperatorExecuter = exports.ExecuteState = void 0;
40
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
41
+ var ExecuteState;
42
+ (function (ExecuteState) {
43
+ ExecuteState[ExecuteState["EXECUTE"] = 0] = "EXECUTE";
44
+ ExecuteState[ExecuteState["NO_EXECUTE"] = 1] = "NO_EXECUTE";
45
+ ExecuteState[ExecuteState["STOP"] = 2] = "STOP";
46
+ })(ExecuteState = exports.ExecuteState || (exports.ExecuteState = {}));
47
+ var OperatorExecuter = /** @class */ (function () {
48
+ function OperatorExecuter(rawSet, render, returnContainer, elementSource, source, afterCallBack, startingExecute) {
49
+ if (startingExecute === void 0) { startingExecute = true; }
50
+ this.rawSet = rawSet;
51
+ this.render = render;
52
+ this.returnContainer = returnContainer;
53
+ this.elementSource = elementSource;
54
+ this.source = source;
55
+ this.afterCallBack = afterCallBack;
56
+ this.startingExecute = startingExecute;
57
+ }
58
+ ;
59
+ OperatorExecuter.prototype.start = function () {
60
+ var _a, _b, _c, _d, _e, _f;
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var attrValue, r, state;
63
+ return __generator(this, function (_g) {
64
+ switch (_g.label) {
65
+ case 0:
66
+ attrValue = this.elementSource.attr;
67
+ if ((_a = this.source.operatorAround) === null || _a === void 0 ? void 0 : _a.beforeAttr) {
68
+ attrValue = (_b = this.source.operatorAround.beforeAttr(attrValue, this)) !== null && _b !== void 0 ? _b : '';
69
+ }
70
+ r = attrValue;
71
+ if (r && this.startingExecute) {
72
+ r = ScriptUtils_1.ScriptUtils.eval(" ".concat(this.render.bindScript, "; return ").concat(attrValue), Object.assign(this.source.obj, { __render: this.render }));
73
+ }
74
+ if ((_c = this.source.operatorAround) === null || _c === void 0 ? void 0 : _c.before) {
75
+ r = (_d = this.source.operatorAround) === null || _d === void 0 ? void 0 : _d.before(r, this);
76
+ }
77
+ return [4 /*yield*/, this.execute(r)];
78
+ case 1:
79
+ state = _g.sent();
80
+ (_f = (_e = this.source.operatorAround) === null || _e === void 0 ? void 0 : _e.after) === null || _f === void 0 ? void 0 : _f.call(_e, r, this);
81
+ return [2 /*return*/, state];
82
+ }
83
+ });
84
+ });
85
+ };
86
+ ;
87
+ return OperatorExecuter;
88
+ }());
89
+ exports.OperatorExecuter = OperatorExecuter;
@@ -0,0 +1,8 @@
1
+ import { RawSet } from '../rawsets/RawSet';
2
+ import { Render } from '../rawsets/Render';
3
+ import { AfterCallBack, ElementSource, ExecuteState, OperatorExecuter, ReturnContainer, Source } from './OperatorExecuter';
4
+ export declare abstract class OperatorExecuterAttrRequire<T> extends OperatorExecuter<T> {
5
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack, startingExecute?: boolean);
6
+ execute(data: T): Promise<ExecuteState>;
7
+ protected abstract executeAttrRequire(attr: T): Promise<ExecuteState>;
8
+ }
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (_) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.OperatorExecuterAttrRequire = void 0;
55
+ var OperatorExecuter_1 = require("./OperatorExecuter");
56
+ var OperatorExecuterAttrRequire = /** @class */ (function (_super) {
57
+ __extends(OperatorExecuterAttrRequire, _super);
58
+ function OperatorExecuterAttrRequire(rawSet, render, returnContainer, elementSource, source, afterCallBack, startingExecute) {
59
+ if (startingExecute === void 0) { startingExecute = true; }
60
+ return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, startingExecute) || this;
61
+ }
62
+ ;
63
+ OperatorExecuterAttrRequire.prototype.execute = function (data) {
64
+ return __awaiter(this, void 0, void 0, function () {
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0:
68
+ if (!this.elementSource.attr) {
69
+ return [2 /*return*/, OperatorExecuter_1.ExecuteState.NO_EXECUTE];
70
+ }
71
+ return [4 /*yield*/, this.executeAttrRequire(data)];
72
+ case 1: return [2 /*return*/, _a.sent()];
73
+ }
74
+ });
75
+ });
76
+ };
77
+ return OperatorExecuterAttrRequire;
78
+ }(OperatorExecuter_1.OperatorExecuter));
79
+ exports.OperatorExecuterAttrRequire = OperatorExecuterAttrRequire;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dom-render",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "main": "DomRender.js",
5
5
  "license": "MIT",
6
6
  "description": "html view template engine",
@@ -20,7 +20,7 @@ export declare class RawSet {
20
20
  action: Function;
21
21
  } | undefined;
22
22
  data?: any;
23
- static readonly DR = "dr";
23
+ static readonly DR_NAME = "dr";
24
24
  static readonly DR_IF_NAME = "dr-if";
25
25
  static readonly DR_FOR_NAME = "dr-for";
26
26
  static readonly DR_FOR_OF_NAME = "dr-for-of";
@@ -48,7 +48,7 @@ export declare class RawSet {
48
48
  static readonly DR_ON_CONSTRUCTOR_ARGUMENTS_OPTIONNAME = "dr-on-constructor:arguments";
49
49
  static readonly drAttrsOriginName: Attrs;
50
50
  static readonly DR_TAGS: never[];
51
- static readonly DR_ATTRIBUTES: string[];
51
+ static readonly DR_ATTRIBUTES: readonly ["dr", "dr-appender", "dr-if", "dr-for-of", "dr-for", "dr-this", "dr-form", "dr-pre", "dr-inner-html", "dr-inner-text", "dr-repeat", "dr-detect"];
52
52
  constructor(uuid: string, type: RawSetType, point: {
53
53
  start: Comment | Text | HTMLMetaElement;
54
54
  node: Node;
@@ -60,7 +60,7 @@ export declare class RawSet {
60
60
  } | undefined, data?: any);
61
61
  get isConnected(): boolean;
62
62
  getUsingTriggerVariables(config?: Config): Set<string>;
63
- render(obj: any, config: Config): RawSet[];
63
+ render(obj: any, config: Config): Promise<RawSet[]>;
64
64
  static generateStyleSheetsLocal(): void;
65
65
  static generateCSS(id: string, cssRule: CSSRule): void;
66
66
  static generateStyleTransform(styleBody: string | string[], id: string, styleTagWrap?: boolean): string;
@@ -95,7 +95,7 @@ export declare class RawSet {
95
95
  regex: RegExp;
96
96
  random: string;
97
97
  }[]): void;
98
- static drThisCreate(rawSet: RawSet, element: Element, drThis: string, drVarOption: string, drStripOption: boolean | string | null, obj: any, config: Config, set?: ComponentSet): DocumentFragment;
98
+ static drThisCreate(rawSet: RawSet, element: Element, drThis: string, drVarOption: string, drStripOption: boolean | string | null, obj: any, config: Config, set?: ComponentSet): Promise<DocumentFragment>;
99
99
  static createComponentTargetAttribute(name: string, getThisObj: (element: Element, attrValue: string, obj: any, rawSet: RawSet) => any, factory: (element: Element, attrValue: string, obj: any, rawSet: RawSet) => DocumentFragment): TargetAttr;
100
100
  static createComponentTargetElement(name: string, objFactory: (element: Element, obj: any, rawSet: RawSet, counstructorParam: any[]) => any, template?: string, styles?: string[]): TargetElement;
101
101
  static isExporesion(data: string | null): boolean;