@dooboostore/simple-web-component 1.0.2 → 1.0.3
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 +2 -2
- package/dist/cjs/decorators/{elementDefind.js → elementDefine.js} +6 -6
- package/dist/cjs/decorators/{elementDefind.js.map → elementDefine.js.map} +2 -2
- package/dist/cjs/decorators/query.js.map +1 -1
- package/dist/cjs/decorators/queryAll.js.map +1 -1
- package/dist/cjs/elements/SwcChoose.js +1 -1
- package/dist/cjs/elements/SwcChoose.js.map +1 -1
- package/dist/cjs/elements/SwcForOf.js +1 -1
- package/dist/cjs/elements/SwcForOf.js.map +1 -1
- package/dist/cjs/elements/SwcIf.js +1 -1
- package/dist/cjs/elements/SwcIf.js.map +1 -1
- package/dist/cjs/elements/SwcObject.js +1 -1
- package/dist/cjs/elements/SwcObject.js.map +1 -1
- package/dist/cjs/elements/SwcOther.js +1 -1
- package/dist/cjs/elements/SwcOther.js.map +1 -1
- package/dist/cjs/elements/SwcWhen.js +1 -1
- package/dist/cjs/elements/SwcWhen.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/decorators/{elementDefind.js → elementDefine.js} +3 -3
- package/dist/esm/decorators/{elementDefind.js.map → elementDefine.js.map} +2 -2
- package/dist/esm/decorators/query.js.map +1 -1
- package/dist/esm/decorators/queryAll.js.map +1 -1
- package/dist/esm/elements/SwcChoose.js +2 -2
- package/dist/esm/elements/SwcChoose.js.map +1 -1
- package/dist/esm/elements/SwcForOf.js +2 -2
- package/dist/esm/elements/SwcForOf.js.map +1 -1
- package/dist/esm/elements/SwcIf.js +2 -2
- package/dist/esm/elements/SwcIf.js.map +1 -1
- package/dist/esm/elements/SwcObject.js +2 -2
- package/dist/esm/elements/SwcObject.js.map +1 -1
- package/dist/esm/elements/SwcOther.js +2 -2
- package/dist/esm/elements/SwcOther.js.map +1 -1
- package/dist/esm/elements/SwcWhen.js +2 -2
- package/dist/esm/elements/SwcWhen.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +9 -9
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +2 -2
- package/dist/types/decorators/{elementDefind.d.ts → elementDefine.d.ts} +2 -2
- package/dist/types/decorators/{elementDefind.d.ts.map → elementDefine.d.ts.map} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +9 -9
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +2 -2
- package/package.json +1 -1
- package/src/decorators/{elementDefind.ts → elementDefine.ts} +1 -1
- package/src/decorators/query.ts +1 -1
- package/src/decorators/queryAll.ts +1 -1
- package/src/elements/SwcChoose.ts +2 -2
- package/src/elements/SwcForOf.ts +2 -2
- package/src/elements/SwcIf.ts +2 -2
- package/src/elements/SwcObject.ts +2 -2
- package/src/elements/SwcOther.ts +2 -2
- package/src/elements/SwcWhen.ts +2 -2
- package/src/index.ts +1 -1
|
@@ -37,7 +37,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
37
37
|
TEMPLATE_METHOD_KEY: () => TEMPLATE_METHOD_KEY,
|
|
38
38
|
addEventListener: () => addEventListener,
|
|
39
39
|
attributeChanged: () => attributeChanged,
|
|
40
|
-
|
|
40
|
+
elementDefine: () => elementDefine,
|
|
41
41
|
getAddEventListenerMetadata: () => getAddEventListenerMetadata,
|
|
42
42
|
getAttributeChangedMap: () => getAttributeChangedMap,
|
|
43
43
|
getElementConfig: () => getElementConfig,
|
|
@@ -236,7 +236,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
236
236
|
return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
// src/decorators/
|
|
239
|
+
// src/decorators/elementDefine.ts
|
|
240
240
|
var ELEMENT_CONFIG_KEY = Symbol("simple-web-component:element-config");
|
|
241
241
|
var BUILT_IN_TAG_MAP = /* @__PURE__ */ new Map();
|
|
242
242
|
var registerTag = (className, tagName) => {
|
|
@@ -302,7 +302,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
302
302
|
["HTMLVideoElement", "video"],
|
|
303
303
|
["HTMLHeadingElement", "h1"]
|
|
304
304
|
].forEach(([cls, tag]) => registerTag(cls, tag));
|
|
305
|
-
var
|
|
305
|
+
var elementDefine = (inConfig) => (constructor) => {
|
|
306
306
|
const config = typeof inConfig === "string" ? { tagName: inConfig } : inConfig;
|
|
307
307
|
let extendsTagName = config.extends;
|
|
308
308
|
if (!extendsTagName) {
|
|
@@ -647,7 +647,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
647
647
|
__metadata("design:returntype", void 0)
|
|
648
648
|
], SwcForOf.prototype, "renderTemplate", null);
|
|
649
649
|
SwcForOf = __decorate([
|
|
650
|
-
|
|
650
|
+
elementDefine({ tagName: "swc-for-of", useShadow: true }),
|
|
651
651
|
__metadata("design:paramtypes", [])
|
|
652
652
|
], SwcForOf);
|
|
653
653
|
|
|
@@ -751,7 +751,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
751
751
|
__metadata2("design:returntype", void 0)
|
|
752
752
|
], SwcIf.prototype, "renderTemplate", null);
|
|
753
753
|
SwcIf = __decorate2([
|
|
754
|
-
|
|
754
|
+
elementDefine({ tagName: "swc-if", useShadow: true }),
|
|
755
755
|
__metadata2("design:paramtypes", [])
|
|
756
756
|
], SwcIf);
|
|
757
757
|
|
|
@@ -847,7 +847,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
847
847
|
__metadata3("design:returntype", void 0)
|
|
848
848
|
], SwcChoose.prototype, "render", null);
|
|
849
849
|
SwcChoose = __decorate3([
|
|
850
|
-
|
|
850
|
+
elementDefine({ tagName: "swc-choose", useShadow: true })
|
|
851
851
|
], SwcChoose);
|
|
852
852
|
|
|
853
853
|
// src/elements/SwcWhen.ts
|
|
@@ -881,7 +881,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
881
881
|
__metadata4("design:returntype", void 0)
|
|
882
882
|
], SwcWhen.prototype, "render", null);
|
|
883
883
|
SwcWhen = __decorate4([
|
|
884
|
-
|
|
884
|
+
elementDefine({ tagName: "swc-when", useShadow: true })
|
|
885
885
|
], SwcWhen);
|
|
886
886
|
|
|
887
887
|
// src/elements/SwcOther.ts
|
|
@@ -915,7 +915,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
915
915
|
__metadata5("design:returntype", void 0)
|
|
916
916
|
], SwcOther.prototype, "render", null);
|
|
917
917
|
SwcOther = __decorate5([
|
|
918
|
-
|
|
918
|
+
elementDefine({ tagName: "swc-other", useShadow: true })
|
|
919
919
|
], SwcOther);
|
|
920
920
|
|
|
921
921
|
// src/elements/SwcObject.ts
|
|
@@ -1006,7 +1006,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1006
1006
|
__metadata6("design:returntype", void 0)
|
|
1007
1007
|
], SwcObject.prototype, "renderTemplate", null);
|
|
1008
1008
|
SwcObject = __decorate6([
|
|
1009
|
-
|
|
1009
|
+
elementDefine({ tagName: "swc-object", useShadow: true }),
|
|
1010
1010
|
__metadata6("design:paramtypes", [])
|
|
1011
1011
|
], SwcObject);
|
|
1012
1012
|
return __toCommonJS(bundle_entry_exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/bundle-entry.ts", "../../../core/src/reflect/ReflectUtils.ts", "../../src/decorators/attributeChanged.ts", "../../src/decorators/template.ts", "../../src/decorators/style.ts", "../../src/decorators/query.ts", "../../src/decorators/queryAll.ts", "../../src/decorators/addEventListener.ts", "../../src/decorators/
|
|
4
|
-
"sourcesContent": ["export * from './index';\n", "import { ConstructorType } from '../types';\nexport namespace ReflectUtils {\n export const getParameterTypes = (target: any, propertyKey?: string | symbol): ConstructorType<any>[] => {\n // console.log('---------param')\n if (propertyKey) {\n return Reflect.getMetadata('design:paramtypes', target, propertyKey) || [];\n } else {\n return Reflect.getMetadata('design:paramtypes', target) || [];\n }\n }\n\n\n export const getReturnType = (target: any, propertyKey: string | symbol): any => {\n return Reflect.getMetadata('design:returntype', target, propertyKey);\n }\n\n // @Reflect.metadata(\"design:type\", Point)\n export const getType = (target: any, propertyKey?: string | symbol): any => {\n if (propertyKey) {\n return Reflect.getMetadata('design:type', target, propertyKey);\n } else {\n return Reflect.getMetadata('design:type', target);\n }\n }\n\n export const getMetadata = <T = any>(metadataKey: any, target: any, propertyKey?: string | symbol): T | undefined => {\n if (propertyKey) {\n return Reflect.getMetadata(metadataKey, target, propertyKey);\n } else {\n return Reflect.getMetadata(metadataKey, target);\n }\n\n\n //\n // let tt = target;\n // // proxy \uAC78\uB9B0\uAC70\uB294 \uC624\uB9AC\uC9C0\uB110 constructor\uC5D0 \uB4E4\uC5B4\uAC00\uC788\uC744\uACBD\uC6B0\uB3C4\uC788\uC5B4\uC11C reflect\uAC00 proxy\uC758 constructor\uC5D0\uC11C \uCC3E\uB294\uACBD\uC6B0\uB3C4\uC788\uB2E4,\n // // \uC11C\uBC84\uB791 \uD504\uB860\uD2B8\uB791 \uB2E4\uB978\uB4EF.. \uADF8\uB798\uC11C \uC704\uB85C \uCC3E\uC544\uAC00\uBA74\uC11C\n // while (tt) {\n // let meta: any = undefined;\n // if (propertyKey) {\n // meta = Reflect.getMetadata(metadataKey, tt, propertyKey);\n // } else {\n // meta = Reflect.getMetadata(metadataKey, tt);\n // }\n // if (meta) {\n // return meta;\n // }\n // tt = Reflect.getPrototypeOf(tt);\n // }\n }\n\n export const getMetadataKeys = (target: any) => {\n return Reflect.getMetadataKeys(target);\n }\n\n export const getOwnMetadata = (metadataKey: any, target: any, propertyKey?: string): number[] | any => {\n if (propertyKey) {\n return Reflect.getOwnMetadata(metadataKey, target, propertyKey);\n } else {\n return Reflect.getOwnMetadata(metadataKey, target);\n }\n }\n\n export const getMetadatas = (target: any) => {\n return ReflectUtils.getMetadataKeys(target).map(it => ReflectUtils.getMetadata(it, target));\n }\n\n export const metadata = (metadataKey: any, data: any) => {\n return Reflect.metadata(metadataKey, data);\n }\n\n export const defineMetadata = (metadataKey: any, value: any, target: any, propertyKey?: string | symbol) => {\n // console.log(\"Reflect:\",Reflect)\n if (propertyKey && Reflect.defineMetadata) {\n Reflect.defineMetadata(metadataKey, value, target, propertyKey);\n } else if (Reflect.defineMetadata) {\n Reflect.defineMetadata(metadataKey, value, target);\n // Reflect.defineMetadata(\"design:paramtypes\", value, target);\n }\n // console.log(\"Reflect:\",Reflect.getMetadata(metadataKey, target))\n // console.log(\"Reflect:\",Reflect.getMetadata('design:paramtypes', target))\n }\n}\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const ATTRIBUTE_CHANGED_METADATA_KEY = Symbol('simple-web-component:attribute-changed');\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport function attributeChanged(attributeName: string | string[]): MethodDecorator;\nexport function attributeChanged(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function attributeChanged(arg1: string | string[] | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (attributeName: string, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let meta = ReflectUtils.getMetadata<Map<string, (string | symbol)[]>>(ATTRIBUTE_CHANGED_METADATA_KEY, constructor);\n if (!meta) {\n meta = new Map<string, (string | symbol)[]>();\n ReflectUtils.defineMetadata(ATTRIBUTE_CHANGED_METADATA_KEY, meta, constructor);\n }\n\n let methods = meta.get(attributeName);\n if (!methods) {\n methods = [];\n meta.set(attributeName, methods);\n }\n if (!methods.includes(propertyKey)) {\n methods.push(propertyKey);\n }\n };\n\n if (typeof arg1 === 'string') {\n return (target: Object, propertyKey: string | symbol) => {\n decorator(arg1, target, propertyKey);\n };\n } else if (Array.isArray(arg1)) {\n return (target: Object, propertyKey: string | symbol) => {\n arg1.forEach(name => decorator(name, target, propertyKey));\n };\n } else if (arg1 && arg2) {\n decorator(ATTRIBUTE_CHANGED_WILDCARD, arg1, arg2);\n }\n}\n\nexport const getAttributeChangedMap = (target: any): Map<string, string | symbol> | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ATTRIBUTE_CHANGED_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const TEMPLATE_METHOD_KEY = Symbol('simple-web-component:template-method');\n\nexport const template: MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n // console.log('setTemplateMethod target.constructor', target.constructor)\n ReflectUtils.defineMetadata(TEMPLATE_METHOD_KEY, propertyKey, target.constructor);\n};\n\nexport const getTemplateMethod = (target: any): string | symbol | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n // console.log('getTemplateMethod constructor', constructor)\n return ReflectUtils.getMetadata(TEMPLATE_METHOD_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const STYLE_METHOD_KEY = Symbol('simple-web-component:style-method');\n\nexport const style: MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n ReflectUtils.defineMetadata(STYLE_METHOD_KEY, propertyKey, target.constructor);\n};\n\nexport const getStyleMethod = (target: any): string | symbol | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(STYLE_METHOD_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface QueryOptions {\n useShadow?: boolean;\n}\n\nexport interface QueryMetadata {\n selector: string;\n options: QueryOptions;\n propertyKey: string | symbol;\n isMethod: boolean;\n}\n\nexport const QUERY_METADATA_KEY = Symbol('simple-web-component:query');\n\nexport const query = (selector: string, options: QueryOptions = { useShadow: true }): any => {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const isMethod = !!descriptor;\n const constructor = target.constructor;\n\n // \uBA54\uD0C0\uB370\uC774\uD130 \uC800\uC7A5 (\uB098\uC911\uC5D0 elementDefind\uC5D0\uC11C \uC0AC\uC6A9)\n let queries = ReflectUtils.getMetadata<QueryMetadata[]>(QUERY_METADATA_KEY, constructor);\n if (!queries) {\n queries = [];\n ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);\n }\n queries.push({ selector, options, propertyKey, isMethod });\n\n if (!isMethod) {\n // \uC18D\uC131 \uB370\uCF54\uB808\uC774\uD130\uC778 \uACBD\uC6B0: \uAE30\uC874\uCC98\uB7FC Lazy Getter \uC124\uC815\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n return root.querySelector(selector);\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n};\n\nexport const getQueryMetadata = (target: any): QueryMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface QueryAllOptions {\n useShadow?: boolean;\n}\n\nexport interface QueryAllMetadata {\n selector: string;\n options: QueryAllOptions;\n propertyKey: string | symbol;\n isMethod: boolean;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol('simple-web-component:query-all');\n\nexport const queryAll = (selector: string, options: QueryAllOptions = { useShadow: true }): any => {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const isMethod = !!descriptor;\n const constructor = target.constructor;\n\n // \uBA54\uD0C0\uB370\uC774\uD130 \uC800\uC7A5 (\uB098\uC911\uC5D0 elementDefind\uC5D0\uC11C \uC0AC\uC6A9)\n let queries = ReflectUtils.getMetadata<QueryAllMetadata[]>(QUERY_ALL_METADATA_KEY, constructor);\n if (!queries) {\n queries = [];\n ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);\n }\n queries.push({ selector, options, propertyKey, isMethod });\n\n if (!isMethod) {\n // \uC18D\uC131 \uB370\uCF54\uB808\uC774\uD130\uC778 \uACBD\uC6B0: \uAE30\uC874\uCC98\uB7FC Lazy Getter \uC124\uC815\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n return root.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n};\n\nexport const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n selector?: string;\n eventName: string;\n useShadow?: boolean;\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n}\n\nexport interface AddEventListenerMetadata {\n options: AddEventListenerOptions;\n propertyKey: string | symbol;\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol('simple-web-component:add-event-listener');\n\nexport const addEventListener = (options: AddEventListenerOptions): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n\n let listeners = ReflectUtils.getMetadata<AddEventListenerMetadata[]>(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n if (!listeners) {\n listeners = [];\n ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);\n }\n listeners.push({ options, propertyKey });\n };\n};\n\nexport const getAddEventListenerMetadata = (target: any): AddEventListenerMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getAttributeChangedMap, ATTRIBUTE_CHANGED_WILDCARD } from './attributeChanged';\nimport { getTemplateMethod } from './template';\nimport { getStyleMethod } from './style';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\n\nexport interface ElementConfig {\n tagName: string;\n useShadow?: boolean;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\nconst BUILT_IN_TAG_MAP = new Map<any, string>();\n\nconst registerTag = (className: string, tagName: string) => {\n if (typeof globalThis !== 'undefined' && (globalThis as any)[className]) {\n BUILT_IN_TAG_MAP.set((globalThis as any)[className], tagName);\n }\n};\n\n// Register comprehensive list of supported tags for automatic extends inference\n[\n ['HTMLAnchorElement', 'a'],\n ['HTMLAreaElement', 'area'],\n ['HTMLAudioElement', 'audio'],\n ['HTMLBaseElement', 'base'],\n ['HTMLButtonElement', 'button'],\n ['HTMLCanvasElement', 'canvas'],\n ['HTMLDataElement', 'data'],\n ['HTMLDataListElement', 'datalist'],\n ['HTMLDetailsElement', 'details'],\n ['HTMLDialogElement', 'dialog'],\n ['HTMLDivElement', 'div'],\n ['HTMLDListElement', 'dl'],\n ['HTMLEmbedElement', 'embed'],\n ['HTMLFieldSetElement', 'fieldset'],\n ['HTMLFormElement', 'form'],\n ['HTMLHRElement', 'hr'],\n ['HTMLIFrameElement', 'iframe'],\n ['HTMLImageElement', 'img'],\n ['HTMLInputElement', 'input'],\n ['HTMLLabelElement', 'label'],\n ['HTMLLegendElement', 'legend'],\n ['HTMLLIElement', 'li'],\n ['HTMLLinkElement', 'link'],\n ['HTMLMapElement', 'map'],\n ['HTMLMetaElement', 'meta'],\n ['HTMLMeterElement', 'meter'],\n ['HTMLModElement', 'del'],\n ['HTMLObjectElement', 'object'],\n ['HTMLOListElement', 'ol'],\n ['HTMLOptGroupElement', 'optgroup'],\n ['HTMLOptionElement', 'option'],\n ['HTMLOutputElement', 'output'],\n ['HTMLParagraphElement', 'p'],\n ['HTMLParamElement', 'param'],\n ['HTMLPictureElement', 'picture'],\n ['HTMLPreElement', 'pre'],\n ['HTMLProgressElement', 'progress'],\n ['HTMLQuoteElement', 'blockquote'],\n ['HTMLScriptElement', 'script'],\n ['HTMLSelectElement', 'select'],\n ['HTMLSlotElement', 'slot'],\n ['HTMLSourceElement', 'source'],\n ['HTMLSpanElement', 'span'],\n ['HTMLStyleElement', 'style'],\n ['HTMLTableElement', 'table'],\n ['HTMLTableSectionElement', 'tbody'],\n ['HTMLTableCellElement', 'td'],\n ['HTMLTemplateElement', 'template'],\n ['HTMLTextAreaElement', 'textarea'],\n ['HTMLTimeElement', 'time'],\n ['HTMLTitleElement', 'title'],\n ['HTMLTableRowElement', 'tr'],\n ['HTMLTrackElement', 'track'],\n ['HTMLUListElement', 'ul'],\n ['HTMLVideoElement', 'video'],\n ['HTMLHeadingElement', 'h1']\n].forEach(([cls, tag]) => registerTag(cls, tag));\n\nexport const elementDefind =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { tagName: inConfig } : inConfig;\n\n // 1. Automatically derive extendsTagName from prototype chain if not provided\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = Object.getPrototypeOf(constructor);\n while (proto && proto !== HTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n }\n\n // 2. Automatically collect observed attributes from @attributeChanged decorators\n const attributeChangedMap = getAttributeChangedMap(constructor);\n const observedFromDecorators = attributeChangedMap ? Array.from(attributeChangedMap.keys()).filter(it => it !== ATTRIBUTE_CHANGED_WILDCARD) : [];\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...observedFromDecorators])];\n\n // 3. Create a new anonymous class that extends the original constructor\n const NewClass = class extends (constructor as any) {\n private _observer: MutationObserver | null = null;\n private _boundElements = new WeakMap<Element, Set<string | symbol>>();\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n constructor(...args: any[]) {\n super(...args);\n if (config.useShadow === true && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n private _syncDecorators() {\n // 5. Execute @query and @queryAll methods\n const queryMetadata = getQueryMetadata(this);\n if (queryMetadata) {\n queryMetadata\n .filter(it => it.isMethod)\n .forEach(it => {\n const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const element = root.querySelector(it.selector);\n\n // 중복 호출 방지: 해당 selector로 찾은 요소가 이전과 다를 때만 호출하거나,\n // 또는 매번 호출할지 결정해야 함. 여기서는 새로운 요소가 발견되면 호출하는 방식으로 처리.\n if (element) {\n let bound = this._boundElements.get(element);\n if (!bound) {\n bound = new Set();\n this._boundElements.set(element, bound);\n }\n if (!bound.has(it.propertyKey)) {\n (this as any)[it.propertyKey](element);\n bound.add(it.propertyKey);\n }\n }\n });\n }\n\n const queryAllMetadata = getQueryAllMetadata(this);\n if (queryAllMetadata) {\n queryAllMetadata\n .filter(it => it.isMethod)\n .forEach(it => {\n const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const elements = root.querySelectorAll(it.selector);\n\n // queryAll은 목록이 바뀔 수 있으므로 일단 호출하되,\n // 내부 로직은 사용자에게 맡기거나 좀 더 정교한 비교가 필요할 수 있음.\n // 여기서는 단순하게 호출만 다시 함. (사용자가 요청한 '다시 호출' 반영)\n (this as any)[it.propertyKey](elements);\n });\n }\n\n // 6. Register @addEventListener methods\n const eventListeners = getAddEventListenerMetadata(this);\n if (eventListeners) {\n eventListeners.forEach(it => {\n const { selector, eventName, useShadow, ...options } = it.options;\n const root = useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const targetElements = selector ? root.querySelectorAll(selector) : [this as any as Element];\n\n targetElements.forEach(targetElement => {\n if (targetElement) {\n let bound = this._boundElements.get(targetElement);\n if (!bound) {\n bound = new Set();\n this._boundElements.set(targetElement, bound);\n }\n\n // 중복 바인딩 방지: (요소, 이벤트, 메서드) 조합 확인\n const eventKey = `event:${String(it.propertyKey)}:${eventName}`;\n if (!bound.has(eventKey)) {\n targetElement.addEventListener(\n eventName,\n event => {\n (this as any)[it.propertyKey](event);\n },\n options\n );\n bound.add(eventKey);\n }\n }\n });\n });\n }\n }\n\n disconnectedCallback() {\n if (this._observer) {\n this._observer.disconnect();\n }\n if (super.disconnectedCallback) {\n super.disconnectedCallback();\n }\n }\n\n connectedMoveCallback() {\n //default logic...\n if (super.connectedMoveCallback) {\n super.connectedMoveCallback();\n }\n }\n\n adoptedCallback() {\n //default logic...\n if (super.adoptedCallback) {\n super.adoptedCallback();\n }\n }\n\n async connectedCallback() {\n const templateMethod = getTemplateMethod(this);\n const styleMethod = getStyleMethod(this);\n\n const template = templateMethod ? await (this as any)[templateMethod]() : undefined;\n const style = styleMethod ? await (this as any)[styleMethod]() : undefined;\n\n // If not using shadow DOM and no decorators are present, do nothing\n if (!this.shadowRoot && template === undefined && style === undefined) {\n return;\n }\n\n let content = '';\n if (style !== undefined && style.trim().length > 0) {\n content += `<style>${style}</style>`;\n }\n\n if (template !== undefined) {\n content += template;\n } else if (!this.shadowRoot) {\n content += this.innerHTML;\n }\n\n if (this.shadowRoot) {\n this.shadowRoot.innerHTML = content;\n } else {\n this.innerHTML = content;\n }\n\n // 초기 동기화\n (this as any)._syncDecorators();\n\n // 7. Watch for DOM changes (MutationObserver)\n this._observer = new MutationObserver(() => {\n (this as any)._syncDecorators();\n });\n const target = this.shadowRoot || this;\n this._observer.observe(target, { childList: true, subtree: true });\n\n if (super.connectedCallback) {\n await super.connectedCallback();\n }\n }\n\n // 4. Handle attribute changes and route to decorated methods\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n // Call the original callback if it exists\n if (super.attributeChangedCallback) {\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n // Call all methods associated with @attributeChanged\n const methodKeys = attributeChangedMap?.get(name);\n if (methodKeys && Array.isArray(methodKeys)) {\n methodKeys.forEach(key => {\n if (typeof (this as any)[key] === 'function') {\n (this as any)[key](newValue, oldValue, name);\n }\n });\n }\n\n // Call the wildcard methods if they exist\n const wildcardMethodKeys = attributeChangedMap?.get(ATTRIBUTE_CHANGED_WILDCARD);\n if (wildcardMethodKeys && Array.isArray(wildcardMethodKeys)) {\n wildcardMethodKeys.forEach(key => {\n if (typeof (this as any)[key] === 'function') {\n (this as any)[key](newValue, oldValue, name);\n }\n });\n }\n }\n };\n\n // 5. Register Custom Element using specified or default registry\n const registry = config.customElementRegistry || (typeof customElements !== 'undefined' ? customElements : undefined);\n if (registry && !registry.get(config.tagName)) {\n const options = extendsTagName ? { extends: extendsTagName } : undefined;\n registry.define(config.tagName, NewClass as any, options);\n }\n\n // 6. Save metadata\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n\n return NewClass as any;\n };\n\nexport const getElementConfig = (target: any): ElementConfig | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n", "import { getTemplateMethod } from '../decorators/template';\nimport { getStyleMethod } from '../decorators/style';\n\nexport abstract class SwcHTMLElementBase extends HTMLElement {\n protected _masterTplNodes: Node[] = [];\n protected _asKey: string = 'value';\n protected _asIndexKey: string = 'index';\n\n constructor() {\n super();\n }\n\n protected initCore() {\n this._asKey = this.getAttribute('as') || 'value';\n this._asIndexKey = this.getAttribute('as-index') || 'index';\n const tplSlot = this.shadowRoot?.getElementById('tpl-slot') as HTMLSlotElement;\n if (tplSlot) {\n this._masterTplNodes = tplSlot.assignedNodes().map(n => n.cloneNode(true));\n }\n }\n\n protected getValueByPath(obj: any, path: string) {\n if (path === this._asKey) return obj;\n if (path.startsWith(`${this._asKey}.`)) {\n return path\n .split('.')\n .slice(1)\n .reduce((acc, part) => acc && acc[part], obj);\n }\n return undefined;\n }\n\n protected applyData(node: Node, data: any, index?: number) {\n const context: Record<string, any> = {};\n if (index !== undefined) {\n context[this._asIndexKey] = index.toString();\n }\n\n const walk = (n: Node) => {\n if (n.nodeType === Node.TEXT_NODE) {\n if (!(n as any)._original) (n as any)._original = n.textContent;\n let text = (n as any)._original;\n\n text = text.replace(/{{(.*?)}}/g, (match: string, path: string) => {\n path = path.trim();\n if (context[path] !== undefined) return context[path];\n const val = this.getValueByPath(data, path);\n return val !== undefined ? val : match;\n });\n if (n.textContent !== text) n.textContent = text;\n } else if (n.nodeType === Node.ELEMENT_NODE) {\n const el = n as Element;\n Array.from(el.attributes).forEach(a => {\n if (!(a as any)._original) (a as any)._original = a.value;\n let val = (a as any)._original;\n\n val = val.replace(/{{(.*?)}}/g, (match: string, path: string) => {\n path = path.trim();\n if (context[path] !== undefined) return context[path];\n const v = this.getValueByPath(data, path);\n return v !== undefined ? v : match;\n });\n if (a.value !== val) a.value = val;\n });\n el.childNodes.forEach(walk);\n }\n };\n walk(node);\n }\n\n /**\n * \uAC1D\uCCB4/\uBC30\uC5F4\uC758 \uBCC0\uACBD\uC744 \uAC10\uC9C0\uD558\uB294 Proxy \uC0DD\uC131 \uC720\uD2F8\uB9AC\uD2F0\n */\n protected createReactiveProxy(target: any, onChange: () => void, onIndexChange?: (index: number, val: any) => void) {\n return new Proxy(target, {\n set: (t, prop, val) => {\n const isIndex = !isNaN(Number(prop));\n t[prop] = val;\n if (isIndex && onIndexChange) {\n onIndexChange(Number(prop), val);\n } else {\n onChange();\n }\n return true;\n },\n deleteProperty: (t, prop) => {\n delete t[prop];\n onChange();\n return true;\n }\n });\n }\n}\n", "import { elementDefind, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefind({ tagName: 'swc-for-of', useShadow: true })\nexport class SwcForOf extends SwcHTMLElementBase {\n private _value: any[] = [];\n\n constructor() {\n super();\n }\n\n set value(val: any[]) {\n if (!Array.isArray(val)) val = [];\n this._value = this.createReactiveProxy(\n val,\n () => this.renderAll(),\n (idx, v) => this.updateSingleRow(idx, v)\n );\n this.renderAll();\n }\n\n get value(): any[] {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this.renderAll();\n }\n\n public updateSingleRow(index: number, newValue: any) {\n const targets = this.querySelectorAll(`[slot=\"row-${index}\"]`);\n if (targets.length > 0) {\n targets.forEach(target => this.applyData(target, newValue, index));\n } else {\n this.renderRow(newValue, index);\n }\n }\n\n private renderRow(item: any, index: number) {\n if (!this.shadowRoot || this._masterTplNodes.length === 0) return;\n\n const slotName = `row-${index}`;\n if (!this.shadowRoot.querySelector(`slot[name=\"${slotName}\"]`)) {\n const slot = document.createElement('slot');\n slot.name = slotName;\n this.shadowRoot.appendChild(slot);\n }\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', slotName);\n (clone as HTMLElement).style.display = '';\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', slotName);\n span.appendChild(clone);\n this.appendChild(span);\n this.applyData(span, item, index);\n return;\n }\n this.appendChild(clone);\n this.applyData(clone, item, index);\n });\n }\n\n private renderAll() {\n if (this._masterTplNodes.length === 0 || !this.shadowRoot) return;\n\n Array.from(this.children).forEach(c => {\n const slot = c.getAttribute('slot');\n if (slot && slot.startsWith('row-')) {\n c.remove();\n }\n });\n\n Array.from(this.shadowRoot.querySelectorAll('slot')).forEach(s => {\n if (s.id !== 'tpl-slot') s.remove();\n });\n\n this._value.forEach((item, index) => this.renderRow(item, index));\n }\n}\n", "import { elementDefind, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefind({ tagName: 'swc-if', useShadow: true })\nexport class SwcIf extends SwcHTMLElementBase {\n private _value: any = false;\n private _observer: MutationObserver | null = null;\n\n constructor() {\n super();\n }\n\n set value(val: any) {\n this._value = val;\n this.render();\n }\n\n get value(): any {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this._observer = new MutationObserver(() => this.render());\n this._observer.observe(this, { attributes: true });\n this.render();\n }\n\n disconnectedCallback() {\n this._observer?.disconnect();\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const attrValue = this.getAttribute('value');\n if (attrValue !== null && attrValue.includes('{{')) return;\n\n let displayValue = attrValue !== null ? attrValue : this._value;\n let isTruthy = !!displayValue;\n if (typeof displayValue === 'string') {\n if (displayValue === 'false' || displayValue === '0' || displayValue === '') isTruthy = false;\n else {\n try {\n isTruthy = !!new Function(`return ${displayValue}`)();\n } catch (e) {\n isTruthy = true;\n }\n }\n }\n\n Array.from(this.children).forEach(c => {\n if (c.getAttribute('slot') === 'if-content') {\n c.remove();\n }\n });\n\n const existingSlot = this.shadowRoot.querySelector('slot[name=\"if-content\"]');\n if (existingSlot) existingSlot.remove();\n\n if (isTruthy && this._masterTplNodes.length > 0) {\n const contentSlot = document.createElement('slot');\n contentSlot.name = 'if-content';\n this.shadowRoot.appendChild(contentSlot);\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', 'if-content');\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', 'if-content');\n span.appendChild(clone);\n this.appendChild(span);\n return;\n }\n this.appendChild(clone);\n });\n }\n }\n}\n", "import { elementDefind, template, style } from '../index';\n\n@elementDefind({ tagName: 'swc-choose', useShadow: true })\nexport class SwcChoose extends HTMLElement {\n private _observer: MutationObserver | null = null;\n private _value: any = undefined;\n\n set value(val: any) {\n this._value = val;\n this.evaluate();\n }\n\n get value() {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot id=\"choose-slot\"></slot>`;\n }\n\n connectedCallback() {\n this._observer = new MutationObserver(() => this.evaluate());\n this._observer.observe(this, { attributes: true, subtree: true, childList: true });\n this.evaluate();\n }\n\n disconnectedCallback() {\n this._observer?.disconnect();\n }\n\n private evaluate() {\n const whens = Array.from(this.querySelectorAll('swc-when'));\n const other = this.querySelector('swc-other');\n let matched = false;\n\n // 현재 choose에 설정된 value (문자열인 경우 \"null\", \"undefined\" 등 처리)\n const chooseValue = this.getAttribute('value') ?? this._value;\n\n whens.forEach(when => {\n if (matched) {\n (when as HTMLElement).style.display = 'none';\n return;\n }\n\n const testAttr = when.getAttribute('test');\n if (testAttr === null) return;\n if (testAttr.includes('{{')) return; // 아직 치환 전이면 스킵\n\n let isConditionMet = false;\n\n if (chooseValue !== undefined && chooseValue !== null) {\n // 1. 매칭 모드: choose의 value와 when의 test값이 같은지 비교\n isConditionMet = String(chooseValue) === String(testAttr);\n } else {\n // 2. 표현식 모드: testAttr 자체가 실행 가능한 코드인 경우\n try {\n if (testAttr === 'true') isConditionMet = true;\n else if (testAttr === 'false') isConditionMet = false;\n else isConditionMet = !!new Function(`return ${testAttr}`)();\n } catch (e) {\n isConditionMet = false;\n }\n }\n\n if (isConditionMet) {\n (when as HTMLElement).style.display = '';\n matched = true;\n } else {\n (when as HTMLElement).style.display = 'none';\n }\n });\n\n if (other) {\n (other as HTMLElement).style.display = matched ? 'none' : '';\n }\n }\n}\n", "import { elementDefind, template, style } from '../index';\n\n@elementDefind({ tagName: 'swc-when', useShadow: true })\nexport class SwcWhen extends HTMLElement {\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot></slot>`;\n }\n}\n", "import { elementDefind, template, style } from '../index';\n\n@elementDefind({ tagName: 'swc-other', useShadow: true })\nexport class SwcOther extends HTMLElement {\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot></slot>`;\n }\n}\n", "import { elementDefind, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefind({ tagName: 'swc-object', useShadow: true })\nexport class SwcObject extends SwcHTMLElementBase {\n private _value: any = {};\n private _renderedNodes: Node[] = [];\n\n constructor() {\n super();\n }\n\n set value(val: any) {\n if (typeof val !== 'object' || val === null) val = {};\n this._value = this.createReactiveProxy(val, () => this.updateUI());\n this.render();\n }\n\n get value(): any {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this.render();\n }\n\n private updateUI() {\n this._renderedNodes.forEach(node => {\n this.applyData(node, this._value);\n });\n }\n\n private render() {\n if (!this.shadowRoot || this._masterTplNodes.length === 0) return;\n\n this._renderedNodes.forEach(n => {\n if (n.parentElement === this) this.removeChild(n);\n });\n this._renderedNodes = [];\n\n let slot = this.shadowRoot.querySelector('slot[name=\"obj-content\"]');\n if (!slot) {\n slot = document.createElement('slot');\n (slot as HTMLSlotElement).name = 'obj-content';\n this.shadowRoot.appendChild(slot);\n }\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', 'obj-content');\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', 'obj-content');\n span.appendChild(clone);\n this.appendChild(span);\n this._renderedNodes.push(span);\n this.applyData(span, this._value);\n return;\n }\n this.appendChild(clone);\n this._renderedNodes.push(clone);\n this.applyData(clone, this._value);\n });\n }\n}\n"],
|
|
3
|
+
"sources": ["../../src/bundle-entry.ts", "../../../core/src/reflect/ReflectUtils.ts", "../../src/decorators/attributeChanged.ts", "../../src/decorators/template.ts", "../../src/decorators/style.ts", "../../src/decorators/query.ts", "../../src/decorators/queryAll.ts", "../../src/decorators/addEventListener.ts", "../../src/decorators/elementDefine.ts", "../../src/elements/SwcHTMLElementBase.ts", "../../src/elements/SwcForOf.ts", "../../src/elements/SwcIf.ts", "../../src/elements/SwcChoose.ts", "../../src/elements/SwcWhen.ts", "../../src/elements/SwcOther.ts", "../../src/elements/SwcObject.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './index';\n", "import { ConstructorType } from '../types';\nexport namespace ReflectUtils {\n export const getParameterTypes = (target: any, propertyKey?: string | symbol): ConstructorType<any>[] => {\n // console.log('---------param')\n if (propertyKey) {\n return Reflect.getMetadata('design:paramtypes', target, propertyKey) || [];\n } else {\n return Reflect.getMetadata('design:paramtypes', target) || [];\n }\n }\n\n\n export const getReturnType = (target: any, propertyKey: string | symbol): any => {\n return Reflect.getMetadata('design:returntype', target, propertyKey);\n }\n\n // @Reflect.metadata(\"design:type\", Point)\n export const getType = (target: any, propertyKey?: string | symbol): any => {\n if (propertyKey) {\n return Reflect.getMetadata('design:type', target, propertyKey);\n } else {\n return Reflect.getMetadata('design:type', target);\n }\n }\n\n export const getMetadata = <T = any>(metadataKey: any, target: any, propertyKey?: string | symbol): T | undefined => {\n if (propertyKey) {\n return Reflect.getMetadata(metadataKey, target, propertyKey);\n } else {\n return Reflect.getMetadata(metadataKey, target);\n }\n\n\n //\n // let tt = target;\n // // proxy \uAC78\uB9B0\uAC70\uB294 \uC624\uB9AC\uC9C0\uB110 constructor\uC5D0 \uB4E4\uC5B4\uAC00\uC788\uC744\uACBD\uC6B0\uB3C4\uC788\uC5B4\uC11C reflect\uAC00 proxy\uC758 constructor\uC5D0\uC11C \uCC3E\uB294\uACBD\uC6B0\uB3C4\uC788\uB2E4,\n // // \uC11C\uBC84\uB791 \uD504\uB860\uD2B8\uB791 \uB2E4\uB978\uB4EF.. \uADF8\uB798\uC11C \uC704\uB85C \uCC3E\uC544\uAC00\uBA74\uC11C\n // while (tt) {\n // let meta: any = undefined;\n // if (propertyKey) {\n // meta = Reflect.getMetadata(metadataKey, tt, propertyKey);\n // } else {\n // meta = Reflect.getMetadata(metadataKey, tt);\n // }\n // if (meta) {\n // return meta;\n // }\n // tt = Reflect.getPrototypeOf(tt);\n // }\n }\n\n export const getMetadataKeys = (target: any) => {\n return Reflect.getMetadataKeys(target);\n }\n\n export const getOwnMetadata = (metadataKey: any, target: any, propertyKey?: string): number[] | any => {\n if (propertyKey) {\n return Reflect.getOwnMetadata(metadataKey, target, propertyKey);\n } else {\n return Reflect.getOwnMetadata(metadataKey, target);\n }\n }\n\n export const getMetadatas = (target: any) => {\n return ReflectUtils.getMetadataKeys(target).map(it => ReflectUtils.getMetadata(it, target));\n }\n\n export const metadata = (metadataKey: any, data: any) => {\n return Reflect.metadata(metadataKey, data);\n }\n\n export const defineMetadata = (metadataKey: any, value: any, target: any, propertyKey?: string | symbol) => {\n // console.log(\"Reflect:\",Reflect)\n if (propertyKey && Reflect.defineMetadata) {\n Reflect.defineMetadata(metadataKey, value, target, propertyKey);\n } else if (Reflect.defineMetadata) {\n Reflect.defineMetadata(metadataKey, value, target);\n // Reflect.defineMetadata(\"design:paramtypes\", value, target);\n }\n // console.log(\"Reflect:\",Reflect.getMetadata(metadataKey, target))\n // console.log(\"Reflect:\",Reflect.getMetadata('design:paramtypes', target))\n }\n}\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const ATTRIBUTE_CHANGED_METADATA_KEY = Symbol('simple-web-component:attribute-changed');\nexport const ATTRIBUTE_CHANGED_WILDCARD = '*';\n\nexport function attributeChanged(attributeName: string | string[]): MethodDecorator;\nexport function attributeChanged(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function attributeChanged(arg1: string | string[] | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (attributeName: string, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let meta = ReflectUtils.getMetadata<Map<string, (string | symbol)[]>>(ATTRIBUTE_CHANGED_METADATA_KEY, constructor);\n if (!meta) {\n meta = new Map<string, (string | symbol)[]>();\n ReflectUtils.defineMetadata(ATTRIBUTE_CHANGED_METADATA_KEY, meta, constructor);\n }\n\n let methods = meta.get(attributeName);\n if (!methods) {\n methods = [];\n meta.set(attributeName, methods);\n }\n if (!methods.includes(propertyKey)) {\n methods.push(propertyKey);\n }\n };\n\n if (typeof arg1 === 'string') {\n return (target: Object, propertyKey: string | symbol) => {\n decorator(arg1, target, propertyKey);\n };\n } else if (Array.isArray(arg1)) {\n return (target: Object, propertyKey: string | symbol) => {\n arg1.forEach(name => decorator(name, target, propertyKey));\n };\n } else if (arg1 && arg2) {\n decorator(ATTRIBUTE_CHANGED_WILDCARD, arg1, arg2);\n }\n}\n\nexport const getAttributeChangedMap = (target: any): Map<string, string | symbol> | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ATTRIBUTE_CHANGED_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const TEMPLATE_METHOD_KEY = Symbol('simple-web-component:template-method');\n\nexport const template: MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n // console.log('setTemplateMethod target.constructor', target.constructor)\n ReflectUtils.defineMetadata(TEMPLATE_METHOD_KEY, propertyKey, target.constructor);\n};\n\nexport const getTemplateMethod = (target: any): string | symbol | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n // console.log('getTemplateMethod constructor', constructor)\n return ReflectUtils.getMetadata(TEMPLATE_METHOD_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const STYLE_METHOD_KEY = Symbol('simple-web-component:style-method');\n\nexport const style: MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n ReflectUtils.defineMetadata(STYLE_METHOD_KEY, propertyKey, target.constructor);\n};\n\nexport const getStyleMethod = (target: any): string | symbol | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(STYLE_METHOD_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface QueryOptions {\n useShadow?: boolean;\n}\n\nexport interface QueryMetadata {\n selector: string;\n options: QueryOptions;\n propertyKey: string | symbol;\n isMethod: boolean;\n}\n\nexport const QUERY_METADATA_KEY = Symbol('simple-web-component:query');\n\nexport const query = (selector: string, options: QueryOptions = { useShadow: true }): any => {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const isMethod = !!descriptor;\n const constructor = target.constructor;\n\n // \uBA54\uD0C0\uB370\uC774\uD130 \uC800\uC7A5 (\uB098\uC911\uC5D0 elementDefine\uC5D0\uC11C \uC0AC\uC6A9)\n let queries = ReflectUtils.getMetadata<QueryMetadata[]>(QUERY_METADATA_KEY, constructor);\n if (!queries) {\n queries = [];\n ReflectUtils.defineMetadata(QUERY_METADATA_KEY, queries, constructor);\n }\n queries.push({ selector, options, propertyKey, isMethod });\n\n if (!isMethod) {\n // \uC18D\uC131 \uB370\uCF54\uB808\uC774\uD130\uC778 \uACBD\uC6B0: \uAE30\uC874\uCC98\uB7FC Lazy Getter \uC124\uC815\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n return root.querySelector(selector);\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n};\n\nexport const getQueryMetadata = (target: any): QueryMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(QUERY_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface QueryAllOptions {\n useShadow?: boolean;\n}\n\nexport interface QueryAllMetadata {\n selector: string;\n options: QueryAllOptions;\n propertyKey: string | symbol;\n isMethod: boolean;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol('simple-web-component:query-all');\n\nexport const queryAll = (selector: string, options: QueryAllOptions = { useShadow: true }): any => {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n const isMethod = !!descriptor;\n const constructor = target.constructor;\n\n // \uBA54\uD0C0\uB370\uC774\uD130 \uC800\uC7A5 (\uB098\uC911\uC5D0 elementDefine\uC5D0\uC11C \uC0AC\uC6A9)\n let queries = ReflectUtils.getMetadata<QueryAllMetadata[]>(QUERY_ALL_METADATA_KEY, constructor);\n if (!queries) {\n queries = [];\n ReflectUtils.defineMetadata(QUERY_ALL_METADATA_KEY, queries, constructor);\n }\n queries.push({ selector, options, propertyKey, isMethod });\n\n if (!isMethod) {\n // \uC18D\uC131 \uB370\uCF54\uB808\uC774\uD130\uC778 \uACBD\uC6B0: \uAE30\uC874\uCC98\uB7FC Lazy Getter \uC124\uC815\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n return root.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true\n });\n }\n };\n};\n\nexport const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(QUERY_ALL_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface AddEventListenerOptions extends EventListenerOptions {\n selector?: string;\n eventName: string;\n useShadow?: boolean;\n capture?: boolean;\n once?: boolean;\n passive?: boolean;\n}\n\nexport interface AddEventListenerMetadata {\n options: AddEventListenerOptions;\n propertyKey: string | symbol;\n}\n\nexport const ADD_EVENT_LISTENER_METADATA_KEY = Symbol('simple-web-component:add-event-listener');\n\nexport const addEventListener = (options: AddEventListenerOptions): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n\n let listeners = ReflectUtils.getMetadata<AddEventListenerMetadata[]>(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n if (!listeners) {\n listeners = [];\n ReflectUtils.defineMetadata(ADD_EVENT_LISTENER_METADATA_KEY, listeners, constructor);\n }\n listeners.push({ options, propertyKey });\n };\n};\n\nexport const getAddEventListenerMetadata = (target: any): AddEventListenerMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);\n};\n", "import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getAttributeChangedMap, ATTRIBUTE_CHANGED_WILDCARD } from './attributeChanged';\nimport { getTemplateMethod } from './template';\nimport { getStyleMethod } from './style';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\n\nexport interface ElementConfig {\n tagName: string;\n useShadow?: boolean;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\nconst BUILT_IN_TAG_MAP = new Map<any, string>();\n\nconst registerTag = (className: string, tagName: string) => {\n if (typeof globalThis !== 'undefined' && (globalThis as any)[className]) {\n BUILT_IN_TAG_MAP.set((globalThis as any)[className], tagName);\n }\n};\n\n// Register comprehensive list of supported tags for automatic extends inference\n[\n ['HTMLAnchorElement', 'a'],\n ['HTMLAreaElement', 'area'],\n ['HTMLAudioElement', 'audio'],\n ['HTMLBaseElement', 'base'],\n ['HTMLButtonElement', 'button'],\n ['HTMLCanvasElement', 'canvas'],\n ['HTMLDataElement', 'data'],\n ['HTMLDataListElement', 'datalist'],\n ['HTMLDetailsElement', 'details'],\n ['HTMLDialogElement', 'dialog'],\n ['HTMLDivElement', 'div'],\n ['HTMLDListElement', 'dl'],\n ['HTMLEmbedElement', 'embed'],\n ['HTMLFieldSetElement', 'fieldset'],\n ['HTMLFormElement', 'form'],\n ['HTMLHRElement', 'hr'],\n ['HTMLIFrameElement', 'iframe'],\n ['HTMLImageElement', 'img'],\n ['HTMLInputElement', 'input'],\n ['HTMLLabelElement', 'label'],\n ['HTMLLegendElement', 'legend'],\n ['HTMLLIElement', 'li'],\n ['HTMLLinkElement', 'link'],\n ['HTMLMapElement', 'map'],\n ['HTMLMetaElement', 'meta'],\n ['HTMLMeterElement', 'meter'],\n ['HTMLModElement', 'del'],\n ['HTMLObjectElement', 'object'],\n ['HTMLOListElement', 'ol'],\n ['HTMLOptGroupElement', 'optgroup'],\n ['HTMLOptionElement', 'option'],\n ['HTMLOutputElement', 'output'],\n ['HTMLParagraphElement', 'p'],\n ['HTMLParamElement', 'param'],\n ['HTMLPictureElement', 'picture'],\n ['HTMLPreElement', 'pre'],\n ['HTMLProgressElement', 'progress'],\n ['HTMLQuoteElement', 'blockquote'],\n ['HTMLScriptElement', 'script'],\n ['HTMLSelectElement', 'select'],\n ['HTMLSlotElement', 'slot'],\n ['HTMLSourceElement', 'source'],\n ['HTMLSpanElement', 'span'],\n ['HTMLStyleElement', 'style'],\n ['HTMLTableElement', 'table'],\n ['HTMLTableSectionElement', 'tbody'],\n ['HTMLTableCellElement', 'td'],\n ['HTMLTemplateElement', 'template'],\n ['HTMLTextAreaElement', 'textarea'],\n ['HTMLTimeElement', 'time'],\n ['HTMLTitleElement', 'title'],\n ['HTMLTableRowElement', 'tr'],\n ['HTMLTrackElement', 'track'],\n ['HTMLUListElement', 'ul'],\n ['HTMLVideoElement', 'video'],\n ['HTMLHeadingElement', 'h1']\n].forEach(([cls, tag]) => registerTag(cls, tag));\n\nexport const elementDefine =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { tagName: inConfig } : inConfig;\n\n // 1. Automatically derive extendsTagName from prototype chain if not provided\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = Object.getPrototypeOf(constructor);\n while (proto && proto !== HTMLElement && proto !== Function.prototype) {\n extendsTagName = BUILT_IN_TAG_MAP.get(proto);\n if (extendsTagName) break;\n proto = Object.getPrototypeOf(proto);\n }\n }\n\n // 2. Automatically collect observed attributes from @attributeChanged decorators\n const attributeChangedMap = getAttributeChangedMap(constructor);\n const observedFromDecorators = attributeChangedMap ? Array.from(attributeChangedMap.keys()).filter(it => it !== ATTRIBUTE_CHANGED_WILDCARD) : [];\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...observedFromDecorators])];\n\n // 3. Create a new anonymous class that extends the original constructor\n const NewClass = class extends (constructor as any) {\n private _observer: MutationObserver | null = null;\n private _boundElements = new WeakMap<Element, Set<string | symbol>>();\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n constructor(...args: any[]) {\n super(...args);\n if (config.useShadow === true && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n private _syncDecorators() {\n // 5. Execute @query and @queryAll methods\n const queryMetadata = getQueryMetadata(this);\n if (queryMetadata) {\n queryMetadata\n .filter(it => it.isMethod)\n .forEach(it => {\n const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const element = root.querySelector(it.selector);\n\n // 중복 호출 방지: 해당 selector로 찾은 요소가 이전과 다를 때만 호출하거나,\n // 또는 매번 호출할지 결정해야 함. 여기서는 새로운 요소가 발견되면 호출하는 방식으로 처리.\n if (element) {\n let bound = this._boundElements.get(element);\n if (!bound) {\n bound = new Set();\n this._boundElements.set(element, bound);\n }\n if (!bound.has(it.propertyKey)) {\n (this as any)[it.propertyKey](element);\n bound.add(it.propertyKey);\n }\n }\n });\n }\n\n const queryAllMetadata = getQueryAllMetadata(this);\n if (queryAllMetadata) {\n queryAllMetadata\n .filter(it => it.isMethod)\n .forEach(it => {\n const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const elements = root.querySelectorAll(it.selector);\n\n // queryAll은 목록이 바뀔 수 있으므로 일단 호출하되,\n // 내부 로직은 사용자에게 맡기거나 좀 더 정교한 비교가 필요할 수 있음.\n // 여기서는 단순하게 호출만 다시 함. (사용자가 요청한 '다시 호출' 반영)\n (this as any)[it.propertyKey](elements);\n });\n }\n\n // 6. Register @addEventListener methods\n const eventListeners = getAddEventListenerMetadata(this);\n if (eventListeners) {\n eventListeners.forEach(it => {\n const { selector, eventName, useShadow, ...options } = it.options;\n const root = useShadow !== false && this.shadowRoot ? this.shadowRoot : this;\n const targetElements = selector ? root.querySelectorAll(selector) : [this as any as Element];\n\n targetElements.forEach(targetElement => {\n if (targetElement) {\n let bound = this._boundElements.get(targetElement);\n if (!bound) {\n bound = new Set();\n this._boundElements.set(targetElement, bound);\n }\n\n // 중복 바인딩 방지: (요소, 이벤트, 메서드) 조합 확인\n const eventKey = `event:${String(it.propertyKey)}:${eventName}`;\n if (!bound.has(eventKey)) {\n targetElement.addEventListener(\n eventName,\n event => {\n (this as any)[it.propertyKey](event);\n },\n options\n );\n bound.add(eventKey);\n }\n }\n });\n });\n }\n }\n\n disconnectedCallback() {\n if (this._observer) {\n this._observer.disconnect();\n }\n if (super.disconnectedCallback) {\n super.disconnectedCallback();\n }\n }\n\n connectedMoveCallback() {\n //default logic...\n if (super.connectedMoveCallback) {\n super.connectedMoveCallback();\n }\n }\n\n adoptedCallback() {\n //default logic...\n if (super.adoptedCallback) {\n super.adoptedCallback();\n }\n }\n\n async connectedCallback() {\n const templateMethod = getTemplateMethod(this);\n const styleMethod = getStyleMethod(this);\n\n const template = templateMethod ? await (this as any)[templateMethod]() : undefined;\n const style = styleMethod ? await (this as any)[styleMethod]() : undefined;\n\n // If not using shadow DOM and no decorators are present, do nothing\n if (!this.shadowRoot && template === undefined && style === undefined) {\n return;\n }\n\n let content = '';\n if (style !== undefined && style.trim().length > 0) {\n content += `<style>${style}</style>`;\n }\n\n if (template !== undefined) {\n content += template;\n } else if (!this.shadowRoot) {\n content += this.innerHTML;\n }\n\n if (this.shadowRoot) {\n this.shadowRoot.innerHTML = content;\n } else {\n this.innerHTML = content;\n }\n\n // 초기 동기화\n (this as any)._syncDecorators();\n\n // 7. Watch for DOM changes (MutationObserver)\n this._observer = new MutationObserver(() => {\n (this as any)._syncDecorators();\n });\n const target = this.shadowRoot || this;\n this._observer.observe(target, { childList: true, subtree: true });\n\n if (super.connectedCallback) {\n await super.connectedCallback();\n }\n }\n\n // 4. Handle attribute changes and route to decorated methods\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {\n // Call the original callback if it exists\n if (super.attributeChangedCallback) {\n super.attributeChangedCallback(name, oldValue, newValue);\n }\n\n // Call all methods associated with @attributeChanged\n const methodKeys = attributeChangedMap?.get(name);\n if (methodKeys && Array.isArray(methodKeys)) {\n methodKeys.forEach(key => {\n if (typeof (this as any)[key] === 'function') {\n (this as any)[key](newValue, oldValue, name);\n }\n });\n }\n\n // Call the wildcard methods if they exist\n const wildcardMethodKeys = attributeChangedMap?.get(ATTRIBUTE_CHANGED_WILDCARD);\n if (wildcardMethodKeys && Array.isArray(wildcardMethodKeys)) {\n wildcardMethodKeys.forEach(key => {\n if (typeof (this as any)[key] === 'function') {\n (this as any)[key](newValue, oldValue, name);\n }\n });\n }\n }\n };\n\n // 5. Register Custom Element using specified or default registry\n const registry = config.customElementRegistry || (typeof customElements !== 'undefined' ? customElements : undefined);\n if (registry && !registry.get(config.tagName)) {\n const options = extendsTagName ? { extends: extendsTagName } : undefined;\n registry.define(config.tagName, NewClass as any, options);\n }\n\n // 6. Save metadata\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n\n return NewClass as any;\n };\n\nexport const getElementConfig = (target: any): ElementConfig | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(ELEMENT_CONFIG_KEY, constructor);\n};\n", "import { getTemplateMethod } from '../decorators/template';\nimport { getStyleMethod } from '../decorators/style';\n\nexport abstract class SwcHTMLElementBase extends HTMLElement {\n protected _masterTplNodes: Node[] = [];\n protected _asKey: string = 'value';\n protected _asIndexKey: string = 'index';\n\n constructor() {\n super();\n }\n\n protected initCore() {\n this._asKey = this.getAttribute('as') || 'value';\n this._asIndexKey = this.getAttribute('as-index') || 'index';\n const tplSlot = this.shadowRoot?.getElementById('tpl-slot') as HTMLSlotElement;\n if (tplSlot) {\n this._masterTplNodes = tplSlot.assignedNodes().map(n => n.cloneNode(true));\n }\n }\n\n protected getValueByPath(obj: any, path: string) {\n if (path === this._asKey) return obj;\n if (path.startsWith(`${this._asKey}.`)) {\n return path\n .split('.')\n .slice(1)\n .reduce((acc, part) => acc && acc[part], obj);\n }\n return undefined;\n }\n\n protected applyData(node: Node, data: any, index?: number) {\n const context: Record<string, any> = {};\n if (index !== undefined) {\n context[this._asIndexKey] = index.toString();\n }\n\n const walk = (n: Node) => {\n if (n.nodeType === Node.TEXT_NODE) {\n if (!(n as any)._original) (n as any)._original = n.textContent;\n let text = (n as any)._original;\n\n text = text.replace(/{{(.*?)}}/g, (match: string, path: string) => {\n path = path.trim();\n if (context[path] !== undefined) return context[path];\n const val = this.getValueByPath(data, path);\n return val !== undefined ? val : match;\n });\n if (n.textContent !== text) n.textContent = text;\n } else if (n.nodeType === Node.ELEMENT_NODE) {\n const el = n as Element;\n Array.from(el.attributes).forEach(a => {\n if (!(a as any)._original) (a as any)._original = a.value;\n let val = (a as any)._original;\n\n val = val.replace(/{{(.*?)}}/g, (match: string, path: string) => {\n path = path.trim();\n if (context[path] !== undefined) return context[path];\n const v = this.getValueByPath(data, path);\n return v !== undefined ? v : match;\n });\n if (a.value !== val) a.value = val;\n });\n el.childNodes.forEach(walk);\n }\n };\n walk(node);\n }\n\n /**\n * \uAC1D\uCCB4/\uBC30\uC5F4\uC758 \uBCC0\uACBD\uC744 \uAC10\uC9C0\uD558\uB294 Proxy \uC0DD\uC131 \uC720\uD2F8\uB9AC\uD2F0\n */\n protected createReactiveProxy(target: any, onChange: () => void, onIndexChange?: (index: number, val: any) => void) {\n return new Proxy(target, {\n set: (t, prop, val) => {\n const isIndex = !isNaN(Number(prop));\n t[prop] = val;\n if (isIndex && onIndexChange) {\n onIndexChange(Number(prop), val);\n } else {\n onChange();\n }\n return true;\n },\n deleteProperty: (t, prop) => {\n delete t[prop];\n onChange();\n return true;\n }\n });\n }\n}\n", "import { elementDefine, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefine({ tagName: 'swc-for-of', useShadow: true })\nexport class SwcForOf extends SwcHTMLElementBase {\n private _value: any[] = [];\n\n constructor() {\n super();\n }\n\n set value(val: any[]) {\n if (!Array.isArray(val)) val = [];\n this._value = this.createReactiveProxy(\n val,\n () => this.renderAll(),\n (idx, v) => this.updateSingleRow(idx, v)\n );\n this.renderAll();\n }\n\n get value(): any[] {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this.renderAll();\n }\n\n public updateSingleRow(index: number, newValue: any) {\n const targets = this.querySelectorAll(`[slot=\"row-${index}\"]`);\n if (targets.length > 0) {\n targets.forEach(target => this.applyData(target, newValue, index));\n } else {\n this.renderRow(newValue, index);\n }\n }\n\n private renderRow(item: any, index: number) {\n if (!this.shadowRoot || this._masterTplNodes.length === 0) return;\n\n const slotName = `row-${index}`;\n if (!this.shadowRoot.querySelector(`slot[name=\"${slotName}\"]`)) {\n const slot = document.createElement('slot');\n slot.name = slotName;\n this.shadowRoot.appendChild(slot);\n }\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', slotName);\n (clone as HTMLElement).style.display = '';\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', slotName);\n span.appendChild(clone);\n this.appendChild(span);\n this.applyData(span, item, index);\n return;\n }\n this.appendChild(clone);\n this.applyData(clone, item, index);\n });\n }\n\n private renderAll() {\n if (this._masterTplNodes.length === 0 || !this.shadowRoot) return;\n\n Array.from(this.children).forEach(c => {\n const slot = c.getAttribute('slot');\n if (slot && slot.startsWith('row-')) {\n c.remove();\n }\n });\n\n Array.from(this.shadowRoot.querySelectorAll('slot')).forEach(s => {\n if (s.id !== 'tpl-slot') s.remove();\n });\n\n this._value.forEach((item, index) => this.renderRow(item, index));\n }\n}\n", "import { elementDefine, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefine({ tagName: 'swc-if', useShadow: true })\nexport class SwcIf extends SwcHTMLElementBase {\n private _value: any = false;\n private _observer: MutationObserver | null = null;\n\n constructor() {\n super();\n }\n\n set value(val: any) {\n this._value = val;\n this.render();\n }\n\n get value(): any {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this._observer = new MutationObserver(() => this.render());\n this._observer.observe(this, { attributes: true });\n this.render();\n }\n\n disconnectedCallback() {\n this._observer?.disconnect();\n }\n\n private render() {\n if (!this.shadowRoot) return;\n\n const attrValue = this.getAttribute('value');\n if (attrValue !== null && attrValue.includes('{{')) return;\n\n let displayValue = attrValue !== null ? attrValue : this._value;\n let isTruthy = !!displayValue;\n if (typeof displayValue === 'string') {\n if (displayValue === 'false' || displayValue === '0' || displayValue === '') isTruthy = false;\n else {\n try {\n isTruthy = !!new Function(`return ${displayValue}`)();\n } catch (e) {\n isTruthy = true;\n }\n }\n }\n\n Array.from(this.children).forEach(c => {\n if (c.getAttribute('slot') === 'if-content') {\n c.remove();\n }\n });\n\n const existingSlot = this.shadowRoot.querySelector('slot[name=\"if-content\"]');\n if (existingSlot) existingSlot.remove();\n\n if (isTruthy && this._masterTplNodes.length > 0) {\n const contentSlot = document.createElement('slot');\n contentSlot.name = 'if-content';\n this.shadowRoot.appendChild(contentSlot);\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', 'if-content');\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', 'if-content');\n span.appendChild(clone);\n this.appendChild(span);\n return;\n }\n this.appendChild(clone);\n });\n }\n }\n}\n", "import { elementDefine, template, style } from '../index';\n\n@elementDefine({ tagName: 'swc-choose', useShadow: true })\nexport class SwcChoose extends HTMLElement {\n private _observer: MutationObserver | null = null;\n private _value: any = undefined;\n\n set value(val: any) {\n this._value = val;\n this.evaluate();\n }\n\n get value() {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot id=\"choose-slot\"></slot>`;\n }\n\n connectedCallback() {\n this._observer = new MutationObserver(() => this.evaluate());\n this._observer.observe(this, { attributes: true, subtree: true, childList: true });\n this.evaluate();\n }\n\n disconnectedCallback() {\n this._observer?.disconnect();\n }\n\n private evaluate() {\n const whens = Array.from(this.querySelectorAll('swc-when'));\n const other = this.querySelector('swc-other');\n let matched = false;\n\n // 현재 choose에 설정된 value (문자열인 경우 \"null\", \"undefined\" 등 처리)\n const chooseValue = this.getAttribute('value') ?? this._value;\n\n whens.forEach(when => {\n if (matched) {\n (when as HTMLElement).style.display = 'none';\n return;\n }\n\n const testAttr = when.getAttribute('test');\n if (testAttr === null) return;\n if (testAttr.includes('{{')) return; // 아직 치환 전이면 스킵\n\n let isConditionMet = false;\n\n if (chooseValue !== undefined && chooseValue !== null) {\n // 1. 매칭 모드: choose의 value와 when의 test값이 같은지 비교\n isConditionMet = String(chooseValue) === String(testAttr);\n } else {\n // 2. 표현식 모드: testAttr 자체가 실행 가능한 코드인 경우\n try {\n if (testAttr === 'true') isConditionMet = true;\n else if (testAttr === 'false') isConditionMet = false;\n else isConditionMet = !!new Function(`return ${testAttr}`)();\n } catch (e) {\n isConditionMet = false;\n }\n }\n\n if (isConditionMet) {\n (when as HTMLElement).style.display = '';\n matched = true;\n } else {\n (when as HTMLElement).style.display = 'none';\n }\n });\n\n if (other) {\n (other as HTMLElement).style.display = matched ? 'none' : '';\n }\n }\n}\n", "import { elementDefine, template, style } from '../index';\n\n@elementDefine({ tagName: 'swc-when', useShadow: true })\nexport class SwcWhen extends HTMLElement {\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot></slot>`;\n }\n}\n", "import { elementDefine, template, style } from '../index';\n\n@elementDefine({ tagName: 'swc-other', useShadow: true })\nexport class SwcOther extends HTMLElement {\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n render() {\n return `<slot></slot>`;\n }\n}\n", "import { elementDefine, template, style } from '../index';\nimport { SwcHTMLElementBase } from './SwcHTMLElementBase';\n\n@elementDefine({ tagName: 'swc-object', useShadow: true })\nexport class SwcObject extends SwcHTMLElementBase {\n private _value: any = {};\n private _renderedNodes: Node[] = [];\n\n constructor() {\n super();\n }\n\n set value(val: any) {\n if (typeof val !== 'object' || val === null) val = {};\n this._value = this.createReactiveProxy(val, () => this.updateUI());\n this.render();\n }\n\n get value(): any {\n return this._value;\n }\n\n @style\n styles() {\n return `:host { display: contents; }`;\n }\n\n @template\n renderTemplate() {\n return `<slot id=\"tpl-slot\" style=\"display:none;\"></slot>`;\n }\n\n connectedCallback() {\n this.initCore();\n this.render();\n }\n\n private updateUI() {\n this._renderedNodes.forEach(node => {\n this.applyData(node, this._value);\n });\n }\n\n private render() {\n if (!this.shadowRoot || this._masterTplNodes.length === 0) return;\n\n this._renderedNodes.forEach(n => {\n if (n.parentElement === this) this.removeChild(n);\n });\n this._renderedNodes = [];\n\n let slot = this.shadowRoot.querySelector('slot[name=\"obj-content\"]');\n if (!slot) {\n slot = document.createElement('slot');\n (slot as HTMLSlotElement).name = 'obj-content';\n this.shadowRoot.appendChild(slot);\n }\n\n this._masterTplNodes.forEach(tplNode => {\n const clone = tplNode.cloneNode(true);\n if (clone.nodeType === Node.ELEMENT_NODE) {\n (clone as HTMLElement).setAttribute('slot', 'obj-content');\n } else if (clone.nodeType === Node.TEXT_NODE) {\n if (clone.textContent?.trim().length === 0) return;\n const span = document.createElement('span');\n span.setAttribute('slot', 'obj-content');\n span.appendChild(clone);\n this.appendChild(span);\n this._renderedNodes.push(span);\n this.applyData(span, this._value);\n return;\n }\n this.appendChild(clone);\n this._renderedNodes.push(clone);\n this.applyData(clone, this._value);\n });\n }\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,MAAW;AAAA,GAAX,CAAWA,kBAAX;AACUA,kBAAA,oBAAoB,CAAC,QAAa,gBAA0D;AAErG,UAAI,aAAa;AACb,eAAO,QAAQ,YAAY,qBAAqB,QAAQ,WAAW,KAAK,CAAC;MAC7E,OAAO;AACH,eAAO,QAAQ,YAAY,qBAAqB,MAAM,KAAK,CAAC;MAChE;IACJ;AAGaA,kBAAA,gBAAgB,CAAC,QAAa,gBAAuC;AAC9E,aAAO,QAAQ,YAAY,qBAAqB,QAAQ,WAAW;IACvE;AAGaA,kBAAA,UAAU,CAAC,QAAa,gBAAuC;AACxE,UAAI,aAAa;AACb,eAAO,QAAQ,YAAY,eAAe,QAAQ,WAAW;MACjE,OAAO;AACH,eAAO,QAAQ,YAAY,eAAe,MAAM;MACpD;IACJ;AAEaA,kBAAA,cAAc,CAAU,aAAkB,QAAa,gBAAiD;AACjH,UAAI,aA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O;AACjC,aAAK,WAAW,YAAY,IAAI;MAClC;AAEA,WAAK,gBAAgB,QAAQ,aAAU;AACrC,cAAM,QAAQ,QAAQ,UAAU,IAAI;AACpC,YAAI,MAAM,aAAa,KAAK,cAAc;AACvC,gBAAsB,aAAa,QAAQ,aAAa;QAC3D,WAAW,MAAM,aAAa,KAAK,WAAW;AAC5C,cAAI,MAAM,aAAa,KAAI,EAAG,WAAW;AAAG;AAC5C,gBAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,eAAK,aAAa,QAAQ,aAAa;AACvC,eAAK,YAAY,KAAK;AACtB,eAAK,YAAY,IAAI;AACrB,eAAK,eAAe,KAAK,IAAI;AAC7B,eAAK,UAAU,MAAM,KAAK,MAAM;AAChC;QACF;AACA,aAAK,YAAY,KAAK;AACtB,aAAK,eAAe,KAAK,KAAK;AAC9B,aAAK,UAAU,OAAO,KAAK,MAAM;MACnC,CAAC;IACH;;AArDA,EAAAC,YAAA;IADC;;;;;AAMD,EAAAA,YAAA;IADC;;;;;AAvBU,cAASA,YAAA;IADrB,cAAc,EAAE,SAAS,cAAc,WAAW,KAAI,CAAE;;KAC5C,SAAS;",
|
|
6
6
|
"names": ["ReflectUtils", "template", "style", "SwcForOf", "SwcIf", "__decorate", "SwcChoose", "__decorate", "SwcWhen", "__decorate", "SwcOther", "__decorate", "SwcObject", "__decorate"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -84,7 +84,7 @@ const registerTag = (className: string, tagName: string) => {
|
|
|
84
84
|
['HTMLHeadingElement', 'h1']
|
|
85
85
|
].forEach(([cls, tag]) => registerTag(cls, tag));
|
|
86
86
|
|
|
87
|
-
export const
|
|
87
|
+
export const elementDefine =
|
|
88
88
|
(inConfig: ElementConfig | string): ClassDecorator =>
|
|
89
89
|
(constructor: any) => {
|
|
90
90
|
const config: ElementConfig = typeof inConfig === 'string' ? { tagName: inConfig } : inConfig;
|
package/src/decorators/query.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const query = (selector: string, options: QueryOptions = { useShadow: tru
|
|
|
18
18
|
const isMethod = !!descriptor;
|
|
19
19
|
const constructor = target.constructor;
|
|
20
20
|
|
|
21
|
-
// 메타데이터 저장 (나중에
|
|
21
|
+
// 메타데이터 저장 (나중에 elementDefine에서 사용)
|
|
22
22
|
let queries = ReflectUtils.getMetadata<QueryMetadata[]>(QUERY_METADATA_KEY, constructor);
|
|
23
23
|
if (!queries) {
|
|
24
24
|
queries = [];
|
|
@@ -18,7 +18,7 @@ export const queryAll = (selector: string, options: QueryAllOptions = { useShado
|
|
|
18
18
|
const isMethod = !!descriptor;
|
|
19
19
|
const constructor = target.constructor;
|
|
20
20
|
|
|
21
|
-
// 메타데이터 저장 (나중에
|
|
21
|
+
// 메타데이터 저장 (나중에 elementDefine에서 사용)
|
|
22
22
|
let queries = ReflectUtils.getMetadata<QueryAllMetadata[]>(QUERY_ALL_METADATA_KEY, constructor);
|
|
23
23
|
if (!queries) {
|
|
24
24
|
queries = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@elementDefine({ tagName: 'swc-choose', useShadow: true })
|
|
4
4
|
export class SwcChoose extends HTMLElement {
|
|
5
5
|
private _observer: MutationObserver | null = null;
|
|
6
6
|
private _value: any = undefined;
|
package/src/elements/SwcForOf.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
import { SwcHTMLElementBase } from './SwcHTMLElementBase';
|
|
3
3
|
|
|
4
|
-
@
|
|
4
|
+
@elementDefine({ tagName: 'swc-for-of', useShadow: true })
|
|
5
5
|
export class SwcForOf extends SwcHTMLElementBase {
|
|
6
6
|
private _value: any[] = [];
|
|
7
7
|
|
package/src/elements/SwcIf.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
import { SwcHTMLElementBase } from './SwcHTMLElementBase';
|
|
3
3
|
|
|
4
|
-
@
|
|
4
|
+
@elementDefine({ tagName: 'swc-if', useShadow: true })
|
|
5
5
|
export class SwcIf extends SwcHTMLElementBase {
|
|
6
6
|
private _value: any = false;
|
|
7
7
|
private _observer: MutationObserver | null = null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
import { SwcHTMLElementBase } from './SwcHTMLElementBase';
|
|
3
3
|
|
|
4
|
-
@
|
|
4
|
+
@elementDefine({ tagName: 'swc-object', useShadow: true })
|
|
5
5
|
export class SwcObject extends SwcHTMLElementBase {
|
|
6
6
|
private _value: any = {};
|
|
7
7
|
private _renderedNodes: Node[] = [];
|
package/src/elements/SwcOther.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@elementDefine({ tagName: 'swc-other', useShadow: true })
|
|
4
4
|
export class SwcOther extends HTMLElement {
|
|
5
5
|
@style
|
|
6
6
|
styles() {
|
package/src/elements/SwcWhen.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { elementDefine, template, style } from '../index';
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@elementDefine({ tagName: 'swc-when', useShadow: true })
|
|
4
4
|
export class SwcWhen extends HTMLElement {
|
|
5
5
|
@style
|
|
6
6
|
styles() {
|
package/src/index.ts
CHANGED