@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.
Files changed (55) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/decorators/{elementDefind.js → elementDefine.js} +6 -6
  3. package/dist/cjs/decorators/{elementDefind.js.map → elementDefine.js.map} +2 -2
  4. package/dist/cjs/decorators/query.js.map +1 -1
  5. package/dist/cjs/decorators/queryAll.js.map +1 -1
  6. package/dist/cjs/elements/SwcChoose.js +1 -1
  7. package/dist/cjs/elements/SwcChoose.js.map +1 -1
  8. package/dist/cjs/elements/SwcForOf.js +1 -1
  9. package/dist/cjs/elements/SwcForOf.js.map +1 -1
  10. package/dist/cjs/elements/SwcIf.js +1 -1
  11. package/dist/cjs/elements/SwcIf.js.map +1 -1
  12. package/dist/cjs/elements/SwcObject.js +1 -1
  13. package/dist/cjs/elements/SwcObject.js.map +1 -1
  14. package/dist/cjs/elements/SwcOther.js +1 -1
  15. package/dist/cjs/elements/SwcOther.js.map +1 -1
  16. package/dist/cjs/elements/SwcWhen.js +1 -1
  17. package/dist/cjs/elements/SwcWhen.js.map +1 -1
  18. package/dist/cjs/index.js +1 -1
  19. package/dist/cjs/index.js.map +1 -1
  20. package/dist/esm/decorators/{elementDefind.js → elementDefine.js} +3 -3
  21. package/dist/esm/decorators/{elementDefind.js.map → elementDefine.js.map} +2 -2
  22. package/dist/esm/decorators/query.js.map +1 -1
  23. package/dist/esm/decorators/queryAll.js.map +1 -1
  24. package/dist/esm/elements/SwcChoose.js +2 -2
  25. package/dist/esm/elements/SwcChoose.js.map +1 -1
  26. package/dist/esm/elements/SwcForOf.js +2 -2
  27. package/dist/esm/elements/SwcForOf.js.map +1 -1
  28. package/dist/esm/elements/SwcIf.js +2 -2
  29. package/dist/esm/elements/SwcIf.js.map +1 -1
  30. package/dist/esm/elements/SwcObject.js +2 -2
  31. package/dist/esm/elements/SwcObject.js.map +1 -1
  32. package/dist/esm/elements/SwcOther.js +2 -2
  33. package/dist/esm/elements/SwcOther.js.map +1 -1
  34. package/dist/esm/elements/SwcWhen.js +2 -2
  35. package/dist/esm/elements/SwcWhen.js.map +1 -1
  36. package/dist/esm/index.js +1 -1
  37. package/dist/esm/index.js.map +1 -1
  38. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +9 -9
  39. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +2 -2
  40. package/dist/types/decorators/{elementDefind.d.ts → elementDefine.d.ts} +2 -2
  41. package/dist/types/decorators/{elementDefind.d.ts.map → elementDefine.d.ts.map} +1 -1
  42. package/dist/types/index.d.ts +1 -1
  43. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +9 -9
  44. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +2 -2
  45. package/package.json +1 -1
  46. package/src/decorators/{elementDefind.ts → elementDefine.ts} +1 -1
  47. package/src/decorators/query.ts +1 -1
  48. package/src/decorators/queryAll.ts +1 -1
  49. package/src/elements/SwcChoose.ts +2 -2
  50. package/src/elements/SwcForOf.ts +2 -2
  51. package/src/elements/SwcIf.ts +2 -2
  52. package/src/elements/SwcObject.ts +2 -2
  53. package/src/elements/SwcOther.ts +2 -2
  54. package/src/elements/SwcWhen.ts +2 -2
  55. package/src/index.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcForOf.ts"],
4
- "sourcesContent": ["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"],
4
+ "sourcesContent": ["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"],
5
5
  "mappings": ";;;;;;;;;AAAA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,aAAa,KAAI,EAAG,WAAW;AAAG;AAC5C,cAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,aAAK,aAAa,QAAQ,QAAQ;AAClC,aAAK,YAAY,KAAK;AACtB,aAAK,YAAY,IAAI;AACrB,aAAK,UAAU,MAAM,MAAM,KAAK;AAChC;MACF;AACA,WAAK,YAAY,KAAK;AACtB,WAAK,UAAU,OAAO,MAAM,KAAK;IACnC,CAAC;EACH;EAEQ,YAAS;AACf,QAAI,KAAK,gBAAgB,WAAW,KAAK,CAAC,KAAK;AAAY;AAE3D,UAAM,KAAK,KAAK,QAAQ,EAAE,QAAQ,OAAI;AACpC,YAAM,OAAO,EAAE,aAAa,MAAM;AAClC,UAAI,QAAQ,KAAK,WAAW,MAAM,GAAG;AACnC,UAAE,OAAM;MACV;IACF,CAAC;AAED,UAAM,KAAK,KAAK,WAAW,iBAAiB,MAAM,CAAC,EAAE,QAAQ,OAAI;AAC/D,UAAI,EAAE,OAAO;AAAY,UAAE,OAAM;IACnC,CAAC;AAED,SAAK,OAAO,QAAQ,CAAC,MAAM,UAAU,KAAK,UAAU,MAAM,KAAK,CAAC;EAClE;;AAnEA,WAAA;EADC;;;;;AAMD,WAAA;EADC;;;;;AA1BU,WAAQ,WAAA;EADpB,cAAc,EAAE,SAAS,cAAc,WAAW,KAAI,CAAE;;GAC5C,QAAQ;",
6
6
  "names": ["SwcForOf"]
7
7
  }
@@ -7,7 +7,7 @@ var __decorate = function(decorators, target, key, desc) {
7
7
  var __metadata = function(k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { elementDefind, template, style } from "../index.js";
10
+ import { elementDefine, template, style } from "../index.js";
11
11
  import { SwcHTMLElementBase } from "./SwcHTMLElementBase.js";
12
12
  let SwcIf = class SwcIf2 extends SwcHTMLElementBase {
13
13
  constructor() {
@@ -99,7 +99,7 @@ __decorate([
99
99
  __metadata("design:returntype", void 0)
100
100
  ], SwcIf.prototype, "renderTemplate", null);
101
101
  SwcIf = __decorate([
102
- elementDefind({ tagName: "swc-if", useShadow: true }),
102
+ elementDefine({ tagName: "swc-if", useShadow: true }),
103
103
  __metadata("design:paramtypes", [])
104
104
  ], SwcIf);
105
105
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcIf.ts"],
4
- "sourcesContent": ["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"],
4
+ "sourcesContent": ["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"],
5
5
  "mappings": ";;;;;;;;;AAAA,SAAS,eAAe,UAAU,aAAa;AAC/C,SAAS,0BAA0B;AAG5B,IAAM,QAAN,MAAMA,eAAc,mBAAkB;EAI3C,cAAA;AACE,UAAK;AAJC,SAAA,SAAc;AACd,SAAA,YAAqC;EAI7C;EAEA,IAAI,MAAM,KAAQ;AAChB,SAAK,SAAS;AACd,SAAK,OAAM;EACb;EAEA,IAAI,QAAK;AACP,WAAO,KAAK;EACd;EAGA,SAAM;AACJ,WAAO;EACT;EAGA,iBAAc;AACZ,WAAO;EACT;EAEA,oBAAiB;AACf,SAAK,SAAQ;AACb,SAAK,YAAY,IAAI,iBAAiB,MAAM,KAAK,OAAM,CAAE;AACzD,SAAK,UAAU,QAAQ,MAAM,EAAE,YAAY,KAAI,CAAE;AACjD,SAAK,OAAM;EACb;EAEA,uBAAoB;AAClB,SAAK,WAAW,WAAU;EAC5B;EAEQ,SAAM;AACZ,QAAI,CAAC,KAAK;AAAY;AAEtB,UAAM,YAAY,KAAK,aAAa,OAAO;AAC3C,QAAI,cAAc,QAAQ,UAAU,SAAS,IAAI;AAAG;AAEpD,QAAI,eAAe,cAAc,OAAO,YAAY,KAAK;AACzD,QAAI,WAAW,CAAC,CAAC;AACjB,QAAI,OAAO,iBAAiB,UAAU;AACpC,UAAI,iBAAiB,WAAW,iBAAiB,OAAO,iBAAiB;AAAI,mBAAW;WACnF;AACH,YAAI;AACF,qBAAW,CAAC,CAAC,IAAI,SAAS,UAAU,YAAY,EAAE,EAAC;QACrD,SAAS,GAAG;AACV,qBAAW;QACb;MACF;IACF;AAEA,UAAM,KAAK,KAAK,QAAQ,EAAE,QAAQ,OAAI;AACpC,UAAI,EAAE,aAAa,MAAM,MAAM,cAAc;AAC3C,UAAE,OAAM;MACV;IACF,CAAC;AAED,UAAM,eAAe,KAAK,WAAW,cAAc,yBAAyB;AAC5E,QAAI;AAAc,mBAAa,OAAM;AAErC,QAAI,YAAY,KAAK,gBAAgB,SAAS,GAAG;AAC/C,YAAM,cAAc,SAAS,cAAc,MAAM;AACjD,kBAAY,OAAO;AACnB,WAAK,WAAW,YAAY,WAAW;AAEvC,WAAK,gBAAgB,QAAQ,aAAU;AACrC,cAAM,QAAQ,QAAQ,UAAU,IAAI;AACpC,YAAI,MAAM,aAAa,KAAK,cAAc;AACvC,gBAAsB,aAAa,QAAQ,YAAY;QAC1D,WAAW,MAAM,aAAa,KAAK,WAAW;AAC5C,cAAI,MAAM,aAAa,KAAI,EAAG,WAAW;AAAG;AAC5C,gBAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,eAAK,aAAa,QAAQ,YAAY;AACtC,eAAK,YAAY,KAAK;AACtB,eAAK,YAAY,IAAI;AACrB;QACF;AACA,aAAK,YAAY,KAAK;MACxB,CAAC;IACH;EACF;;AApEA,WAAA;EADC;;;;;AAMD,WAAA;EADC;;;;;AAtBU,QAAK,WAAA;EADjB,cAAc,EAAE,SAAS,UAAU,WAAW,KAAI,CAAE;;GACxC,KAAK;",
6
6
  "names": ["SwcIf"]
7
7
  }
@@ -7,7 +7,7 @@ var __decorate = function(decorators, target, key, desc) {
7
7
  var __metadata = function(k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { elementDefind, template, style } from "../index.js";
10
+ import { elementDefine, template, style } from "../index.js";
11
11
  import { SwcHTMLElementBase } from "./SwcHTMLElementBase.js";
12
12
  let SwcObject = class SwcObject2 extends SwcHTMLElementBase {
13
13
  constructor() {
@@ -87,7 +87,7 @@ __decorate([
87
87
  __metadata("design:returntype", void 0)
88
88
  ], SwcObject.prototype, "renderTemplate", null);
89
89
  SwcObject = __decorate([
90
- elementDefind({ tagName: "swc-object", useShadow: true }),
90
+ elementDefine({ tagName: "swc-object", useShadow: true }),
91
91
  __metadata("design:paramtypes", [])
92
92
  ], SwcObject);
93
93
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcObject.ts"],
4
- "sourcesContent": ["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"],
4
+ "sourcesContent": ["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 }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Aa,KAAI,EAAG,WAAW;AAAG;AAC5C,cAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,aAAK,aAAa,QAAQ,aAAa;AACvC,aAAK,YAAY,KAAK;AACtB,aAAK,YAAY,IAAI;AACrB,aAAK,eAAe,KAAK,IAAI;AAC7B,aAAK,UAAU,MAAM,KAAK,MAAM;AAChC;MACF;AACA,WAAK,YAAY,KAAK;AACtB,WAAK,eAAe,KAAK,KAAK;AAC9B,WAAK,UAAU,OAAO,KAAK,MAAM;IACnC,CAAC;EACH;;AArDA,WAAA;EADC;;;;;AAMD,WAAA;EADC;;;;;AAvBU,YAAS,WAAA;EADrB,cAAc,EAAE,SAAS,cAAc,WAAW,KAAI,CAAE;;GAC5C,SAAS;",
6
6
  "names": ["SwcObject"]
7
7
  }
@@ -7,7 +7,7 @@ var __decorate = function(decorators, target, key, desc) {
7
7
  var __metadata = function(k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { elementDefind, template, style } from "../index.js";
10
+ import { elementDefine, template, style } from "../index.js";
11
11
  let SwcOther = class SwcOther2 extends HTMLElement {
12
12
  styles() {
13
13
  return `:host { display: contents; }`;
@@ -29,7 +29,7 @@ __decorate([
29
29
  __metadata("design:returntype", void 0)
30
30
  ], SwcOther.prototype, "render", null);
31
31
  SwcOther = __decorate([
32
- elementDefind({ tagName: "swc-other", useShadow: true })
32
+ elementDefine({ tagName: "swc-other", useShadow: true })
33
33
  ], SwcOther);
34
34
  export {
35
35
  SwcOther
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcOther.ts"],
4
- "sourcesContent": ["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"],
4
+ "sourcesContent": ["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"],
5
5
  "mappings": ";;;;;;;;;AAAA,SAAS,eAAe,UAAU,aAAa;AAGxC,IAAM,WAAN,MAAMA,kBAAiB,YAAW;EAEvC,SAAM;AACJ,WAAO;EACT;EAGA,SAAM;AACJ,WAAO;EACT;;AAPA,WAAA;EADC;;;;;AAMD,WAAA;EADC;;;;;AANU,WAAQ,WAAA;EADpB,cAAc,EAAE,SAAS,aAAa,WAAW,KAAI,CAAE;GAC3C,QAAQ;",
6
6
  "names": ["SwcOther"]
7
7
  }
@@ -7,7 +7,7 @@ var __decorate = function(decorators, target, key, desc) {
7
7
  var __metadata = function(k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { elementDefind, template, style } from "../index.js";
10
+ import { elementDefine, template, style } from "../index.js";
11
11
  let SwcWhen = class SwcWhen2 extends HTMLElement {
12
12
  styles() {
13
13
  return `:host { display: contents; }`;
@@ -29,7 +29,7 @@ __decorate([
29
29
  __metadata("design:returntype", void 0)
30
30
  ], SwcWhen.prototype, "render", null);
31
31
  SwcWhen = __decorate([
32
- elementDefind({ tagName: "swc-when", useShadow: true })
32
+ elementDefine({ tagName: "swc-when", useShadow: true })
33
33
  ], SwcWhen);
34
34
  export {
35
35
  SwcWhen
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/elements/SwcWhen.ts"],
4
- "sourcesContent": ["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"],
4
+ "sourcesContent": ["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"],
5
5
  "mappings": ";;;;;;;;;AAAA,SAAS,eAAe,UAAU,aAAa;AAGxC,IAAM,UAAN,MAAMA,iBAAgB,YAAW;EAEtC,SAAM;AACJ,WAAO;EACT;EAGA,SAAM;AACJ,WAAO;EACT;;AAPA,WAAA;EADC;;;;;AAMD,WAAA;EADC;;;;;AANU,UAAO,WAAA;EADnB,cAAc,EAAE,SAAS,YAAY,WAAW,KAAI,CAAE;GAC1C,OAAO;",
6
6
  "names": ["SwcWhen"]
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./decorators/elementDefind.js";
1
+ export * from "./decorators/elementDefine.js";
2
2
  export * from "./decorators/template.js";
3
3
  export * from "./decorators/style.js";
4
4
  export * from "./decorators/attributeChanged.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["export * from './decorators/elementDefind';\nexport * from './decorators/template';\nexport * from './decorators/style';\nexport * from './decorators/attributeChanged';\nexport * from './decorators/query';\nexport * from './decorators/queryAll';\nexport * from './decorators/addEventListener';\nexport * from './elements/SwcForOf';\nexport * from './elements/SwcIf';\nexport * from './elements/SwcChoose';\nexport * from './elements/SwcWhen';\nexport * from './elements/SwcOther';\nexport * from './elements/SwcObject';\nexport * from './elements/SwcHTMLElementBase';\n"],
4
+ "sourcesContent": ["export * from './decorators/elementDefine';\nexport * from './decorators/template';\nexport * from './decorators/style';\nexport * from './decorators/attributeChanged';\nexport * from './decorators/query';\nexport * from './decorators/queryAll';\nexport * from './decorators/addEventListener';\nexport * from './elements/SwcForOf';\nexport * from './elements/SwcIf';\nexport * from './elements/SwcChoose';\nexport * from './elements/SwcWhen';\nexport * from './elements/SwcOther';\nexport * from './elements/SwcObject';\nexport * from './elements/SwcHTMLElementBase';\n"],
5
5
  "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -183,7 +183,7 @@ var getAddEventListenerMetadata = (target) => {
183
183
  return ReflectUtils.getMetadata(ADD_EVENT_LISTENER_METADATA_KEY, constructor);
184
184
  };
185
185
 
186
- // src/decorators/elementDefind.ts
186
+ // src/decorators/elementDefine.ts
187
187
  var ELEMENT_CONFIG_KEY = Symbol("simple-web-component:element-config");
188
188
  var BUILT_IN_TAG_MAP = /* @__PURE__ */ new Map();
189
189
  var registerTag = (className, tagName) => {
@@ -249,7 +249,7 @@ var registerTag = (className, tagName) => {
249
249
  ["HTMLVideoElement", "video"],
250
250
  ["HTMLHeadingElement", "h1"]
251
251
  ].forEach(([cls, tag]) => registerTag(cls, tag));
252
- var elementDefind = (inConfig) => (constructor) => {
252
+ var elementDefine = (inConfig) => (constructor) => {
253
253
  const config = typeof inConfig === "string" ? { tagName: inConfig } : inConfig;
254
254
  let extendsTagName = config.extends;
255
255
  if (!extendsTagName) {
@@ -594,7 +594,7 @@ __decorate([
594
594
  __metadata("design:returntype", void 0)
595
595
  ], SwcForOf.prototype, "renderTemplate", null);
596
596
  SwcForOf = __decorate([
597
- elementDefind({ tagName: "swc-for-of", useShadow: true }),
597
+ elementDefine({ tagName: "swc-for-of", useShadow: true }),
598
598
  __metadata("design:paramtypes", [])
599
599
  ], SwcForOf);
600
600
 
@@ -698,7 +698,7 @@ __decorate2([
698
698
  __metadata2("design:returntype", void 0)
699
699
  ], SwcIf.prototype, "renderTemplate", null);
700
700
  SwcIf = __decorate2([
701
- elementDefind({ tagName: "swc-if", useShadow: true }),
701
+ elementDefine({ tagName: "swc-if", useShadow: true }),
702
702
  __metadata2("design:paramtypes", [])
703
703
  ], SwcIf);
704
704
 
@@ -794,7 +794,7 @@ __decorate3([
794
794
  __metadata3("design:returntype", void 0)
795
795
  ], SwcChoose.prototype, "render", null);
796
796
  SwcChoose = __decorate3([
797
- elementDefind({ tagName: "swc-choose", useShadow: true })
797
+ elementDefine({ tagName: "swc-choose", useShadow: true })
798
798
  ], SwcChoose);
799
799
 
800
800
  // src/elements/SwcWhen.ts
@@ -828,7 +828,7 @@ __decorate4([
828
828
  __metadata4("design:returntype", void 0)
829
829
  ], SwcWhen.prototype, "render", null);
830
830
  SwcWhen = __decorate4([
831
- elementDefind({ tagName: "swc-when", useShadow: true })
831
+ elementDefine({ tagName: "swc-when", useShadow: true })
832
832
  ], SwcWhen);
833
833
 
834
834
  // src/elements/SwcOther.ts
@@ -862,7 +862,7 @@ __decorate5([
862
862
  __metadata5("design:returntype", void 0)
863
863
  ], SwcOther.prototype, "render", null);
864
864
  SwcOther = __decorate5([
865
- elementDefind({ tagName: "swc-other", useShadow: true })
865
+ elementDefine({ tagName: "swc-other", useShadow: true })
866
866
  ], SwcOther);
867
867
 
868
868
  // src/elements/SwcObject.ts
@@ -953,7 +953,7 @@ __decorate6([
953
953
  __metadata6("design:returntype", void 0)
954
954
  ], SwcObject.prototype, "renderTemplate", null);
955
955
  SwcObject = __decorate6([
956
- elementDefind({ tagName: "swc-object", useShadow: true }),
956
+ elementDefine({ tagName: "swc-object", useShadow: true }),
957
957
  __metadata6("design:paramtypes", [])
958
958
  ], SwcObject);
959
959
  export {
@@ -974,7 +974,7 @@ export {
974
974
  TEMPLATE_METHOD_KEY,
975
975
  addEventListener,
976
976
  attributeChanged,
977
- elementDefind,
977
+ elementDefine,
978
978
  getAddEventListenerMetadata,
979
979
  getAttributeChangedMap,
980
980
  getElementConfig,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../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/elementDefind.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": ["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": ["../../../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": ["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": ";AACO,IAAW;CAAX,CAAWA,kBAAX;AACUA,gBAAA,oBAAoB,CAAC,QAAa,gBAA0D;AAErG,QAAI,aAAa;AACb,aAAO,QAAQ,YAAY,qBAAqB,QAAQ,WAAW,KAAK,CAAC;IAC7E,OAAO;AACH,aAAO,QAAQ,YAAY,qBAAqB,MAAM,KAAK,CAAC;IAChE;EACJ;AAGaA,gBAAA,gBAAgB,CAAC,QAAa,gBAAuC;AAC9E,WAAO,QAAQ,YAAY,qBAAqB,QAAQ,WAAW;EACvE;AAGaA,gBAAA,UAAU,CAAC,QAAa,gBAAuC;AACxE,QAAI,aAAa;AACb,aAAO,QAAQ,YAAY,eAAe,QAAQ,WAAW;IACjE,OAAO;AACH,aAAO,QAAQ,YAAY,eAAe,MAAM;IACpD;EACJ;AAEaA,gBAAA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,aAAa,KAAK,cAAc;AACvC,cAAsB,aAAa,QAAQ,aAAa;MAC3D,WAAW,MAAM,aAAa,KAAK,WAAW;AAC5C,YAAI,MAAM,aAAa,KAAI,EAAG,WAAW;AAAG;AAC5C,cAAM,OAAO,SAAS,cAAc,MAAM;AAC1C,aAAK,aAAa,QAAQ,aAAa;AACvC,aAAK,YAAY,KAAK;AACtB,aAAK,YAAY,IAAI;AACrB,aAAK,eAAe,KAAK,IAAI;AAC7B,aAAK,UAAU,MAAM,KAAK,MAAM;AAChC;MACF;AACA,WAAK,YAAY,KAAK;AACtB,WAAK,eAAe,KAAK,KAAK;AAC9B,WAAK,UAAU,OAAO,KAAK,MAAM;IACnC,CAAC;EACH;;AArDAC,YAAA;EADC;;;;;AAMDA,YAAA;EADC;;;;;AAvBU,YAASA,YAAA;EADrB,cAAc,EAAE,SAAS,cAAc,WAAW,KAAI,CAAE;;GAC5C,SAAS;",
6
6
  "names": ["ReflectUtils", "template", "style", "SwcForOf", "SwcIf", "__decorate", "SwcChoose", "__decorate", "SwcWhen", "__decorate", "SwcOther", "__decorate", "SwcObject", "__decorate"]
7
7
  }
@@ -6,6 +6,6 @@ export interface ElementConfig {
6
6
  customElementRegistry?: CustomElementRegistry;
7
7
  }
8
8
  export declare const ELEMENT_CONFIG_KEY: unique symbol;
9
- export declare const elementDefind: (inConfig: ElementConfig | string) => ClassDecorator;
9
+ export declare const elementDefine: (inConfig: ElementConfig | string) => ClassDecorator;
10
10
  export declare const getElementConfig: (target: any) => ElementConfig | undefined;
11
- //# sourceMappingURL=elementDefind.d.ts.map
11
+ //# sourceMappingURL=elementDefine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementDefind.d.ts","sourceRoot":"","sources":["../../../src/decorators/elementDefind.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C;AAED,eAAO,MAAM,kBAAkB,eAAgD,CAAC;AAsEhF,eAAO,MAAM,aAAa,GACvB,UAAU,aAAa,GAAG,MAAM,KAAG,cA0NnC,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,QAAQ,GAAG,KAAG,aAAa,GAAG,SAG9D,CAAC"}
1
+ {"version":3,"file":"elementDefine.d.ts","sourceRoot":"","sources":["../../../src/decorators/elementDefine.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CAC/C;AAED,eAAO,MAAM,kBAAkB,eAAgD,CAAC;AAsEhF,eAAO,MAAM,aAAa,GACvB,UAAU,aAAa,GAAG,MAAM,KAAG,cA0NnC,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,QAAQ,GAAG,KAAG,aAAa,GAAG,SAG9D,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './decorators/elementDefind';
1
+ export * from './decorators/elementDefine';
2
2
  export * from './decorators/template';
3
3
  export * from './decorators/style';
4
4
  export * from './decorators/attributeChanged';