@dooboostore/dom-render 1.0.98
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/DomRender.d.ts +24 -0
- package/DomRender.js +115 -0
- package/DomRenderProxy.d.ts +38 -0
- package/DomRenderProxy.js +586 -0
- package/README.MD +938 -0
- package/components/ComponentBase.d.ts +41 -0
- package/components/ComponentBase.js +210 -0
- package/components/ComponentSet.d.ts +22 -0
- package/components/ComponentSet.js +23 -0
- package/components/appender/Appender.d.ts +23 -0
- package/components/appender/Appender.js +59 -0
- package/components/checkbox/CheckBox.d.ts +47 -0
- package/components/checkbox/CheckBox.js +118 -0
- package/components/choose/Choose.d.ts +39 -0
- package/components/choose/Choose.js +110 -0
- package/components/details/Details.d.ts +57 -0
- package/components/details/Details.js +199 -0
- package/components/dialog/Dialog.d.ts +1 -0
- package/components/dialog/Dialog.js +85 -0
- package/components/dialog/example/ImageEditorDialog.d.ts +1 -0
- package/components/dialog/example/ImageEditorDialog.js +116 -0
- package/components/forOf/ForOf.d.ts +18 -0
- package/components/forOf/ForOf.js +32 -0
- package/components/if/If.d.ts +21 -0
- package/components/if/If.js +40 -0
- package/components/index.d.ts +27 -0
- package/components/index.js +13 -0
- package/components/input/Input.d.ts +34 -0
- package/components/input/Input.js +86 -0
- package/components/promise/PromiseSwitch.d.ts +55 -0
- package/components/promise/PromiseSwitch.js +181 -0
- package/components/radio/Radio.d.ts +45 -0
- package/components/radio/Radio.js +123 -0
- package/components/select/Select.d.ts +23 -0
- package/components/select/Select.js +52 -0
- package/components/this/This.d.ts +24 -0
- package/components/this/This.js +62 -0
- package/components/timer/Timer.d.ts +26 -0
- package/components/timer/Timer.js +102 -0
- package/configs/Config.d.ts +34 -0
- package/configs/Config.js +2 -0
- package/configs/TargetAttr.d.ts +7 -0
- package/configs/TargetAttr.js +2 -0
- package/configs/TargetElement.d.ts +16 -0
- package/configs/TargetElement.js +2 -0
- package/css/parse/index.d.ts +49 -0
- package/css/parse/index.js +498 -0
- package/css/stringify/compiler.d.ts +34 -0
- package/css/stringify/compiler.js +36 -0
- package/css/stringify/compress.d.ts +104 -0
- package/css/stringify/compress.js +147 -0
- package/css/stringify/identity.d.ts +109 -0
- package/css/stringify/identity.js +183 -0
- package/css/stringify/index.d.ts +24 -0
- package/css/stringify/index.js +27 -0
- package/css/stringify/types.d.ts +15 -0
- package/css/stringify/types.js +2 -0
- package/css/types.d.ts +10 -0
- package/css/types.js +2 -0
- package/decorators/DomRenderNoProxy.d.ts +4 -0
- package/decorators/DomRenderNoProxy.js +15 -0
- package/events/EventManager.d.ts +68 -0
- package/events/EventManager.js +477 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/iterators/Range.d.ts +24 -0
- package/iterators/Range.js +70 -0
- package/lifecycle/OnBeforeReturnGet.d.ts +4 -0
- package/lifecycle/OnBeforeReturnGet.js +2 -0
- package/lifecycle/OnBeforeReturnSet.d.ts +5 -0
- package/lifecycle/OnBeforeReturnSet.js +4 -0
- package/lifecycle/OnChangeAttrRender.d.ts +9 -0
- package/lifecycle/OnChangeAttrRender.js +4 -0
- package/lifecycle/OnChildRenderedByProperty.d.ts +5 -0
- package/lifecycle/OnChildRenderedByProperty.js +4 -0
- package/lifecycle/OnCreateRender.d.ts +5 -0
- package/lifecycle/OnCreateRender.js +4 -0
- package/lifecycle/OnCreateRenderData.d.ts +10 -0
- package/lifecycle/OnCreateRenderData.js +4 -0
- package/lifecycle/OnCreateRendered.d.ts +8 -0
- package/lifecycle/OnCreateRendered.js +4 -0
- package/lifecycle/OnCreatedThisChild.d.ts +6 -0
- package/lifecycle/OnCreatedThisChild.js +4 -0
- package/lifecycle/OnDestroyRender.d.ts +9 -0
- package/lifecycle/OnDestroyRender.js +4 -0
- package/lifecycle/OnInitRender.d.ts +6 -0
- package/lifecycle/OnInitRender.js +4 -0
- package/lifecycle/OnProxyDomRender.d.ts +5 -0
- package/lifecycle/OnProxyDomRender.js +2 -0
- package/lifecycle/dr-this/OnDrThisBind.d.ts +5 -0
- package/lifecycle/dr-this/OnDrThisBind.js +4 -0
- package/lifecycle/dr-this/OnDrThisUnBind.d.ts +5 -0
- package/lifecycle/dr-this/OnDrThisUnBind.js +4 -0
- package/managers/RenderManager.d.ts +2 -0
- package/managers/RenderManager.js +12 -0
- package/messenger/DefaultMessenger.d.ts +4 -0
- package/messenger/DefaultMessenger.js +4 -0
- package/messenger/Messenger.d.ts +79 -0
- package/messenger/Messenger.js +185 -0
- package/operators/Appender.d.ts +15 -0
- package/operators/Appender.js +90 -0
- package/operators/Dr.d.ts +9 -0
- package/operators/Dr.js +53 -0
- package/operators/DrAppender.d.ts +9 -0
- package/operators/DrAppender.js +69 -0
- package/operators/DrFor.d.ts +9 -0
- package/operators/DrFor.js +58 -0
- package/operators/DrForOf.d.ts +9 -0
- package/operators/DrForOf.js +120 -0
- package/operators/DrForm.d.ts +9 -0
- package/operators/DrForm.js +79 -0
- package/operators/DrIf.d.ts +9 -0
- package/operators/DrIf.js +70 -0
- package/operators/DrInnerHTML.d.ts +9 -0
- package/operators/DrInnerHTML.js +48 -0
- package/operators/DrInnerText.d.ts +9 -0
- package/operators/DrInnerText.js +46 -0
- package/operators/DrPre.d.ts +8 -0
- package/operators/DrPre.js +22 -0
- package/operators/DrRepeat.d.ts +9 -0
- package/operators/DrRepeat.js +70 -0
- package/operators/DrStripElement.d.ts +9 -0
- package/operators/DrStripElement.js +50 -0
- package/operators/DrTargetAttr.d.ts +8 -0
- package/operators/DrTargetAttr.js +45 -0
- package/operators/DrTargetElement.d.ts +13 -0
- package/operators/DrTargetElement.js +91 -0
- package/operators/DrTargetElementIsElement.d.ts +13 -0
- package/operators/DrTargetElementIsElement.js +79 -0
- package/operators/DrThis.d.ts +7 -0
- package/operators/DrThis.js +72 -0
- package/operators/DrThisProperty.d.ts +11 -0
- package/operators/DrThisProperty.js +93 -0
- package/operators/OperatorExecuter.d.ts +50 -0
- package/operators/OperatorExecuter.js +50 -0
- package/operators/OperatorExecuterAttrRequire.d.ts +9 -0
- package/operators/OperatorExecuterAttrRequire.js +25 -0
- package/package.json +70 -0
- package/rawsets/AttrInitCallBack.d.ts +6 -0
- package/rawsets/AttrInitCallBack.js +2 -0
- package/rawsets/Attrs.d.ts +27 -0
- package/rawsets/Attrs.js +2 -0
- package/rawsets/CreatorMetaData.d.ts +20 -0
- package/rawsets/CreatorMetaData.js +2 -0
- package/rawsets/DestroyOptionType.d.ts +5 -0
- package/rawsets/DestroyOptionType.js +6 -0
- package/rawsets/ElementInitCallBack.d.ts +9 -0
- package/rawsets/ElementInitCallBack.js +2 -0
- package/rawsets/RawSet.d.ts +180 -0
- package/rawsets/RawSet.js +1450 -0
- package/rawsets/RawSetOperatorType.d.ts +4 -0
- package/rawsets/RawSetOperatorType.js +5 -0
- package/rawsets/RawSetType.d.ts +8 -0
- package/rawsets/RawSetType.js +9 -0
- package/rawsets/Render.d.ts +27 -0
- package/rawsets/Render.js +2 -0
- package/routers/HashRouter.d.ts +24 -0
- package/routers/HashRouter.js +86 -0
- package/routers/PathRouter.d.ts +23 -0
- package/routers/PathRouter.js +73 -0
- package/routers/Router.d.ts +68 -0
- package/routers/Router.js +132 -0
- package/types/Types.d.ts +12 -0
- package/types/Types.js +26 -0
- package/validators/AllCheckedValidatorArray.d.ts +7 -0
- package/validators/AllCheckedValidatorArray.js +11 -0
- package/validators/AllUnCheckedValidatorArray.d.ts +7 -0
- package/validators/AllUnCheckedValidatorArray.js +11 -0
- package/validators/CheckedValidator.d.ts +6 -0
- package/validators/CheckedValidator.js +11 -0
- package/validators/CountEqualsCheckedValidatorArray.d.ts +8 -0
- package/validators/CountEqualsCheckedValidatorArray.js +12 -0
- package/validators/CountEqualsUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountEqualsUnCheckedValidatorArray.js +12 -0
- package/validators/CountGreaterThanCheckedValidatorArray.d.ts +8 -0
- package/validators/CountGreaterThanCheckedValidatorArray.js +12 -0
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +8 -0
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +12 -0
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +12 -0
- package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountGreaterThanUnCheckedValidatorArray.js +12 -0
- package/validators/CountLessThanCheckedValidatorArray.d.ts +8 -0
- package/validators/CountLessThanCheckedValidatorArray.js +12 -0
- package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +8 -0
- package/validators/CountLessThanEqualsCheckedValidatorArray.js +12 -0
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +12 -0
- package/validators/CountLessThanUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountLessThanUnCheckedValidatorArray.js +12 -0
- package/validators/CountUnCheckedValidatorArray.d.ts +8 -0
- package/validators/CountUnCheckedValidatorArray.js +12 -0
- package/validators/EmptyValidator.d.ts +6 -0
- package/validators/EmptyValidator.js +12 -0
- package/validators/ExcludeCheckedValidatorArray.d.ts +9 -0
- package/validators/ExcludeCheckedValidatorArray.js +17 -0
- package/validators/FormValidator.d.ts +8 -0
- package/validators/FormValidator.js +16 -0
- package/validators/IncludeCheckedValidatorArray.d.ts +9 -0
- package/validators/IncludeCheckedValidatorArray.js +17 -0
- package/validators/MultipleValidator.d.ts +9 -0
- package/validators/MultipleValidator.js +25 -0
- package/validators/NonPassValidator.d.ts +6 -0
- package/validators/NonPassValidator.js +10 -0
- package/validators/NotEmptyValidator.d.ts +6 -0
- package/validators/NotEmptyValidator.js +13 -0
- package/validators/NotRegExpTestValidator.d.ts +7 -0
- package/validators/NotRegExpTestValidator.js +20 -0
- package/validators/PassValidator.d.ts +6 -0
- package/validators/PassValidator.js +10 -0
- package/validators/RegExpTestValidator.d.ts +7 -0
- package/validators/RegExpTestValidator.js +21 -0
- package/validators/RequiredValidator.d.ts +6 -0
- package/validators/RequiredValidator.js +12 -0
- package/validators/UnCheckedValidator.d.ts +6 -0
- package/validators/UnCheckedValidator.js +11 -0
- package/validators/ValidMultipleValidator.d.ts +10 -0
- package/validators/ValidMultipleValidator.js +12 -0
- package/validators/ValidValidator.d.ts +7 -0
- package/validators/ValidValidator.js +11 -0
- package/validators/ValidValidatorArray.d.ts +8 -0
- package/validators/ValidValidatorArray.js +11 -0
- package/validators/Validator.d.ts +58 -0
- package/validators/Validator.js +203 -0
- package/validators/ValidatorArray.d.ts +18 -0
- package/validators/ValidatorArray.js +77 -0
- package/validators/ValueEqualsValidator.d.ts +7 -0
- package/validators/ValueEqualsValidator.js +11 -0
- package/validators/ValueNotEqualsValidator.d.ts +7 -0
- package/validators/ValueNotEqualsValidator.js +11 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
14
|
+
export class DrFor extends OperatorExecuterAttrRequire {
|
|
15
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
16
|
+
source.operatorAround = undefined;
|
|
17
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
18
|
+
}
|
|
19
|
+
executeAttrRequire(attr) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
|
23
|
+
const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
|
24
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
25
|
+
// console.log('-----asdad',attr , this.elementSource.attrs.drItOption);
|
|
26
|
+
ScriptUtils.eval(`
|
|
27
|
+
${this.render.bindScript}
|
|
28
|
+
${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
|
|
29
|
+
for(${attr}) {
|
|
30
|
+
const n = this.__render.element.cloneNode(true);
|
|
31
|
+
var destIt = ${this.elementSource.attrs.drItOption};
|
|
32
|
+
if (destIt !== undefined) {
|
|
33
|
+
n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/g, destIt)))
|
|
34
|
+
n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);
|
|
35
|
+
}
|
|
36
|
+
if (this.__render.drStripOption === 'true') {
|
|
37
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
38
|
+
} else {
|
|
39
|
+
this.__render.fag.append(n);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
|
|
43
|
+
`, Object.assign(this.source.obj, {
|
|
44
|
+
__render: Object.freeze(Object.assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
|
45
|
+
}));
|
|
46
|
+
RawSet.drVarDecoding(newTemp, vars);
|
|
47
|
+
RawSet.drItOtherDecoding(newTemp, itRandom);
|
|
48
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
49
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
50
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
51
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
52
|
+
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
53
|
+
this.returnContainer.raws.push(...rr);
|
|
54
|
+
return ExecuteState.EXECUTE;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=DrFor.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrForOf.d.ts.map
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
14
|
+
export class DrForOf extends OperatorExecuterAttrRequire {
|
|
15
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
16
|
+
source.operatorAround = undefined;
|
|
17
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
18
|
+
}
|
|
19
|
+
executeAttrRequire(attr) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
// console.log('타지도않냐?')
|
|
23
|
+
const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, 'DrForOf');
|
|
24
|
+
const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
|
25
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
26
|
+
// console.log('----!', this.elementSource.attrs)
|
|
27
|
+
// ScriptUtils.evalReturn()
|
|
28
|
+
ScriptUtils.eval(`
|
|
29
|
+
${this.render.bindScript}
|
|
30
|
+
${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
|
|
31
|
+
var i = -1;
|
|
32
|
+
const forOf = ${attr};
|
|
33
|
+
const forOfStr = \`${attr}\`.trim();
|
|
34
|
+
// console.log('forOf---',forOf);
|
|
35
|
+
if (forOf) {
|
|
36
|
+
for(const it of forOf) {
|
|
37
|
+
i++;
|
|
38
|
+
var destIt = it;
|
|
39
|
+
if (/\\[(.*,?)\\],/g.test(forOfStr)) {
|
|
40
|
+
if (typeof it === 'string') {
|
|
41
|
+
destIt = it;
|
|
42
|
+
} else {
|
|
43
|
+
destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];
|
|
44
|
+
}
|
|
45
|
+
} else if (forOf.isRange) {
|
|
46
|
+
destIt = it;
|
|
47
|
+
} else {
|
|
48
|
+
destIt = forOfStr + '[' + i +']'
|
|
49
|
+
}
|
|
50
|
+
const n = this.__render.element.cloneNode(true);
|
|
51
|
+
// console.log('zzzzzzzzzzz', n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}'));
|
|
52
|
+
Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
|
|
53
|
+
// console.log('---------'+destIt,n, Array.from(n.getAttributeNames()).map(it=>({name:it,attr: n.getAttribute(it)})));
|
|
54
|
+
// console.log('---------destItdestIt',destIt);
|
|
55
|
+
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)))
|
|
56
|
+
const drOptionAttr = n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}');
|
|
57
|
+
if (drOptionAttr) {
|
|
58
|
+
const drOptionAttrResult = $scriptUtils.evalReturn(drOptionAttr, this);
|
|
59
|
+
Array.from(Object.entries(drOptionAttrResult??{})).forEach(([k,v])=>{
|
|
60
|
+
if (v === null) {
|
|
61
|
+
n.removeAttribute(k);
|
|
62
|
+
} else {
|
|
63
|
+
n.setAttribute(k,v);
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const drOptionFilter = n.getAttribute('${RawSet.DR_DETECT_FILTER_OPTIONNAME}');
|
|
69
|
+
if (drOptionFilter) {
|
|
70
|
+
const drOptionFilterResult = $scriptUtils.evalReturn(drOptionFilter, this);
|
|
71
|
+
// console.log('---drforof----', drOptionFilter, drOptionFilterResult)
|
|
72
|
+
if (!drOptionFilterResult) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);
|
|
78
|
+
// console.log('!@@@@', n.innerHTML);
|
|
79
|
+
// DR_THIS_OPTIONNAME 는 제거한다 꼬인다. strip 할때 막 꼬여버린다.
|
|
80
|
+
// const drOptionThis = n.getAttribute('${RawSet.DR_THIS_OPTIONNAME}');
|
|
81
|
+
// if (drOptionThis) {
|
|
82
|
+
// n.setAttribute('${RawSet.DR_THIS_NAME}', drOptionThis)
|
|
83
|
+
// }
|
|
84
|
+
if (this.__render.drStripOption === 'true') {
|
|
85
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
86
|
+
} else {
|
|
87
|
+
this.__render.fag.append(n);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if('${this.elementSource.attrs.drNextOption}' !== 'null') {
|
|
93
|
+
const n = this.__render.element.cloneNode(true);
|
|
94
|
+
Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
|
|
95
|
+
const [name, idx] = '${this.elementSource.attrs.drNextOption}'.split(',');
|
|
96
|
+
n.setAttribute('${RawSet.DR_FOR_OF_NAME}', name + '[' + idx + ']');
|
|
97
|
+
n.setAttribute('${RawSet.DR_NEXT_OPTIONNAME}', name + ',' + (Number(idx) + 1));
|
|
98
|
+
this.__render.fag.append(n);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
|
|
102
|
+
`, Object.assign(this.source.obj, {
|
|
103
|
+
__render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
|
104
|
+
// eslint-disable-next-line no-use-before-define
|
|
105
|
+
))
|
|
106
|
+
}));
|
|
107
|
+
RawSet.drVarDecoding(newTemp, vars);
|
|
108
|
+
RawSet.drItOtherDecoding(newTemp, itRandom);
|
|
109
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
110
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
111
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
112
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
113
|
+
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
114
|
+
// const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
|
|
115
|
+
this.returnContainer.raws.push(...rr);
|
|
116
|
+
return ExecuteState.EXECUTE;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=DrForOf.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrForm.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
11
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
12
|
+
import { Validator } from '../validators/Validator';
|
|
13
|
+
import { EventManager } from '../events/EventManager';
|
|
14
|
+
import { ValidatorArray } from '../validators/ValidatorArray';
|
|
15
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
16
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
17
|
+
export class DrForm extends OperatorExecuterAttrRequire {
|
|
18
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
19
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
20
|
+
}
|
|
21
|
+
executeAttrRequire(attr) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
var _a;
|
|
24
|
+
RawSet.drFormOtherMoveAttr(this.elementSource.element, 'name', 'temp-name', this.source.config);
|
|
25
|
+
const data = ScriptUtils.evalReturn(`${attr}`, this.source.obj);
|
|
26
|
+
const childs = Array.from(this.elementSource.element.querySelectorAll('[name]'));
|
|
27
|
+
const fromName = ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`)) !== null && _a !== void 0 ? _a : '', this.source.obj);
|
|
28
|
+
const thisName = fromName !== null && fromName !== void 0 ? fromName : this.elementSource.element.getAttribute('name');
|
|
29
|
+
// // 자기자신이 Input 대상일때
|
|
30
|
+
if (childs.length <= 0 && thisName) {
|
|
31
|
+
childs.push(this.elementSource.element);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
if (data instanceof Validator) {
|
|
35
|
+
data.setTarget(this.elementSource.element);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
childs.forEach(it => {
|
|
39
|
+
var _a, _b, _c, _d, _e;
|
|
40
|
+
const eventName = (_a = it.getAttribute(`${RawSet.DR_FORM_NAME}:event`)) !== null && _a !== void 0 ? _a : 'change';
|
|
41
|
+
const validatorName = it.getAttribute(`${RawSet.DR_FORM_NAME}:validator`);
|
|
42
|
+
const attrEventName = EventManager.attrPrefix + 'event-' + eventName;
|
|
43
|
+
let varpath = (_c = ScriptUtils.evalReturn((_b = this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`)) !== null && _b !== void 0 ? _b : '', this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
|
|
44
|
+
if (varpath != null) {
|
|
45
|
+
if (validatorName) {
|
|
46
|
+
ScriptUtils.eval(`
|
|
47
|
+
${this.render.bindScript}
|
|
48
|
+
const validator = typeof ${validatorName} ==='function' ? new ${validatorName}() : ${validatorName};
|
|
49
|
+
${attr}['${varpath}'] = validator;
|
|
50
|
+
`, Object.assign(this.source.obj, {
|
|
51
|
+
__render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
varpath = `${attr}['${varpath}']`;
|
|
55
|
+
const data = ScriptUtils.evalReturn(`${varpath}`, this.source.obj);
|
|
56
|
+
if (data instanceof ValidatorArray) {
|
|
57
|
+
it.setAttribute(attrEventName, `${varpath}.setArrayValue($target, $target.value, $event); ${(_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : ''};`);
|
|
58
|
+
data.addValidator(it.value, it);
|
|
59
|
+
}
|
|
60
|
+
else if (data instanceof Validator) {
|
|
61
|
+
// varpath += (varpath ? '.value' : 'value');
|
|
62
|
+
// varpath = drAttr.drForm + '.' + varpath;
|
|
63
|
+
// it.setAttribute(attrEventName, `${varpath} = $target.value; ${target}=$target; ${event}=$event;`);
|
|
64
|
+
it.setAttribute(attrEventName, `${varpath}.set($target.value, $target, $event); ${(_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : ''};`);
|
|
65
|
+
data.setTarget(it);
|
|
66
|
+
data.value = it.value;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
it.setAttribute(attrEventName, `${varpath} = $target.value;`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
RawSet.drFormOtherMoveAttr(this.elementSource.element, 'temp-name', 'name', this.source.config);
|
|
74
|
+
this.returnContainer.raws.push(...RawSet.checkPointCreates(this.elementSource.element, this.source.obj, this.source.config));
|
|
75
|
+
return ExecuteState.EXECUTE;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=DrForm.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrIf.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
14
|
+
export class DrIf extends OperatorExecuterAttrRequire {
|
|
15
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
16
|
+
source.operatorAround = undefined;
|
|
17
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
18
|
+
}
|
|
19
|
+
executeAttrRequire(attr) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
var _a, _b, _c, _d;
|
|
22
|
+
const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, 'DrIf');
|
|
23
|
+
const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
|
24
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
25
|
+
// Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v)); <-- 이부분은 다른 attr에도 적용을 할지말지 생각해야됨 엘리먼트 존재유무에 따라서 적용을 할지말지 결정해야됨
|
|
26
|
+
const keepgoing = ScriptUtils.eval(`
|
|
27
|
+
${this.render.bindScript}
|
|
28
|
+
${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
|
|
29
|
+
if ($rawSet.data === (${attr})) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
$rawSet.data = ${attr};
|
|
33
|
+
if($rawSet.data) {
|
|
34
|
+
const n = $element.cloneNode(true);
|
|
35
|
+
Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
|
|
36
|
+
var destIt = ${this.elementSource.attrs.drItOption};
|
|
37
|
+
if (destIt !== undefined) {
|
|
38
|
+
// 여기가 ..아주 헛갈리는데...
|
|
39
|
+
Array.from(n.getAttributeNames()).forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#DrIFIt\\#/g, destIt)))
|
|
40
|
+
n.innerHTML = n.innerHTML.replace(/\\#DrIFIt\\#/g, destIt);
|
|
41
|
+
}
|
|
42
|
+
if (this.__render.drStripOption === 'true') {
|
|
43
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
44
|
+
} else {
|
|
45
|
+
this.__render.fag.append(n);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''};
|
|
49
|
+
return true;
|
|
50
|
+
`, Object.assign(this.source.obj, {
|
|
51
|
+
__render: Object.freeze(Object.assign({ fag: newTemp, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
|
52
|
+
}));
|
|
53
|
+
// TODO: 뭐지?? 지워야되는거 아닌가?
|
|
54
|
+
if (keepgoing === false) {
|
|
55
|
+
return ExecuteState.STOP;
|
|
56
|
+
}
|
|
57
|
+
RawSet.drVarDecoding(newTemp, vars);
|
|
58
|
+
RawSet.drItOtherDecoding(newTemp, itRandom);
|
|
59
|
+
// const bypass = (newTemp.innerHTML ?? '').trim().length <= 0;
|
|
60
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
61
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
62
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
63
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
64
|
+
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
65
|
+
this.returnContainer.raws.push(...rr);
|
|
66
|
+
return ExecuteState.EXECUTE;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=DrIf.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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 DrInnerHTML extends OperatorExecuterAttrRequire<string> {
|
|
6
|
+
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
|
7
|
+
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrInnerHTML.d.ts.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
14
|
+
export class DrInnerHTML extends OperatorExecuterAttrRequire {
|
|
15
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
16
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
17
|
+
}
|
|
18
|
+
executeAttrRequire(attr) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
22
|
+
ScriptUtils.eval(`
|
|
23
|
+
${this.render.bindScript}
|
|
24
|
+
const n = $element.cloneNode(true);
|
|
25
|
+
${(_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : ''}
|
|
26
|
+
n.innerHTML = ${attr};
|
|
27
|
+
if (this.__render.drStripOption === 'true') {
|
|
28
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
29
|
+
} else {
|
|
30
|
+
this.__render.fag.append(n);
|
|
31
|
+
}
|
|
32
|
+
${(_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : ''}
|
|
33
|
+
`, Object.assign(this.source.obj, {
|
|
34
|
+
__render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
|
|
35
|
+
// eslint-disable-next-line no-use-before-define
|
|
36
|
+
))
|
|
37
|
+
}));
|
|
38
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
39
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
40
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
41
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
42
|
+
(_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
43
|
+
this.returnContainer.raws.push(...rr);
|
|
44
|
+
return ExecuteState.EXECUTE;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=DrInnerHTML.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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 DrInnerText extends OperatorExecuterAttrRequire<string> {
|
|
6
|
+
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
|
7
|
+
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrInnerText.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
14
|
+
export class DrInnerText extends OperatorExecuterAttrRequire {
|
|
15
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
16
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
17
|
+
}
|
|
18
|
+
executeAttrRequire(attr) {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
22
|
+
ScriptUtils.eval(`
|
|
23
|
+
${this.render.bindScript}
|
|
24
|
+
const n = $element.cloneNode(true);
|
|
25
|
+
${(_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : ''}
|
|
26
|
+
n.innerText = ${attr};
|
|
27
|
+
if (this.__render.drStripOption === 'true') {
|
|
28
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
29
|
+
} else {
|
|
30
|
+
this.__render.fag.append(n);
|
|
31
|
+
}
|
|
32
|
+
${(_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : ''}
|
|
33
|
+
`, Object.assign(this.source.obj, {
|
|
34
|
+
__render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
|
|
35
|
+
}));
|
|
36
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
37
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
38
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
39
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
40
|
+
(_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
41
|
+
this.returnContainer.raws.push(...rr);
|
|
42
|
+
return ExecuteState.EXECUTE;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=DrInnerText.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AfterCallBack, ElementSource, ExecuteState, OperatorExecuter, ReturnContainer, Source } from './OperatorExecuter';
|
|
2
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
3
|
+
import { Render } from '../rawsets/Render';
|
|
4
|
+
export declare class DrPre extends OperatorExecuter<null> {
|
|
5
|
+
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
|
6
|
+
execute(value: null): Promise<ExecuteState>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=DrPre.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { ExecuteState, OperatorExecuter } from './OperatorExecuter';
|
|
11
|
+
export class DrPre extends OperatorExecuter {
|
|
12
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
13
|
+
source.operatorAround = undefined;
|
|
14
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack);
|
|
15
|
+
}
|
|
16
|
+
execute(value) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
return (value != null) ? ExecuteState.EXECUTE : ExecuteState.NO_EXECUTE;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=DrPre.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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 DrRepeat extends OperatorExecuterAttrRequire<string> {
|
|
6
|
+
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
|
7
|
+
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrRepeat.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
|
|
11
|
+
import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
|
|
12
|
+
import { RawSet } from '../rawsets/RawSet';
|
|
13
|
+
import { EventManager } from '../events/EventManager';
|
|
14
|
+
import { ExecuteState } from './OperatorExecuter';
|
|
15
|
+
export class DrRepeat extends OperatorExecuterAttrRequire {
|
|
16
|
+
constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
17
|
+
source.operatorAround = undefined;
|
|
18
|
+
super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
|
|
19
|
+
}
|
|
20
|
+
executeAttrRequire(attr) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
|
24
|
+
const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
|
25
|
+
const newTemp = this.source.config.window.document.createElement('temp');
|
|
26
|
+
ScriptUtils.eval(`
|
|
27
|
+
${this.render.bindScript}
|
|
28
|
+
${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
|
|
29
|
+
var i = 0;
|
|
30
|
+
const repeat = ${attr};
|
|
31
|
+
const repeatStr = \`${attr}\`;
|
|
32
|
+
let range = repeat;
|
|
33
|
+
if (typeof repeat === 'number') {
|
|
34
|
+
range = ${EventManager.RANGE_VARNAME}(repeat);
|
|
35
|
+
}
|
|
36
|
+
for(const it of range) {
|
|
37
|
+
var destIt = it;
|
|
38
|
+
if (range.isRange) {
|
|
39
|
+
destIt = it;
|
|
40
|
+
} else {
|
|
41
|
+
destIt = repeatStr + '[' + i +']'
|
|
42
|
+
}
|
|
43
|
+
const n = this.__render.element.cloneNode(true);
|
|
44
|
+
n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearRangeIt\\#/g, destIt).replace(/\\#nearRangeIndex\\#/g, destIt)))
|
|
45
|
+
n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);
|
|
46
|
+
|
|
47
|
+
if (this.__render.drStripOption === 'true') {
|
|
48
|
+
Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
|
|
49
|
+
} else {
|
|
50
|
+
this.__render.fag.append(n);
|
|
51
|
+
}
|
|
52
|
+
i++;
|
|
53
|
+
}
|
|
54
|
+
${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
|
|
55
|
+
`, Object.assign(this.source.obj, {
|
|
56
|
+
__render: Object.freeze(Object.assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
|
57
|
+
}));
|
|
58
|
+
RawSet.drVarDecoding(newTemp, vars);
|
|
59
|
+
RawSet.drItOtherDecoding(newTemp, itRandom);
|
|
60
|
+
const tempalte = this.source.config.window.document.createElement('template');
|
|
61
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
|
62
|
+
this.returnContainer.fag.append(tempalte.content);
|
|
63
|
+
const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
|
64
|
+
(_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
|
65
|
+
this.returnContainer.raws.push(...rr);
|
|
66
|
+
return ExecuteState.EXECUTE;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=DrRepeat.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
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 DrStripElement extends OperatorExecuterAttrRequire<string> {
|
|
6
|
+
constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
|
|
7
|
+
executeAttrRequire(attr: string): Promise<ExecuteState>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=DrStripElement.d.ts.map
|