@dooboostore/simple-web-component 1.0.35 → 1.0.36
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/README.md +21 -21
- package/dist/cjs/decorators/addEventListener.js +12 -4
- package/dist/cjs/decorators/addEventListener.js.map +2 -2
- package/dist/cjs/decorators/applyAttribute.js +19 -18
- package/dist/cjs/decorators/applyAttribute.js.map +2 -2
- package/dist/cjs/decorators/applyClass.js +23 -22
- package/dist/cjs/decorators/applyClass.js.map +2 -2
- package/dist/cjs/decorators/applyNode.js +18 -17
- package/dist/cjs/decorators/applyNode.js.map +2 -2
- package/dist/cjs/decorators/applyStyle.js +20 -19
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/attribute.js +16 -15
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/{changedAttributeHost.js → changedAttributeThis.js} +6 -6
- package/dist/cjs/decorators/changedAttributeThis.js.map +7 -0
- package/dist/cjs/decorators/elementDefine.js +21 -20
- package/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/decorators/emitCustomEvent.js +18 -16
- package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
- package/dist/cjs/decorators/index.js +1 -1
- package/dist/cjs/decorators/index.js.map +1 -1
- package/dist/cjs/decorators/query.js +38 -60
- package/dist/cjs/decorators/query.js.map +2 -2
- package/dist/cjs/decorators/queryAll.js +31 -63
- package/dist/cjs/decorators/queryAll.js.map +2 -2
- package/dist/cjs/decorators/setProperty.js +13 -12
- package/dist/cjs/decorators/setProperty.js.map +2 -2
- package/dist/cjs/elements/SwcAsync.js +6 -6
- package/dist/cjs/elements/SwcAsync.js.map +1 -1
- package/dist/cjs/elements/SwcChoose.js +5 -5
- package/dist/cjs/elements/SwcChoose.js.map +1 -1
- package/dist/cjs/elements/SwcIf.js +6 -6
- package/dist/cjs/elements/SwcIf.js.map +1 -1
- package/dist/cjs/elements/SwcLoop.js +5 -5
- package/dist/cjs/elements/SwcLoop.js.map +1 -1
- package/dist/cjs/elements/register.js +18 -18
- package/dist/cjs/elements/register.js.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/Utils.js +13 -13
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/addEventListener.js +12 -4
- package/dist/esm/decorators/addEventListener.js.map +2 -2
- package/dist/esm/decorators/applyAttribute.js +19 -18
- package/dist/esm/decorators/applyAttribute.js.map +2 -2
- package/dist/esm/decorators/applyClass.js +23 -22
- package/dist/esm/decorators/applyClass.js.map +2 -2
- package/dist/esm/decorators/applyNode.js +18 -17
- package/dist/esm/decorators/applyNode.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +20 -19
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/attribute.js +16 -15
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/{changedAttributeHost.js → changedAttributeThis.js} +3 -3
- package/dist/esm/decorators/changedAttributeThis.js.map +7 -0
- package/dist/esm/decorators/elementDefine.js +19 -18
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/emitCustomEvent.js +18 -16
- package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
- package/dist/esm/decorators/index.js +1 -1
- package/dist/esm/decorators/index.js.map +1 -1
- package/dist/esm/decorators/query.js +38 -60
- package/dist/esm/decorators/query.js.map +2 -2
- package/dist/esm/decorators/queryAll.js +31 -63
- package/dist/esm/decorators/queryAll.js.map +2 -2
- package/dist/esm/decorators/setProperty.js +13 -12
- package/dist/esm/decorators/setProperty.js.map +2 -2
- package/dist/esm/elements/SwcAsync.js +7 -7
- package/dist/esm/elements/SwcAsync.js.map +1 -1
- package/dist/esm/elements/SwcChoose.js +6 -6
- package/dist/esm/elements/SwcChoose.js.map +1 -1
- package/dist/esm/elements/SwcIf.js +7 -7
- package/dist/esm/elements/SwcIf.js.map +1 -1
- package/dist/esm/elements/SwcLoop.js +6 -6
- package/dist/esm/elements/SwcLoop.js.map +1 -1
- package/dist/esm/elements/register.js +19 -19
- package/dist/esm/elements/register.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/Utils.js +13 -13
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +271 -308
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/addEventListener.d.ts +5 -7
- package/dist/types/decorators/addEventListener.d.ts.map +1 -1
- package/dist/types/decorators/applyAttribute.d.ts +4 -4
- package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
- package/dist/types/decorators/applyClass.d.ts +6 -6
- package/dist/types/decorators/applyClass.d.ts.map +1 -1
- package/dist/types/decorators/applyNode.d.ts +6 -6
- package/dist/types/decorators/applyNode.d.ts.map +1 -1
- package/dist/types/decorators/applyStyle.d.ts +4 -4
- package/dist/types/decorators/applyStyle.d.ts.map +1 -1
- package/dist/types/decorators/attribute.d.ts +5 -5
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/changedAttributeThis.d.ts +18 -0
- package/dist/types/decorators/changedAttributeThis.d.ts.map +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/emitCustomEvent.d.ts +4 -9
- package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +1 -1
- package/dist/types/decorators/query.d.ts +17 -63
- package/dist/types/decorators/query.d.ts.map +1 -1
- package/dist/types/decorators/queryAll.d.ts +6 -63
- package/dist/types/decorators/queryAll.d.ts.map +1 -1
- package/dist/types/decorators/setProperty.d.ts +1 -1
- package/dist/types/decorators/setProperty.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts +7 -7
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +271 -308
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +4 -4
- package/src/decorators/addEventListener.ts +11 -9
- package/src/decorators/applyAttribute.ts +16 -15
- package/src/decorators/applyClass.ts +18 -17
- package/src/decorators/applyNode.ts +21 -20
- package/src/decorators/applyStyle.ts +17 -16
- package/src/decorators/attribute.ts +20 -19
- package/src/decorators/{changedAttributeHost.ts → changedAttributeThis.ts} +10 -12
- package/src/decorators/elementDefine.ts +21 -20
- package/src/decorators/emitCustomEvent.ts +21 -26
- package/src/decorators/index.ts +1 -1
- package/src/decorators/query.ts +51 -124
- package/src/decorators/queryAll.ts +30 -127
- package/src/decorators/setProperty.ts +12 -11
- package/src/elements/SwcAsync.ts +7 -7
- package/src/elements/SwcChoose.ts +6 -6
- package/src/elements/SwcIf.ts +8 -8
- package/src/elements/SwcLoop.ts +6 -6
- package/src/elements/register.ts +20 -20
- package/src/types.ts +5 -5
- package/src/utils/Utils.ts +17 -18
- package/dist/cjs/decorators/changedAttributeHost.js.map +0 -7
- package/dist/esm/decorators/changedAttributeHost.js.map +0 -7
- package/dist/types/decorators/changedAttributeHost.d.ts +0 -20
- package/dist/types/decorators/changedAttributeHost.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcIf.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
4
|
+
"sourcesContent": ["import { changedAttributeThis } from '../decorators/changedAttributeThis';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { SwcIfInterface } from '../types';\nimport { attributeThis, getAttributeValue } from '../decorators';\n\nclass SwcIf extends HTMLTemplateElement implements SwcIfInterface {\n // id =\n // @attributeThis('value')\n _value: any;\n\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n @attributeThis('skip-if-same')\n _skipIfSame: string | null;\n\n private _nodes: Node[] = [];\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n // this._value = nv;\n this.refresh(nv);\n }\n\n constructor() {\n super();\n }\n\n @changedAttributeThis('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value?: any) {\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value);\n\n // skip-if-same 속성이 존재하고(true/빈 문자열), 이전 값과 새로운 값이 완전히 동일하면 렌더링 스킵!\n if (this.hasAttribute('skip-if-same') && this._value === targetValue && this._nodes.length > 0) {\n return;\n }\n\n this.cleanup();\n this._value = targetValue;\n\n const portal = this.parentElement;\n if (!portal || !this._value) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $value: this._value, $templateHost: this };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n this._nodes = Array.from(processedFragment.childNodes);\n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) (node as any).__swc_template_host = this;\n });\n\n portal.insertBefore(processedFragment, this.nextSibling);\n }\n\n private cleanup() {\n this._nodes.forEach(n => {\n const realNode = (n as any).__upgraded_instance || n;\n if (realNode.parentElement) {\n realNode.parentElement.removeChild(realNode);\n }\n });\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
|
|
5
5
|
"mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAAgD;AAChD,sBAA6B;AAE7B,wBAAiD;;;;;;;;;;AAEjD,MAAM,cAAc,oBAAmB;EAerC,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EAEA,IAAI,MAAM,IAAO;AAEf,SAAK,QAAQ,EAAE;EACjB;EAEA,cAAA;AACE,UAAK;AAZC,SAAA,SAAiB,CAAA;EAazB;EAGQ,SAAS,OAAY,GAAW,GAAS;AAC/C,SAAK,SAAS;AACd,SAAK,QAAQ,KAAK,MAAM;EAC1B;;;;;EAOQ,mBAAmB,MAAc,WAAgB,SAAc,MAAkC;AACvG,QAAI,SAAc;AAClB,QAAI,MAAM;AACR,eAAS;QACP,YAAY;UACV,SAAS,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,KAAK,GAAG,KAAK,GAAG,GAAE;UACrD,YAAY,EAAE,OAAO,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,GAAE;UACzD,MAAM,EAAE,OAAO,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,GAAE;;;IAGzD;AACA,UAAM,KAAK,IAAI,6BAAiB,MAAM,MAAM;AAC5C,UAAM,MAAM,KAAK,eAAe,eAAe;AAG/C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AM,WAAY,EAAU,uBAAuB;AACnD,UAAI,SAAS,eAAe;AAC1B,iBAAS,cAAc,YAAY,QAAQ;MAC7C;IACF,CAAC;AACD,SAAK,SAAS,CAAA;EAChB;EAEA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AA7GA,WAAA;MADC,iCAAc,oBAAoB;;;AAGnC,WAAA;MADC,iCAAc,kBAAkB;;;AAIjC,WAAA;MADC,iCAAc,cAAc;;;AAmBrB,WAAA;MADP,kDAAqB,OAAO;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var import_changedAttributeThis = require("../decorators/changedAttributeThis");
|
|
2
2
|
var import_Utils = require("../utils/Utils");
|
|
3
3
|
var import_core = require("@dooboostore/core");
|
|
4
4
|
var import_core_web = require("@dooboostore/core-web");
|
|
@@ -32,7 +32,7 @@ class SwcLoop extends HTMLTemplateElement {
|
|
|
32
32
|
this._value = value;
|
|
33
33
|
this.refresh(this._value);
|
|
34
34
|
}
|
|
35
|
-
// @
|
|
35
|
+
// @changedAttributeThis('replace-wrap')
|
|
36
36
|
// private setReplaceWrap(replaceWrapAttr?: string | null) {
|
|
37
37
|
// this.refresh();
|
|
38
38
|
// }
|
|
@@ -160,15 +160,15 @@ class SwcLoop extends HTMLTemplateElement {
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
__decorate([
|
|
163
|
-
(0, import_decorators.
|
|
163
|
+
(0, import_decorators.attributeThis)("replace-wrap-start"),
|
|
164
164
|
__metadata("design:type", String)
|
|
165
165
|
], SwcLoop.prototype, "_replaceWrapStart", void 0);
|
|
166
166
|
__decorate([
|
|
167
|
-
(0, import_decorators.
|
|
167
|
+
(0, import_decorators.attributeThis)("replace-wrap-end"),
|
|
168
168
|
__metadata("design:type", String)
|
|
169
169
|
], SwcLoop.prototype, "_replaceWrapEnd", void 0);
|
|
170
170
|
__decorate([
|
|
171
|
-
(0,
|
|
171
|
+
(0, import_changedAttributeThis.changedAttributeThis)("value"),
|
|
172
172
|
__metadata("design:type", Function),
|
|
173
173
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
174
174
|
__metadata("design:returntype", void 0)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcLoop.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
4
|
+
"sourcesContent": ["import { changedAttributeThis } from '../decorators/changedAttributeThis';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { attributeThis, getAttributeValue } from '../decorators';\n\nclass SwcLoop extends HTMLTemplateElement {\n _value: any[] = [];\n\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n private _nodeGroups: Node[][] = [];\n\n get value(): any[] {\n return this._value;\n }\n\n set value(nv: any[]) {\n this._value = nv;\n this.refresh(nv);\n }\n\n getValue(index: number) {\n return this._value?.[index];\n }\n\n constructor() {\n super();\n // console.log('swc SwcLoop constructor called!');\n // console.log('swc SwcLoop', this.getAttribute('value'));\n }\n\n @changedAttributeThis('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n const expressions = ae.getExpressions('replace');\n for (const expr of expressions) {\n const script = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n try {\n const value = FunctionUtils.executeReturn({\n script: script,\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n private createFragmentAndNodes(items: any[], helperSet: any, startIndex: number = 0): { fragment: DocumentFragment; newNodesGroup: Node[][] } {\n const win = this.ownerDocument?.defaultView || window;\n const fragment = win.document.createDocumentFragment();\n const newNodesGroup: Node[][] = [];\n\n items.forEach((item, i) => {\n const index = startIndex + i;\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n\n const content = temp.content;\n const nodes = Array.from(content.childNodes);\n\n const setTemplateHost = (element: HTMLElement) => {\n (element as any).__swc_template_host = this;\n Array.from(element.children).forEach((child: any) => {\n if (child instanceof HTMLElement) {\n setTemplateHost(child);\n }\n });\n };\n\n nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) {\n setTemplateHost(node as HTMLElement);\n }\n });\n newNodesGroup.push(nodes);\n fragment.appendChild(content);\n });\n\n return { fragment, newNodesGroup };\n }\n\n appendItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n const startIndex = this._value ? this._value.length : 0;\n\n // 내부 상태(value) 업데이트 (기존 배열에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...(this._value || []), ...items];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, startIndex);\n this._nodeGroups.push(...newNodesGroup);\n\n console.log('뭐야 씨발');\n // append 위치 계산: 기존에 그려진 마지막 노드 뒤에 삽입, 없으면 템플릿 바로 뒤에 삽입\n let insertReference: Node | null = this.nextSibling;\n if (this._nodeGroups.length > items.length) {\n const lastExistingGroup = this._nodeGroups[this._nodeGroups.length - items.length - 1];\n if (lastExistingGroup && lastExistingGroup.length > 0) {\n const lastNode = lastExistingGroup[lastExistingGroup.length - 1];\n insertReference = lastNode.nextSibling;\n }\n }\n\n portal.insertBefore(fragment, insertReference);\n }\n\n async prependItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n // 내부 상태(value) 업데이트 (기존 배열의 앞쪽에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...items, ...(this._value || [])];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, 0);\n\n // 기존의 nodeGroups 배열 맨 앞에 새로운 그룹들을 추가\n this._nodeGroups = [...newNodesGroup, ...this._nodeGroups];\n\n // prepend 위치: 이 템플릿(SwcLoop) 노드의 바로 다음 위치 (가장 위)\n portal.insertBefore(fragment, this.nextSibling);\n }\n\n refresh(value?: any) {\n // 1. 그릴 대상 확정\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value ?? []);\n\n // 2. 화면 정리\n this.cleanup();\n\n // 3. 상태 완전 교체 (이어붙이지 않음!)\n this._value = targetValue;\n\n if (!this._value || this._value.length <= 0) return;\n\n // 4. 화면 다시 그리기 (appendItem을 쓰지 않고 바로 그리기)\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n helperSet.$templateHost = this;\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(this._value, helperSet, 0);\n\n this._nodeGroups = newNodesGroup;\n const portal = SwcUtils.getParentContainer(this);\n if (portal) {\n // console.log('append????!~~~~~!?',fragment)\n portal.insertBefore(fragment, this.nextSibling);\n }\n }\n\n private cleanup() {\n console.log('누가 cleanup');\n this._nodeGroups.forEach(nodes => nodes.forEach(n => n.parentElement?.removeChild(n)));\n this._nodeGroups = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n}\n"],
|
|
5
5
|
"mappings": "AAAA,kCAAqC;AACrC,mBAAyB;AACzB,kBAAgD;AAChD,sBAA6B;AAC7B,wBAAiD;;;;;;;;;;AAEjD,MAAM,gBAAgB,oBAAmB;EAUvC,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EAEA,IAAI,MAAM,IAAS;AACjB,SAAK,SAAS;AACd,SAAK,QAAQ,EAAE;EACjB;EAEA,SAAS,OAAa;AACpB,WAAO,KAAK,SAAS,KAAK;EAC5B;EAEA,cAAA;AACE,UAAK;AAvBP,SAAA,SAAgB,CAAA;AAOR,SAAA,cAAwB,CAAA;EAmBhC;EAGQ,SAAS,OAAY,GAAW,GAAS;AAC/C,SAAK,SAAS;AACd,SAAK,QAAQ,KAAK,MAAM;EAC1B;;;;;EAOQ,mBAAmB,MAAc,WAAgB,SAAc,MAAkC;AACvG,QAAI,SAAc;AAClB,aAAS;MACP,YAAY;QACV,SAAS,EAAE,OAAO,GAAG,KAAK,KAAK,IAAI,KAAK,GAAG,KAAK,GAAG,GAAE;QACrD,YAAY,EAAE,OAAO,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,GAAE;QACzD,MAAM,EAAE,OAAO,GAAG,KAAK,KAAK,KAAK,KAAK,GAAG,KAAK,GAAG,GAAE;;;AAGvD,UAAM,KAAK,IAAI,6BAAiB,MAAM,MAAM;AAC5C,UAAM,MAAM,KAAK,eAAe,eAAe;AAG/C,UAAM,cAAc,GAAG,eAAe,SAAS;AAC/C,eAAW,QAAQ,aAAa;AAC9B,YAAM,SAAS,6BAAa,iBAAiB,KAAK,QAAQ,IAAI,QAAQ;AACtE,UAAI;AACF,cAAM,QAAQ,0BAAc,cAAc;UACxC;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,SAAY,YAAS,qCAAkB,MAAM,OAAO,KAAK,KAAK,UAAU,CAAA;AAGtG,SAAK,QAAO;AAGZ,SAAK,SAAS;AAEd,QAAI,CAAC,KAAK,UAAU,KAAK,OAAO,UAAU;AAAG;AAG7C,UAAM,MAAM,KAAK,eAAe,eAAe;AAC/C,UAAM,YAAY,sBAAS,oBAAoB,KAAK,IAAI;AACxD,cAAU,gBAAgB;AAC1B,UAAM,EAAE,UAAU,cAAa,IAAK,KAAK,uBAAuB,KAAK,QAAQ,WAAW,CAAC;AAEzF,SAAK,cAAc;AACnB,UAAM,SAAS,sBAAS,mBAAmB,IAAI;AAC/C,QAAI,QAAQ;AAEV,aAAO,aAAa,UAAU,KAAK,WAAW;IAChD;EACF;EAEQ,UAAO;AACb,YAAQ,IAAI,sBAAY;AACxB,SAAK,YAAY,QAAQ,WAAS,MAAM,QAAQ,OAAK,EAAE,eAAe,YAAY,CAAC,CAAC,CAAC;AACrF,SAAK,cAAc,CAAA;EACrB;EAEA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AAjMA,WAAA;MADC,iCAAc,oBAAoB;;;AAGnC,WAAA;MADC,iCAAc,kBAAkB;;;AAyBzB,WAAA;MADP,kDAAqB,OAAO;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -147,7 +147,7 @@ const registerAllElements = (w) => {
|
|
|
147
147
|
this._value = value;
|
|
148
148
|
this.refresh(this._value);
|
|
149
149
|
}
|
|
150
|
-
// @
|
|
150
|
+
// @changedAttributeThis('replace-wrap')
|
|
151
151
|
// private setReplaceWrap(replaceWrapAttr?: string | null) {
|
|
152
152
|
// this.refresh();
|
|
153
153
|
// }
|
|
@@ -217,19 +217,19 @@ const registerAllElements = (w) => {
|
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
__decorate([
|
|
220
|
-
(0, import_decorators.
|
|
220
|
+
(0, import_decorators.attributeThis)("replace-wrap-start"),
|
|
221
221
|
__metadata("design:type", String)
|
|
222
222
|
], SwcIf.prototype, "_replaceWrapStart", void 0);
|
|
223
223
|
__decorate([
|
|
224
|
-
(0, import_decorators.
|
|
224
|
+
(0, import_decorators.attributeThis)("replace-wrap-end"),
|
|
225
225
|
__metadata("design:type", String)
|
|
226
226
|
], SwcIf.prototype, "_replaceWrapEnd", void 0);
|
|
227
227
|
__decorate([
|
|
228
|
-
(0, import_decorators.
|
|
228
|
+
(0, import_decorators.attributeThis)("skip-if-same"),
|
|
229
229
|
__metadata("design:type", String)
|
|
230
230
|
], SwcIf.prototype, "_skipIfSame", void 0);
|
|
231
231
|
__decorate([
|
|
232
|
-
(0, import_decorators.
|
|
232
|
+
(0, import_decorators.changedAttributeThis)("value"),
|
|
233
233
|
__metadata("design:type", Function),
|
|
234
234
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
235
235
|
__metadata("design:returntype", void 0)
|
|
@@ -258,7 +258,7 @@ const registerAllElements = (w) => {
|
|
|
258
258
|
this._value = value;
|
|
259
259
|
this.refresh(this._value);
|
|
260
260
|
}
|
|
261
|
-
// @
|
|
261
|
+
// @changedAttributeThis('replace-wrap')
|
|
262
262
|
// private setReplaceWrap(replaceWrapAttr?: string | null) {
|
|
263
263
|
// this.refresh();
|
|
264
264
|
// }
|
|
@@ -386,15 +386,15 @@ const registerAllElements = (w) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
__decorate([
|
|
389
|
-
(0, import_decorators.
|
|
389
|
+
(0, import_decorators.attributeThis)("replace-wrap-start"),
|
|
390
390
|
__metadata("design:type", String)
|
|
391
391
|
], SwcLoop.prototype, "_replaceWrapStart", void 0);
|
|
392
392
|
__decorate([
|
|
393
|
-
(0, import_decorators.
|
|
393
|
+
(0, import_decorators.attributeThis)("replace-wrap-end"),
|
|
394
394
|
__metadata("design:type", String)
|
|
395
395
|
], SwcLoop.prototype, "_replaceWrapEnd", void 0);
|
|
396
396
|
__decorate([
|
|
397
|
-
(0, import_decorators.
|
|
397
|
+
(0, import_decorators.changedAttributeThis)("value"),
|
|
398
398
|
__metadata("design:type", Function),
|
|
399
399
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
400
400
|
__metadata("design:returntype", void 0)
|
|
@@ -426,7 +426,7 @@ const registerAllElements = (w) => {
|
|
|
426
426
|
this._value = value;
|
|
427
427
|
this.refresh(this._value);
|
|
428
428
|
}
|
|
429
|
-
// @
|
|
429
|
+
// @changedAttributeThis('replace-wrap')
|
|
430
430
|
// private setReplaceWrap(replaceWrapAttr?: string | null) {
|
|
431
431
|
// this.refresh();
|
|
432
432
|
// }
|
|
@@ -530,15 +530,15 @@ const registerAllElements = (w) => {
|
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
532
|
__decorate([
|
|
533
|
-
(0, import_decorators.
|
|
533
|
+
(0, import_decorators.attributeThis)("replace-wrap-start"),
|
|
534
534
|
__metadata("design:type", String)
|
|
535
535
|
], SwcChoose.prototype, "_replaceWrapStart", void 0);
|
|
536
536
|
__decorate([
|
|
537
|
-
(0, import_decorators.
|
|
537
|
+
(0, import_decorators.attributeThis)("replace-wrap-end"),
|
|
538
538
|
__metadata("design:type", String)
|
|
539
539
|
], SwcChoose.prototype, "_replaceWrapEnd", void 0);
|
|
540
540
|
__decorate([
|
|
541
|
-
(0, import_decorators.
|
|
541
|
+
(0, import_decorators.changedAttributeThis)("value"),
|
|
542
542
|
__metadata("design:type", Function),
|
|
543
543
|
__metadata("design:paramtypes", [Object, String, String]),
|
|
544
544
|
__metadata("design:returntype", void 0)
|
|
@@ -561,7 +561,7 @@ const registerAllElements = (w) => {
|
|
|
561
561
|
setValue(valueAttr) {
|
|
562
562
|
this.executeAsync(this._value);
|
|
563
563
|
}
|
|
564
|
-
// @
|
|
564
|
+
// @changedAttributeThis('replace-wrap')
|
|
565
565
|
// private setReplaceWrap() {
|
|
566
566
|
// this.executeAsync(this._value);
|
|
567
567
|
// }
|
|
@@ -644,19 +644,19 @@ const registerAllElements = (w) => {
|
|
|
644
644
|
}
|
|
645
645
|
};
|
|
646
646
|
__decorate([
|
|
647
|
-
(0, import_decorators.
|
|
647
|
+
(0, import_decorators.attributeThis)("value"),
|
|
648
648
|
__metadata("design:type", Object)
|
|
649
649
|
], SwcAsync.prototype, "_value", void 0);
|
|
650
650
|
__decorate([
|
|
651
|
-
(0, import_decorators.
|
|
651
|
+
(0, import_decorators.attributeThis)("replace-wrap-start"),
|
|
652
652
|
__metadata("design:type", String)
|
|
653
653
|
], SwcAsync.prototype, "_replaceWrapStart", void 0);
|
|
654
654
|
__decorate([
|
|
655
|
-
(0, import_decorators.
|
|
655
|
+
(0, import_decorators.attributeThis)("replace-wrap-end"),
|
|
656
656
|
__metadata("design:type", String)
|
|
657
657
|
], SwcAsync.prototype, "_replaceWrapEnd", void 0);
|
|
658
658
|
__decorate([
|
|
659
|
-
(0, import_decorators.
|
|
659
|
+
(0, import_decorators.changedAttributeThis)("value"),
|
|
660
660
|
__metadata("design:type", Function),
|
|
661
661
|
__metadata("design:paramtypes", [String]),
|
|
662
662
|
__metadata("design:returntype", void 0)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/register.ts"],
|
|
4
|
-
"sourcesContent": ["import { getElementConfig, elementDefine, attributeHost, changedAttributeHost, getAttributeValue } from '../decorators';\nimport { SwcAppMixin } from './SwcAppMixin';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils,ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\n\ntype Constructor<T> = new (...args: any[]) => T;\n\nexport const registerAllElements = (w: any): Record<string, Constructor<HTMLElement>> => {\n const {\n HTMLElement: _HTMLElement,\n HTMLTemplateElement: _HTMLTemplateElement,\n DocumentFragment: _DocumentFragment,\n Node: _Node,\n Element: _Element,\n HTMLAnchorElement: _HTMLAnchorElement,\n HTMLAreaElement: _HTMLAreaElement,\n HTMLAudioElement: _HTMLAudioElement,\n HTMLBaseElement: _HTMLBaseElement,\n HTMLButtonElement: _HTMLButtonElement,\n HTMLCanvasElement: _HTMLCanvasElement,\n HTMLDataElement: _HTMLDataElement,\n HTMLDataListElement: _HTMLDataListElement,\n HTMLDetailsElement: _HTMLDetailsElement,\n HTMLDialogElement: _HTMLDialogElement,\n HTMLDivElement: _HTMLDivElement,\n HTMLDListElement: _HTMLDListElement,\n HTMLEmbedElement: _HTMLEmbedElement,\n HTMLFieldSetElement: _HTMLFieldSetElement,\n HTMLFormElement: _HTMLFormElement,\n HTMLHRElement: _HTMLHRElement,\n HTMLIFrameElement: _HTMLIFrameElement,\n HTMLImageElement: _HTMLImageElement,\n HTMLInputElement: _HTMLInputElement,\n HTMLLabelElement: _HTMLLabelElement,\n HTMLLegendElement: _HTMLLegendElement,\n HTMLLIElement: _HTMLLIElement,\n HTMLLinkElement: _HTMLLinkElement,\n HTMLMapElement: _HTMLMapElement,\n HTMLMetaElement: _HTMLMetaElement,\n HTMLMeterElement: _HTMLMeterElement,\n HTMLModElement: _HTMLModElement,\n HTMLObjectElement: _HTMLObjectElement,\n HTMLOListElement: _HTMLOListElement,\n HTMLOptGroupElement: _HTMLOptGroupElement,\n HTMLOptionElement: _HTMLOptionElement,\n HTMLOutputElement: _HTMLOutputElement,\n HTMLParagraphElement: _HTMLParagraphElement,\n HTMLParamElement: _HTMLParamElement,\n HTMLPictureElement: _HTMLPictureElement,\n HTMLPreElement: _HTMLPreElement,\n HTMLProgressElement: _HTMLProgressElement,\n HTMLQuoteElement: _HTMLQuoteElement,\n HTMLScriptElement: _HTMLScriptElement,\n HTMLSelectElement: _HTMLSelectElement,\n HTMLSlotElement: _HTMLSlotElement,\n HTMLSourceElement: _HTMLSourceElement,\n HTMLSpanElement: _HTMLSpanElement,\n HTMLStyleElement: _HTMLStyleElement,\n HTMLTableElement: _HTMLTableElement,\n HTMLTableSectionElement: _HTMLTableSectionElement,\n HTMLTableCellElement: _HTMLTableCellElement,\n HTMLTextAreaElement: _HTMLTextAreaElement,\n HTMLTimeElement: _HTMLTimeElement,\n HTMLTitleElement: _HTMLTitleElement,\n HTMLTableRowElement: _HTMLTableRowElement,\n HTMLTrackElement: _HTMLTrackElement,\n HTMLUListElement: _HTMLUListElement,\n HTMLVideoElement: _HTMLVideoElement,\n HTMLHeadingElement: _HTMLHeadingElement,\n HTMLBodyElement: _HTMLBodyElement,\n } = w as any;\n\n const HTMLElement = _HTMLElement as typeof globalThis.HTMLElement;\n const HTMLTemplateElement = _HTMLTemplateElement as typeof globalThis.HTMLTemplateElement;\n const DocumentFragment = _DocumentFragment as typeof globalThis.DocumentFragment;\n const Node = _Node as typeof globalThis.Node;\n const Element = _Element as typeof globalThis.Element;\n const HTMLAnchorElement = _HTMLAnchorElement as typeof globalThis.HTMLAnchorElement;\n const HTMLAreaElement = _HTMLAreaElement as typeof globalThis.HTMLAreaElement;\n const HTMLAudioElement = _HTMLAudioElement as typeof globalThis.HTMLAudioElement;\n const HTMLBaseElement = _HTMLBaseElement as typeof globalThis.HTMLBaseElement;\n const HTMLButtonElement = _HTMLButtonElement as typeof globalThis.HTMLButtonElement;\n const HTMLCanvasElement = _HTMLCanvasElement as typeof globalThis.HTMLCanvasElement;\n const HTMLDataElement = _HTMLDataElement as typeof globalThis.HTMLDataElement;\n const HTMLDataListElement = _HTMLDataListElement as typeof globalThis.HTMLDataListElement;\n const HTMLDetailsElement = _HTMLDetailsElement as typeof globalThis.HTMLDetailsElement;\n const HTMLDialogElement = _HTMLDialogElement as typeof globalThis.HTMLDialogElement;\n const HTMLDivElement = _HTMLDivElement as typeof globalThis.HTMLDivElement;\n const HTMLDListElement = _HTMLDListElement as typeof globalThis.HTMLDListElement;\n const HTMLEmbedElement = _HTMLEmbedElement as typeof globalThis.HTMLEmbedElement;\n const HTMLFieldSetElement = _HTMLFieldSetElement as typeof globalThis.HTMLFieldSetElement;\n const HTMLFormElement = _HTMLFormElement as typeof globalThis.HTMLFormElement;\n const HTMLHRElement = _HTMLHRElement as typeof globalThis.HTMLHRElement;\n const HTMLIFrameElement = _HTMLIFrameElement as typeof globalThis.HTMLIFrameElement;\n const HTMLImageElement = _HTMLImageElement as typeof globalThis.HTMLImageElement;\n const HTMLInputElement = _HTMLInputElement as typeof globalThis.HTMLInputElement;\n const HTMLLabelElement = _HTMLLabelElement as typeof globalThis.HTMLLabelElement;\n const HTMLLegendElement = _HTMLLegendElement as typeof globalThis.HTMLLegendElement;\n const HTMLLIElement = _HTMLLIElement as typeof globalThis.HTMLLIElement;\n const HTMLLinkElement = _HTMLLinkElement as typeof globalThis.HTMLLinkElement;\n const HTMLMapElement = _HTMLMapElement as typeof globalThis.HTMLMapElement;\n const HTMLMetaElement = _HTMLMetaElement as typeof globalThis.HTMLMetaElement;\n const HTMLMeterElement = _HTMLMeterElement as typeof globalThis.HTMLMeterElement;\n const HTMLModElement = _HTMLModElement as typeof globalThis.HTMLModElement;\n const HTMLObjectElement = _HTMLObjectElement as typeof globalThis.HTMLObjectElement;\n const HTMLOListElement = _HTMLOListElement as typeof globalThis.HTMLOListElement;\n const HTMLOptGroupElement = _HTMLOptGroupElement as typeof globalThis.HTMLOptGroupElement;\n const HTMLOptionElement = _HTMLOptionElement as typeof globalThis.HTMLOptionElement;\n const HTMLOutputElement = _HTMLOutputElement as typeof globalThis.HTMLOutputElement;\n const HTMLParagraphElement = _HTMLParagraphElement as typeof globalThis.HTMLParagraphElement;\n const HTMLParamElement = _HTMLParamElement as typeof globalThis.HTMLParamElement;\n const HTMLPictureElement = _HTMLPictureElement as typeof globalThis.HTMLPictureElement;\n const HTMLPreElement = _HTMLPreElement as typeof globalThis.HTMLPreElement;\n const HTMLProgressElement = _HTMLProgressElement as typeof globalThis.HTMLProgressElement;\n const HTMLQuoteElement = _HTMLQuoteElement as typeof globalThis.HTMLQuoteElement;\n const HTMLScriptElement = _HTMLScriptElement as typeof globalThis.HTMLScriptElement;\n const HTMLSelectElement = _HTMLSelectElement as typeof globalThis.HTMLSelectElement;\n const HTMLSlotElement = _HTMLSlotElement as typeof globalThis.HTMLSlotElement;\n const HTMLSourceElement = _HTMLSourceElement as typeof globalThis.HTMLSourceElement;\n const HTMLSpanElement = _HTMLSpanElement as typeof globalThis.HTMLSpanElement;\n const HTMLStyleElement = _HTMLStyleElement as typeof globalThis.HTMLStyleElement;\n const HTMLTableElement = _HTMLTableElement as typeof globalThis.HTMLTableElement;\n const HTMLTableSectionElement = _HTMLTableSectionElement as typeof globalThis.HTMLTableSectionElement;\n const HTMLTableCellElement = _HTMLTableCellElement as typeof globalThis.HTMLTableCellElement;\n const HTMLTextAreaElement = _HTMLTextAreaElement as typeof globalThis.HTMLTextAreaElement;\n const HTMLTimeElement = _HTMLTimeElement as typeof globalThis.HTMLTimeElement;\n const HTMLTitleElement = _HTMLTitleElement as typeof globalThis.HTMLTitleElement;\n const HTMLTableRowElement = _HTMLTableRowElement as typeof globalThis.HTMLTableRowElement;\n const HTMLTrackElement = _HTMLTrackElement as typeof globalThis.HTMLTrackElement;\n const HTMLUListElement = _HTMLUListElement as typeof globalThis.HTMLUListElement;\n const HTMLVideoElement = _HTMLVideoElement as typeof globalThis.HTMLVideoElement;\n const HTMLHeadingElement = _HTMLHeadingElement as typeof globalThis.HTMLHeadingElement;\n const HTMLBodyElement = _HTMLBodyElement as typeof globalThis.HTMLBodyElement;\n\n\n // --- Sub Templates ---\n @elementDefine('swc-loading', { extends: 'template', window: w }) class SwcLoading extends HTMLTemplateElement {}\n @elementDefine('swc-error', { extends: 'template', window: w }) class SwcError extends HTMLTemplateElement {}\n @elementDefine('swc-success', { extends: 'template', window: w }) class SwcSuccess extends HTMLTemplateElement {}\n @elementDefine('swc-when', { extends: 'template', window: w }) class SwcWhen extends HTMLTemplateElement {}\n @elementDefine('swc-otherwise', { extends: 'template', window: w }) class SwcOtherwise extends HTMLTemplateElement {}\n @elementDefine('swc-default', { extends: 'template', window: w }) class SwcDefault extends HTMLTemplateElement {}\n\n // --- Core Elements ---\n @elementDefine('swc-app', { window: w })\n class SwcApp extends SwcAppMixin(HTMLElement) {}\n\n @elementDefine('swc-if', { extends: 'template', window: w })\n class SwcIf extends HTMLTemplateElement {\n // id =\n // @attributeHost('value')\n _value: any;\n\n @attributeHost('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeHost('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n @attributeHost('skip-if-same')\n _skipIfSame: string | null;\n\n private _nodes: Node[] = [];\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n // this._value = nv;\n this.refresh(nv);\n }\n\n constructor() {\n super();\n }\n\n @changedAttributeHost('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeHost('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value?: any) {\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value);\n\n // skip-if-same 속성이 존재하고(true/빈 문자열), 이전 값과 새로운 값이 완전히 동일하면 렌더링 스킵!\n if (this.hasAttribute('skip-if-same') && this._value === targetValue && this._nodes.length > 0) {\n return;\n }\n\n this.cleanup();\n this._value = targetValue;\n\n const portal = this.parentElement;\n if (!portal || !this._value) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $value: this._value, $templateHost: this };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n this._nodes = Array.from(processedFragment.childNodes);\n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) (node as any).__swc_template_host = this;\n });\n\n portal.insertBefore(processedFragment, this.nextSibling);\n }\n\n private cleanup() {\n this._nodes.forEach(n => {\n const realNode = (n as any).__upgraded_instance || n;\n if (realNode.parentElement) {\n realNode.parentElement.removeChild(realNode);\n }\n });\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-loop', { extends: 'template', window: w })\n class SwcLoop extends HTMLTemplateElement {\n _value: any[] = [];\n\n @attributeHost('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeHost('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n private _nodeGroups: Node[][] = [];\n\n get value(): any[] {\n return this._value;\n }\n\n set value(nv: any[]) {\n this._value = nv;\n this.refresh(nv);\n }\n\n getValue(index: number) {\n return this._value?.[index];\n }\n\n constructor() {\n super();\n // console.log('swc SwcLoop constructor called!');\n // console.log('swc SwcLoop', this.getAttribute('value'));\n }\n\n @changedAttributeHost('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeHost('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n const expressions = ae.getExpressions('replace');\n for (const expr of expressions) {\n const script = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n try {\n const value = FunctionUtils.executeReturn({\n script: script,\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n private createFragmentAndNodes(items: any[], helperSet: any, startIndex: number = 0): { fragment: DocumentFragment; newNodesGroup: Node[][] } {\n const win = this.ownerDocument?.defaultView || window;\n const fragment = win.document.createDocumentFragment();\n const newNodesGroup: Node[][] = [];\n\n items.forEach((item, i) => {\n const index = startIndex + i;\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n\n const content = temp.content;\n const nodes = Array.from(content.childNodes);\n\n const setTemplateHost = (element: HTMLElement) => {\n (element as any).__swc_template_host = this;\n Array.from(element.children).forEach((child: any) => {\n if (child instanceof HTMLElement) {\n setTemplateHost(child);\n }\n });\n };\n\n nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) {\n setTemplateHost(node as HTMLElement);\n }\n });\n newNodesGroup.push(nodes);\n fragment.appendChild(content);\n });\n\n return { fragment, newNodesGroup };\n }\n\n appendItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n const startIndex = this._value ? this._value.length : 0;\n\n // 내부 상태(value) 업데이트 (기존 배열에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...(this._value || []), ...items];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, startIndex);\n this._nodeGroups.push(...newNodesGroup);\n\n console.log('뭐야 씨발');\n // append 위치 계산: 기존에 그려진 마지막 노드 뒤에 삽입, 없으면 템플릿 바로 뒤에 삽입\n let insertReference: Node | null = this.nextSibling;\n if (this._nodeGroups.length > items.length) {\n const lastExistingGroup = this._nodeGroups[this._nodeGroups.length - items.length - 1];\n if (lastExistingGroup && lastExistingGroup.length > 0) {\n const lastNode = lastExistingGroup[lastExistingGroup.length - 1];\n insertReference = lastNode.nextSibling;\n }\n }\n\n portal.insertBefore(fragment, insertReference);\n }\n\n async prependItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n // 내부 상태(value) 업데이트 (기존 배열의 앞쪽에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...items, ...(this._value || [])];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, 0);\n\n // 기존의 nodeGroups 배열 맨 앞에 새로운 그룹들을 추가\n this._nodeGroups = [...newNodesGroup, ...this._nodeGroups];\n\n // prepend 위치: 이 템플릿(SwcLoop) 노드의 바로 다음 위치 (가장 위)\n portal.insertBefore(fragment, this.nextSibling);\n }\n\n refresh(value?: any) {\n // 1. 그릴 대상 확정\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value ?? []);\n\n // 2. 화면 정리\n this.cleanup();\n\n // 3. 상태 완전 교체 (이어붙이지 않음!)\n this._value = targetValue;\n\n if (!this._value || this._value.length <= 0) return;\n\n // 4. 화면 다시 그리기 (appendItem을 쓰지 않고 바로 그리기)\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n helperSet.$templateHost = this;\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(this._value, helperSet, 0);\n\n this._nodeGroups = newNodesGroup;\n const portal = SwcUtils.getParentContainer(this);\n if (portal) {\n // console.log('append????!~~~~~!?',fragment)\n portal.insertBefore(fragment, this.nextSibling);\n }\n }\n\n private cleanup() {\n console.log('누가 cleanup');\n this._nodeGroups.forEach(nodes => nodes.forEach(n => n.parentElement?.removeChild(n)));\n this._nodeGroups = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-choose', { extends: 'template', window: w })\n class SwcChoose extends HTMLTemplateElement {\n _value: any;\n\n @attributeHost('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeHost('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n private _nodes: Node[] = [];\n private _previousTemplate: HTMLTemplateElement | null = null;\n\n get value(): any {\n return this._value;\n }\n\n set value(nv: any) {\n this._value = nv;\n this.refresh(this._value);\n }\n\n constructor() {\n super();\n // console.log('swc chooooooooooooooooooooooooose constructor called!');\n // console.log('swc cccccccss', this.getAttribute('value'));\n }\n\n // static get observedAttributes() {\n // return ['value'];\n // }\n\n attributeChangedCallback(na, o, n) {\n // console.log('-----------------choooooooose attr origin', na, o, n);\n }\n\n @changedAttributeHost('value')\n private setValue(value: any, o: string, n: string) {\n console.log('chooooooose value', value)\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeHost('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value?: any) {\n value = getAttributeValue(this, 'value') ?? this._value;\n console.log('[DEBUG] SwcChoose.refresh called, value:', value);\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) {\n console.log('[DEBUG] SwcChoose portal is null!');\n return;\n }\n\n const win = (getElementConfig(this).window ?? this.ownerDocument?.defaultView) || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const groupArgs = { ...helperSet, $value: value, $templateHost: this };\n\n const templates = Array.from(this.content.querySelectorAll('template'));\n let selected: HTMLTemplateElement | null = null;\n\n for (const t of templates) {\n if (t.getAttribute('is') === 'swc-when') {\n const attrVal = t.getAttribute('test') || '';\n let matches = false;\n\n\n\n const result = FunctionUtils.executeReturn({\n script: attrVal,\n context: t,\n args: groupArgs\n });\n matches = !!result;\n // Use ActionExpression to parse and extract script from value attribute\n // const ae = new ActionExpression(attrVal);\n // const expr = ae.getFirstExpression('replace');\n\n // if (expr) {\n // const decodedScript = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n // const result = FunctionUtils.executeReturn({\n // script: decodedScript,\n // context: t,\n // args: groupArgs\n // });\n // matches = !!result;\n // } else {\n // matches = String(attrVal) === String(value);\n // }\n\n if (matches) {\n selected = t;\n break;\n }\n }\n }\n\n const target = selected || (this.content.querySelector('template[is=\"swc-otherwise\"]') as HTMLTemplateElement);\n\n const skipValue = target?.getAttribute?.('skip-if-same');\n const skipValue2 = this._previousTemplate?.getAttribute?.('skip-if-same');\n const hasSkipIfSame = target?.hasAttribute?.('skip-if-same');\n const isSame = this._previousTemplate === target;\n // console.log('---rrrr---', this._previousTemplate, target, hasSkipIfSame, isSame, skipValue, skipValue2);\n if (hasSkipIfSame && isSame) {\n return;\n }\n\n this.cleanup();\n this._previousTemplate = target;\n\n if (target) {\n let htmlString = target.innerHTML;\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n // console.log('[DEBUG] SwcChoose processedFragment children:', processedFragment._childNodesInternal?.length);\n this._nodes = Array.from(processedFragment.childNodes);\n \n const setTemplateHost = (element: HTMLElement) => {\n (element as any).__swc_template_host = this;\n Array.from(element.children).forEach((child: any) => {\n if (child instanceof HTMLElement) {\n setTemplateHost(child);\n }\n });\n };\n \n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) {\n setTemplateHost(node as HTMLElement);\n }\n });\n\n console.log(`[DEBUG] SwcChoose before insertBefore, portal: ${portal?.tagName}, isConnected: ${(portal as any)?.isConnected}`);\n portal.insertBefore(processedFragment, this.nextSibling);\n console.log('[DEBUG] SwcChoose after insertBefore');\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-async', { extends: 'template', window: w })\n class SwcAsync extends HTMLTemplateElement {\n @attributeHost('value')\n _value: any;\n @attributeHost('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeHost('replace-wrap-end')\n _replaceWrapEnd: string | null; resultValue?: any;\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n this.executeAsync(nv);\n }\n\n private _nodes: Node[] = [];\n\n @changedAttributeHost('value')\n private setValue(valueAttr?: string | null) {\n this.executeAsync(this._value);\n }\n\n // @changedAttributeHost('replace-wrap')\n // private setReplaceWrap() {\n // this.executeAsync(this._value);\n // }\n\n private executeAsync(result: any = this._value) {\n if (result === undefined || result === null) {\n this.refresh('default');\n return;\n }\n\n if (result instanceof Promise) {\n this.refresh('loading');\n result\n .then(v => {\n this.resultValue = v;\n this.refresh('success');\n })\n .catch(e => {\n console.error('[SWC-ASYNC] Promise rejected:', e);\n this.resultValue = e;\n this.refresh('error');\n });\n } else {\n this.resultValue = result;\n this.refresh('success');\n }\n }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(state: string = 'default') {\n // console.log('rrrrrrrrrrrrrrrrr', state);\n this.cleanup();\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n const t = this.content.querySelector(`template[is=\"swc-${state}\"]`) as HTMLTemplateElement;\n if (t) {\n let htmlString = t.innerHTML;\n const groupArgs = { ...helperSet, $value: this._value, $state: state, $templateHost: this };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n const content = temp.content;\n\n this._nodes = Array.from(content.childNodes);\n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) (node as any).__template_swc_host = this;\n });\n\n portal.insertBefore(content, this.nextSibling);\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n // --- \"is\" Elements ---\n @elementDefine('swc-app-a', { extends: 'a', window: w })\n class SwcAppAnchor extends SwcAppMixin(HTMLAnchorElement) {}\n\n @elementDefine('swc-app-area', { extends: 'area', window: w })\n class SwcAppArea extends SwcAppMixin(HTMLAreaElement) {}\n\n @elementDefine('swc-app-audio', { extends: 'audio', window: w })\n class SwcAppAudio extends SwcAppMixin(HTMLAudioElement) {}\n\n @elementDefine('swc-app-base', { extends: 'base', window: w })\n class SwcAppBase extends SwcAppMixin(HTMLBaseElement) {}\n\n @elementDefine('swc-app-button', { extends: 'button', window: w })\n class SwcAppButton extends SwcAppMixin(HTMLButtonElement) {}\n\n @elementDefine('swc-app-canvas', { extends: 'canvas', window: w })\n class SwcAppCanvas extends SwcAppMixin(HTMLCanvasElement) {}\n\n @elementDefine('swc-app-data', { extends: 'data', window: w })\n class SwcAppData extends SwcAppMixin(HTMLDataElement) {}\n\n @elementDefine('swc-app-datalist', { extends: 'datalist', window: w })\n class SwcAppDataList extends SwcAppMixin(HTMLDataListElement) {}\n\n @elementDefine('swc-app-details', { extends: 'details', window: w })\n class SwcAppDetails extends SwcAppMixin(HTMLDetailsElement) {}\n\n @elementDefine('swc-app-dialog', { extends: 'dialog', window: w })\n class SwcAppDialog extends SwcAppMixin(HTMLDialogElement) {}\n\n @elementDefine('swc-app-div', { extends: 'div', window: w })\n class SwcAppDiv extends SwcAppMixin(HTMLDivElement) {}\n\n @elementDefine('swc-app-dl', { extends: 'dl', window: w })\n class SwcAppDList extends SwcAppMixin(HTMLDListElement) {}\n\n @elementDefine('swc-app-embed', { extends: 'embed', window: w })\n class SwcAppEmbed extends SwcAppMixin(HTMLEmbedElement) {}\n\n @elementDefine('swc-app-fieldset', { extends: 'fieldset', window: w })\n class SwcAppFieldSet extends SwcAppMixin(HTMLFieldSetElement) {}\n\n @elementDefine('swc-app-form', { extends: 'form', window: w })\n class SwcAppForm extends SwcAppMixin(HTMLFormElement) {}\n\n @elementDefine('swc-app-hr', { extends: 'hr', window: w })\n class SwcAppHR extends SwcAppMixin(HTMLHRElement) {}\n\n @elementDefine('swc-app-iframe', { extends: 'iframe', window: w })\n class SwcAppIFrame extends SwcAppMixin(HTMLIFrameElement) {}\n\n @elementDefine('swc-app-img', { extends: 'img', window: w })\n class SwcAppImage extends SwcAppMixin(HTMLImageElement) {}\n\n @elementDefine('swc-app-input', { extends: 'input', window: w })\n class SwcAppInput extends SwcAppMixin(HTMLInputElement) {}\n\n @elementDefine('swc-app-label', { extends: 'label', window: w })\n class SwcAppLabel extends SwcAppMixin(HTMLLabelElement) {}\n\n @elementDefine('swc-app-legend', { extends: 'legend', window: w })\n class SwcAppLegend extends SwcAppMixin(HTMLLegendElement) {}\n\n @elementDefine('swc-app-li', { extends: 'li', window: w })\n class SwcAppLI extends SwcAppMixin(HTMLLIElement) {}\n\n @elementDefine('swc-app-link', { extends: 'link', window: w })\n class SwcAppLink extends SwcAppMixin(HTMLLinkElement) {}\n\n @elementDefine('swc-app-map', { extends: 'map', window: w })\n class SwcAppMap extends SwcAppMixin(HTMLMapElement) {}\n\n @elementDefine('swc-app-meta', { extends: 'meta', window: w })\n class SwcAppMeta extends SwcAppMixin(HTMLMetaElement) {}\n\n @elementDefine('swc-app-meter', { extends: 'meter', window: w })\n class SwcAppMeter extends SwcAppMixin(HTMLMeterElement) {}\n\n @elementDefine('swc-app-del', { extends: 'del', window: w })\n class SwcAppMod extends SwcAppMixin(HTMLModElement) {}\n\n @elementDefine('swc-app-object', { extends: 'object', window: w })\n class SwcAppObject extends SwcAppMixin(HTMLObjectElement) {}\n\n @elementDefine('swc-app-ol', { extends: 'ol', window: w })\n class SwcAppOList extends SwcAppMixin(HTMLOListElement) {}\n\n @elementDefine('swc-app-optgroup', { extends: 'optgroup', window: w })\n class SwcAppOptGroup extends SwcAppMixin(HTMLOptGroupElement) {}\n\n @elementDefine('swc-app-option', { extends: 'option', window: w })\n class SwcAppOption extends SwcAppMixin(HTMLOptionElement) {}\n\n @elementDefine('swc-app-output', { extends: 'output', window: w })\n class SwcAppOutput extends SwcAppMixin(HTMLOutputElement) {}\n\n @elementDefine('swc-app-p', { extends: 'p', window: w })\n class SwcAppParagraph extends SwcAppMixin(HTMLParagraphElement) {}\n\n @elementDefine('swc-app-param', { extends: 'param', window: w })\n class SwcAppParam extends SwcAppMixin(HTMLParamElement) {}\n\n @elementDefine('swc-app-picture', { extends: 'picture', window: w })\n class SwcAppPicture extends SwcAppMixin(HTMLPictureElement) {}\n\n @elementDefine('swc-app-pre', { extends: 'pre', window: w })\n class SwcAppPre extends SwcAppMixin(HTMLPreElement) {}\n\n @elementDefine('swc-app-progress', { extends: 'progress', window: w })\n class SwcAppProgress extends SwcAppMixin(HTMLProgressElement) {}\n\n @elementDefine('swc-app-blockquote', { extends: 'blockquote', window: w })\n class SwcAppQuote extends SwcAppMixin(HTMLQuoteElement) {}\n\n @elementDefine('swc-app-script', { extends: 'script', window: w })\n class SwcAppScript extends SwcAppMixin(HTMLScriptElement) {}\n\n @elementDefine('swc-app-select', { extends: 'select', window: w })\n class SwcAppSelect extends SwcAppMixin(HTMLSelectElement) {}\n\n @elementDefine('swc-app-slot', { extends: 'slot', window: w })\n class SwcAppSlot extends SwcAppMixin(HTMLSlotElement) {}\n\n @elementDefine('swc-app-source', { extends: 'source', window: w })\n class SwcAppSource extends SwcAppMixin(HTMLSourceElement) {}\n\n @elementDefine('swc-app-span', { extends: 'span', window: w })\n class SwcAppSpan extends SwcAppMixin(HTMLSpanElement) {}\n\n @elementDefine('swc-app-style', { extends: 'style', window: w })\n class SwcAppStyle extends SwcAppMixin(HTMLStyleElement) {}\n\n @elementDefine('swc-app-table', { extends: 'table', window: w })\n class SwcAppTable extends SwcAppMixin(HTMLTableElement) {}\n\n @elementDefine('swc-app-tbody', { extends: 'tbody', window: w })\n class SwcAppTableSection extends SwcAppMixin(HTMLTableSectionElement) {}\n\n @elementDefine('swc-app-td', { extends: 'td', window: w })\n class SwcAppTableCell extends SwcAppMixin(HTMLTableCellElement) {}\n\n @elementDefine('swc-app-template', { extends: 'template', window: w })\n class SwcAppTemplate extends SwcAppMixin(HTMLTemplateElement) {}\n\n @elementDefine('swc-app-textarea', { extends: 'textarea', window: w })\n class SwcAppTextArea extends SwcAppMixin(HTMLTextAreaElement) {}\n\n @elementDefine('swc-app-time', { extends: 'time', window: w })\n class SwcAppTime extends SwcAppMixin(HTMLTimeElement) {}\n\n @elementDefine('swc-app-title', { extends: 'title', window: w })\n class SwcAppTitle extends SwcAppMixin(HTMLTitleElement) {}\n\n @elementDefine('swc-app-tr', { extends: 'tr', window: w })\n class SwcAppTableRow extends SwcAppMixin(HTMLTableRowElement) {}\n\n @elementDefine('swc-app-track', { extends: 'track', window: w })\n class SwcAppTrack extends SwcAppMixin(HTMLTrackElement) {}\n\n @elementDefine('swc-app-ul', { extends: 'ul', window: w })\n class SwcAppUList extends SwcAppMixin(HTMLUListElement) {}\n\n @elementDefine('swc-app-video', { extends: 'video', window: w })\n class SwcAppVideo extends SwcAppMixin(HTMLVideoElement) {}\n\n @elementDefine('swc-app-h1', { extends: 'h1', window: w })\n class SwcAppHeading extends SwcAppMixin(HTMLHeadingElement) {}\n\n @elementDefine('swc-app-body', { extends: 'body', window: w })\n class SwcAppBody extends SwcAppMixin(HTMLBodyElement) {}\n\n\n return {\n // Sub Templates\n SwcLoading,\n SwcError,\n SwcSuccess,\n SwcWhen,\n SwcOtherwise,\n SwcDefault,\n // Core Elements\n SwcApp,\n SwcIf,\n SwcLoop,\n SwcChoose,\n SwcAsync,\n // App Elements\n SwcAppAnchor,\n SwcAppArea,\n SwcAppAudio,\n SwcAppBase,\n SwcAppButton,\n SwcAppCanvas,\n SwcAppData,\n SwcAppDataList,\n SwcAppDetails,\n SwcAppDialog,\n SwcAppDiv,\n SwcAppDList,\n SwcAppEmbed,\n SwcAppFieldSet,\n SwcAppForm,\n SwcAppHR,\n SwcAppIFrame,\n SwcAppImage,\n SwcAppInput,\n SwcAppLabel,\n SwcAppLegend,\n SwcAppLI,\n SwcAppLink,\n SwcAppMap,\n SwcAppMeta,\n SwcAppMeter,\n SwcAppMod,\n SwcAppObject,\n SwcAppOList,\n SwcAppOptGroup,\n SwcAppOption,\n SwcAppOutput,\n SwcAppParagraph,\n SwcAppParam,\n SwcAppPicture,\n SwcAppPre,\n SwcAppProgress,\n SwcAppQuote,\n SwcAppScript,\n SwcAppSelect,\n SwcAppSlot,\n SwcAppSource,\n SwcAppSpan,\n SwcAppStyle,\n SwcAppTable,\n SwcAppTableSection,\n SwcAppTableCell,\n SwcAppTemplate,\n SwcAppTextArea,\n SwcAppTime,\n SwcAppTitle,\n SwcAppTableRow,\n SwcAppTrack,\n SwcAppUList,\n SwcAppVideo,\n SwcAppHeading,\n SwcAppBody,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import { getElementConfig, elementDefine, attributeThis, changedAttributeThis, getAttributeValue } from '../decorators';\nimport { SwcAppMixin } from './SwcAppMixin';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils,ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\n\ntype Constructor<T> = new (...args: any[]) => T;\n\nexport const registerAllElements = (w: any): Record<string, Constructor<HTMLElement>> => {\n const {\n HTMLElement: _HTMLElement,\n HTMLTemplateElement: _HTMLTemplateElement,\n DocumentFragment: _DocumentFragment,\n Node: _Node,\n Element: _Element,\n HTMLAnchorElement: _HTMLAnchorElement,\n HTMLAreaElement: _HTMLAreaElement,\n HTMLAudioElement: _HTMLAudioElement,\n HTMLBaseElement: _HTMLBaseElement,\n HTMLButtonElement: _HTMLButtonElement,\n HTMLCanvasElement: _HTMLCanvasElement,\n HTMLDataElement: _HTMLDataElement,\n HTMLDataListElement: _HTMLDataListElement,\n HTMLDetailsElement: _HTMLDetailsElement,\n HTMLDialogElement: _HTMLDialogElement,\n HTMLDivElement: _HTMLDivElement,\n HTMLDListElement: _HTMLDListElement,\n HTMLEmbedElement: _HTMLEmbedElement,\n HTMLFieldSetElement: _HTMLFieldSetElement,\n HTMLFormElement: _HTMLFormElement,\n HTMLHRElement: _HTMLHRElement,\n HTMLIFrameElement: _HTMLIFrameElement,\n HTMLImageElement: _HTMLImageElement,\n HTMLInputElement: _HTMLInputElement,\n HTMLLabelElement: _HTMLLabelElement,\n HTMLLegendElement: _HTMLLegendElement,\n HTMLLIElement: _HTMLLIElement,\n HTMLLinkElement: _HTMLLinkElement,\n HTMLMapElement: _HTMLMapElement,\n HTMLMetaElement: _HTMLMetaElement,\n HTMLMeterElement: _HTMLMeterElement,\n HTMLModElement: _HTMLModElement,\n HTMLObjectElement: _HTMLObjectElement,\n HTMLOListElement: _HTMLOListElement,\n HTMLOptGroupElement: _HTMLOptGroupElement,\n HTMLOptionElement: _HTMLOptionElement,\n HTMLOutputElement: _HTMLOutputElement,\n HTMLParagraphElement: _HTMLParagraphElement,\n HTMLParamElement: _HTMLParamElement,\n HTMLPictureElement: _HTMLPictureElement,\n HTMLPreElement: _HTMLPreElement,\n HTMLProgressElement: _HTMLProgressElement,\n HTMLQuoteElement: _HTMLQuoteElement,\n HTMLScriptElement: _HTMLScriptElement,\n HTMLSelectElement: _HTMLSelectElement,\n HTMLSlotElement: _HTMLSlotElement,\n HTMLSourceElement: _HTMLSourceElement,\n HTMLSpanElement: _HTMLSpanElement,\n HTMLStyleElement: _HTMLStyleElement,\n HTMLTableElement: _HTMLTableElement,\n HTMLTableSectionElement: _HTMLTableSectionElement,\n HTMLTableCellElement: _HTMLTableCellElement,\n HTMLTextAreaElement: _HTMLTextAreaElement,\n HTMLTimeElement: _HTMLTimeElement,\n HTMLTitleElement: _HTMLTitleElement,\n HTMLTableRowElement: _HTMLTableRowElement,\n HTMLTrackElement: _HTMLTrackElement,\n HTMLUListElement: _HTMLUListElement,\n HTMLVideoElement: _HTMLVideoElement,\n HTMLHeadingElement: _HTMLHeadingElement,\n HTMLBodyElement: _HTMLBodyElement,\n } = w as any;\n\n const HTMLElement = _HTMLElement as typeof globalThis.HTMLElement;\n const HTMLTemplateElement = _HTMLTemplateElement as typeof globalThis.HTMLTemplateElement;\n const DocumentFragment = _DocumentFragment as typeof globalThis.DocumentFragment;\n const Node = _Node as typeof globalThis.Node;\n const Element = _Element as typeof globalThis.Element;\n const HTMLAnchorElement = _HTMLAnchorElement as typeof globalThis.HTMLAnchorElement;\n const HTMLAreaElement = _HTMLAreaElement as typeof globalThis.HTMLAreaElement;\n const HTMLAudioElement = _HTMLAudioElement as typeof globalThis.HTMLAudioElement;\n const HTMLBaseElement = _HTMLBaseElement as typeof globalThis.HTMLBaseElement;\n const HTMLButtonElement = _HTMLButtonElement as typeof globalThis.HTMLButtonElement;\n const HTMLCanvasElement = _HTMLCanvasElement as typeof globalThis.HTMLCanvasElement;\n const HTMLDataElement = _HTMLDataElement as typeof globalThis.HTMLDataElement;\n const HTMLDataListElement = _HTMLDataListElement as typeof globalThis.HTMLDataListElement;\n const HTMLDetailsElement = _HTMLDetailsElement as typeof globalThis.HTMLDetailsElement;\n const HTMLDialogElement = _HTMLDialogElement as typeof globalThis.HTMLDialogElement;\n const HTMLDivElement = _HTMLDivElement as typeof globalThis.HTMLDivElement;\n const HTMLDListElement = _HTMLDListElement as typeof globalThis.HTMLDListElement;\n const HTMLEmbedElement = _HTMLEmbedElement as typeof globalThis.HTMLEmbedElement;\n const HTMLFieldSetElement = _HTMLFieldSetElement as typeof globalThis.HTMLFieldSetElement;\n const HTMLFormElement = _HTMLFormElement as typeof globalThis.HTMLFormElement;\n const HTMLHRElement = _HTMLHRElement as typeof globalThis.HTMLHRElement;\n const HTMLIFrameElement = _HTMLIFrameElement as typeof globalThis.HTMLIFrameElement;\n const HTMLImageElement = _HTMLImageElement as typeof globalThis.HTMLImageElement;\n const HTMLInputElement = _HTMLInputElement as typeof globalThis.HTMLInputElement;\n const HTMLLabelElement = _HTMLLabelElement as typeof globalThis.HTMLLabelElement;\n const HTMLLegendElement = _HTMLLegendElement as typeof globalThis.HTMLLegendElement;\n const HTMLLIElement = _HTMLLIElement as typeof globalThis.HTMLLIElement;\n const HTMLLinkElement = _HTMLLinkElement as typeof globalThis.HTMLLinkElement;\n const HTMLMapElement = _HTMLMapElement as typeof globalThis.HTMLMapElement;\n const HTMLMetaElement = _HTMLMetaElement as typeof globalThis.HTMLMetaElement;\n const HTMLMeterElement = _HTMLMeterElement as typeof globalThis.HTMLMeterElement;\n const HTMLModElement = _HTMLModElement as typeof globalThis.HTMLModElement;\n const HTMLObjectElement = _HTMLObjectElement as typeof globalThis.HTMLObjectElement;\n const HTMLOListElement = _HTMLOListElement as typeof globalThis.HTMLOListElement;\n const HTMLOptGroupElement = _HTMLOptGroupElement as typeof globalThis.HTMLOptGroupElement;\n const HTMLOptionElement = _HTMLOptionElement as typeof globalThis.HTMLOptionElement;\n const HTMLOutputElement = _HTMLOutputElement as typeof globalThis.HTMLOutputElement;\n const HTMLParagraphElement = _HTMLParagraphElement as typeof globalThis.HTMLParagraphElement;\n const HTMLParamElement = _HTMLParamElement as typeof globalThis.HTMLParamElement;\n const HTMLPictureElement = _HTMLPictureElement as typeof globalThis.HTMLPictureElement;\n const HTMLPreElement = _HTMLPreElement as typeof globalThis.HTMLPreElement;\n const HTMLProgressElement = _HTMLProgressElement as typeof globalThis.HTMLProgressElement;\n const HTMLQuoteElement = _HTMLQuoteElement as typeof globalThis.HTMLQuoteElement;\n const HTMLScriptElement = _HTMLScriptElement as typeof globalThis.HTMLScriptElement;\n const HTMLSelectElement = _HTMLSelectElement as typeof globalThis.HTMLSelectElement;\n const HTMLSlotElement = _HTMLSlotElement as typeof globalThis.HTMLSlotElement;\n const HTMLSourceElement = _HTMLSourceElement as typeof globalThis.HTMLSourceElement;\n const HTMLSpanElement = _HTMLSpanElement as typeof globalThis.HTMLSpanElement;\n const HTMLStyleElement = _HTMLStyleElement as typeof globalThis.HTMLStyleElement;\n const HTMLTableElement = _HTMLTableElement as typeof globalThis.HTMLTableElement;\n const HTMLTableSectionElement = _HTMLTableSectionElement as typeof globalThis.HTMLTableSectionElement;\n const HTMLTableCellElement = _HTMLTableCellElement as typeof globalThis.HTMLTableCellElement;\n const HTMLTextAreaElement = _HTMLTextAreaElement as typeof globalThis.HTMLTextAreaElement;\n const HTMLTimeElement = _HTMLTimeElement as typeof globalThis.HTMLTimeElement;\n const HTMLTitleElement = _HTMLTitleElement as typeof globalThis.HTMLTitleElement;\n const HTMLTableRowElement = _HTMLTableRowElement as typeof globalThis.HTMLTableRowElement;\n const HTMLTrackElement = _HTMLTrackElement as typeof globalThis.HTMLTrackElement;\n const HTMLUListElement = _HTMLUListElement as typeof globalThis.HTMLUListElement;\n const HTMLVideoElement = _HTMLVideoElement as typeof globalThis.HTMLVideoElement;\n const HTMLHeadingElement = _HTMLHeadingElement as typeof globalThis.HTMLHeadingElement;\n const HTMLBodyElement = _HTMLBodyElement as typeof globalThis.HTMLBodyElement;\n\n\n // --- Sub Templates ---\n @elementDefine('swc-loading', { extends: 'template', window: w }) class SwcLoading extends HTMLTemplateElement {}\n @elementDefine('swc-error', { extends: 'template', window: w }) class SwcError extends HTMLTemplateElement {}\n @elementDefine('swc-success', { extends: 'template', window: w }) class SwcSuccess extends HTMLTemplateElement {}\n @elementDefine('swc-when', { extends: 'template', window: w }) class SwcWhen extends HTMLTemplateElement {}\n @elementDefine('swc-otherwise', { extends: 'template', window: w }) class SwcOtherwise extends HTMLTemplateElement {}\n @elementDefine('swc-default', { extends: 'template', window: w }) class SwcDefault extends HTMLTemplateElement {}\n\n // --- Core Elements ---\n @elementDefine('swc-app', { window: w })\n class SwcApp extends SwcAppMixin(HTMLElement) {}\n\n @elementDefine('swc-if', { extends: 'template', window: w })\n class SwcIf extends HTMLTemplateElement {\n // id =\n // @attributeThis('value')\n _value: any;\n\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n @attributeThis('skip-if-same')\n _skipIfSame: string | null;\n\n private _nodes: Node[] = [];\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n // this._value = nv;\n this.refresh(nv);\n }\n\n constructor() {\n super();\n }\n\n @changedAttributeThis('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value?: any) {\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value);\n\n // skip-if-same 속성이 존재하고(true/빈 문자열), 이전 값과 새로운 값이 완전히 동일하면 렌더링 스킵!\n if (this.hasAttribute('skip-if-same') && this._value === targetValue && this._nodes.length > 0) {\n return;\n }\n\n this.cleanup();\n this._value = targetValue;\n\n const portal = this.parentElement;\n if (!portal || !this._value) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $value: this._value, $templateHost: this };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n this._nodes = Array.from(processedFragment.childNodes);\n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) (node as any).__swc_template_host = this;\n });\n\n portal.insertBefore(processedFragment, this.nextSibling);\n }\n\n private cleanup() {\n this._nodes.forEach(n => {\n const realNode = (n as any).__upgraded_instance || n;\n if (realNode.parentElement) {\n realNode.parentElement.removeChild(realNode);\n }\n });\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-loop', { extends: 'template', window: w })\n class SwcLoop extends HTMLTemplateElement {\n _value: any[] = [];\n\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n private _nodeGroups: Node[][] = [];\n\n get value(): any[] {\n return this._value;\n }\n\n set value(nv: any[]) {\n this._value = nv;\n this.refresh(nv);\n }\n\n getValue(index: number) {\n return this._value?.[index];\n }\n\n constructor() {\n super();\n // console.log('swc SwcLoop constructor called!');\n // console.log('swc SwcLoop', this.getAttribute('value'));\n }\n\n @changedAttributeThis('value')\n private setValue(value: any, o: string, n: string) {\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n const expressions = ae.getExpressions('replace');\n for (const expr of expressions) {\n const script = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n try {\n const value = FunctionUtils.executeReturn({\n script: script,\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n private createFragmentAndNodes(items: any[], helperSet: any, startIndex: number = 0): { fragment: DocumentFragment; newNodesGroup: Node[][] } {\n const win = this.ownerDocument?.defaultView || window;\n const fragment = win.document.createDocumentFragment();\n const newNodesGroup: Node[][] = [];\n\n items.forEach((item, i) => {\n const index = startIndex + i;\n let htmlString = this.innerHTML;\n const groupArgs = { ...helperSet, $item: item, $index: index, $value: this._value };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n\n const content = temp.content;\n const nodes = Array.from(content.childNodes);\n\n const setTemplateHost = (element: HTMLElement) => {\n (element as any).__swc_template_host = this;\n Array.from(element.children).forEach((child: any) => {\n if (child instanceof HTMLElement) {\n setTemplateHost(child);\n }\n });\n };\n\n nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) {\n setTemplateHost(node as HTMLElement);\n }\n });\n newNodesGroup.push(nodes);\n fragment.appendChild(content);\n });\n\n return { fragment, newNodesGroup };\n }\n\n appendItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n const startIndex = this._value ? this._value.length : 0;\n\n // 내부 상태(value) 업데이트 (기존 배열에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...(this._value || []), ...items];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, startIndex);\n this._nodeGroups.push(...newNodesGroup);\n\n console.log('뭐야 씨발');\n // append 위치 계산: 기존에 그려진 마지막 노드 뒤에 삽입, 없으면 템플릿 바로 뒤에 삽입\n let insertReference: Node | null = this.nextSibling;\n if (this._nodeGroups.length > items.length) {\n const lastExistingGroup = this._nodeGroups[this._nodeGroups.length - items.length - 1];\n if (lastExistingGroup && lastExistingGroup.length > 0) {\n const lastNode = lastExistingGroup[lastExistingGroup.length - 1];\n insertReference = lastNode.nextSibling;\n }\n }\n\n portal.insertBefore(fragment, insertReference);\n }\n\n async prependItem(...items: any[]) {\n if (!items || items.length <= 0) return;\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n // 내부 상태(value) 업데이트 (기존 배열의 앞쪽에 새 아이템 추가)\n if (this._value !== items) {\n this._value = [...items, ...(this._value || [])];\n }\n\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(items, helperSet, 0);\n\n // 기존의 nodeGroups 배열 맨 앞에 새로운 그룹들을 추가\n this._nodeGroups = [...newNodesGroup, ...this._nodeGroups];\n\n // prepend 위치: 이 템플릿(SwcLoop) 노드의 바로 다음 위치 (가장 위)\n portal.insertBefore(fragment, this.nextSibling);\n }\n\n refresh(value?: any) {\n // 1. 그릴 대상 확정\n const targetValue = value !== undefined ? value : (getAttributeValue(this, 'value') ?? this._value ?? []);\n\n // 2. 화면 정리\n this.cleanup();\n\n // 3. 상태 완전 교체 (이어붙이지 않음!)\n this._value = targetValue;\n\n if (!this._value || this._value.length <= 0) return;\n\n // 4. 화면 다시 그리기 (appendItem을 쓰지 않고 바로 그리기)\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n helperSet.$templateHost = this;\n const { fragment, newNodesGroup } = this.createFragmentAndNodes(this._value, helperSet, 0);\n\n this._nodeGroups = newNodesGroup;\n const portal = SwcUtils.getParentContainer(this);\n if (portal) {\n // console.log('append????!~~~~~!?',fragment)\n portal.insertBefore(fragment, this.nextSibling);\n }\n }\n\n private cleanup() {\n console.log('누가 cleanup');\n this._nodeGroups.forEach(nodes => nodes.forEach(n => n.parentElement?.removeChild(n)));\n this._nodeGroups = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-choose', { extends: 'template', window: w })\n class SwcChoose extends HTMLTemplateElement {\n _value: any;\n\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null;\n\n private _nodes: Node[] = [];\n private _previousTemplate: HTMLTemplateElement | null = null;\n\n get value(): any {\n return this._value;\n }\n\n set value(nv: any) {\n this._value = nv;\n this.refresh(this._value);\n }\n\n constructor() {\n super();\n // console.log('swc chooooooooooooooooooooooooose constructor called!');\n // console.log('swc cccccccss', this.getAttribute('value'));\n }\n\n // static get observedAttributes() {\n // return ['value'];\n // }\n\n attributeChangedCallback(na, o, n) {\n // console.log('-----------------choooooooose attr origin', na, o, n);\n }\n\n @changedAttributeThis('value')\n private setValue(value: any, o: string, n: string) {\n console.log('chooooooose value', value)\n this._value = value;\n this.refresh(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap(replaceWrapAttr?: string | null) {\n // this.refresh();\n // }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(value?: any) {\n value = getAttributeValue(this, 'value') ?? this._value;\n console.log('[DEBUG] SwcChoose.refresh called, value:', value);\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) {\n console.log('[DEBUG] SwcChoose portal is null!');\n return;\n }\n\n const win = (getElementConfig(this).window ?? this.ownerDocument?.defaultView) || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const groupArgs = { ...helperSet, $value: value, $templateHost: this };\n\n const templates = Array.from(this.content.querySelectorAll('template'));\n let selected: HTMLTemplateElement | null = null;\n\n for (const t of templates) {\n if (t.getAttribute('is') === 'swc-when') {\n const attrVal = t.getAttribute('test') || '';\n let matches = false;\n\n\n\n const result = FunctionUtils.executeReturn({\n script: attrVal,\n context: t,\n args: groupArgs\n });\n matches = !!result;\n // Use ActionExpression to parse and extract script from value attribute\n // const ae = new ActionExpression(attrVal);\n // const expr = ae.getFirstExpression('replace');\n\n // if (expr) {\n // const decodedScript = ConvertUtils.decodeHtmlEntity(expr.script, win.document);\n // const result = FunctionUtils.executeReturn({\n // script: decodedScript,\n // context: t,\n // args: groupArgs\n // });\n // matches = !!result;\n // } else {\n // matches = String(attrVal) === String(value);\n // }\n\n if (matches) {\n selected = t;\n break;\n }\n }\n }\n\n const target = selected || (this.content.querySelector('template[is=\"swc-otherwise\"]') as HTMLTemplateElement);\n\n const skipValue = target?.getAttribute?.('skip-if-same');\n const skipValue2 = this._previousTemplate?.getAttribute?.('skip-if-same');\n const hasSkipIfSame = target?.hasAttribute?.('skip-if-same');\n const isSame = this._previousTemplate === target;\n // console.log('---rrrr---', this._previousTemplate, target, hasSkipIfSame, isSame, skipValue, skipValue2);\n if (hasSkipIfSame && isSame) {\n return;\n }\n\n this.cleanup();\n this._previousTemplate = target;\n\n if (target) {\n let htmlString = target.innerHTML;\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const result = this.ownerDocument?.createElement('template') || document.createElement('template');\n result.innerHTML = htmlString;\n const processedFragment = result.content;\n\n // console.log('[DEBUG] SwcChoose processedFragment children:', processedFragment._childNodesInternal?.length);\n this._nodes = Array.from(processedFragment.childNodes);\n \n const setTemplateHost = (element: HTMLElement) => {\n (element as any).__swc_template_host = this;\n Array.from(element.children).forEach((child: any) => {\n if (child instanceof HTMLElement) {\n setTemplateHost(child);\n }\n });\n };\n \n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) {\n setTemplateHost(node as HTMLElement);\n }\n });\n\n console.log(`[DEBUG] SwcChoose before insertBefore, portal: ${portal?.tagName}, isConnected: ${(portal as any)?.isConnected}`);\n portal.insertBefore(processedFragment, this.nextSibling);\n console.log('[DEBUG] SwcChoose after insertBefore');\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n @elementDefine('swc-async', { extends: 'template', window: w })\n class SwcAsync extends HTMLTemplateElement {\n @attributeThis('value')\n _value: any;\n @attributeThis('replace-wrap-start')\n _replaceWrapStart: string | null;\n @attributeThis('replace-wrap-end')\n _replaceWrapEnd: string | null; resultValue?: any;\n\n get value(): boolean {\n return this._value;\n }\n\n set value(nv: any) {\n this.executeAsync(nv);\n }\n\n private _nodes: Node[] = [];\n\n @changedAttributeThis('value')\n private setValue(valueAttr?: string | null) {\n this.executeAsync(this._value);\n }\n\n // @changedAttributeThis('replace-wrap')\n // private setReplaceWrap() {\n // this.executeAsync(this._value);\n // }\n\n private executeAsync(result: any = this._value) {\n if (result === undefined || result === null) {\n this.refresh('default');\n return;\n }\n\n if (result instanceof Promise) {\n this.refresh('loading');\n result\n .then(v => {\n this.resultValue = v;\n this.refresh('success');\n })\n .catch(e => {\n console.error('[SWC-ASYNC] Promise rejected:', e);\n this.resultValue = e;\n this.refresh('error');\n });\n } else {\n this.resultValue = result;\n this.refresh('success');\n }\n }\n\n private replaceExpressions(html: string, groupArgs: any, context: any, wrap: {start: string, end: string}): string {\n let config: any = undefined;\n if (wrap) {\n config = {\n expression: {\n replace: { start: `${wrap.start}`, end: `${wrap.end}` },\n callReturn: { start: `${wrap.start}=`, end: `${wrap.end}` },\n call: { start: `${wrap.start}@`, end: `${wrap.end}` }\n }\n };\n }\n const ae = new ActionExpression(html, config);\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions('replace')) {\n try {\n const value = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),\n context,\n args: groupArgs\n });\n ae.replace(expr, String(value));\n } catch (e) {\n console.error(`[SWC] Failed to execute ${expr.original}:`, e);\n }\n }\n return ae.getUnprocessedTemplate();\n }\n\n refresh(state: string = 'default') {\n // console.log('rrrrrrrrrrrrrrrrr', state);\n this.cleanup();\n const portal = SwcUtils.getParentContainer(this);\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n\n const t = this.content.querySelector(`template[is=\"swc-${state}\"]`) as HTMLTemplateElement;\n if (t) {\n let htmlString = t.innerHTML;\n const groupArgs = { ...helperSet, $value: this._value, $state: state, $templateHost: this };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, {start:this._replaceWrapStart ?? '{#{', end: this._replaceWrapEnd ?? '}#}'});\n\n const temp = this.ownerDocument?.createElement('template') || document.createElement('template');\n temp.innerHTML = htmlString;\n const content = temp.content;\n\n this._nodes = Array.from(content.childNodes);\n this._nodes.forEach((node: any) => {\n if (node instanceof HTMLElement) (node as any).__template_swc_host = this;\n });\n\n portal.insertBefore(content, this.nextSibling);\n }\n }\n\n private cleanup() {\n this._nodes.forEach(n => n.parentElement?.removeChild(n));\n this._nodes = [];\n }\n\n disconnectedCallback() {\n this.cleanup();\n }\n }\n\n // --- \"is\" Elements ---\n @elementDefine('swc-app-a', { extends: 'a', window: w })\n class SwcAppAnchor extends SwcAppMixin(HTMLAnchorElement) {}\n\n @elementDefine('swc-app-area', { extends: 'area', window: w })\n class SwcAppArea extends SwcAppMixin(HTMLAreaElement) {}\n\n @elementDefine('swc-app-audio', { extends: 'audio', window: w })\n class SwcAppAudio extends SwcAppMixin(HTMLAudioElement) {}\n\n @elementDefine('swc-app-base', { extends: 'base', window: w })\n class SwcAppBase extends SwcAppMixin(HTMLBaseElement) {}\n\n @elementDefine('swc-app-button', { extends: 'button', window: w })\n class SwcAppButton extends SwcAppMixin(HTMLButtonElement) {}\n\n @elementDefine('swc-app-canvas', { extends: 'canvas', window: w })\n class SwcAppCanvas extends SwcAppMixin(HTMLCanvasElement) {}\n\n @elementDefine('swc-app-data', { extends: 'data', window: w })\n class SwcAppData extends SwcAppMixin(HTMLDataElement) {}\n\n @elementDefine('swc-app-datalist', { extends: 'datalist', window: w })\n class SwcAppDataList extends SwcAppMixin(HTMLDataListElement) {}\n\n @elementDefine('swc-app-details', { extends: 'details', window: w })\n class SwcAppDetails extends SwcAppMixin(HTMLDetailsElement) {}\n\n @elementDefine('swc-app-dialog', { extends: 'dialog', window: w })\n class SwcAppDialog extends SwcAppMixin(HTMLDialogElement) {}\n\n @elementDefine('swc-app-div', { extends: 'div', window: w })\n class SwcAppDiv extends SwcAppMixin(HTMLDivElement) {}\n\n @elementDefine('swc-app-dl', { extends: 'dl', window: w })\n class SwcAppDList extends SwcAppMixin(HTMLDListElement) {}\n\n @elementDefine('swc-app-embed', { extends: 'embed', window: w })\n class SwcAppEmbed extends SwcAppMixin(HTMLEmbedElement) {}\n\n @elementDefine('swc-app-fieldset', { extends: 'fieldset', window: w })\n class SwcAppFieldSet extends SwcAppMixin(HTMLFieldSetElement) {}\n\n @elementDefine('swc-app-form', { extends: 'form', window: w })\n class SwcAppForm extends SwcAppMixin(HTMLFormElement) {}\n\n @elementDefine('swc-app-hr', { extends: 'hr', window: w })\n class SwcAppHR extends SwcAppMixin(HTMLHRElement) {}\n\n @elementDefine('swc-app-iframe', { extends: 'iframe', window: w })\n class SwcAppIFrame extends SwcAppMixin(HTMLIFrameElement) {}\n\n @elementDefine('swc-app-img', { extends: 'img', window: w })\n class SwcAppImage extends SwcAppMixin(HTMLImageElement) {}\n\n @elementDefine('swc-app-input', { extends: 'input', window: w })\n class SwcAppInput extends SwcAppMixin(HTMLInputElement) {}\n\n @elementDefine('swc-app-label', { extends: 'label', window: w })\n class SwcAppLabel extends SwcAppMixin(HTMLLabelElement) {}\n\n @elementDefine('swc-app-legend', { extends: 'legend', window: w })\n class SwcAppLegend extends SwcAppMixin(HTMLLegendElement) {}\n\n @elementDefine('swc-app-li', { extends: 'li', window: w })\n class SwcAppLI extends SwcAppMixin(HTMLLIElement) {}\n\n @elementDefine('swc-app-link', { extends: 'link', window: w })\n class SwcAppLink extends SwcAppMixin(HTMLLinkElement) {}\n\n @elementDefine('swc-app-map', { extends: 'map', window: w })\n class SwcAppMap extends SwcAppMixin(HTMLMapElement) {}\n\n @elementDefine('swc-app-meta', { extends: 'meta', window: w })\n class SwcAppMeta extends SwcAppMixin(HTMLMetaElement) {}\n\n @elementDefine('swc-app-meter', { extends: 'meter', window: w })\n class SwcAppMeter extends SwcAppMixin(HTMLMeterElement) {}\n\n @elementDefine('swc-app-del', { extends: 'del', window: w })\n class SwcAppMod extends SwcAppMixin(HTMLModElement) {}\n\n @elementDefine('swc-app-object', { extends: 'object', window: w })\n class SwcAppObject extends SwcAppMixin(HTMLObjectElement) {}\n\n @elementDefine('swc-app-ol', { extends: 'ol', window: w })\n class SwcAppOList extends SwcAppMixin(HTMLOListElement) {}\n\n @elementDefine('swc-app-optgroup', { extends: 'optgroup', window: w })\n class SwcAppOptGroup extends SwcAppMixin(HTMLOptGroupElement) {}\n\n @elementDefine('swc-app-option', { extends: 'option', window: w })\n class SwcAppOption extends SwcAppMixin(HTMLOptionElement) {}\n\n @elementDefine('swc-app-output', { extends: 'output', window: w })\n class SwcAppOutput extends SwcAppMixin(HTMLOutputElement) {}\n\n @elementDefine('swc-app-p', { extends: 'p', window: w })\n class SwcAppParagraph extends SwcAppMixin(HTMLParagraphElement) {}\n\n @elementDefine('swc-app-param', { extends: 'param', window: w })\n class SwcAppParam extends SwcAppMixin(HTMLParamElement) {}\n\n @elementDefine('swc-app-picture', { extends: 'picture', window: w })\n class SwcAppPicture extends SwcAppMixin(HTMLPictureElement) {}\n\n @elementDefine('swc-app-pre', { extends: 'pre', window: w })\n class SwcAppPre extends SwcAppMixin(HTMLPreElement) {}\n\n @elementDefine('swc-app-progress', { extends: 'progress', window: w })\n class SwcAppProgress extends SwcAppMixin(HTMLProgressElement) {}\n\n @elementDefine('swc-app-blockquote', { extends: 'blockquote', window: w })\n class SwcAppQuote extends SwcAppMixin(HTMLQuoteElement) {}\n\n @elementDefine('swc-app-script', { extends: 'script', window: w })\n class SwcAppScript extends SwcAppMixin(HTMLScriptElement) {}\n\n @elementDefine('swc-app-select', { extends: 'select', window: w })\n class SwcAppSelect extends SwcAppMixin(HTMLSelectElement) {}\n\n @elementDefine('swc-app-slot', { extends: 'slot', window: w })\n class SwcAppSlot extends SwcAppMixin(HTMLSlotElement) {}\n\n @elementDefine('swc-app-source', { extends: 'source', window: w })\n class SwcAppSource extends SwcAppMixin(HTMLSourceElement) {}\n\n @elementDefine('swc-app-span', { extends: 'span', window: w })\n class SwcAppSpan extends SwcAppMixin(HTMLSpanElement) {}\n\n @elementDefine('swc-app-style', { extends: 'style', window: w })\n class SwcAppStyle extends SwcAppMixin(HTMLStyleElement) {}\n\n @elementDefine('swc-app-table', { extends: 'table', window: w })\n class SwcAppTable extends SwcAppMixin(HTMLTableElement) {}\n\n @elementDefine('swc-app-tbody', { extends: 'tbody', window: w })\n class SwcAppTableSection extends SwcAppMixin(HTMLTableSectionElement) {}\n\n @elementDefine('swc-app-td', { extends: 'td', window: w })\n class SwcAppTableCell extends SwcAppMixin(HTMLTableCellElement) {}\n\n @elementDefine('swc-app-template', { extends: 'template', window: w })\n class SwcAppTemplate extends SwcAppMixin(HTMLTemplateElement) {}\n\n @elementDefine('swc-app-textarea', { extends: 'textarea', window: w })\n class SwcAppTextArea extends SwcAppMixin(HTMLTextAreaElement) {}\n\n @elementDefine('swc-app-time', { extends: 'time', window: w })\n class SwcAppTime extends SwcAppMixin(HTMLTimeElement) {}\n\n @elementDefine('swc-app-title', { extends: 'title', window: w })\n class SwcAppTitle extends SwcAppMixin(HTMLTitleElement) {}\n\n @elementDefine('swc-app-tr', { extends: 'tr', window: w })\n class SwcAppTableRow extends SwcAppMixin(HTMLTableRowElement) {}\n\n @elementDefine('swc-app-track', { extends: 'track', window: w })\n class SwcAppTrack extends SwcAppMixin(HTMLTrackElement) {}\n\n @elementDefine('swc-app-ul', { extends: 'ul', window: w })\n class SwcAppUList extends SwcAppMixin(HTMLUListElement) {}\n\n @elementDefine('swc-app-video', { extends: 'video', window: w })\n class SwcAppVideo extends SwcAppMixin(HTMLVideoElement) {}\n\n @elementDefine('swc-app-h1', { extends: 'h1', window: w })\n class SwcAppHeading extends SwcAppMixin(HTMLHeadingElement) {}\n\n @elementDefine('swc-app-body', { extends: 'body', window: w })\n class SwcAppBody extends SwcAppMixin(HTMLBodyElement) {}\n\n\n return {\n // Sub Templates\n SwcLoading,\n SwcError,\n SwcSuccess,\n SwcWhen,\n SwcOtherwise,\n SwcDefault,\n // Core Elements\n SwcApp,\n SwcIf,\n SwcLoop,\n SwcChoose,\n SwcAsync,\n // App Elements\n SwcAppAnchor,\n SwcAppArea,\n SwcAppAudio,\n SwcAppBase,\n SwcAppButton,\n SwcAppCanvas,\n SwcAppData,\n SwcAppDataList,\n SwcAppDetails,\n SwcAppDialog,\n SwcAppDiv,\n SwcAppDList,\n SwcAppEmbed,\n SwcAppFieldSet,\n SwcAppForm,\n SwcAppHR,\n SwcAppIFrame,\n SwcAppImage,\n SwcAppInput,\n SwcAppLabel,\n SwcAppLegend,\n SwcAppLI,\n SwcAppLink,\n SwcAppMap,\n SwcAppMeta,\n SwcAppMeter,\n SwcAppMod,\n SwcAppObject,\n SwcAppOList,\n SwcAppOptGroup,\n SwcAppOption,\n SwcAppOutput,\n SwcAppParagraph,\n SwcAppParam,\n SwcAppPicture,\n SwcAppPre,\n SwcAppProgress,\n SwcAppQuote,\n SwcAppScript,\n SwcAppSelect,\n SwcAppSlot,\n SwcAppSource,\n SwcAppSpan,\n SwcAppStyle,\n SwcAppTable,\n SwcAppTableSection,\n SwcAppTableCell,\n SwcAppTemplate,\n SwcAppTextArea,\n SwcAppTime,\n SwcAppTitle,\n SwcAppTableRow,\n SwcAppTrack,\n SwcAppUList,\n SwcAppVideo,\n SwcAppHeading,\n SwcAppBody,\n };\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA,wBAAwG;AACxG,yBAA4B;AAC5B,mBAAyB;AACzB,kBAA+C;AAC/C,sBAA6B;;;;;;;;;;AAItB,MAAM,sBAAsB,CAAC,MAAoD;AACtF,QAAM,EACJ,aAAa,cACb,qBAAqB,sBACrB,kBAAkB,mBAClB,MAAM,OACN,SAAS,UACT,mBAAmB,oBACnB,iBAAiB,kBACjB,kBAAkB,mBAClB,iBAAiB,kBACjB,mBAAmB,oBACnB,mBAAmB,oBACnB,iBAAiB,kBACjB,qBAAqB,sBACrB,oBAAoB,qBACpB,mBAAmB,oBACnB,gBAAgB,iBAChB,kBAAkB,mBAClB,kBAAkB,mBAClB,qBAAqB,sBACrB,iBAAiB,kBACjB,eAAe,gBACf,mBAAmB,oBACnB,kBAAkB,mBAClB,kBAAkB,mBAClB,kBAAkB,mBAClB,mBAAmB,oBACnB,eAAe,gBACf,iBAAiB,kBACjB,gBAAgB,iBAChB,iBAAiB,kBACjB,kBAAkB,mBAClB,gBAAgB,iBAChB,mBAAmB,oBACnB,kBAAkB,mBAClB,qBAAqB,sBACrB,mBAAmB,oBACnB,mBAAmB,oBACnB,sBAAsB,uBACtB,kBAAkB,mBAClB,oBAAoB,qBACpB,gBAAgB,iBAChB,qBAAqB,sBACrB,kBAAkB,mBAClB,mBAAmB,oBACnB,mBAAmB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IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/types.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { Router } from '@dooboostore/core-web';\nimport {SwcAttributeConfigType} from \"./elements/SwcAppEngine\";\n\nexport enum InjectSituationType {\n HOST_SET = 'SIMPLE_WEB_COMPONENT://HOSTSET',\n APP_HOST = 'SIMPLE_WEB_COMPONENT://APPHOST',\n APP_HOSTS = 'SIMPLE_WEB_COMPONENT://APPHOSTS',\n HOST = 'SIMPLE_WEB_COMPONENT://HOST',\n PARENT_HOST = 'SIMPLE_WEB_COMPONENT://PARENTHOST',\n HOSTS = 'SIMPLE_WEB_COMPONENT://HOSTS',\n FIRST_HOST = 'SIMPLE_WEB_COMPONENT://FIRSTHOST',\n LAST_HOST = 'SIMPLE_WEB_COMPONENT://LASTHOST',\n FIRST_APP_HOST = 'SIMPLE_WEB_COMPONENT://FIRSTAPPHOST',\n LAST_APP_HOST = 'SIMPLE_WEB_COMPONENT://LASTAPPHOST'\n}\n\nexport type SwcRootType = 'light' | 'shadow' | 'all' | 'auto';\n\nexport type SpecialSelector = '
|
|
4
|
+
"sourcesContent": ["import { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { Router } from '@dooboostore/core-web';\nimport {SwcAttributeConfigType} from \"./elements/SwcAppEngine\";\n\nexport enum InjectSituationType {\n HOST_SET = 'SIMPLE_WEB_COMPONENT://HOSTSET',\n APP_HOST = 'SIMPLE_WEB_COMPONENT://APPHOST',\n APP_HOSTS = 'SIMPLE_WEB_COMPONENT://APPHOSTS',\n HOST = 'SIMPLE_WEB_COMPONENT://HOST',\n PARENT_HOST = 'SIMPLE_WEB_COMPONENT://PARENTHOST',\n HOSTS = 'SIMPLE_WEB_COMPONENT://HOSTS',\n FIRST_HOST = 'SIMPLE_WEB_COMPONENT://FIRSTHOST',\n LAST_HOST = 'SIMPLE_WEB_COMPONENT://LASTHOST',\n FIRST_APP_HOST = 'SIMPLE_WEB_COMPONENT://FIRSTAPPHOST',\n LAST_APP_HOST = 'SIMPLE_WEB_COMPONENT://LASTAPPHOST'\n}\n\nexport type SwcRootType = 'light' | 'shadow' | 'all' | 'auto';\n\nexport type SpecialSelector = '$this' | '$window' | '$document' | '$host' | '$appHost' | '$firstHost' | '$lastHost' | '$firstAppHost' | '$lastAppHost' | '$hosts' | '$appHosts';\n\nexport type SwcQueryOptions = { root?: SwcRootType };\n\nexport type HelperSet = {\n $d: Document;\n $w: Window;\n $q: (selector: string, root?: Element | Document | ShadowRoot) => HTMLElement | null;\n $qa: (selector: string, root?: Element | Document | ShadowRoot) => HTMLElement[];\n $qi: (id: string, root?: Document | ShadowRoot) => HTMLElement | null;\n};\n\nexport type HostSet = {\n $host: HTMLElement | null; // Nearest parent SWC component\n $parentHost: HTMLElement | null; // Grandparent SWC ancestor\n $hosts: HTMLElement[]; // All SWC ancestors [root, ..., parent]\n $firstHost: HTMLElement | null; // Top-most SWC ancestor\n $lastHost: HTMLElement | null; // Same as $host\n $templateHost: HTMLTemplateElement | null | undefined;\n $appHost: SwcAppInterface | null;\n $appHosts: SwcAppInterface[];\n $firstAppHost: SwcAppInterface | null;\n $lastAppHost: SwcAppInterface | null;\n};\n\nexport type HelperHostSet = HelperSet & HostSet & {$this: any};\n\nexport type SwcAppMessage<T = any> = {\n publisher?: any;\n data?: T;\n type?: string;\n};\n\nexport interface SwcChooseInterface extends HTMLTemplateElement {\n value: any;\n refresh(): void;\n}\nexport interface SwcIfInterface extends HTMLTemplateElement {\n value: any;\n refresh(): void;\n}\nexport interface SwcAppInterface extends HTMLElement {\n simpleApplication?: SimpleApplication;\n router?: Router;\n connect(config?: SwcAttributeConfigType): Promise<void>;\n routing(path: string): Promise<void>;\n reload(): void;\n back(): void;\n forward(): void;\n publishMessage(message: SwcAppMessage): void;\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAK,sBAAL,kBAAKA,yBAAL;AACL,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,iBAAc;AACd,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,gBAAa;AACb,EAAAA,qBAAA,eAAY;AACZ,EAAAA,qBAAA,oBAAiB;AACjB,EAAAA,qBAAA,mBAAgB;AAVN,SAAAA;AAAA,GAAA;",
|
|
6
6
|
"names": ["InjectSituationType"]
|
|
7
7
|
}
|
package/dist/cjs/utils/Utils.js
CHANGED
|
@@ -222,7 +222,7 @@ var SwcUtils;
|
|
|
222
222
|
}
|
|
223
223
|
return current;
|
|
224
224
|
};
|
|
225
|
-
SwcUtils2.
|
|
225
|
+
SwcUtils2.findNearestSwcHostIncludingSelf = (el) => {
|
|
226
226
|
const el1 = el;
|
|
227
227
|
if (el1.__swc_host) return el1.__swc_host;
|
|
228
228
|
let current = el.parentElement || el.getRootNode?.()?.host;
|
|
@@ -235,26 +235,26 @@ var SwcUtils;
|
|
|
235
235
|
}
|
|
236
236
|
return void 0;
|
|
237
237
|
};
|
|
238
|
-
SwcUtils2.
|
|
238
|
+
SwcUtils2.findAllSwcHostsIncludingSelf = (el) => {
|
|
239
239
|
const hosts = [];
|
|
240
|
-
let current = (0, SwcUtils2.
|
|
240
|
+
let current = (0, SwcUtils2.findNearestSwcHostIncludingSelf)(el);
|
|
241
241
|
while (current) {
|
|
242
242
|
hosts.push(current);
|
|
243
|
-
current = (0, SwcUtils2.
|
|
243
|
+
current = (0, SwcUtils2.findNearestSwcHostIncludingSelf)(current);
|
|
244
244
|
}
|
|
245
245
|
return hosts.reverse();
|
|
246
246
|
};
|
|
247
247
|
SwcUtils2.getHosts = (el) => {
|
|
248
|
-
const ancestors = (0, SwcUtils2.
|
|
248
|
+
const ancestors = (0, SwcUtils2.findAllSwcHostsIncludingSelf)(el);
|
|
249
249
|
if ((0, import_decorators.getElementConfig)(el)) return [...ancestors, el];
|
|
250
250
|
return ancestors;
|
|
251
251
|
};
|
|
252
252
|
SwcUtils2.getHost = (el) => {
|
|
253
253
|
if ((0, import_decorators.getElementConfig)(el)) return el;
|
|
254
|
-
return (0, SwcUtils2.
|
|
254
|
+
return (0, SwcUtils2.findNearestSwcHostIncludingSelf)(el);
|
|
255
255
|
};
|
|
256
256
|
SwcUtils2.getAppHosts = (el) => {
|
|
257
|
-
const hosts = SwcUtils2.
|
|
257
|
+
const hosts = SwcUtils2.findAllAppHostsIncludingSelfDirect(el);
|
|
258
258
|
return hosts;
|
|
259
259
|
};
|
|
260
260
|
SwcUtils2.getAppHost = (el) => {
|
|
@@ -262,11 +262,11 @@ var SwcUtils;
|
|
|
262
262
|
const appHostsWithoutSelf = appHosts.filter((h) => h !== el);
|
|
263
263
|
return appHostsWithoutSelf.length > 0 ? appHostsWithoutSelf[appHostsWithoutSelf.length - 1] : void 0;
|
|
264
264
|
};
|
|
265
|
-
SwcUtils2.
|
|
266
|
-
const appHosts = (0, SwcUtils2.
|
|
265
|
+
SwcUtils2.findAppHostIncludingSelfDirect = (el) => {
|
|
266
|
+
const appHosts = (0, SwcUtils2.findAllAppHostsIncludingSelfDirect)(el);
|
|
267
267
|
return appHosts.length > 0 ? appHosts[appHosts.length - 1] : null;
|
|
268
268
|
};
|
|
269
|
-
SwcUtils2.
|
|
269
|
+
SwcUtils2.findAllAppHostsIncludingSelfDirect = (el) => {
|
|
270
270
|
const appHosts = [];
|
|
271
271
|
const w = el.ownerDocument?.defaultView || (typeof window !== "undefined" ? window : void 0);
|
|
272
272
|
if (!w) {
|
|
@@ -292,7 +292,7 @@ var SwcUtils;
|
|
|
292
292
|
return appHosts.reverse();
|
|
293
293
|
};
|
|
294
294
|
SwcUtils2.getHostSet = (el) => {
|
|
295
|
-
const ancestors = (0, SwcUtils2.
|
|
295
|
+
const ancestors = (0, SwcUtils2.findAllSwcHostsIncludingSelf)(el);
|
|
296
296
|
const $host = ancestors.length > 0 ? ancestors[ancestors.length - 1] : null;
|
|
297
297
|
const $parentHost = ancestors.length > 1 ? ancestors[ancestors.length - 2] : null;
|
|
298
298
|
const $hosts = ancestors;
|
|
@@ -306,7 +306,7 @@ var SwcUtils;
|
|
|
306
306
|
}
|
|
307
307
|
curr = curr.parentElement || curr.getRootNode().host;
|
|
308
308
|
}
|
|
309
|
-
const $appHosts = SwcUtils2.
|
|
309
|
+
const $appHosts = SwcUtils2.findAllAppHostsIncludingSelfDirect(el);
|
|
310
310
|
const $appHost = $appHosts.length > 0 ? $appHosts[$appHosts.length - 1] === el ? $appHosts.length > 1 ? $appHosts[$appHosts.length - 2] : null : $appHosts[$appHosts.length - 1] : null;
|
|
311
311
|
const $firstAppHost = $appHosts.length > 0 ? $appHosts[0] : null;
|
|
312
312
|
return {
|
|
@@ -314,7 +314,7 @@ var SwcUtils;
|
|
|
314
314
|
$parentHost,
|
|
315
315
|
$hosts,
|
|
316
316
|
$firstHost,
|
|
317
|
-
$lastHost: $
|
|
317
|
+
$lastHost: $host,
|
|
318
318
|
$templateHost: el.__swc_template_host,
|
|
319
319
|
$appHost,
|
|
320
320
|
$appHosts,
|