dom-render 1.0.97 → 1.0.99
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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dom-render.iml +9 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jpa-buddy.xml +6 -0
- package/.idea/misc.xml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/README.MD +6 -793
- package/package.json +1 -1
- package/DomRender.d.ts +0 -13
- package/DomRender.js +0 -72
- package/DomRenderProxy.d.ts +0 -30
- package/DomRenderProxy.js +0 -510
- package/components/ComponentSet.d.ts +0 -10
- package/components/ComponentSet.js +0 -13
- package/configs/Config.d.ts +0 -34
- package/configs/Config.js +0 -2
- package/configs/TargetAttr.d.ts +0 -6
- package/configs/TargetAttr.js +0 -2
- package/configs/TargetElement.d.ts +0 -14
- package/configs/TargetElement.js +0 -2
- package/css/parse/index.d.ts +0 -1
- package/css/parse/index.js +0 -512
- package/css/stringify/compiler.d.ts +0 -32
- package/css/stringify/compiler.js +0 -40
- package/css/stringify/compress.d.ts +0 -75
- package/css/stringify/compress.js +0 -156
- package/css/stringify/identity.d.ts +0 -85
- package/css/stringify/identity.js +0 -194
- package/css/stringify/index.d.ts +0 -14
- package/css/stringify/index.js +0 -44
- package/dist/bundle.js +0 -5493
- package/events/EventManager.d.ts +0 -49
- package/events/EventManager.js +0 -529
- package/iterators/Range.d.ts +0 -23
- package/iterators/Range.js +0 -80
- package/lifecycle/OnBeforeReturnGet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnGet.js +0 -2
- package/lifecycle/OnBeforeReturnSet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnSet.js +0 -2
- package/lifecycle/OnChangeAttrRender.d.ts +0 -3
- package/lifecycle/OnChangeAttrRender.js +0 -2
- package/lifecycle/OnCreateRender.d.ts +0 -3
- package/lifecycle/OnCreateRender.js +0 -2
- package/lifecycle/OnDestroyRender.d.ts +0 -4
- package/lifecycle/OnDestroyRender.js +0 -2
- package/lifecycle/OnInitRender.d.ts +0 -3
- package/lifecycle/OnInitRender.js +0 -2
- package/lifecycle/OnProxyDomRender.d.ts +0 -4
- package/lifecycle/OnProxyDomRender.js +0 -2
- package/managers/RenderManager.d.ts +0 -3
- package/managers/RenderManager.js +0 -18
- package/messenger/DefaultMessenger.d.ts +0 -3
- package/messenger/DefaultMessenger.js +0 -27
- package/messenger/Messenger.d.ts +0 -78
- package/messenger/Messenger.js +0 -201
- package/operators/Appender.d.ts +0 -10
- package/operators/Appender.js +0 -64
- package/operators/AttrExpresion.d.ts +0 -0
- package/operators/AttrExpresion.js +0 -44
- package/operators/Dr.d.ts +0 -8
- package/operators/Dr.js +0 -101
- package/operators/DrAppender.d.ts +0 -8
- package/operators/DrAppender.js +0 -107
- package/operators/DrFor.d.ts +0 -8
- package/operators/DrFor.js +0 -104
- package/operators/DrForOf.d.ts +0 -8
- package/operators/DrForOf.js +0 -107
- package/operators/DrForm.d.ts +0 -8
- package/operators/DrForm.js +0 -138
- package/operators/DrIf.d.ts +0 -8
- package/operators/DrIf.js +0 -108
- package/operators/DrInnerHTML.d.ts +0 -8
- package/operators/DrInnerHTML.js +0 -99
- package/operators/DrInnerText.d.ts +0 -8
- package/operators/DrInnerText.js +0 -97
- package/operators/DrPre.d.ts +0 -7
- package/operators/DrPre.js +0 -73
- package/operators/DrRepeat.d.ts +0 -8
- package/operators/DrRepeat.js +0 -105
- package/operators/DrTargetAttr.d.ts +0 -7
- package/operators/DrTargetAttr.js +0 -98
- package/operators/DrTargetElement.d.ts +0 -7
- package/operators/DrTargetElement.js +0 -114
- package/operators/DrThis.d.ts +0 -5
- package/operators/DrThis.js +0 -108
- package/operators/DrThisProperty.d.ts +0 -10
- package/operators/DrThisProperty.js +0 -143
- package/operators/OperatorExecuter.d.ts +0 -49
- package/operators/OperatorExecuter.js +0 -89
- package/operators/OperatorExecuterAttrRequire.d.ts +0 -8
- package/operators/OperatorExecuterAttrRequire.js +0 -79
- package/rawsets/AttrInitCallBack.d.ts +0 -5
- package/rawsets/AttrInitCallBack.js +0 -2
- package/rawsets/Attrs.d.ts +0 -24
- package/rawsets/Attrs.js +0 -2
- package/rawsets/CreatorMetaData.d.ts +0 -18
- package/rawsets/CreatorMetaData.js +0 -2
- package/rawsets/DestroyOptionType.d.ts +0 -4
- package/rawsets/DestroyOptionType.js +0 -8
- package/rawsets/ElementInitCallBack.d.ts +0 -8
- package/rawsets/ElementInitCallBack.js +0 -2
- package/rawsets/RawSet.d.ts +0 -118
- package/rawsets/RawSet.js +0 -1141
- package/rawsets/RawSetOperatorType.d.ts +0 -3
- package/rawsets/RawSetOperatorType.js +0 -7
- package/rawsets/RawSetType.d.ts +0 -7
- package/rawsets/RawSetType.js +0 -11
- package/rawsets/Render.d.ts +0 -17
- package/rawsets/Render.js +0 -2
- package/routers/HashRouter.d.ts +0 -9
- package/routers/HashRouter.js +0 -53
- package/routers/PathRouter.d.ts +0 -9
- package/routers/PathRouter.js +0 -52
- package/routers/Router.d.ts +0 -28
- package/routers/Router.js +0 -126
- package/types/Types.d.ts +0 -14
- package/types/Types.js +0 -36
- package/utils/clipboard/ClipBoardUtils.d.ts +0 -6
- package/utils/clipboard/ClipBoardUtils.js +0 -25
- package/utils/dom/DomUtils.d.ts +0 -13
- package/utils/dom/DomUtils.js +0 -47
- package/utils/location/LocationUtils.d.ts +0 -16
- package/utils/location/LocationUtils.js +0 -63
- package/utils/node/NodeUtils.d.ts +0 -10
- package/utils/node/NodeUtils.js +0 -27
- package/utils/random/RandomUtils.d.ts +0 -7
- package/utils/random/RandomUtils.js +0 -47
- package/utils/script/ScriptUtils.d.ts +0 -14
- package/utils/script/ScriptUtils.js +0 -89
- package/utils/storage/StorageUtils.d.ts +0 -16
- package/utils/storage/StorageUtils.js +0 -87
- package/utils/string/StringUtils.d.ts +0 -6
- package/utils/string/StringUtils.js +0 -58
- package/utils/valid/ValidUtils.d.ts +0 -10
- package/utils/valid/ValidUtils.js +0 -78
- package/validators/AllCheckedValidatorArray.d.ts +0 -6
- package/validators/AllCheckedValidatorArray.js +0 -32
- package/validators/AllUnCheckedValidatorArray.d.ts +0 -6
- package/validators/AllUnCheckedValidatorArray.js +0 -32
- package/validators/CheckedValidator.d.ts +0 -5
- package/validators/CheckedValidator.js +0 -32
- package/validators/CountEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountUnCheckedValidatorArray.js +0 -34
- package/validators/EmptyValidator.d.ts +0 -5
- package/validators/EmptyValidator.js +0 -33
- package/validators/ExcludeCheckedValidatorArray.d.ts +0 -8
- package/validators/ExcludeCheckedValidatorArray.js +0 -41
- package/validators/FormValidator.d.ts +0 -7
- package/validators/FormValidator.js +0 -37
- package/validators/IncludeCheckedValidatorArray.d.ts +0 -8
- package/validators/IncludeCheckedValidatorArray.js +0 -41
- package/validators/MultipleValidator.d.ts +0 -8
- package/validators/MultipleValidator.js +0 -48
- package/validators/NonPassValidator.d.ts +0 -5
- package/validators/NonPassValidator.js +0 -31
- package/validators/NotEmptyValidator.d.ts +0 -5
- package/validators/NotEmptyValidator.js +0 -34
- package/validators/NotRegExpTestValidator.d.ts +0 -6
- package/validators/NotRegExpTestValidator.js +0 -42
- package/validators/PassValidator.d.ts +0 -5
- package/validators/PassValidator.js +0 -31
- package/validators/RegExpTestValidator.d.ts +0 -6
- package/validators/RegExpTestValidator.js +0 -43
- package/validators/RequiredValidator.d.ts +0 -5
- package/validators/RequiredValidator.js +0 -33
- package/validators/UnCheckedValidator.d.ts +0 -5
- package/validators/UnCheckedValidator.js +0 -32
- package/validators/ValidMultipleValidator.d.ts +0 -9
- package/validators/ValidMultipleValidator.js +0 -34
- package/validators/ValidValidator.d.ts +0 -6
- package/validators/ValidValidator.js +0 -33
- package/validators/ValidValidatorArray.d.ts +0 -7
- package/validators/ValidValidatorArray.js +0 -33
- package/validators/Validator.d.ts +0 -57
- package/validators/Validator.js +0 -242
- package/validators/ValidatorArray.d.ts +0 -17
- package/validators/ValidatorArray.js +0 -99
- package/validators/ValueEqualsValidator.d.ts +0 -6
- package/validators/ValueEqualsValidator.js +0 -33
- package/validators/ValueNotEqualsValidator.d.ts +0 -6
- package/validators/ValueNotEqualsValidator.js +0 -33
@@ -1,7 +0,0 @@
|
|
1
|
-
import { RawSet } from '../rawsets/RawSet';
|
2
|
-
import { AfterCallBack, ElementSource, ExecuteState, OperatorExecuter, ReturnContainer, Source } from './OperatorExecuter';
|
3
|
-
import { Render } from '../rawsets/Render';
|
4
|
-
export declare class DrTargetElement extends OperatorExecuter<void> {
|
5
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
6
|
-
execute(): Promise<ExecuteState>;
|
7
|
-
}
|
@@ -1,114 +0,0 @@
|
|
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.DrTargetElement = void 0;
|
55
|
-
var ScriptUtils_1 = require("../utils/script/ScriptUtils");
|
56
|
-
var RawSet_1 = require("../rawsets/RawSet");
|
57
|
-
var OperatorExecuter_1 = require("./OperatorExecuter");
|
58
|
-
var DrTargetElement = /** @class */ (function (_super) {
|
59
|
-
__extends(DrTargetElement, _super);
|
60
|
-
function DrTargetElement(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
61
|
-
var _this = this;
|
62
|
-
source.operatorAround = undefined;
|
63
|
-
_this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
64
|
-
return _this;
|
65
|
-
}
|
66
|
-
DrTargetElement.prototype.execute = function () {
|
67
|
-
var _a, _b, _c, _d;
|
68
|
-
return __awaiter(this, void 0, void 0, function () {
|
69
|
-
var targetElement, documentFragment, detectAction_1, render_1, rr;
|
70
|
-
var _e;
|
71
|
-
var _this = this;
|
72
|
-
return __generator(this, function (_f) {
|
73
|
-
switch (_f.label) {
|
74
|
-
case 0:
|
75
|
-
targetElement = (_b = (_a = this.source.config) === null || _a === void 0 ? void 0 : _a.targetElements) === null || _b === void 0 ? void 0 : _b.find(function (it) { return it.name.toLowerCase() === _this.elementSource.element.tagName.toLowerCase(); });
|
76
|
-
if (!targetElement) return [3 /*break*/, 2];
|
77
|
-
return [4 /*yield*/, targetElement.callBack(this.elementSource.element, this.source.obj, this.rawSet, this.elementSource.attrs, this.source.config)];
|
78
|
-
case 1:
|
79
|
-
documentFragment = _f.sent();
|
80
|
-
if (documentFragment) {
|
81
|
-
detectAction_1 = this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_DETECT_NAME);
|
82
|
-
render_1 = documentFragment.render;
|
83
|
-
this.rawSet.fragment = documentFragment;
|
84
|
-
this.rawSet.data = render_1.component;
|
85
|
-
if (detectAction_1 && render_1) {
|
86
|
-
this.rawSet.detect = {
|
87
|
-
action: function () {
|
88
|
-
var script = "var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; " + detectAction_1 + " ";
|
89
|
-
ScriptUtils_1.ScriptUtils.eval(script, Object.assign(_this.source.obj, {
|
90
|
-
__render: render_1
|
91
|
-
}));
|
92
|
-
}
|
93
|
-
};
|
94
|
-
}
|
95
|
-
rr = RawSet_1.RawSet.checkPointCreates(documentFragment, this.source.obj, this.source.config);
|
96
|
-
(_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(documentFragment, this.elementSource.element);
|
97
|
-
(_e = this.returnContainer.raws).push.apply(_e, rr);
|
98
|
-
this.afterCallBack.onElementInitCallBacks.push({
|
99
|
-
name: targetElement.name.toLowerCase(),
|
100
|
-
obj: this.source.obj,
|
101
|
-
targetElement: targetElement,
|
102
|
-
creatorMetaData: targetElement.__creatorMetaData
|
103
|
-
});
|
104
|
-
(_d = targetElement === null || targetElement === void 0 ? void 0 : targetElement.complete) === null || _d === void 0 ? void 0 : _d.call(targetElement, this.elementSource.element, this.source.obj, this.rawSet);
|
105
|
-
}
|
106
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
107
|
-
case 2: return [2 /*return*/, OperatorExecuter_1.ExecuteState.NO_EXECUTE];
|
108
|
-
}
|
109
|
-
});
|
110
|
-
});
|
111
|
-
};
|
112
|
-
return DrTargetElement;
|
113
|
-
}(OperatorExecuter_1.OperatorExecuter));
|
114
|
-
exports.DrTargetElement = DrTargetElement;
|
package/operators/DrThis.d.ts
DELETED
package/operators/DrThis.js
DELETED
@@ -1,108 +0,0 @@
|
|
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.DrThis = void 0;
|
55
|
-
var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
|
56
|
-
var RawSet_1 = require("../rawsets/RawSet");
|
57
|
-
var ComponentSet_1 = require("../components/ComponentSet");
|
58
|
-
var OperatorExecuter_1 = require("./OperatorExecuter");
|
59
|
-
var DrThis = /** @class */ (function (_super) {
|
60
|
-
__extends(DrThis, _super);
|
61
|
-
function DrThis() {
|
62
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
63
|
-
}
|
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, "" + this.elementSource.attrs.drThis + (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
|
-
// console.log('dr-this!!!!!!!', this.rawSet, this.source.obj)
|
87
|
-
_g = (_f = this.returnContainer.fag).append;
|
88
|
-
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)];
|
89
|
-
case 3:
|
90
|
-
// console.log('dr-this!!!!!!!', this.rawSet, this.source.obj)
|
91
|
-
_g.apply(_f, [_j.sent()]);
|
92
|
-
_j.label = 4;
|
93
|
-
case 4:
|
94
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
95
|
-
(_e = this.elementSource.element.parentNode) === null || _e === void 0 ? void 0 : _e.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
96
|
-
(_h = this.returnContainer.raws).push.apply(_h, rr);
|
97
|
-
return [3 /*break*/, 6];
|
98
|
-
case 5:
|
99
|
-
this.elementSource.element.remove();
|
100
|
-
_j.label = 6;
|
101
|
-
case 6: return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
102
|
-
}
|
103
|
-
});
|
104
|
-
});
|
105
|
-
};
|
106
|
-
return DrThis;
|
107
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
108
|
-
exports.DrThis = DrThis;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
2
|
-
import { RawSet } from '../rawsets/RawSet';
|
3
|
-
import { Render } from '../rawsets/Render';
|
4
|
-
import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
|
5
|
-
import { Config } from '../configs/Config';
|
6
|
-
export declare class DrThisProperty extends OperatorExecuterAttrRequire<string> {
|
7
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
8
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
9
|
-
static append(obj: any, fullPath: string, key: string, rawSet: RawSet, config: Config): RawSet[];
|
10
|
-
}
|
@@ -1,143 +0,0 @@
|
|
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 __assign = (this && this.__assign) || function () {
|
18
|
-
__assign = Object.assign || function(t) {
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
20
|
-
s = arguments[i];
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
22
|
-
t[p] = s[p];
|
23
|
-
}
|
24
|
-
return t;
|
25
|
-
};
|
26
|
-
return __assign.apply(this, arguments);
|
27
|
-
};
|
28
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
29
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
30
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
31
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
32
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
33
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
34
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
35
|
-
});
|
36
|
-
};
|
37
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
38
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
39
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
40
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
41
|
-
function step(op) {
|
42
|
-
if (f) throw new TypeError("Generator is already executing.");
|
43
|
-
while (_) try {
|
44
|
-
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;
|
45
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
46
|
-
switch (op[0]) {
|
47
|
-
case 0: case 1: t = op; break;
|
48
|
-
case 4: _.label++; return { value: op[1], done: false };
|
49
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
50
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
51
|
-
default:
|
52
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
53
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
54
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
55
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
56
|
-
if (t[2]) _.ops.pop();
|
57
|
-
_.trys.pop(); continue;
|
58
|
-
}
|
59
|
-
op = body.call(thisArg, _);
|
60
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
61
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
62
|
-
}
|
63
|
-
};
|
64
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
65
|
-
exports.DrThisProperty = void 0;
|
66
|
-
var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
|
67
|
-
var ScriptUtils_1 = require("../utils/script/ScriptUtils");
|
68
|
-
var RawSet_1 = require("../rawsets/RawSet");
|
69
|
-
var OperatorExecuter_1 = require("./OperatorExecuter");
|
70
|
-
var DrThisProperty = /** @class */ (function (_super) {
|
71
|
-
__extends(DrThisProperty, _super);
|
72
|
-
function DrThisProperty(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
73
|
-
var _this = this;
|
74
|
-
source.operatorAround = undefined;
|
75
|
-
_this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
76
|
-
return _this;
|
77
|
-
}
|
78
|
-
DrThisProperty.prototype.executeAttrRequire = function (attr) {
|
79
|
-
var _a, _b, _c, _d, _e;
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
81
|
-
var itRandom, vars, newTemp, dictioanry, dictionaryKey, tempalte, rr;
|
82
|
-
var _f;
|
83
|
-
return __generator(this, function (_g) {
|
84
|
-
itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
|
85
|
-
vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
86
|
-
newTemp = this.source.config.window.document.createElement('temp');
|
87
|
-
dictioanry = ScriptUtils_1.ScriptUtils.evalReturn(attr, this.source.obj);
|
88
|
-
dictionaryKey = (_b = this.elementSource.attrs.drKeyOption) !== null && _b !== void 0 ? _b : '';
|
89
|
-
// console.log('--->', attr, dictionaryKey)
|
90
|
-
// if (!(dictioanry instanceof Dictionary)) {
|
91
|
-
// return ExecuteState.STOP;
|
92
|
-
// }
|
93
|
-
// await new Promise(resolve => setTimeout(resolve, 1000));
|
94
|
-
// console.log('!!!!!!!!!!!!!!', this.rawSet);
|
95
|
-
ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '') + "\n var i = 0; \n const dictionary = " + attr + ";\n const dictionaryKey = '" + dictionaryKey + "';\n const dictionaryStr = `" + attr + "`.trim();\n // console.log('----@#!@#@!#', this.__render.oldChild);\n if (dictionary) {\n for(const it in dictionary) {\n var destIt = dictionaryStr + '[\"' + it + '\"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n n.setAttribute('dr-key', it);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('dr-has-keys',Object.keys(dictionary).join(','));\n }\n " + ((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '') + "\n ", Object.assign(this.source.obj, {
|
96
|
-
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render))
|
97
|
-
}));
|
98
|
-
RawSet_1.RawSet.drVarDecoding(newTemp, vars);
|
99
|
-
RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
|
100
|
-
tempalte = this.source.config.window.document.createElement('template');
|
101
|
-
tempalte.innerHTML = newTemp.innerHTML;
|
102
|
-
this.returnContainer.fag.append(tempalte.content);
|
103
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
104
|
-
(_e = this.elementSource.element.parentNode) === null || _e === void 0 ? void 0 : _e.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
105
|
-
// const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
|
106
|
-
(_f = this.returnContainer.raws).push.apply(_f, rr);
|
107
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
108
|
-
});
|
109
|
-
});
|
110
|
-
};
|
111
|
-
DrThisProperty.append = function (obj, fullPath, key, rawSet, config) {
|
112
|
-
var _this = this;
|
113
|
-
var _a, _b;
|
114
|
-
var genNode = config.window.document.importNode(rawSet.fragment, true);
|
115
|
-
// console.log('---> append', rawSet, genNode);
|
116
|
-
var rawSets = [];
|
117
|
-
for (var _i = 0, _c = Array.from(genNode.childNodes.values()); _i < _c.length; _i++) {
|
118
|
-
var cNode = _c[_i];
|
119
|
-
var element = cNode.cloneNode(true);
|
120
|
-
element.removeAttribute(RawSet_1.RawSet.DR_THIS_PROPERTY_NAME);
|
121
|
-
element.setAttribute(RawSet_1.RawSet.DR_THIS_NAME, "this." + fullPath);
|
122
|
-
element.setAttribute(RawSet_1.RawSet.DR_KEY_OPTIONNAME, key);
|
123
|
-
// rawSet.point.end.after(element);
|
124
|
-
var fg = config.window.document.createDocumentFragment();
|
125
|
-
fg.append(element);
|
126
|
-
rawSets.push.apply(rawSets, RawSet_1.RawSet.checkPointCreates(fg, obj, config));
|
127
|
-
rawSet.point.end.before(fg);
|
128
|
-
var start = rawSet.point.start;
|
129
|
-
var keys = (_b = (_a = start.getAttribute(RawSet_1.RawSet.DR_HAS_KEYS_OPTIONNAME)) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
130
|
-
keys.push(key);
|
131
|
-
start.setAttribute(RawSet_1.RawSet.DR_HAS_KEYS_OPTIONNAME, keys.join(','));
|
132
|
-
rawSets.forEach(function (it) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
133
|
-
switch (_a.label) {
|
134
|
-
case 0: return [4 /*yield*/, it.render(obj, config)];
|
135
|
-
case 1: return [2 /*return*/, _a.sent()];
|
136
|
-
}
|
137
|
-
}); }); });
|
138
|
-
}
|
139
|
-
return rawSets;
|
140
|
-
};
|
141
|
-
return DrThisProperty;
|
142
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
143
|
-
exports.DrThisProperty = DrThisProperty;
|
@@ -1,49 +0,0 @@
|
|
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
|
-
}
|
@@ -1,89 +0,0 @@
|
|
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(" " + this.render.bindScript + "; return " + 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;
|
@@ -1,8 +0,0 @@
|
|
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
|
-
}
|
@@ -1,79 +0,0 @@
|
|
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;
|