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
package/operators/Dr.js
DELETED
@@ -1,101 +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.Dr = 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 Dr = /** @class */ (function (_super) {
|
71
|
-
__extends(Dr, _super);
|
72
|
-
function Dr(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
73
|
-
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
|
74
|
-
}
|
75
|
-
Dr.prototype.executeAttrRequire = function (data) {
|
76
|
-
var _a, _b;
|
77
|
-
return __awaiter(this, void 0, void 0, function () {
|
78
|
-
var itRandom, vars, newTemp, tempalte, rr;
|
79
|
-
var _c;
|
80
|
-
return __generator(this, function (_d) {
|
81
|
-
itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
|
82
|
-
vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
83
|
-
newTemp = this.source.config.window.document.createElement('temp');
|
84
|
-
ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n const n = $element.cloneNode(true);\n var destIt = " + this.elementSource.attrs.drItOption + ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n // console.log('----', n.innerHTML);\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n // console.log('----', n.innerHTML);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__fag.append(it));\n } else {\n this.__render.fag.append(n);\n }", Object.assign(this.source.obj, {
|
85
|
-
__render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
86
|
-
}));
|
87
|
-
RawSet_1.RawSet.drVarDecoding(newTemp, vars);
|
88
|
-
RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
|
89
|
-
tempalte = this.source.config.window.document.createElement('template');
|
90
|
-
tempalte.innerHTML = newTemp.innerHTML;
|
91
|
-
this.returnContainer.fag.append(tempalte.content);
|
92
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
93
|
-
(_b = this.elementSource.element.parentNode) === null || _b === void 0 ? void 0 : _b.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
94
|
-
(_c = this.returnContainer.raws).push.apply(_c, rr);
|
95
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
96
|
-
});
|
97
|
-
});
|
98
|
-
};
|
99
|
-
return Dr;
|
100
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
101
|
-
exports.Dr = Dr;
|
@@ -1,8 +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
|
-
export declare class DrAppender extends OperatorExecuterAttrRequire<string> {
|
6
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
7
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
8
|
-
}
|
package/operators/DrAppender.js
DELETED
@@ -1,107 +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.DrAppender = 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 DrAppender = /** @class */ (function (_super) {
|
71
|
-
__extends(DrAppender, _super);
|
72
|
-
function DrAppender(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
|
-
DrAppender.prototype.executeAttrRequire = function (attr) {
|
79
|
-
var _a, _b, _c, _d;
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
81
|
-
var itRandom, vars, newTemp, tempalte, rr;
|
82
|
-
var _e;
|
83
|
-
return __generator(this, function (_f) {
|
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
|
-
ScriptUtils_1.ScriptUtils.eval("\n try{\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '" + this.elementSource.attrs.drAppender + " && " + this.elementSource.attrs.drAppender + ".length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.setAttribute('dr-for-of', '" + this.elementSource.attrs.drAppender + "[' + (" + this.elementSource.attrs.drAppender + ".length-1) + ']');\n n.setAttribute('dr-next', '" + this.elementSource.attrs.drAppender + ",' + " + this.elementSource.attrs.drAppender + ".length);\n ifWrap.append(n);\n this.__render.fag.append(ifWrap);\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n }catch(e){}\n ", Object.assign(this.source.obj, {
|
88
|
-
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
89
|
-
// eslint-disable-next-line no-use-before-define
|
90
|
-
))
|
91
|
-
}));
|
92
|
-
RawSet_1.RawSet.drVarDecoding(newTemp, vars);
|
93
|
-
RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
|
94
|
-
tempalte = this.source.config.window.document.createElement('template');
|
95
|
-
tempalte.innerHTML = newTemp.innerHTML;
|
96
|
-
this.returnContainer.fag.append(tempalte.content);
|
97
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
98
|
-
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
99
|
-
// const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
|
100
|
-
(_e = this.returnContainer.raws).push.apply(_e, rr);
|
101
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
102
|
-
});
|
103
|
-
});
|
104
|
-
};
|
105
|
-
return DrAppender;
|
106
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
107
|
-
exports.DrAppender = DrAppender;
|
package/operators/DrFor.d.ts
DELETED
@@ -1,8 +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
|
-
export declare class DrFor extends OperatorExecuterAttrRequire<string> {
|
6
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
7
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
8
|
-
}
|
package/operators/DrFor.js
DELETED
@@ -1,104 +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.DrFor = 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 DrFor = /** @class */ (function (_super) {
|
71
|
-
__extends(DrFor, _super);
|
72
|
-
function DrFor(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
|
-
DrFor.prototype.executeAttrRequire = function (attr) {
|
79
|
-
var _a, _b, _c, _d;
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
81
|
-
var itRandom, vars, newTemp, tempalte, rr;
|
82
|
-
var _e;
|
83
|
-
return __generator(this, function (_f) {
|
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
|
-
ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n for(" + attr + ") {\n const n = this.__render.element.cloneNode(true);\n var destIt = " + this.elementSource.attrs.drItOption + ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/g, destIt))) \n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n }\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n ", Object.assign(this.source.obj, {
|
88
|
-
__render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
89
|
-
}));
|
90
|
-
RawSet_1.RawSet.drVarDecoding(newTemp, vars);
|
91
|
-
RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
|
92
|
-
tempalte = this.source.config.window.document.createElement('template');
|
93
|
-
tempalte.innerHTML = newTemp.innerHTML;
|
94
|
-
this.returnContainer.fag.append(tempalte.content);
|
95
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
96
|
-
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
97
|
-
(_e = this.returnContainer.raws).push.apply(_e, rr);
|
98
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
99
|
-
});
|
100
|
-
});
|
101
|
-
};
|
102
|
-
return DrFor;
|
103
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
104
|
-
exports.DrFor = DrFor;
|
package/operators/DrForOf.d.ts
DELETED
@@ -1,8 +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
|
-
export declare class DrForOf extends OperatorExecuterAttrRequire<string> {
|
6
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
7
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
8
|
-
}
|
package/operators/DrForOf.js
DELETED
@@ -1,107 +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.DrForOf = 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 DrForOf = /** @class */ (function (_super) {
|
71
|
-
__extends(DrForOf, _super);
|
72
|
-
function DrForOf(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
|
-
DrForOf.prototype.executeAttrRequire = function (attr) {
|
79
|
-
var _a, _b, _c, _d;
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
81
|
-
var itRandom, vars, newTemp, tempalte, rr;
|
82
|
-
var _e;
|
83
|
-
return __generator(this, function (_f) {
|
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
|
-
ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n var i = 0; \n const forOf = " + attr + ";\n const forOfStr = `" + attr + "`.trim();\n if (forOf) {\n for(const it of forOf) {\n var destIt = it;\n if (/\\[(.*,?)\\],/g.test(forOfStr)) {\n if (typeof it === 'string') {\n destIt = it;\n } else {\n destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];\n }\n } else if (forOf.isRange) {\n destIt = it;\n } else {\n destIt = forOfStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n i++;\n }\n \n if('" + this.elementSource.attrs.drNextOption + "' !== 'null') {\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const [name, idx] = '" + this.elementSource.attrs.drNextOption + "'.split(',');\n n.setAttribute('dr-for-of', name + '[' + idx + ']');\n n.setAttribute('dr-next', name + ',' + (Number(idx) + 1));\n this.__render.fag.append(n);\n }\n }\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n ", Object.assign(this.source.obj, {
|
88
|
-
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
89
|
-
// eslint-disable-next-line no-use-before-define
|
90
|
-
))
|
91
|
-
}));
|
92
|
-
RawSet_1.RawSet.drVarDecoding(newTemp, vars);
|
93
|
-
RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
|
94
|
-
tempalte = this.source.config.window.document.createElement('template');
|
95
|
-
tempalte.innerHTML = newTemp.innerHTML;
|
96
|
-
this.returnContainer.fag.append(tempalte.content);
|
97
|
-
rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
98
|
-
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
99
|
-
// const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
|
100
|
-
(_e = this.returnContainer.raws).push.apply(_e, rr);
|
101
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
102
|
-
});
|
103
|
-
});
|
104
|
-
};
|
105
|
-
return DrForOf;
|
106
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
107
|
-
exports.DrForOf = DrForOf;
|
package/operators/DrForm.d.ts
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
import { RawSet } from '../rawsets/RawSet';
|
2
|
-
import { Render } from '../rawsets/Render';
|
3
|
-
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
4
|
-
import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
|
5
|
-
export declare class DrForm extends OperatorExecuterAttrRequire<string> {
|
6
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
7
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
8
|
-
}
|
package/operators/DrForm.js
DELETED
@@ -1,138 +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.DrForm = void 0;
|
66
|
-
var ScriptUtils_1 = require("../utils/script/ScriptUtils");
|
67
|
-
var RawSet_1 = require("../rawsets/RawSet");
|
68
|
-
var Validator_1 = require("../validators/Validator");
|
69
|
-
var EventManager_1 = require("../events/EventManager");
|
70
|
-
var ValidatorArray_1 = require("../validators/ValidatorArray");
|
71
|
-
var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
|
72
|
-
var OperatorExecuter_1 = require("./OperatorExecuter");
|
73
|
-
var DrForm = /** @class */ (function (_super) {
|
74
|
-
__extends(DrForm, _super);
|
75
|
-
function DrForm(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
76
|
-
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
77
|
-
}
|
78
|
-
DrForm.prototype.executeAttrRequire = function (attr) {
|
79
|
-
var _a;
|
80
|
-
return __awaiter(this, void 0, void 0, function () {
|
81
|
-
var data, childs, fromName, thisName;
|
82
|
-
var _b;
|
83
|
-
var _this = this;
|
84
|
-
return __generator(this, function (_c) {
|
85
|
-
RawSet_1.RawSet.drFormOtherMoveAttr(this.elementSource.element, 'name', 'temp-name', this.source.config);
|
86
|
-
data = ScriptUtils_1.ScriptUtils.evalReturn("" + attr, this.source.obj);
|
87
|
-
childs = Array.from(this.elementSource.element.querySelectorAll('[name]'));
|
88
|
-
fromName = ScriptUtils_1.ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":name")) !== null && _a !== void 0 ? _a : '', this.source.obj);
|
89
|
-
thisName = fromName !== null && fromName !== void 0 ? fromName : this.elementSource.element.getAttribute('name');
|
90
|
-
// // 자기자신이 Input 대상일때
|
91
|
-
if (childs.length <= 0 && thisName) {
|
92
|
-
childs.push(this.elementSource.element);
|
93
|
-
}
|
94
|
-
else {
|
95
|
-
if (data instanceof Validator_1.Validator) {
|
96
|
-
data.setTarget(this.elementSource.element);
|
97
|
-
}
|
98
|
-
}
|
99
|
-
childs.forEach(function (it) {
|
100
|
-
var _a, _b, _c, _d, _e;
|
101
|
-
var eventName = (_a = it.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":event")) !== null && _a !== void 0 ? _a : 'change';
|
102
|
-
var validatorName = it.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":validator");
|
103
|
-
var attrEventName = EventManager_1.EventManager.attrPrefix + 'event-' + eventName;
|
104
|
-
var varpath = (_c = ScriptUtils_1.ScriptUtils.evalReturn((_b = _this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":name")) !== null && _b !== void 0 ? _b : '', _this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
|
105
|
-
if (varpath != null) {
|
106
|
-
if (validatorName) {
|
107
|
-
ScriptUtils_1.ScriptUtils.eval("\n " + _this.render.bindScript + "\n const validator = typeof " + validatorName + " ==='function' ? new " + validatorName + "() : " + validatorName + ";\n " + attr + "['" + varpath + "'] = validator;\n ", Object.assign(_this.source.obj, {
|
108
|
-
__render: Object.freeze(__assign({ drStripOption: _this.elementSource.attrs.drStripOption }, _this.render))
|
109
|
-
}));
|
110
|
-
}
|
111
|
-
varpath = attr + "['" + varpath + "']";
|
112
|
-
var data_1 = ScriptUtils_1.ScriptUtils.evalReturn("" + varpath, _this.source.obj);
|
113
|
-
if (data_1 instanceof ValidatorArray_1.ValidatorArray) {
|
114
|
-
it.setAttribute(attrEventName, varpath + ".setArrayValue($target, $target.value, $event); " + ((_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : '') + ";");
|
115
|
-
data_1.addValidator(it.value, it);
|
116
|
-
}
|
117
|
-
else if (data_1 instanceof Validator_1.Validator) {
|
118
|
-
// varpath += (varpath ? '.value' : 'value');
|
119
|
-
// varpath = drAttr.drForm + '.' + varpath;
|
120
|
-
// it.setAttribute(attrEventName, `${varpath} = $target.value; ${target}=$target; ${event}=$event;`);
|
121
|
-
it.setAttribute(attrEventName, varpath + ".set($target.value, $target, $event); " + ((_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : '') + ";");
|
122
|
-
data_1.setTarget(it);
|
123
|
-
data_1.value = it.value;
|
124
|
-
}
|
125
|
-
else {
|
126
|
-
it.setAttribute(attrEventName, varpath + " = $target.value;");
|
127
|
-
}
|
128
|
-
}
|
129
|
-
});
|
130
|
-
RawSet_1.RawSet.drFormOtherMoveAttr(this.elementSource.element, 'temp-name', 'name', this.source.config);
|
131
|
-
(_b = this.returnContainer.raws).push.apply(_b, RawSet_1.RawSet.checkPointCreates(this.elementSource.element, this.source.obj, this.source.config));
|
132
|
-
return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
|
133
|
-
});
|
134
|
-
});
|
135
|
-
};
|
136
|
-
return DrForm;
|
137
|
-
}(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
|
138
|
-
exports.DrForm = DrForm;
|
package/operators/DrIf.d.ts
DELETED
@@ -1,8 +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
|
-
export declare class DrIf extends OperatorExecuterAttrRequire<string> {
|
6
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
7
|
-
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
8
|
-
}
|