@dooboostore/simple-web-component 1.0.31 → 1.0.33
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 +280 -43
- package/dist/cjs/decorators/applyStyle.js +1 -1
- package/dist/cjs/decorators/applyStyle.js.map +2 -2
- package/dist/cjs/decorators/attribute.js +17 -1
- package/dist/cjs/decorators/attribute.js.map +2 -2
- package/dist/cjs/decorators/elementDefine.js +27 -10
- package/dist/cjs/decorators/elementDefine.js.map +3 -3
- package/dist/cjs/decorators/index.js +3 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +86 -0
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +7 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +62 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
- package/dist/cjs/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +16 -16
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
- package/dist/cjs/elements/SwcAppMixin.js +32 -3
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/elements/SwcAsync.js +69 -57
- package/dist/cjs/elements/SwcAsync.js.map +2 -2
- package/dist/cjs/elements/SwcChoose.js +66 -60
- package/dist/cjs/elements/SwcChoose.js.map +2 -2
- package/dist/cjs/elements/SwcIf.js +51 -66
- package/dist/cjs/elements/SwcIf.js.map +2 -2
- package/dist/cjs/elements/SwcLoop.js +58 -78
- package/dist/cjs/elements/SwcLoop.js.map +2 -2
- package/dist/cjs/elements/register.js +310 -335
- package/dist/cjs/elements/register.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/Utils.js +7 -13
- package/dist/cjs/utils/Utils.js.map +2 -2
- package/dist/esm/decorators/applyStyle.js +1 -1
- package/dist/esm/decorators/applyStyle.js.map +2 -2
- package/dist/esm/decorators/attribute.js +18 -2
- package/dist/esm/decorators/attribute.js.map +2 -2
- package/dist/esm/decorators/elementDefine.js +25 -8
- package/dist/esm/decorators/elementDefine.js.map +3 -3
- package/dist/esm/decorators/index.js +3 -1
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js +67 -0
- package/dist/esm/decorators/publishSwcAppMessage.js.map +7 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +43 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
- package/dist/esm/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +13 -13
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
- package/dist/esm/elements/SwcAppMixin.js +32 -3
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/elements/SwcAsync.js +70 -58
- package/dist/esm/elements/SwcAsync.js.map +2 -2
- package/dist/esm/elements/SwcChoose.js +67 -61
- package/dist/esm/elements/SwcChoose.js.map +2 -2
- package/dist/esm/elements/SwcIf.js +52 -67
- package/dist/esm/elements/SwcIf.js.map +2 -2
- package/dist/esm/elements/SwcLoop.js +59 -79
- package/dist/esm/elements/SwcLoop.js.map +2 -2
- package/dist/esm/elements/register.js +239 -264
- package/dist/esm/elements/register.js.map +2 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/utils/Utils.js +7 -13
- package/dist/esm/utils/Utils.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +2804 -2498
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/attribute.d.ts.map +1 -1
- package/dist/types/decorators/elementDefine.d.ts +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +3 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +13 -0
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +16 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +18 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -0
- package/dist/types/elements/SwcAppMixin.d.ts +3 -0
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/elements/register.d.ts.map +1 -1
- package/dist/types/types.d.ts +14 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/Utils.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +2804 -2498
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +4 -4
- package/src/decorators/applyStyle.ts +1 -1
- package/src/decorators/attribute.ts +35 -30
- package/src/decorators/elementDefine.ts +28 -8
- package/src/decorators/index.ts +3 -1
- package/src/decorators/publishSwcAppMessage.ts +100 -0
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +73 -0
- package/src/decorators/{subscribeSwcAppRouteChange.ts → subscribeSwcAppRouteChangeWhileConnected.ts} +19 -19
- package/src/elements/SwcAppMixin.ts +43 -4
- package/src/elements/SwcAsync.ts +75 -69
- package/src/elements/SwcChoose.ts +67 -80
- package/src/elements/SwcIf.ts +51 -76
- package/src/elements/SwcLoop.ts +56 -87
- package/src/elements/register.ts +235 -307
- package/src/types.ts +14 -1
- package/src/utils/Utils.ts +11 -17
- package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +0 -7
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +0 -18
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],
|
|
4
|
+
"sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { Router } from '@dooboostore/core-web';\n\nexport const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for('simple-web-component:subscribe-swc-app-route-change-while-connected');\n\nexport interface SwcAppRouteChangeSubscriberMetadata {\n propertyKey: string | symbol;\n pathPattern?: string | string[];\n filter?: (router: Router) => boolean;\n}\n\nexport interface SwcAppRouteChangeOptions {\n path?: string | string[];\n filter?: (router: Router) => boolean;\n}\n\nfunction createSubscribeSwcAppRouteChangeWhileConnected(options?: SwcAppRouteChangeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const pathPattern = options?.path;\n const filter = options?.filter;\n\n const constructor = target.constructor;\n let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor) as SwcAppRouteChangeSubscriberMetadata[];\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, pathPattern, filter });\n \n return descriptor;\n };\n}\n\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uC9C1\uC811 \uC0AC\uC6A9 (\uAD04\uD638 \uC5C6\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\n// \uC624\uBC84\uB85C\uB4DC \uC2DC\uADF8\uB2C8\uCC98 - \uD568\uC218 \uD638\uCD9C (\uAD04\uD638 \uC788\uC74C)\nexport function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPattern: string): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(pathPatterns: string[]): MethodDecorator;\nexport function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;\n\n// \uC2E4\uC81C \uAD6C\uD604 (\uC774\uC911 \uBAA8\uB4DC)\nexport function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions?: any, propertyKey?: string | symbol, descriptor?: PropertyDescriptor): any {\n // \uC9C1\uC811 \uB370\uCF54\uB808\uC774\uD130\uB85C \uC0AC\uC6A9\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC5C6\uC74C): @subscribeSwcAppRouteChangeWhileConnected\n // propertyKey\uAC00 string | symbol\uC774\uACE0 descriptor\uAC00 \uC788\uC73C\uBA74 \uC9C1\uC811 \uC0AC\uC6A9\n if (propertyKey && (typeof propertyKey === 'string' || typeof propertyKey === 'symbol')) {\n return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKey, descriptor);\n }\n \n // \uD568\uC218\uB85C \uD638\uCD9C\uB41C \uACBD\uC6B0 (\uAD04\uD638 \uC788\uC74C): @subscribeSwcAppRouteChangeWhileConnected() / @subscribeSwcAppRouteChangeWhileConnected('/path')\n let options: SwcAppRouteChangeOptions = {};\n\n if (Array.isArray(targetOrOptions)) {\n // \uBC30\uC5F4: @subscribeSwcAppRouteChangeWhileConnected(['/path1', '/path2'])\n options.path = targetOrOptions;\n } else if (typeof targetOrOptions === 'string') {\n // \uBB38\uC790\uC5F4: @subscribeSwcAppRouteChangeWhileConnected('/path')\n options.path = targetOrOptions;\n } else if (targetOrOptions && typeof targetOrOptions === 'object') {\n // \uAC1D\uCCB4: @subscribeSwcAppRouteChangeWhileConnected({ path: '/path', filter: ... })\n options = targetOrOptions;\n }\n\n return createSubscribeSwcAppRouteChangeWhileConnected(options);\n}\n\n// Helper function to retrieve route change subscribers metadata\nexport const getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target: any): SwcAppRouteChangeSubscriberMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAAoB;AAGtB,MAAM,8DAA8D,OAAO,IAAI,qEAAqE;AAa3J,SAAS,+CAA+C,SAAqD;AAC3G,SAAO,CAAC,QAAgB,aAA8B,eAAoC;AACxF,UAAM,cAAc,SAAS;AAC7B,UAAM,SAAS,SAAS;AAExB,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,aAAa,eAAe,6DAA6D,WAAW;AAC/G,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,mBAAa,eAAe,6DAA6D,MAAM,WAAW;AAAA,IAC5G;AACA,SAAK,KAAK,EAAE,aAAa,aAAa,OAAO,CAAC;AAE9C,WAAO;AAAA,EACT;AACF;AAWO,SAAS,yCAAyC,iBAAuB,aAA+B,YAAsC;AAGnJ,MAAI,gBAAgB,OAAO,gBAAgB,YAAY,OAAO,gBAAgB,WAAW;AACvF,WAAO,+CAA+C,CAAC,CAAC,EAAE,iBAAiB,aAAa,UAAU;AAAA,EACpG;AAGA,MAAI,UAAoC,CAAC;AAEzC,MAAI,MAAM,QAAQ,eAAe,GAAG;AAElC,YAAQ,OAAO;AAAA,EACjB,WAAW,OAAO,oBAAoB,UAAU;AAE9C,YAAQ,OAAO;AAAA,EACjB,WAAW,mBAAmB,OAAO,oBAAoB,UAAU;AAEjE,cAAU;AAAA,EACZ;AAEA,SAAO,+CAA+C,OAAO;AAC/D;AAGO,MAAM,sDAAsD,CAAC,WAAmE;AACrI,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,eAAe,6DAA6D,WAAW;AAC7G;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,7 +2,8 @@ import { SwcAppEngine } from "./SwcAppEngine.js";
|
|
|
2
2
|
import { SwcUtils } from "../utils/Utils.js";
|
|
3
3
|
import { FunctionUtils } from "@dooboostore/core";
|
|
4
4
|
import { ON_CONNECTED_SWC_APP_METADATA_KEY, findAllLifecycleMetadata } from "../decorators/lifecycles.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getSubscribeSwcAppRouteChangeWhileConnectedMetadata } from "../decorators/subscribeSwcAppRouteChangeWhileConnected.js";
|
|
6
|
+
import { getSubscribeSwcAppMessageWhileConnectedMetadata } from "../decorators/subscribeSwcAppMessageWhileConnected.js";
|
|
6
7
|
function SwcAppMixin(Base) {
|
|
7
8
|
return class extends Base {
|
|
8
9
|
constructor() {
|
|
@@ -18,7 +19,7 @@ function SwcAppMixin(Base) {
|
|
|
18
19
|
return this.__swc_engine.router;
|
|
19
20
|
}
|
|
20
21
|
_invokeRouteChangeSubscribers(instance, re) {
|
|
21
|
-
const routeChangeSubscribers =
|
|
22
|
+
const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);
|
|
22
23
|
if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {
|
|
23
24
|
routeChangeSubscribers.forEach((metadata) => {
|
|
24
25
|
const methodName = metadata.propertyKey || metadata;
|
|
@@ -134,7 +135,7 @@ function SwcAppMixin(Base) {
|
|
|
134
135
|
const userConfig = FunctionUtils.executeReturn({
|
|
135
136
|
script: configStr,
|
|
136
137
|
context: this,
|
|
137
|
-
args: SwcUtils.getHelperAndHostSet(win,
|
|
138
|
+
args: SwcUtils.getHelperAndHostSet(win, this)
|
|
138
139
|
});
|
|
139
140
|
this.connect(userConfig);
|
|
140
141
|
} catch (e) {
|
|
@@ -164,6 +165,34 @@ function SwcAppMixin(Base) {
|
|
|
164
165
|
reload() {
|
|
165
166
|
this.router?.reload();
|
|
166
167
|
}
|
|
168
|
+
publishMessage(message) {
|
|
169
|
+
this._swc_connected_instance.forEach((instance) => {
|
|
170
|
+
this._invokeMessageSubscribers(instance, message);
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
_invokeMessageSubscribers(instance, message) {
|
|
174
|
+
const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);
|
|
175
|
+
if (messageSubscribers && Array.isArray(messageSubscribers)) {
|
|
176
|
+
messageSubscribers.forEach((metadata) => {
|
|
177
|
+
const methodName = metadata.propertyKey;
|
|
178
|
+
const messageType = metadata.messageType;
|
|
179
|
+
const filter = metadata.filter;
|
|
180
|
+
let typeMatched = false;
|
|
181
|
+
if (!messageType) {
|
|
182
|
+
typeMatched = true;
|
|
183
|
+
} else if (message.type === messageType) {
|
|
184
|
+
typeMatched = true;
|
|
185
|
+
}
|
|
186
|
+
let filterMatched = true;
|
|
187
|
+
if (filter && typeMatched) {
|
|
188
|
+
filterMatched = filter(message);
|
|
189
|
+
}
|
|
190
|
+
if (typeMatched && filterMatched && typeof instance[methodName] === "function") {
|
|
191
|
+
instance[methodName](message);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
167
196
|
};
|
|
168
197
|
}
|
|
169
198
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcAppMixin.ts"],
|
|
4
|
-
"sourcesContent": ["import { SwcAppEngine, SwcAttributeConfigType, SwcConfigType } from './SwcAppEngine';\nimport { SwcAppInterface } from '../types';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, Subscription } from '@dooboostore/core';\nimport { Router, RouterEventType } from '@dooboostore/core-web';\nimport { ON_CONNECTED_SWC_APP_METADATA_KEY, findAllLifecycleMetadata } from '../decorators/lifecycles';\nimport {
|
|
5
|
-
"mappings": "AAAA,SAAS,oBAA2D;AAEpE,SAAS,gBAAgB;AACzB,SAAS,qBAAmC;AAE5C,SAAS,mCAAmC,gCAAgC;AAC5E,SAAS,
|
|
4
|
+
"sourcesContent": ["import { SwcAppEngine, SwcAttributeConfigType, SwcConfigType } from './SwcAppEngine';\nimport { SwcAppInterface, SwcAppMessage } from '../types';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, Subscription } from '@dooboostore/core';\nimport { Router, RouterEventType } from '@dooboostore/core-web';\nimport { ON_CONNECTED_SWC_APP_METADATA_KEY, findAllLifecycleMetadata } from '../decorators/lifecycles';\nimport { getSubscribeSwcAppRouteChangeWhileConnectedMetadata } from '../decorators/subscribeSwcAppRouteChangeWhileConnected';\nimport { getSubscribeSwcAppMessageWhileConnectedMetadata } from '../decorators/subscribeSwcAppMessageWhileConnected';\n\nexport function SwcAppMixin<T extends { new (...args: any[]): HTMLElement }>(Base: T) {\n //@ts-ignore\n return class extends Base implements SwcAppInterface {\n __swc_engine = new SwcAppEngine(this as any);\n _swc_connected_instance = new Set<any>();\n _routerSubscription?: Subscription;\n _lastRouterEvent?: RouterEventType;\n\n /*\n 사파리 is 일경우\n <script src=\"https://unpkg.com/@ungap/custom-elements\"></script>\n 이걸사용하는데 is 대응하는거다 그런데 이때 처리되는 순서가 크롬이나 표준에서는 부모부터 만들어지고 자식들이 만들어지는데\n 저 polyfill에서는 자식부터 만들어지고 부모가 만들어진다 is일때 아 .. 이문제때문에 자식이 _connected_safari 에 강제로 자기자식넣어준다\n */\n _connected_safari = [];\n get simpleApplication() {\n return this.__swc_engine.simpleApplication;\n }\n get router() {\n return this.__swc_engine.router;\n }\n\n _invokeRouteChangeSubscribers(instance: any, re: RouterEventType) {\n const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);\n if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {\n routeChangeSubscribers.forEach((metadata: any) => {\n const methodName = metadata.propertyKey || metadata;\n const pathPattern = metadata.pathPattern;\n const filter = metadata.filter;\n\n // Path pattern matching (support both string and array)\n let pathMatched = false;\n let pathData: any = null;\n\n if (!pathPattern) {\n // pathPattern이 없으면 모든 경로 매칭 (와일드카드)\n pathMatched = true;\n pathData = {};\n } else if (Array.isArray(pathPattern)) {\n // 배열: 하나라도 매칭되면 OK\n for (const pattern of pathPattern) {\n const data = SwcUtils.parsePathPattern(pattern, re.path || '/');\n if (data !== null) {\n pathMatched = true;\n pathData = data;\n break;\n }\n }\n } else {\n // 문자열\n pathData = SwcUtils.parsePathPattern(pathPattern, re.path || '/');\n pathMatched = pathData !== null;\n }\n\n // Filter validation\n const filterPassed = !filter || filter(this.router!);\n\n // Invoke method if conditions pass\n if (pathMatched && filterPassed) {\n instance[methodName]?.({...re, pathData: pathData});\n }\n });\n }\n }\n\n _connected(instance: any) {\n // console.log('appmixin--> connected', this, instance);\n if (instance) {\n this._swc_connected_instance.add(instance);\n if (this.simpleApplication) {\n this._invokeOnConnectedSwcAppStarted(instance);\n // Notify current route subscribers immediately after connection\n if (this.router && this._lastRouterEvent) {\n this._invokeRouteChangeSubscribers(instance, this._lastRouterEvent);\n }\n }\n }\n }\n\n _disconnected(instance: any) {\n if (instance) {\n this._swc_connected_instance.delete(instance);\n }\n }\n\n _handleRouteChange(route: RouterEventType) {\n if (route.triggerPoint === 'end') {\n // Iterate through all connected component instances\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeRouteChangeSubscribers(instance, route);\n });\n }\n\n // Save last router event\n this._lastRouterEvent = route;\n }\n\n async connect(config?: SwcAttributeConfigType) {\n const swcConfig = {\n routeType: 'element',\n window: config.window,\n ...config\n } as SwcConfigType;\n\n const mode = config?.connectMode || 'direct';\n\n if (mode === 'direct') {\n await this.__swc_engine.connect(swcConfig);\n this.setAttribute('swc-connect-mode', 'direct');\n } else if (mode === 'swap' && !this.parentNode) {\n await this.__swc_engine.connect(swcConfig);\n this.setAttribute('swc-connect-mode', 'direct');\n\n const clonedApp = this.cloneNode(true) as any;\n clonedApp.style.display = 'none';\n this.parentNode.insertBefore(clonedApp, this.nextSibling);\n\n try {\n await clonedApp.connect({ ...(config || {}), connectMode: 'direct' });\n if (this.parentNode) {\n this.parentNode.removeChild(this);\n }\n clonedApp.setAttribute('swc-connect-mode', 'swap');\n clonedApp.style.display = '';\n } catch (e) {\n if (clonedApp.parentNode) {\n clonedApp.parentNode.removeChild(clonedApp);\n }\n throw e;\n }\n }\n\n // 사파리일떄 예외이다 is 일때 polyfill되는데 이떄 부모부터 만들어지는게 아니라 자식부터 만들어진다 그래서 부모가 만들어질때 자식들이 이미 만들어져있어서 부모가 자식들을 등록해주는 형태로 강제로 등록해준다\n this._connected_safari.forEach((instance: any) => {\n this._swc_connected_instance.add(instance);\n });\n // Invoke @onConnectedSwcApp lifecycle methods on all connected component instances\n // const hostSet = SwcUtils.getHostSet(this as any);\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeOnConnectedSwcAppStarted(instance);\n });\n\n\n // Subscribe to router changes after connect\n if (!this._routerSubscription && this.router) {\n this._routerSubscription = this.router.observable.subscribe((route: RouterEventType) => {\n //@ts-ignore\n // console.log('Route changed:', route, this._swcId);\n this._handleRouteChange(route);\n });\n // Navigate to initial path if specified\n const config = this.__swc_engine.config;\n // if (config?.path) {\n // this.router.go(config.path);\n // }\n }\n }\n\n _invokeOnConnectedSwcAppStarted(instance: any) {\n const startedMethods = findAllLifecycleMetadata(instance, ON_CONNECTED_SWC_APP_METADATA_KEY);\n if (startedMethods) {\n for (const m of startedMethods) {\n instance._invokeLifecycleMethod(m);\n }\n }\n }\n\n connectedCallback() {\n // @ts-ignore\n if (super.connectedCallback) super.connectedCallback();\n\n const configStr = this.getAttribute('swc-get-application-config');\n const win = this.ownerDocument?.defaultView || window;\n if (configStr && win) {\n try {\n // console.log('vvvvvvvvvvvvvvvv->>>>', SwcUtils.findNearestSwcHost(this.host), SwcUtils.getHostSet(this.host))\n const userConfig = FunctionUtils.executeReturn({\n script: configStr,\n context: this,\n args: SwcUtils.getHelperAndHostSet(win, this)\n });\n this.connect(userConfig);\n } catch (e) {\n console.error('[SWC-APP-ENGINE] Script execution failed:', e);\n }\n }\n\n this.__swc_engine?.config?.onConnected?.(this);\n }\n\n disconnectedCallback() {\n // @ts-ignore\n if (super.disconnectedCallback) super.disconnectedCallback();\n this._routerSubscription?.unsubscribe();\n this._routerSubscription = undefined;\n this._lastRouterEvent = undefined;\n this.__swc_engine.disconnect();\n this.__swc_engine?.config?.onDisconnected?.(this);\n }\n\n async routing(path: string) {\n await this.router?.go(path);\n }\n\n back(): void {\n this.router?.back();\n }\n\n forward(): void {\n this.router?.forward();\n }\n\n reload(): void {\n this.router?.reload();\n }\n\n publishMessage(message: SwcAppMessage): void {\n // 메시지를 모든 connected component instances로 분배\n this._swc_connected_instance.forEach((instance: any) => {\n this._invokeMessageSubscribers(instance, message);\n });\n }\n\n _invokeMessageSubscribers(instance: any, message: SwcAppMessage) {\n const messageSubscribers = getSubscribeSwcAppMessageWhileConnectedMetadata(instance);\n if (messageSubscribers && Array.isArray(messageSubscribers)) {\n messageSubscribers.forEach((metadata: any) => {\n const methodName = metadata.propertyKey;\n const messageType = metadata.messageType;\n const filter = metadata.filter;\n\n // 메시지 타입 확인\n let typeMatched = false;\n if (!messageType) {\n // messageType이 없으면 모든 메시지 매칭 (와일드카드)\n typeMatched = true;\n } else if (message.type === messageType) {\n typeMatched = true;\n }\n\n // 필터 적용\n let filterMatched = true;\n if (filter && typeMatched) {\n filterMatched = filter(message);\n }\n\n // 조건을 만족하면 메서드 호출\n if (typeMatched && filterMatched && typeof instance[methodName] === 'function') {\n instance[methodName](message);\n }\n });\n }\n }\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,oBAA2D;AAEpE,SAAS,gBAAgB;AACzB,SAAS,qBAAmC;AAE5C,SAAS,mCAAmC,gCAAgC;AAC5E,SAAS,2DAA2D;AACpE,SAAS,uDAAuD;AAE1D,SAAU,YAA6D,MAAO;AAElF,SAAO,cAAc,KAAI;IAAlB,cAAA;;AACL,WAAA,eAAe,IAAI,aAAa,IAAW;AAC3C,WAAA,0BAA0B,oBAAI,IAAG;AAUjC,WAAA,oBAAoB,CAAA;IA+OtB;IA9OE,IAAI,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AAS;AAC7B,gBAAM,SAAS,SAAS;AAGxB,cAAI,cAAc;AAClB,cAAI,CAAC,aAAa;AAEhB,0BAAc;UAChB,WAAW,QAAQ,SAAS,aAAa;AACvC,0BAAc;UAChB;AAGA,cAAI,gBAAgB;AACpB,cAAI,UAAU,aAAa;AACzB,4BAAgB,OAAO,OAAO;UAChC;AAGA,cAAI,eAAe,iBAAiB,OAAO,SAAS,UAAU,MAAM,YAAY;AAC9E,qBAAS,UAAU,EAAE,OAAO;UAC9B;QACF,CAAC;MACH;IACF;;AAEJ;",
|
|
6
6
|
"names": ["config"]
|
|
7
7
|
}
|
|
@@ -9,51 +9,67 @@ var __metadata = function(k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { changedAttributeHost } from "../decorators/changedAttributeHost.js";
|
|
11
11
|
import { SwcUtils } from "../utils/Utils.js";
|
|
12
|
-
import { FunctionUtils } from "@dooboostore/core";
|
|
12
|
+
import { FunctionUtils, ActionExpression } from "@dooboostore/core";
|
|
13
|
+
import { ConvertUtils } from "@dooboostore/core-web";
|
|
14
|
+
import { attributeHost } from "../decorators/index.js";
|
|
13
15
|
class SwcAsync extends HTMLTemplateElement {
|
|
14
16
|
constructor() {
|
|
15
17
|
super(...arguments);
|
|
16
18
|
this._nodes = [];
|
|
17
|
-
this._value = null;
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
get value() {
|
|
21
|
+
return this._value;
|
|
22
|
+
}
|
|
23
|
+
set value(nv) {
|
|
24
|
+
this.executeAsync(nv);
|
|
25
|
+
}
|
|
26
|
+
setValue(valueAttr) {
|
|
27
|
+
this.executeAsync(this._value);
|
|
24
28
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
setReplaceWrap() {
|
|
30
|
+
this.executeAsync(this._value);
|
|
31
|
+
}
|
|
32
|
+
executeAsync(result = this._value) {
|
|
33
|
+
if (result === void 0 || result === null) {
|
|
34
|
+
this.refresh("default");
|
|
29
35
|
return;
|
|
30
36
|
}
|
|
31
|
-
if (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
if (result instanceof Promise) {
|
|
38
|
+
this.refresh("loading");
|
|
39
|
+
result.then((v) => {
|
|
40
|
+
this.resultValue = v;
|
|
41
|
+
this.refresh("success");
|
|
42
|
+
}).catch((e) => {
|
|
43
|
+
console.error("[SWC-ASYNC] Promise rejected:", e);
|
|
44
|
+
this.resultValue = e;
|
|
45
|
+
this.refresh("error");
|
|
38
46
|
});
|
|
39
|
-
this.executeAsync(result);
|
|
40
47
|
} else {
|
|
41
|
-
this.
|
|
48
|
+
this.resultValue = result;
|
|
49
|
+
this.refresh("success");
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
53
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
54
|
+
const ae = new ActionExpression(html, config);
|
|
55
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
56
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
57
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
58
|
+
try {
|
|
59
|
+
const value = FunctionUtils.executeReturn({
|
|
60
|
+
script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
61
|
+
context,
|
|
62
|
+
args: groupArgs
|
|
63
|
+
});
|
|
64
|
+
ae.replace(expr, String(value));
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
67
|
+
}
|
|
54
68
|
}
|
|
69
|
+
return ae.getUnprocessedTemplate();
|
|
55
70
|
}
|
|
56
|
-
|
|
71
|
+
refresh(state = "default") {
|
|
72
|
+
console.log("rrrrrrrrrrrrrrrrr", state);
|
|
57
73
|
this.cleanup();
|
|
58
74
|
const portal = this.parentElement;
|
|
59
75
|
if (!portal)
|
|
@@ -62,46 +78,42 @@ class SwcAsync extends HTMLTemplateElement {
|
|
|
62
78
|
const helperSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
63
79
|
const t = this.content.querySelector(`template[is="swc-${state}"]`);
|
|
64
80
|
if (t) {
|
|
65
|
-
|
|
66
|
-
this.
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const value = attr.value || "";
|
|
74
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
75
|
-
const script = value.slice(2, -2).trim();
|
|
76
|
-
const result = FunctionUtils.executeReturn({
|
|
77
|
-
script,
|
|
78
|
-
context: n,
|
|
79
|
-
args: groupArgs
|
|
80
|
-
});
|
|
81
|
-
n.setAttribute(attr.name, String(result));
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
87
|
-
portal.insertBefore(clone, this.nextSibling);
|
|
81
|
+
let htmlString = t.innerHTML;
|
|
82
|
+
const groupArgs = { ...helperSet, $value: this._value, $state: state };
|
|
83
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
84
|
+
const temp = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
85
|
+
temp.innerHTML = htmlString;
|
|
86
|
+
const content = temp.content;
|
|
87
|
+
this._nodes = Array.from(content.childNodes);
|
|
88
|
+
portal.insertBefore(content, this.nextSibling);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
cleanup() {
|
|
91
92
|
this._nodes.forEach((n) => n.parentElement?.removeChild(n));
|
|
92
93
|
this._nodes = [];
|
|
93
94
|
}
|
|
94
|
-
connectedCallback() {
|
|
95
|
-
this.refresh();
|
|
96
|
-
}
|
|
97
95
|
disconnectedCallback() {
|
|
98
96
|
this.cleanup();
|
|
99
97
|
}
|
|
100
98
|
}
|
|
99
|
+
__decorate([
|
|
100
|
+
attributeHost("value"),
|
|
101
|
+
__metadata("design:type", Object)
|
|
102
|
+
], SwcAsync.prototype, "_value", void 0);
|
|
103
|
+
__decorate([
|
|
104
|
+
attributeHost("replace-wrap"),
|
|
105
|
+
__metadata("design:type", String)
|
|
106
|
+
], SwcAsync.prototype, "_replaceWrap", void 0);
|
|
101
107
|
__decorate([
|
|
102
108
|
changedAttributeHost("value"),
|
|
103
109
|
__metadata("design:type", Function),
|
|
104
110
|
__metadata("design:paramtypes", [String]),
|
|
105
111
|
__metadata("design:returntype", void 0)
|
|
106
|
-
], SwcAsync.prototype, "
|
|
112
|
+
], SwcAsync.prototype, "setValue", null);
|
|
113
|
+
__decorate([
|
|
114
|
+
changedAttributeHost("replace-wrap"),
|
|
115
|
+
__metadata("design:type", Function),
|
|
116
|
+
__metadata("design:paramtypes", []),
|
|
117
|
+
__metadata("design:returntype", void 0)
|
|
118
|
+
], SwcAsync.prototype, "setReplaceWrap", null);
|
|
107
119
|
//# sourceMappingURL=SwcAsync.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcAsync.ts"],
|
|
4
|
-
"sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils } from '@dooboostore/core';\n\nclass SwcAsync extends HTMLTemplateElement {\n
|
|
5
|
-
"mappings": ";;;;;;;;;AAAA,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B,MAAM,iBAAiB,oBAAmB;EAA1C,cAAA;;
|
|
4
|
+
"sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { attributeHost } from '../decorators';\n\nclass SwcAsync extends HTMLTemplateElement {\n @attributeHost('value')\n _value: any;\n\n @attributeHost('replace-wrap')\n _replaceWrap: string | null;\n\n 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?: string | null): string {\n const config = wrap ? { wrapExpression: wrap } : undefined;\n const ae = new ActionExpression(html, config);\n const filterOptions = wrap ? { type: 'replace' as const, wrap } : 'replace';\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions(filterOptions)) {\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 = this.parentElement;\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 };\n\n htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);\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 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"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAAA,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,eAAe,wBAAwB;AAChD,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAE9B,MAAM,iBAAiB,oBAAmB;EAA1C,cAAA;;AAiBU,SAAA,SAAiB,CAAA;EA2F3B;EAnGE,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EAEA,IAAI,MAAM,IAAO;AACf,SAAK,aAAa,EAAE;EACtB;EAKQ,SAAS,WAAyB;AACxC,SAAK,aAAa,KAAK,MAAM;EAC/B;EAGQ,iBAAc;AACpB,SAAK,aAAa,KAAK,MAAM;EAC/B;EAEQ,aAAa,SAAc,KAAK,QAAM;AAC5C,QAAI,WAAW,UAAa,WAAW,MAAM;AAC3C,WAAK,QAAQ,SAAS;AACtB;IACF;AAEA,QAAI,kBAAkB,SAAS;AAC7B,WAAK,QAAQ,SAAS;AACtB,aACG,KAAK,OAAI;AACR,aAAK,cAAc;AACnB,aAAK,QAAQ,SAAS;MACxB,CAAC,EACA,MAAM,OAAI;AACT,gBAAQ,MAAM,iCAAiC,CAAC;AAChD,aAAK,cAAc;AACnB,aAAK,QAAQ,OAAO;MACtB,CAAC;IACL,OAAO;AACL,WAAK,cAAc;AACnB,WAAK,QAAQ,SAAS;IACxB;EACF;EAEQ,mBAAmB,MA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AAY,CAAC,CAAC;AACxD,SAAK,SAAS,CAAA;EAChB;EAEA,uBAAoB;AAClB,SAAK,QAAO;EACd;;AAzGA,WAAA;EADC,cAAc,OAAO;;;AAItB,WAAA;EADC,cAAc,cAAc;;;AAgBrB,WAAA;EADP,qBAAqB,OAAO;;;;;AAMrB,WAAA;EADP,qBAAqB,cAAc;;;;;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,62 +9,71 @@ var __metadata = function(k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import { changedAttributeHost } from "../decorators/changedAttributeHost.js";
|
|
11
11
|
import { SwcUtils } from "../utils/Utils.js";
|
|
12
|
-
import { FunctionUtils } from "@dooboostore/core";
|
|
12
|
+
import { FunctionUtils, ActionExpression } from "@dooboostore/core";
|
|
13
|
+
import { ConvertUtils } from "@dooboostore/core-web";
|
|
14
|
+
import { attributeHost } from "../decorators/index.js";
|
|
13
15
|
class SwcChoose extends HTMLTemplateElement {
|
|
14
16
|
constructor() {
|
|
15
17
|
super(...arguments);
|
|
16
18
|
this._nodes = [];
|
|
17
|
-
this._value = null;
|
|
18
19
|
this._previousTemplate = null;
|
|
19
20
|
}
|
|
20
21
|
get value() {
|
|
21
22
|
return this._value;
|
|
22
23
|
}
|
|
23
24
|
set value(nv) {
|
|
24
|
-
this.
|
|
25
|
-
this.render();
|
|
25
|
+
this.refresh(nv);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!script)
|
|
30
|
-
return;
|
|
31
|
-
FunctionUtils.execute({ script, context: this, args });
|
|
27
|
+
setValue() {
|
|
28
|
+
this.refresh();
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
setReplaceWrap(replaceWrapAttr) {
|
|
31
|
+
this.refresh();
|
|
32
|
+
}
|
|
33
|
+
replaceExpressions(html, groupArgs, context, wrap) {
|
|
34
|
+
const config = wrap ? { wrapExpression: wrap } : void 0;
|
|
35
|
+
const ae = new ActionExpression(html, config);
|
|
36
|
+
const filterOptions = wrap ? { type: "replace", wrap } : "replace";
|
|
37
|
+
const win = this.ownerDocument?.defaultView || window;
|
|
38
|
+
for (const expr of ae.getExpressions(filterOptions)) {
|
|
39
|
+
try {
|
|
40
|
+
const value = FunctionUtils.executeReturn({
|
|
41
|
+
script: ConvertUtils.decodeHtmlEntity(expr.script, win.document),
|
|
42
|
+
context,
|
|
43
|
+
args: groupArgs
|
|
44
|
+
});
|
|
45
|
+
ae.replace(expr, String(value));
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.error(`[SWC] Failed to execute ${expr.original}:`, e);
|
|
48
|
+
}
|
|
47
49
|
}
|
|
50
|
+
return ae.getUnprocessedTemplate();
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
refresh(value = this._value) {
|
|
53
|
+
const portal = this.parentElement;
|
|
54
|
+
if (!portal)
|
|
55
|
+
return;
|
|
50
56
|
const win = this.ownerDocument?.defaultView || window;
|
|
51
57
|
const helperSet = SwcUtils.getHelperAndHostSet(win, this);
|
|
58
|
+
const groupArgs = { ...helperSet, $value: value };
|
|
52
59
|
const templates = Array.from(this.content.querySelectorAll("template"));
|
|
53
60
|
let selected = null;
|
|
54
61
|
for (const t of templates) {
|
|
55
62
|
if (t.getAttribute("is") === "swc-when") {
|
|
63
|
+
const attrVal = t.getAttribute("value") || "";
|
|
56
64
|
let matches = false;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
const ae = new ActionExpression(attrVal);
|
|
66
|
+
const expr = ae.getFirstExpression("replace");
|
|
67
|
+
if (expr) {
|
|
68
|
+
const decodedScript = ConvertUtils.decodeHtmlEntity(expr.script, win.document);
|
|
60
69
|
const result = FunctionUtils.executeReturn({
|
|
61
|
-
script,
|
|
70
|
+
script: decodedScript,
|
|
62
71
|
context: t,
|
|
63
|
-
args:
|
|
72
|
+
args: groupArgs
|
|
64
73
|
});
|
|
65
|
-
matches = result
|
|
74
|
+
matches = !!result;
|
|
66
75
|
} else {
|
|
67
|
-
matches = String(
|
|
76
|
+
matches = String(attrVal) === String(value);
|
|
68
77
|
}
|
|
69
78
|
if (matches) {
|
|
70
79
|
selected = t;
|
|
@@ -73,54 +82,51 @@ class SwcChoose extends HTMLTemplateElement {
|
|
|
73
82
|
}
|
|
74
83
|
}
|
|
75
84
|
const target = selected || this.content.querySelector('template[is="swc-otherwise"]');
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
|
|
85
|
+
const skipValue = target?.getAttribute?.("skip-if-same");
|
|
86
|
+
const skipValue2 = this._previousTemplate?.getAttribute?.("skip-if-same");
|
|
87
|
+
const hasSkipIfSame = target?.hasAttribute?.("skip-if-same");
|
|
88
|
+
const isSame = this._previousTemplate === target;
|
|
89
|
+
if (hasSkipIfSame && isSame) {
|
|
79
90
|
return;
|
|
80
91
|
}
|
|
81
92
|
this.cleanup();
|
|
82
93
|
this._previousTemplate = target;
|
|
83
94
|
if (target) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Array.from(n.attributes).forEach((attr) => {
|
|
92
|
-
const value = attr.value || "";
|
|
93
|
-
if (value.startsWith("{{") && value.endsWith("}}")) {
|
|
94
|
-
const script = value.slice(2, -2).trim();
|
|
95
|
-
const result = FunctionUtils.executeReturn({
|
|
96
|
-
script,
|
|
97
|
-
context: n,
|
|
98
|
-
args: { ...groupArgs, $value: this._value }
|
|
99
|
-
});
|
|
100
|
-
n.setAttribute(attr.name, String(result));
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
this._executeCloneCallback("on-clone-nodes", groupArgs);
|
|
106
|
-
this.parentElement?.insertBefore(clone, this.nextSibling);
|
|
95
|
+
let htmlString = target.innerHTML;
|
|
96
|
+
htmlString = this.replaceExpressions(htmlString, groupArgs, this, this._replaceWrap);
|
|
97
|
+
const result = this.ownerDocument?.createElement("template") || document.createElement("template");
|
|
98
|
+
result.innerHTML = htmlString;
|
|
99
|
+
const processedFragment = result.content;
|
|
100
|
+
this._nodes = Array.from(processedFragment.childNodes);
|
|
101
|
+
portal.insertBefore(processedFragment, this.nextSibling);
|
|
107
102
|
}
|
|
108
103
|
}
|
|
109
104
|
cleanup() {
|
|
110
105
|
this._nodes.forEach((n) => n.parentElement?.removeChild(n));
|
|
111
106
|
this._nodes = [];
|
|
112
107
|
}
|
|
113
|
-
connectedCallback() {
|
|
114
|
-
this.refresh();
|
|
115
|
-
}
|
|
116
108
|
disconnectedCallback() {
|
|
117
109
|
this.cleanup();
|
|
118
110
|
}
|
|
119
111
|
}
|
|
112
|
+
__decorate([
|
|
113
|
+
attributeHost("value"),
|
|
114
|
+
__metadata("design:type", Object)
|
|
115
|
+
], SwcChoose.prototype, "_value", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
attributeHost("replace-wrap"),
|
|
118
|
+
__metadata("design:type", String)
|
|
119
|
+
], SwcChoose.prototype, "_replaceWrap", void 0);
|
|
120
120
|
__decorate([
|
|
121
121
|
changedAttributeHost("value"),
|
|
122
122
|
__metadata("design:type", Function),
|
|
123
|
+
__metadata("design:paramtypes", []),
|
|
124
|
+
__metadata("design:returntype", void 0)
|
|
125
|
+
], SwcChoose.prototype, "setValue", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
changedAttributeHost("replace-wrap"),
|
|
128
|
+
__metadata("design:type", Function),
|
|
123
129
|
__metadata("design:paramtypes", [String]),
|
|
124
130
|
__metadata("design:returntype", void 0)
|
|
125
|
-
], SwcChoose.prototype, "
|
|
131
|
+
], SwcChoose.prototype, "setReplaceWrap", null);
|
|
126
132
|
//# sourceMappingURL=SwcChoose.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/elements/SwcChoose.ts"],
|
|
4
|
-
"sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils } from '@dooboostore/core';\nimport { SwcChooseInterface } from '../types';\n\nclass SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {\n
|
|
5
|
-
"mappings": ";;;;;;;;;AAAA,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;
|
|
4
|
+
"sourcesContent": ["import { changedAttributeHost } from '../decorators/changedAttributeHost';\nimport { SwcUtils } from '../utils/Utils';\nimport { FunctionUtils, ActionExpression } from '@dooboostore/core';\nimport { ConvertUtils } from '@dooboostore/core-web';\nimport { SwcChooseInterface } from '../types';\nimport { attributeHost } from '../decorators';\n\nclass SwcChoose extends HTMLTemplateElement implements SwcChooseInterface {\n @attributeHost('value')\n _value: any;\n\n @attributeHost('replace-wrap')\n _replaceWrap: 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.refresh(nv);\n }\n\n @changedAttributeHost('value')\n private setValue() {\n this.refresh();\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?: string | null): string {\n const config = wrap ? { wrapExpression: wrap } : undefined;\n const ae = new ActionExpression(html, config);\n const filterOptions = wrap ? { type: 'replace' as const, wrap } : 'replace';\n const win = this.ownerDocument?.defaultView || window;\n\n // @ts-ignore\n for (const expr of ae.getExpressions(filterOptions)) {\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 = this._value) {\n const portal = this.parentElement;\n if (!portal) return;\n\n const win = this.ownerDocument?.defaultView || window;\n const helperSet = SwcUtils.getHelperAndHostSet(win, this);\n const groupArgs = { ...helperSet, $value: value };\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('value') || '';\n let matches = false;\n\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, this._replaceWrap);\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 portal.insertBefore(processedFragment, 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"],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