@dooboostore/simple-web-component 1.0.17 → 1.0.18

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 (63) hide show
  1. package/README.md +75 -107
  2. package/dist/cjs/decorators/appendChild.js +48 -0
  3. package/dist/cjs/decorators/appendChild.js.map +7 -0
  4. package/dist/cjs/decorators/elementDefine.js +85 -7
  5. package/dist/cjs/decorators/elementDefine.js.map +2 -2
  6. package/dist/cjs/decorators/index.js +2 -1
  7. package/dist/cjs/decorators/index.js.map +2 -2
  8. package/dist/cjs/decorators/{innerHtml.js → onConnectedInnerHtml.js} +8 -8
  9. package/dist/cjs/decorators/onConnectedInnerHtml.js.map +7 -0
  10. package/dist/cjs/decorators/query.js +16 -0
  11. package/dist/cjs/decorators/query.js.map +2 -2
  12. package/dist/cjs/decorators/queryAll.js +18 -0
  13. package/dist/cjs/decorators/queryAll.js.map +2 -2
  14. package/dist/cjs/decorators/replaceChildren.js +53 -0
  15. package/dist/cjs/decorators/replaceChildren.js.map +7 -0
  16. package/dist/cjs/index.js +11 -1
  17. package/dist/cjs/index.js.map +2 -2
  18. package/dist/esm/decorators/appendChild.js +29 -0
  19. package/dist/esm/decorators/appendChild.js.map +7 -0
  20. package/dist/esm/decorators/elementDefine.js +85 -7
  21. package/dist/esm/decorators/elementDefine.js.map +2 -2
  22. package/dist/esm/decorators/index.js +2 -1
  23. package/dist/esm/decorators/index.js.map +2 -2
  24. package/dist/esm/decorators/{innerHtml.js → onConnectedInnerHtml.js} +5 -5
  25. package/dist/esm/decorators/onConnectedInnerHtml.js.map +7 -0
  26. package/dist/esm/decorators/query.js +16 -0
  27. package/dist/esm/decorators/query.js.map +2 -2
  28. package/dist/esm/decorators/queryAll.js +18 -0
  29. package/dist/esm/decorators/queryAll.js.map +2 -2
  30. package/dist/esm/decorators/replaceChildren.js +34 -0
  31. package/dist/esm/decorators/replaceChildren.js.map +7 -0
  32. package/dist/esm/index.js +7 -1
  33. package/dist/esm/index.js.map +2 -2
  34. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +181 -11
  35. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +3 -3
  36. package/dist/types/decorators/appendChild.d.ts +17 -0
  37. package/dist/types/decorators/appendChild.d.ts.map +1 -0
  38. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  39. package/dist/types/decorators/index.d.ts +2 -1
  40. package/dist/types/decorators/index.d.ts.map +1 -1
  41. package/dist/types/decorators/onConnectedInnerHtml.d.ts +15 -0
  42. package/dist/types/decorators/onConnectedInnerHtml.d.ts.map +1 -0
  43. package/dist/types/decorators/query.d.ts.map +1 -1
  44. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  45. package/dist/types/decorators/replaceChildren.d.ts +9 -0
  46. package/dist/types/decorators/replaceChildren.d.ts.map +1 -0
  47. package/dist/types/index.d.ts +4 -1
  48. package/dist/types/index.d.ts.map +1 -1
  49. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +181 -11
  50. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +3 -3
  51. package/package.json +1 -1
  52. package/src/decorators/appendChild.ts +42 -0
  53. package/src/decorators/elementDefine.ts +90 -7
  54. package/src/decorators/index.ts +2 -1
  55. package/src/decorators/{innerHtml.ts → onConnectedInnerHtml.ts} +7 -6
  56. package/src/decorators/query.ts +12 -0
  57. package/src/decorators/queryAll.ts +16 -0
  58. package/src/decorators/replaceChildren.ts +35 -0
  59. package/src/index.ts +4 -1
  60. package/dist/cjs/decorators/innerHtml.js.map +0 -7
  61. package/dist/esm/decorators/innerHtml.js.map +0 -7
  62. package/dist/types/decorators/innerHtml.d.ts +0 -12
  63. package/dist/types/decorators/innerHtml.d.ts.map +0 -1
@@ -1,11 +1,13 @@
1
1
  import { ReflectUtils } from "@dooboostore/core/reflect/ReflectUtils";
2
2
  import { FunctionUtils } from "@dooboostore/core/function/FunctionUtils";
3
- import { getInnerHtmlMetadataList } from "./innerHtml.js";
3
+ import { getOnConnectedInnerHtmlMetadata } from "./onConnectedInnerHtml.js";
4
4
  import { getAddEventListenerMetadata } from "./addEventListener.js";
5
5
  import { ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, findAllLifecycleMetadata } from "./lifecycles.js";
6
6
  import { getEmitCustomEventMetadataList } from "./emitCustomEvent.js";
7
7
  import { findAllAttributeChangedMetadata } from "./changedAttribute.js";
8
8
  import { findAllSetAttributeMetadata } from "./setAttribute.js";
9
+ import { findAllReplaceChildrenMetadata } from "./replaceChildren.js";
10
+ import { findAllAppendChildMetadata } from "./appendChild.js";
9
11
  import { SwcUtils } from "../utils/Utils.js";
10
12
  import { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from "../config/config.js";
11
13
  import { SituationTypeContainer, SituationTypeContainers } from "@dooboostore/simple-boot/decorators/inject/Inject";
@@ -47,10 +49,12 @@ const elementDefine = (inConfig) => (constructor) => {
47
49
  const addEventListenerList = getAddEventListenerMetadata(constructor) || [];
48
50
  const attrChangeMap = findAllAttributeChangedMetadata(constructor);
49
51
  const setAttrMap = findAllSetAttributeMetadata(constructor);
52
+ const replaceChildrenMap = findAllReplaceChildrenMetadata(constructor);
53
+ const appendChildMap = findAllAppendChildMetadata(constructor);
50
54
  const swcLifecycleAttributes = ["swc-on-constructor", "swc-on-connected", "swc-on-disconnected", "swc-on-before-connected", "swc-on-after-connected", "swc-on-before-disconnected", "swc-on-after-disconnected", "swc-on-before-adopted", "swc-on-after-adopted", "swc-on-attribute-changed"];
51
55
  const swcOnEvents = DOM_EVENT_NAMES.map((e) => `swc-on-${e}`);
52
56
  const mergedObservedAttributes = [.../* @__PURE__ */ new Set([...config.observedAttributes ?? [], ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map((it) => it.options.attributeName), ...swcLifecycleAttributes, ...swcOnEvents])];
53
- const innerHtmlList = getInnerHtmlMetadataList(constructor) || [];
57
+ const connectedInnerHtmlList = getOnConnectedInnerHtmlMetadata(constructor) || [];
54
58
  const NewClass = class extends constructor {
55
59
  _executeSwcScript(attrName, hostSet, extraArgs = {}) {
56
60
  const script = this.getAttribute(attrName);
@@ -117,7 +121,7 @@ const elementDefine = (inConfig) => (constructor) => {
117
121
  this._boundListeners = [];
118
122
  const hostSet = SwcUtils.getHostSet(this);
119
123
  this._executeSwcScript("swc-on-constructor", hostSet);
120
- if (innerHtmlList.some((it) => it.options.useShadow === true) && !this.shadowRoot) {
124
+ if (connectedInnerHtmlList.some((it) => it.options.useShadow === true) && !this.shadowRoot) {
121
125
  this.attachShadow({ mode: "open" });
122
126
  }
123
127
  }
@@ -137,9 +141,9 @@ const elementDefine = (inConfig) => (constructor) => {
137
141
  }
138
142
  if (typeof this.initCore === "function")
139
143
  this.initCore();
140
- if (innerHtmlList.length > 0) {
144
+ if (connectedInnerHtmlList.length > 0) {
141
145
  let sContent = "", lContent = "";
142
- for (const meta of innerHtmlList) {
146
+ for (const meta of connectedInnerHtmlList) {
143
147
  const res = await this[meta.propertyKey]();
144
148
  if (res !== void 0) {
145
149
  if (meta.options.useShadow)
@@ -183,8 +187,9 @@ const elementDefine = (inConfig) => (constructor) => {
183
187
  }
184
188
  };
185
189
  DOM_EVENT_NAMES.forEach((type) => {
186
- this.addEventListener(type, createDelegationHandler(this));
187
- this._boundListeners.push({ target: this, type, handler: createDelegationHandler(this) });
190
+ const handler = createDelegationHandler(this);
191
+ this.addEventListener(type, handler);
192
+ this._boundListeners.push({ target: this, type, handler });
188
193
  });
189
194
  const hasParentHost = SwcUtils.findAllSwcHosts(this).length > 0;
190
195
  if (!hasParentHost) {
@@ -386,6 +391,79 @@ const elementDefine = (inConfig) => (constructor) => {
386
391
  };
387
392
  }
388
393
  });
394
+ replaceChildrenMap.forEach((selector, methodName) => {
395
+ const original = NewClass.prototype[methodName];
396
+ if (typeof original === "function") {
397
+ NewClass.prototype[methodName] = function(...args) {
398
+ const res = original.apply(this, args);
399
+ if (res !== void 0) {
400
+ const conf = getElementConfig(this);
401
+ const currentWin = conf?.window || window;
402
+ const currentDoc = currentWin.document;
403
+ let targetEl = null;
404
+ if (selector === ":host" || !selector) {
405
+ targetEl = this;
406
+ } else {
407
+ targetEl = (this.shadowRoot || this).querySelector(selector);
408
+ }
409
+ if (targetEl) {
410
+ const nodes = Array.isArray(res) ? res : [res];
411
+ const normalizedNodes = nodes.map((n) => {
412
+ if (typeof n === "string") {
413
+ const t = currentDoc.createElement("template");
414
+ t.innerHTML = n;
415
+ return t.content;
416
+ }
417
+ return n;
418
+ });
419
+ targetEl.replaceChildren(...normalizedNodes);
420
+ }
421
+ }
422
+ return res;
423
+ };
424
+ }
425
+ });
426
+ appendChildMap.forEach((meta, methodName) => {
427
+ const { selector, options } = meta;
428
+ const original = NewClass.prototype[methodName];
429
+ if (typeof original === "function") {
430
+ NewClass.prototype[methodName] = function(...args) {
431
+ const res = original.apply(this, args);
432
+ if (res !== void 0) {
433
+ const conf = getElementConfig(this);
434
+ const currentWin = conf?.window || window;
435
+ const currentDoc = currentWin.document;
436
+ let targetEl = null;
437
+ if (selector === ":host" || !selector) {
438
+ targetEl = this;
439
+ } else {
440
+ targetEl = (this.shadowRoot || this).querySelector(selector);
441
+ }
442
+ if (targetEl) {
443
+ const nodes = Array.isArray(res) ? res : [res];
444
+ const normalizedNodes = nodes.map((n) => {
445
+ if (typeof n === "string") {
446
+ const t = currentDoc.createElement("template");
447
+ t.innerHTML = n;
448
+ return t.content;
449
+ }
450
+ return n;
451
+ });
452
+ const pos = options.position || "lastChild";
453
+ if (pos === "lastChild")
454
+ targetEl.append(...normalizedNodes);
455
+ else if (pos === "firstChild")
456
+ targetEl.prepend(...normalizedNodes);
457
+ else if (pos === "nextSibling")
458
+ targetEl.after(...normalizedNodes);
459
+ else if (pos === "previousSibling")
460
+ targetEl.before(...normalizedNodes);
461
+ }
462
+ }
463
+ return res;
464
+ };
465
+ }
466
+ });
389
467
  const originalProto = constructor.prototype;
390
468
  const newProto = NewClass.prototype;
391
469
  Object.getOwnPropertyNames(originalProto).forEach((name) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/elementDefine.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { FunctionUtils } from '@dooboostore/core/function/FunctionUtils';\nimport { getInnerHtmlMetadataList } from './innerHtml';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, ON_ADD_EVENT_LISTENER_METADATA_KEY, ATTRIBUTE_CHANGED_WILDCARD, findAllLifecycleMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { changedAttribute, findAllAttributeChangedMetadata } from './changedAttribute';\nimport { setAttribute, findAllSetAttributeMetadata } from './setAttribute';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationType, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { Router } from '@dooboostore/core-web/routers/Router';\nimport { InjectSituationType, HostSet, SwcAppInterface } from '../types';\n\n// --- Core Interfaces & Types ---\n\nexport interface ElementConfig {\n name: string;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n window?: Window;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\n// Shared state for global delegation to prevent multiple listeners on the same root\nconst globalDelegatedRoots = new WeakSet<Node>();\n\n// --- Environment Initialization Helper ---\n\nfunction buildEnv(configWindow?: Window) {\n const win: any = configWindow || (typeof window !== 'undefined' ? window : undefined);\n const doc: Document = win?.document;\n\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if (win?.[cls]) builtInTagMap.set(win[cls], tag);\n }\n\n const domHelpers = SwcUtils.getHelperSet(win);\n return { win, doc, builtInTagMap, domHelpers };\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nexport const elementDefine =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { name: inConfig } : inConfig;\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n config.window = win;\n\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = 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 config.extends = extendsTagName;\n }\n\n const emitCustomEventList = getEmitCustomEventMetadataList(constructor) || [];\n const addEventListenerList = getAddEventListenerMetadata(constructor) || [];\n const attrChangeMap = findAllAttributeChangedMetadata(constructor);\n const setAttrMap = findAllSetAttributeMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map(it => it.options.attributeName!), ...swcLifecycleAttributes, ...swcOnEvents])];\n const innerHtmlList = getInnerHtmlMetadataList(constructor) || [];\n\n const NewClass = class extends (constructor as any) {\n private _swcId = Math.random().toString(36).substring(2, 11);\n private _emitHandlers = new Map<string, EventListener>();\n private _boundListeners: Array<{ target: EventTarget; type: string; handler: EventListener; options?: any }> = [];\n\n private _executeSwcScript(attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const args = { ...hostSet, ...SWC_DOM_HELPERS, ...extraArgs };\n FunctionUtils.execute({ script, context: this, args });\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n }\n\n private async _invokeLifecycleMethod(methodName: string | symbol, hostSet: HostSet, extraArgs: any[] = []) {\n if (typeof (this as any)[methodName] !== 'function') return;\n const app = hostSet.$appHost?.simpleApplication;\n\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({ situationType: InjectSituationType.HOST_SET, data: hostSet }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOST, data: hostSet.$appHost }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOSTS, data: hostSet.$appHosts }), new SituationTypeContainer({ situationType: InjectSituationType.HOST, data: hostSet.$host }), new SituationTypeContainer({ situationType: InjectSituationType.HOSTS, data: hostSet.$hosts }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_HOST, data: hostSet.$firstHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_HOST, data: hostSet.$lastHost }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_APP_HOST, data: hostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: hostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\n }\n }\n\n private _bindAttributeEvent(el: HTMLElement, attrName: string, script: string, eventName?: string) {\n if (!eventName) {\n if (!attrName.startsWith('swc-on-')) return;\n eventName = attrName.substring(7);\n }\n if (swcLifecycleAttributes.includes(attrName)) return;\n\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...hostSet,\n ...SWC_DOM_HELPERS\n };\n FunctionUtils.execute({ script, context: el, args });\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n }\n\n constructor(...args: any[]) {\n super(...args);\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-constructor', hostSet);\n\n if (innerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n async connectedCallback() {\n const conf = getElementConfig(this);\n const currentWin = conf?.window || window;\n const currentDoc = currentWin.document;\n\n const hostSet = SwcUtils.getHostSet(this as any);\n\n this._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n if (typeof (this as any).initCore === 'function') (this as any).initCore();\n\n if (innerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of innerHtmlList) {\n const res = await (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n // --- Optimized Host Delegation ---\n const createDelegationHandler = (delegateHost: any) => (event: Event) => {\n if ((event as any).__swc_handled) return;\n\n const path = event.composedPath();\n const type = event.type;\n const attrName = `swc-on-${type}`;\n\n for (const node of path) {\n if (node === delegateHost) break;\n if (!(node instanceof HTMLElement)) continue;\n\n const script = node.getAttribute?.(attrName);\n if (script && !getElementConfig(node)) {\n const host = SwcUtils.findNearestSwcHost(node);\n if (host) {\n const childHostSet = SwcUtils.getHostSet(node);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...childHostSet,\n ...SWC_DOM_HELPERS\n };\n FunctionUtils.execute({ script, context: node, args });\n (event as any).__swc_handled = true;\n break;\n }\n }\n }\n };\n\n // 1. Local Delegation (To itself)\n DOM_EVENT_NAMES.forEach(type => {\n this.addEventListener(type, createDelegationHandler(this));\n this._boundListeners.push({ target: this as any, type, handler: createDelegationHandler(this) });\n });\n\n // 2. Structural/Global Delegation (If no parent host exists)\n const hasParentHost = SwcUtils.findAllSwcHosts(this as any).length > 0;\n if (!hasParentHost) {\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n const handler = createDelegationHandler(root);\n root.addEventListener(type, handler);\n });\n globalDelegatedRoots.add(root);\n }\n }\n\n // --- @addEventListener binding (Direct/Delegate/Global) ---\n addEventListenerList.forEach(meta => {\n const { selector, type, options } = meta;\n const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate, removeOnDisconnected } = options;\n const opts = { capture, once, passive };\n\n const bindTargets: EventTarget[] = [];\n\n if (selector === ':window') {\n bindTargets.push(currentWin);\n } else if (selector === ':document') {\n bindTargets.push(currentDoc);\n } else if (selector === ':parentHost') {\n if (hostSet.$parentHost) bindTargets.push(hostSet.$parentHost);\n } else if (selector === ':appHost') {\n if (hostSet.$appHost) bindTargets.push(hostSet.$appHost);\n } else if (selector === ':firstHost') {\n if (hostSet.$firstHost) bindTargets.push(hostSet.$firstHost);\n } else if (selector === ':lastHost') {\n if (hostSet.$lastHost) bindTargets.push(hostSet.$lastHost);\n } else if (selector === ':firstAppHost') {\n if (hostSet.$firstAppHost) bindTargets.push(hostSet.$firstAppHost);\n } else if (selector === ':lastAppHost') {\n if (hostSet.$lastAppHost) bindTargets.push(hostSet.$lastAppHost);\n } else if (!selector || selector === ':host') {\n bindTargets.push(this as any);\n } else if (delegate) {\n const bindRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') bindRoots.push(this.shadowRoot || (this as any));\n else if (r === 'light') bindRoots.push(this as any);\n else if (r === 'shadow') {\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n bindRoots.push(this as any);\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n }\n\n bindRoots.forEach(br => {\n const handler = (event: Event) => {\n const matchedEl = (event.target as HTMLElement).closest(selector);\n if (matchedEl && (br as any).contains(matchedEl)) {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet, matchedEl]);\n }\n };\n br.addEventListener(type, handler, opts);\n const self: any = this;\n if (removeOnDisconnected === true || (br !== self && br !== self.shadowRoot)) {\n this._boundListeners.push({ target: br, type, handler, options: opts });\n }\n });\n } else {\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') searchRoots.push((this.shadowRoot || (this as any)) as any);\n else if (r === 'light') searchRoots.push(this as any);\n else if (r === 'shadow') {\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n }\n\n searchRoots.forEach(sr => {\n sr.querySelectorAll(selector).forEach(el => bindTargets.push(el));\n });\n }\n\n bindTargets.forEach(target => {\n const handler = (event: Event) => {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet]);\n };\n target.addEventListener(type, handler, opts);\n if (removeOnDisconnected === true || target === currentWin || target === currentDoc) {\n this._boundListeners.push({ target, type, handler, options: opts });\n }\n });\n });\n\n if (super.connectedCallback) await super.connectedCallback();\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n this._executeSwcScript('swc-on-connected', hostSet);\n this._executeSwcScript('swc-on-after-connected', hostSet);\n }\n\n disconnectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n this._boundListeners.forEach(l => l.target.removeEventListener(l.type, l.handler, l.options));\n this._boundListeners = [];\n\n if (super.disconnectedCallback) super.disconnectedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-disconnected', hostSet);\n this._executeSwcScript('swc-on-after-disconnected', hostSet);\n }\n\n adoptedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-adopted', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.adoptedCallback) super.adoptedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-adopted', hostSet);\n this._executeSwcScript('swc-on-after-adopted', hostSet);\n }\n\n attributeChangedCallback(name: string, old: string | null, newVal: string | null) {\n if (super.attributeChangedCallback) super.attributeChangedCallback(name, old, newVal);\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n const customEventMeta = emitCustomEventList.find(it => it.options.attributeName === name);\n const eventName = customEventMeta ? customEventMeta.options.type : name.substring(7);\n this._bindAttributeEvent(this as any, name, newVal, eventName);\n }\n }\n\n const mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n const hSet = SwcUtils.getHostSet(this as any);\n mKeys.forEach(key => this._invokeLifecycleMethod(key, hSet, [newVal, old, name]));\n }\n }\n };\n\n // --- @setAttribute wrapping logic ---\n setAttrMap.forEach((methodName, attrName) => {\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n if (res === null) this.removeAttribute(attrName);\n else this.setAttribute(attrName, String(res));\n }\n return res;\n };\n }\n });\n\n // --- @emitCustomEvent wrapping logic ---\n emitCustomEventList.forEach(meta => {\n const { propertyKey, options } = meta;\n const original = NewClass.prototype[propertyKey as any];\n if (typeof original === 'function') {\n NewClass.prototype[propertyKey as any] = function (...args: any[]) {\n const detail = original.apply(this, args);\n const event = new CustomEvent(options.type, {\n detail,\n bubbles: options.bubbles,\n composed: options.composed,\n cancelable: options.cancelable\n });\n this.dispatchEvent(event);\n return detail;\n };\n }\n });\n\n const originalProto = constructor.prototype;\n const newProto = NewClass.prototype;\n Object.getOwnPropertyNames(originalProto).forEach(name => {\n if (name === 'constructor') return;\n const keys = Reflect.getMetadataKeys(originalProto, name);\n keys.forEach(key => Reflect.defineMetadata(key, Reflect.getMetadata(key, originalProto, name), newProto, name));\n });\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, constructor);\n const registry = config.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(config.name)) {\n registry.define(config.name, NewClass as any, config.extends ? { extends: config.extends } : undefined);\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"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,gCAAgC;AAGzC,SAAS,mCAAmC;AAC5C,SAAS,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+F,gCAAgC;AACpT,SAAS,sCAAsC;AAC/C,SAA2B,uCAAuC;AAClE,SAAuB,mCAAmC;AAC1D,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAwB,wBAAwB,+BAA+B;AAI/E,SAAS,2BAAqD;AAYvD,MAAM,qBAAqB,OAAO,qCAAqC;AAG9E,MAAM,uBAAuB,oBAAI,QAAO;AAIxC,SAAS,SAAS,cAAqB;AACrC,QAAM,MAAW,iBAAiB,OAAO,WAAW,cAAc,SAAS;AAC3E,QAAM,MAAgB,KAAK;AAE3B,QAAM,gBAAgB,oBAAI,IAAG;AAC7B,aAAW,CAAC,KAAK,GAAG,KAAK,kBAAkB;AACzC,QAAI,MAAM,GAAG;AAAG,oBAAc,IAAI,IAAI,GAAG,GAAG,GAAG;EACjD;AAEA,QAAM,aAAa,SAAS,aAAa,GAAG;AAC5C,SAAO,EAAE,KAAK,KAAK,eAAe,WAAU;AAC9C;AAEA,MAAM,cAAc,CAAC,SAAa;AAChC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AAI,YAAY,CAAC,SAAS,IAAI,OAAO,IAAI,GAAG;AAC1C,aAAS,OAAO,OAAO,MAAM,UAAiB,OAAO,UAAU,EAAE,SAAS,OAAO,QAAO,IAAK,MAAS;EACxG;AACA,SAAO;AACT;AAEK,MAAM,mBAAmB,CAAC,WAA0C;AACzE,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { FunctionUtils } from '@dooboostore/core/function/FunctionUtils';\nimport { getOnConnectedInnerHtmlMetadata } from './onConnectedInnerHtml';\nimport { getQueryMetadata } from './query';\nimport { getQueryAllMetadata } from './queryAll';\nimport { getAddEventListenerMetadata } from './addEventListener';\nimport { ON_BEFORE_CONNECTED_METADATA_KEY, ON_AFTER_CONNECTED_METADATA_KEY, ON_BEFORE_DISCONNECTED_METADATA_KEY, ON_AFTER_DISCONNECTED_METADATA_KEY, ON_BEFORE_ADOPTED_METADATA_KEY, ON_AFTER_ADOPTED_METADATA_KEY, ON_ADD_EVENT_LISTENER_METADATA_KEY, ATTRIBUTE_CHANGED_WILDCARD, findAllLifecycleMetadata } from './lifecycles';\nimport { getEmitCustomEventMetadataList } from './emitCustomEvent';\nimport { changedAttribute, findAllAttributeChangedMetadata } from './changedAttribute';\nimport { setAttribute, findAllSetAttributeMetadata } from './setAttribute';\nimport { findAllReplaceChildrenMetadata } from './replaceChildren';\nimport { findAllAppendChildMetadata } from './appendChild';\nimport { SwcUtils } from '../utils/Utils';\nimport { HTML_TAG_ENTRIES, DOM_EVENT_NAMES } from '../config/config';\nimport { SituationType, SituationTypeContainer, SituationTypeContainers } from '@dooboostore/simple-boot/decorators/inject/Inject';\nimport { ConstructorType } from '@dooboostore/core/types';\nimport { SimpleApplication } from '@dooboostore/simple-boot/SimpleApplication';\nimport { Router } from '@dooboostore/core-web/routers/Router';\nimport { InjectSituationType, HostSet, SwcAppInterface } from '../types';\n\n// --- Core Interfaces & Types ---\n\nexport interface ElementConfig {\n name: string;\n extends?: string;\n observedAttributes?: string[];\n customElementRegistry?: CustomElementRegistry;\n window?: Window;\n}\n\nexport const ELEMENT_CONFIG_KEY = Symbol('simple-web-component:element-config');\n\n// Shared state for global delegation to prevent multiple listeners on the same root\nconst globalDelegatedRoots = new WeakSet<Node>();\n\n// --- Environment Initialization Helper ---\n\nfunction buildEnv(configWindow?: Window) {\n const win: any = configWindow || (typeof window !== 'undefined' ? window : undefined);\n const doc: Document = win?.document;\n\n const builtInTagMap = new Map<any, string>();\n for (const [cls, tag] of HTML_TAG_ENTRIES) {\n if (win?.[cls]) builtInTagMap.set(win[cls], tag);\n }\n\n const domHelpers = SwcUtils.getHelperSet(win);\n return { win, doc, builtInTagMap, domHelpers };\n}\n\nconst getHandlers = (inst: any) => {\n if (!inst.__swc_attributeEventHandlers) inst.__swc_attributeEventHandlers = new Map();\n return inst.__swc_attributeEventHandlers;\n};\n\nexport const elementDefine =\n (inConfig: ElementConfig | string): ClassDecorator =>\n (constructor: any) => {\n const config: ElementConfig = typeof inConfig === 'string' ? { name: inConfig } : inConfig;\n const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);\n config.window = win;\n\n let extendsTagName = config.extends;\n if (!extendsTagName) {\n let proto = 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 config.extends = extendsTagName;\n }\n\n const emitCustomEventList = getEmitCustomEventMetadataList(constructor) || [];\n const addEventListenerList = getAddEventListenerMetadata(constructor) || [];\n const attrChangeMap = findAllAttributeChangedMetadata(constructor);\n const setAttrMap = findAllSetAttributeMetadata(constructor);\n const replaceChildrenMap = findAllReplaceChildrenMetadata(constructor);\n const appendChildMap = findAllAppendChildMetadata(constructor);\n\n const swcLifecycleAttributes = ['swc-on-constructor', 'swc-on-connected', 'swc-on-disconnected', 'swc-on-before-connected', 'swc-on-after-connected', 'swc-on-before-disconnected', 'swc-on-after-disconnected', 'swc-on-before-adopted', 'swc-on-after-adopted', 'swc-on-attribute-changed'];\n const swcOnEvents = DOM_EVENT_NAMES.map(e => `swc-on-${e}`);\n\n const mergedObservedAttributes = [...new Set([...(config.observedAttributes ?? []), ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map(it => it.options.attributeName!), ...swcLifecycleAttributes, ...swcOnEvents])];\n const connectedInnerHtmlList = getOnConnectedInnerHtmlMetadata(constructor) || [];\n\n const NewClass = class extends (constructor as any) {\n private _swcId = Math.random().toString(36).substring(2, 11);\n private _emitHandlers = new Map<string, EventListener>();\n private _boundListeners: Array<{ target: EventTarget; type: string; handler: EventListener; options?: any }> = [];\n\n private _executeSwcScript(attrName: string, hostSet: HostSet, extraArgs: Record<string, any> = {}) {\n const script = this.getAttribute(attrName);\n if (script) {\n try {\n const args = { ...hostSet, ...SWC_DOM_HELPERS, ...extraArgs };\n FunctionUtils.execute({ script, context: this, args });\n } catch (e) {\n console.error(`[SWC] Failed to execute ${attrName}:`, e);\n }\n }\n }\n\n private async _invokeLifecycleMethod(methodName: string | symbol, hostSet: HostSet, extraArgs: any[] = []) {\n if (typeof (this as any)[methodName] !== 'function') return;\n const app = hostSet.$appHost?.simpleApplication;\n\n if (app) {\n const otherStorage = new Map<any, any>();\n const situations = new SituationTypeContainers([new SituationTypeContainer({ situationType: InjectSituationType.HOST_SET, data: hostSet }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOST, data: hostSet.$appHost }), new SituationTypeContainer({ situationType: InjectSituationType.APP_HOSTS, data: hostSet.$appHosts }), new SituationTypeContainer({ situationType: InjectSituationType.HOST, data: hostSet.$host }), new SituationTypeContainer({ situationType: InjectSituationType.HOSTS, data: hostSet.$hosts }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_HOST, data: hostSet.$firstHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_HOST, data: hostSet.$lastHost }), new SituationTypeContainer({ situationType: InjectSituationType.FIRST_APP_HOST, data: hostSet.$firstAppHost }), new SituationTypeContainer({ situationType: InjectSituationType.LAST_APP_HOST, data: hostSet.$lastAppHost })]);\n otherStorage.set(SituationTypeContainers, situations);\n\n return app.simstanceManager.executeBindParameterSimPromise(\n {\n target: this,\n targetKey: methodName,\n inputParameters: extraArgs\n },\n otherStorage\n );\n } else {\n return (this as any)[methodName](...extraArgs);\n }\n }\n\n private _bindAttributeEvent(el: HTMLElement, attrName: string, script: string, eventName?: string) {\n if (!eventName) {\n if (!attrName.startsWith('swc-on-')) return;\n eventName = attrName.substring(7);\n }\n if (swcLifecycleAttributes.includes(attrName)) return;\n\n const elHandlers = getHandlers(this);\n let handlers = elHandlers.get(el);\n if (!handlers) {\n handlers = new Map();\n elHandlers.set(el, handlers);\n }\n\n const oldHandler = handlers.get(attrName);\n if (oldHandler) el.removeEventListener(eventName, oldHandler);\n\n const handler = (event: any) => {\n const hostSet = SwcUtils.getHostSet(el);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...hostSet,\n ...SWC_DOM_HELPERS\n };\n FunctionUtils.execute({ script, context: el, args });\n };\n\n el.addEventListener(eventName, handler);\n handlers.set(attrName, handler);\n }\n\n constructor(...args: any[]) {\n super(...args);\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-constructor', hostSet);\n\n if (connectedInnerHtmlList.some(it => it.options.useShadow === true) && !this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n }\n\n static get observedAttributes() {\n return mergedObservedAttributes;\n }\n\n async connectedCallback() {\n const conf = getElementConfig(this);\n const currentWin = conf?.window || window;\n const currentDoc = currentWin.document;\n\n const hostSet = SwcUtils.getHostSet(this as any);\n\n this._executeSwcScript('swc-on-before-connected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_CONNECTED_METADATA_KEY);\n if (bMethods) {\n for (const m of bMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n if (typeof (this as any).initCore === 'function') (this as any).initCore();\n\n if (connectedInnerHtmlList.length > 0) {\n let sContent = '',\n lContent = '';\n for (const meta of connectedInnerHtmlList) {\n const res = await (this as any)[meta.propertyKey]();\n if (res !== undefined) {\n if (meta.options.useShadow) sContent += res;\n else lContent += res;\n }\n }\n if (this.shadowRoot) this.shadowRoot.innerHTML = sContent;\n if (lContent) this.innerHTML = lContent;\n }\n\n // --- Optimized Host Delegation ---\n const createDelegationHandler = (delegateHost: any) => (event: Event) => {\n if ((event as any).__swc_handled) return;\n\n const path = event.composedPath();\n const type = event.type;\n const attrName = `swc-on-${type}`;\n\n for (const node of path) {\n if (node === delegateHost) break;\n if (!(node instanceof HTMLElement)) continue;\n\n const script = node.getAttribute?.(attrName);\n if (script && !getElementConfig(node)) {\n const host = SwcUtils.findNearestSwcHost(node);\n if (host) {\n const childHostSet = SwcUtils.getHostSet(node);\n const args = {\n event,\n $data: (event as CustomEvent).detail,\n ...childHostSet,\n ...SWC_DOM_HELPERS\n };\n FunctionUtils.execute({ script, context: node, args });\n (event as any).__swc_handled = true;\n break;\n }\n }\n }\n };\n\n // 1. Local Delegation (To itself)\n DOM_EVENT_NAMES.forEach(type => {\n const handler = createDelegationHandler(this);\n this.addEventListener(type, handler);\n this._boundListeners.push({ target: this as any, type, handler });\n });\n\n // 2. Structural/Global Delegation (If no parent host exists)\n const hasParentHost = SwcUtils.findAllSwcHosts(this as any).length > 0;\n if (!hasParentHost) {\n const root = this.getRootNode();\n if (!globalDelegatedRoots.has(root)) {\n DOM_EVENT_NAMES.forEach(type => {\n const handler = createDelegationHandler(root);\n root.addEventListener(type, handler);\n });\n globalDelegatedRoots.add(root);\n }\n }\n\n // --- @addEventListener binding (Direct/Delegate/Global) ---\n addEventListenerList.forEach(meta => {\n const { selector, type, options } = meta;\n const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate, removeOnDisconnected } = options;\n const opts = { capture, once, passive };\n\n const bindTargets: EventTarget[] = [];\n\n if (selector === ':window') {\n bindTargets.push(currentWin);\n } else if (selector === ':document') {\n bindTargets.push(currentDoc);\n } else if (selector === ':parentHost') {\n if (hostSet.$parentHost) bindTargets.push(hostSet.$parentHost);\n } else if (selector === ':appHost') {\n if (hostSet.$appHost) bindTargets.push(hostSet.$appHost);\n } else if (selector === ':firstHost') {\n if (hostSet.$firstHost) bindTargets.push(hostSet.$firstHost);\n } else if (selector === ':lastHost') {\n if (hostSet.$lastHost) bindTargets.push(hostSet.$lastHost);\n } else if (selector === ':firstAppHost') {\n if (hostSet.$firstAppHost) bindTargets.push(hostSet.$firstAppHost);\n } else if (selector === ':lastAppHost') {\n if (hostSet.$lastAppHost) bindTargets.push(hostSet.$lastAppHost);\n } else if (!selector || selector === ':host') {\n bindTargets.push(this as any);\n } else if (delegate) {\n const bindRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') bindRoots.push(this.shadowRoot || (this as any));\n else if (r === 'light') bindRoots.push(this as any);\n else if (r === 'shadow') {\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n bindRoots.push(this as any);\n if (this.shadowRoot) bindRoots.push(this.shadowRoot as any);\n }\n\n bindRoots.forEach(br => {\n const handler = (event: Event) => {\n const matchedEl = (event.target as HTMLElement).closest(selector);\n if (matchedEl && (br as any).contains(matchedEl)) {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet, matchedEl]);\n }\n };\n br.addEventListener(type, handler, opts);\n const self: any = this;\n if (removeOnDisconnected === true || (br !== self && br !== self.shadowRoot)) {\n this._boundListeners.push({ target: br, type, handler, options: opts });\n }\n });\n } else {\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') searchRoots.push((this.shadowRoot || (this as any)) as any);\n else if (r === 'light') searchRoots.push(this as any);\n else if (r === 'shadow') {\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n } else if (r === 'all') {\n searchRoots.push(this as any);\n if (this.shadowRoot) searchRoots.push(this.shadowRoot as any);\n }\n\n searchRoots.forEach(sr => {\n sr.querySelectorAll(selector).forEach(el => bindTargets.push(el));\n });\n }\n\n bindTargets.forEach(target => {\n const handler = (event: Event) => {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n const currentHostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet]);\n };\n target.addEventListener(type, handler, opts);\n if (removeOnDisconnected === true || target === currentWin || target === currentDoc) {\n this._boundListeners.push({ target, type, handler, options: opts });\n }\n });\n });\n\n if (super.connectedCallback) await super.connectedCallback();\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_CONNECTED_METADATA_KEY);\n if (aMethods) {\n for (const m of aMethods) await this._invokeLifecycleMethod(m, hostSet);\n }\n\n this._executeSwcScript('swc-on-connected', hostSet);\n this._executeSwcScript('swc-on-after-connected', hostSet);\n }\n\n disconnectedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-disconnected', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_DISCONNECTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n this._boundListeners.forEach(l => l.target.removeEventListener(l.type, l.handler, l.options));\n this._boundListeners = [];\n\n if (super.disconnectedCallback) super.disconnectedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_DISCONNECTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-disconnected', hostSet);\n this._executeSwcScript('swc-on-after-disconnected', hostSet);\n }\n\n adoptedCallback() {\n const hostSet = SwcUtils.getHostSet(this as any);\n this._executeSwcScript('swc-on-before-adopted', hostSet);\n const bMethods = findAllLifecycleMetadata(this, ON_BEFORE_ADOPTED_METADATA_KEY);\n if (bMethods) bMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n\n if (super.adoptedCallback) super.adoptedCallback();\n\n const aMethods = findAllLifecycleMetadata(this, ON_AFTER_ADOPTED_METADATA_KEY);\n if (aMethods) aMethods.forEach(m => this._invokeLifecycleMethod(m, hostSet));\n this._executeSwcScript('swc-on-adopted', hostSet);\n this._executeSwcScript('swc-on-after-adopted', hostSet);\n }\n\n attributeChangedCallback(name: string, old: string | null, newVal: string | null) {\n if (super.attributeChangedCallback) super.attributeChangedCallback(name, old, newVal);\n\n if (name.startsWith('swc-on-') && !swcLifecycleAttributes.includes(name)) {\n if (newVal !== null) {\n const customEventMeta = emitCustomEventList.find(it => it.options.attributeName === name);\n const eventName = customEventMeta ? customEventMeta.options.type : name.substring(7);\n this._bindAttributeEvent(this as any, name, newVal, eventName);\n }\n }\n\n const mKeys = attrChangeMap.get(name);\n if (mKeys && Array.isArray(mKeys)) {\n const hSet = SwcUtils.getHostSet(this as any);\n mKeys.forEach(key => this._invokeLifecycleMethod(key, hSet, [newVal, old, name]));\n }\n }\n };\n\n // --- @setAttribute wrapping logic ---\n setAttrMap.forEach((methodName, attrName) => {\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n if (res === null) this.removeAttribute(attrName);\n else this.setAttribute(attrName, String(res));\n }\n return res;\n };\n }\n });\n\n // --- @emitCustomEvent wrapping logic ---\n emitCustomEventList.forEach(meta => {\n const { propertyKey, options } = meta;\n const original = NewClass.prototype[propertyKey as any];\n if (typeof original === 'function') {\n NewClass.prototype[propertyKey as any] = function (...args: any[]) {\n const detail = original.apply(this, args);\n const event = new CustomEvent(options.type, {\n detail,\n bubbles: options.bubbles,\n composed: options.composed,\n cancelable: options.cancelable\n });\n this.dispatchEvent(event);\n return detail;\n };\n }\n });\n\n // --- @replaceChildren wrapping logic ---\n replaceChildrenMap.forEach((selector, methodName) => {\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n const conf = getElementConfig(this);\n const currentWin = conf?.window || window;\n const currentDoc = currentWin.document;\n\n let targetEl: Element | null = null;\n if (selector === ':host' || !selector) {\n targetEl = this;\n } else {\n targetEl = (this.shadowRoot || this).querySelector(selector);\n }\n\n if (targetEl) {\n const nodes: (Node | string)[] = Array.isArray(res) ? res : [res];\n const normalizedNodes = nodes.map(n => {\n if (typeof n === 'string') {\n const t = currentDoc.createElement('template');\n t.innerHTML = n;\n return t.content;\n }\n return n as Node;\n });\n (targetEl as any).replaceChildren(...normalizedNodes);\n }\n }\n return res;\n };\n }\n });\n\n // --- @appendChild wrapping logic ---\n appendChildMap.forEach((meta, methodName) => {\n const { selector, options } = meta;\n const original = NewClass.prototype[methodName as any];\n if (typeof original === 'function') {\n NewClass.prototype[methodName as any] = function (...args: any[]) {\n const res = original.apply(this, args);\n if (res !== undefined) {\n const conf = getElementConfig(this);\n const currentWin = conf?.window || window;\n const currentDoc = currentWin.document;\n\n let targetEl: Element | null = null;\n if (selector === ':host' || !selector) {\n targetEl = this;\n } else {\n targetEl = (this.shadowRoot || this).querySelector(selector);\n }\n\n if (targetEl) {\n const nodes: (Node | string)[] = Array.isArray(res) ? res : [res];\n const normalizedNodes = nodes.map(n => {\n if (typeof n === 'string') {\n const t = currentDoc.createElement('template');\n t.innerHTML = n;\n return t.content;\n }\n return n as Node;\n });\n\n const pos = options.position || 'lastChild';\n if (pos === 'lastChild') (targetEl as any).append(...normalizedNodes);\n else if (pos === 'firstChild') (targetEl as any).prepend(...normalizedNodes);\n else if (pos === 'nextSibling') (targetEl as any).after(...normalizedNodes);\n else if (pos === 'previousSibling') (targetEl as any).before(...normalizedNodes);\n }\n }\n return res;\n };\n }\n });\n\n const originalProto = constructor.prototype;\n const newProto = NewClass.prototype;\n Object.getOwnPropertyNames(originalProto).forEach(name => {\n if (name === 'constructor') return;\n const keys = Reflect.getMetadataKeys(originalProto, name);\n keys.forEach(key => Reflect.defineMetadata(key, Reflect.getMetadata(key, originalProto, name), newProto, name));\n });\n\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, NewClass);\n ReflectUtils.defineMetadata(ELEMENT_CONFIG_KEY, config, constructor);\n const registry = config.customElementRegistry || (win as any)?.customElements;\n if (registry && !registry.get(config.name)) {\n registry.define(config.name, NewClass as any, config.extends ? { extends: config.extends } : undefined);\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"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,uCAAuC;AAGhD,SAAS,mCAAmC;AAC5C,SAAS,kCAAkC,iCAAiC,qCAAqC,oCAAoC,gCAAgC,+BAA+F,gCAAgC;AACpT,SAAS,sCAAsC;AAC/C,SAA2B,uCAAuC;AAClE,SAAuB,mCAAmC;AAC1D,SAAS,sCAAsC;AAC/C,SAAS,kCAAkC;AAC3C,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAAuB;AAClD,SAAwB,wBAAwB,+BAA+B;AAI/E,SAAS,2BAAqD;AAYvD,MAAM,qBAAqB,OAAO,qCAAqC;AAG9E,MAAM,uBAAuB,oBAAI,QAAO;AAIxC,SAAS,SAAS,cAAqB;AACrC,QAAM,MAAW,iBAAiB,OAAO,WAAW,cAAc,SAAS;AAC3E,QAAM,MAAgB,KAAK;AAE3B,QAAM,gBAAgB,oBAAI,IAA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  export * from "./setAttribute.js";
5
5
  export * from "./emitCustomEvent.js";
6
- export * from "./innerHtml.js";
6
+ export * from "./replaceChildren.js";
7
+ export * from "./appendChild.js";
7
8
  export * from "./lifecycles.js";
8
9
  export * from "./query.js";
9
10
  export * from "./queryAll.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/index.ts"],
4
- "sourcesContent": ["export * from './addEventListener';\nexport * from './elementDefine';\nexport * from './changedAttribute';\nexport * from './setAttribute';\nexport * from './emitCustomEvent';\nexport * from './innerHtml';\nexport * from './lifecycles';\nexport * from './query';\nexport * from './queryAll';\n"],
5
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
4
+ "sourcesContent": ["export * from './addEventListener';\nexport * from './elementDefine';\nexport * from './changedAttribute';\nexport * from './setAttribute';\nexport * from './emitCustomEvent';\nexport * from './replaceChildren';\nexport * from './appendChild';\nexport * from './lifecycles';\nexport * from './query';\nexport * from './queryAll';\n"],
5
+ "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
6
  "names": []
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { ReflectUtils } from "@dooboostore/core/reflect/ReflectUtils";
2
2
  const INNER_HTML_METADATA_KEY = Symbol("simple-web-component:inner-html");
3
- function innerHtml(arg1, arg2, arg3) {
3
+ function onConnectedInnerHtml(arg1, arg2, arg3) {
4
4
  const decorator = (options, target, propertyKey) => {
5
5
  const constructor = target.constructor;
6
6
  let list = ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);
@@ -17,13 +17,13 @@ function innerHtml(arg1, arg2, arg3) {
17
17
  decorator(arg1 || {}, target, propertyKey);
18
18
  };
19
19
  }
20
- const getInnerHtmlMetadataList = (target) => {
20
+ const getOnConnectedInnerHtmlMetadata = (target) => {
21
21
  const constructor = target instanceof Function ? target : target.constructor;
22
22
  return ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);
23
23
  };
24
24
  export {
25
25
  INNER_HTML_METADATA_KEY,
26
- getInnerHtmlMetadataList,
27
- innerHtml
26
+ getOnConnectedInnerHtmlMetadata,
27
+ onConnectedInnerHtml
28
28
  };
29
- //# sourceMappingURL=innerHtml.js.map
29
+ //# sourceMappingURL=onConnectedInnerHtml.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/decorators/onConnectedInnerHtml.ts"],
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport interface InnerHtmlOptions {\n useShadow?: boolean;\n}\n\nexport interface InnerHtmlMetadata {\n propertyKey: string | symbol;\n options: InnerHtmlOptions;\n}\n\nexport const INNER_HTML_METADATA_KEY = Symbol('simple-web-component:inner-html');\n\n/**\n * @onConnectedInnerHtml decorator to define the initial HTML content when connected.\n */\nexport function onConnectedInnerHtml(options: InnerHtmlOptions): MethodDecorator;\nexport function onConnectedInnerHtml(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): void;\nexport function onConnectedInnerHtml(arg1?: InnerHtmlOptions | Object, arg2?: string | symbol, arg3?: PropertyDescriptor): MethodDecorator | void {\n const decorator = (options: InnerHtmlOptions, target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let list = ReflectUtils.getMetadata<InnerHtmlMetadata[]>(INNER_HTML_METADATA_KEY, constructor);\n if (!list) {\n list = [];\n ReflectUtils.defineMetadata(INNER_HTML_METADATA_KEY, list, constructor);\n }\n list.push({ propertyKey, options });\n };\n\n if (arg2) {\n return decorator({}, arg1!, arg2);\n }\n\n return (target: Object, propertyKey: string | symbol) => {\n decorator((arg1 as InnerHtmlOptions) || {}, target, propertyKey);\n };\n}\n\nexport const getOnConnectedInnerHtmlMetadata = (target: any): InnerHtmlMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAWtB,MAAM,0BAA0B,OAAO,iCAAiC;AAOxE,SAAS,qBAAqB,MAAkC,MAAwB,MAAmD;AAChJ,QAAM,YAAY,CAAC,SAA2B,QAAgB,gBAAiC;AAC7F,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,aAAa,YAAiC,yBAAyB,WAAW;AAC7F,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,mBAAa,eAAe,yBAAyB,MAAM,WAAW;AAAA,IACxE;AACA,SAAK,KAAK,EAAE,aAAa,QAAQ,CAAC;AAAA,EACpC;AAEA,MAAI,MAAM;AACR,WAAO,UAAU,CAAC,GAAG,MAAO,IAAI;AAAA,EAClC;AAEA,SAAO,CAAC,QAAgB,gBAAiC;AACvD,cAAW,QAA6B,CAAC,GAAG,QAAQ,WAAW;AAAA,EACjE;AACF;AAEO,MAAM,kCAAkC,CAAC,WAAiD;AAC/F,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,yBAAyB,WAAW;AACtE;",
6
+ "names": []
7
+ }
@@ -50,6 +50,22 @@ function query(selector, options = {}) {
50
50
  }
51
51
  return (this.shadowRoot || this).querySelector(selector);
52
52
  },
53
+ set(nv) {
54
+ if (nv === null || nv === void 0) {
55
+ const r = options.root || "auto";
56
+ let targetEl = null;
57
+ if (r === "shadow")
58
+ targetEl = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;
59
+ else if (r === "light")
60
+ targetEl = this.querySelector(selector);
61
+ else if (r === "all")
62
+ targetEl = this.shadowRoot?.querySelector(selector) || this.querySelector(selector);
63
+ else
64
+ targetEl = (this.shadowRoot || this).querySelector(selector);
65
+ if (targetEl)
66
+ targetEl.remove();
67
+ }
68
+ },
53
69
  enumerable: true,
54
70
  configurable: true
55
71
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/query.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getElementConfig } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\n\nexport interface QueryOptions {\n root?: 'light' | 'shadow' | 'all' | 'auto';\n}\n\nexport interface QueryMetadata {\n selector: string;\n options: QueryOptions;\n propertyKey: string | symbol;\n}\n\nexport const QUERY_METADATA_KEY = Symbol('simple-web-component:query');\n\n/**\n * @query decorator to inject a single element into a class property.\n */\nexport function query(selector: string, options: QueryOptions = {}): PropertyDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: never): void => {\n if (descriptor !== undefined) {\n throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);\n }\n\n const constructor = target.constructor;\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 });\n\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n // --- Special Selectors: HostSet ---\n const hostSet = SwcUtils.getHostSet(this);\n if (selector === ':parentHost') return hostSet.$parentHost;\n if (selector === ':appHost') return hostSet.$appHost;\n if (selector === ':firstHost') return hostSet.$firstHost;\n if (selector === ':lastHost') return hostSet.$lastHost;\n if (selector === ':firstAppHost') return hostSet.$firstAppHost;\n if (selector === ':lastAppHost') return hostSet.$lastAppHost;\n\n // --- Special Selectors: Env ---\n const config = getElementConfig(this);\n const win = config?.window || window;\n const doc = win.document;\n\n if (selector === ':window') return win;\n if (selector === ':document') return doc;\n if (!selector || selector === ':host') return this;\n\n // --- Standard Selectors ---\n const r = options.root || 'auto';\n\n if (r === 'shadow') {\n return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;\n }\n if (r === 'light') {\n return this.querySelector(selector);\n }\n if (r === 'all') {\n return this.shadowRoot?.querySelector(selector) || this.querySelector(selector);\n }\n // auto\n return (this.shadowRoot || this).querySelector(selector);\n },\n enumerable: true,\n configurable: true\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"],
5
- "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAYlB,MAAM,qBAAqB,OAAO,4BAA4B;AAK/D,SAAU,MAAM,UAAkB,UAAwB,CAAA,GAAE;AAChE,SAAO,CAAC,QAAgB,aAA8B,eAA4B;AAChF,QAAI,eAAe,QAAW;AAC5B,YAAM,IAAI,MAAM,wDAAwD,OAAO,WAAW,CAAC,GAAG;IAChG;AAEA,UAAM,cAAc,OAAO;AAC3B,QAAI,UAAU,aAAa,YAA6B,oBAAoB,WAAW;AACvF,QAAI,CAAC,SAAS;AACZ,gBAAU,CAAA;AACV,mBAAa,eAAe,oBAAoB,SAAS,WAAW;IACtE;AACA,YAAQ,KAAK,EAAE,UAAU,SAAS,YAAW,CAAE;AAE/C,WAAO,eAAe,QAAQ,aAAa;MACzC,MAAG;AAED,cAAM,UAAU,SAAS,WAAW,IAAI;AACxC,YAAI,aAAa;AAAe,iBAAO,QAAQ;AAC/C,YAAI,aAAa;AAAY,iBAAO,QAAQ;AAC5C,YAAI,aAAa;AAAc,iBAAO,QAAQ;AAC9C,YAAI,aAAa;AAAa,iBAAO,QAAQ;AAC7C,YAAI,aAAa;AAAiB,iBAAO,QAAQ;AACjD,YAAI,aAAa;AAAgB,iBAAO,QAAQ;AAGhD,cAAM,SAAS,iBAAiB,IAAI;AACpC,cAAM,MAAM,QAAQ,UAAU;AAC9B,cAAM,MAAM,IAAI;AAEhB,YAAI,aAAa;AAAW,iBAAO;AACnC,YAAI,aAAa;AAAa,iBAAO;AACrC,YAAI,CAAC,YAAY,aAAa;AAAS,iBAAO;AAG9C,cAAM,IAAI,QAAQ,QAAQ;AAE1B,YAAI,MAAM,UAAU;AAClB,iBAAO,KAAK,aAAa,KAAK,WAAW,cAAc,QAAQ,IAAI;QACrE;AACA,YAAI,MAAM,SAAS;AACjB,iBAAO,KAAK,cAAc,QAAQ;QACpC;AACA,YAAI,MAAM,OAAO;AACf,iBAAO,KAAK,YAAY,cAAc,QAAQ,KAAK,KAAK,cAAc,QAAQ;QAChF;AAEA,gBAAQ,KAAK,cAAc,MAAM,cAAc,QAAQ;MACzD;MACA,YAAY;MACZ,cAAc;KACf;EACH;AACF;AAEO,MAAM,mBAAmB,CAAC,WAA4C;AAC3E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getElementConfig } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\n\nexport interface QueryOptions {\n root?: 'light' | 'shadow' | 'all' | 'auto';\n}\n\nexport interface QueryMetadata {\n selector: string;\n options: QueryOptions;\n propertyKey: string | symbol;\n}\n\nexport const QUERY_METADATA_KEY = Symbol('simple-web-component:query');\n\n/**\n * @query decorator to inject a single element into a class property.\n */\nexport function query(selector: string, options: QueryOptions = {}): PropertyDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: never): void => {\n if (descriptor !== undefined) {\n throw new Error(`@query decorator cannot be used on methods. (Method: ${String(propertyKey)})`);\n }\n\n const constructor = target.constructor;\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 });\n\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n // --- Special Selectors: HostSet ---\n const hostSet = SwcUtils.getHostSet(this);\n if (selector === ':parentHost') return hostSet.$parentHost;\n if (selector === ':appHost') return hostSet.$appHost;\n if (selector === ':firstHost') return hostSet.$firstHost;\n if (selector === ':lastHost') return hostSet.$lastHost;\n if (selector === ':firstAppHost') return hostSet.$firstAppHost;\n if (selector === ':lastAppHost') return hostSet.$lastAppHost;\n\n // --- Special Selectors: Env ---\n const config = getElementConfig(this);\n const win = config?.window || window;\n const doc = win.document;\n\n if (selector === ':window') return win;\n if (selector === ':document') return doc;\n if (!selector || selector === ':host') return this;\n\n // --- Standard Selectors ---\n const r = options.root || 'auto';\n\n if (r === 'shadow') {\n return this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;\n }\n if (r === 'light') {\n return this.querySelector(selector);\n }\n if (r === 'all') {\n return this.shadowRoot?.querySelector(selector) || this.querySelector(selector);\n }\n // auto\n return (this.shadowRoot || this).querySelector(selector);\n },\n set(this: HTMLElement, nv: any) {\n if (nv === null || nv === undefined) {\n const r = options.root || 'auto';\n let targetEl: Element | null = null;\n if (r === 'shadow') targetEl = this.shadowRoot ? this.shadowRoot.querySelector(selector) : null;\n else if (r === 'light') targetEl = this.querySelector(selector);\n else if (r === 'all') targetEl = this.shadowRoot?.querySelector(selector) || this.querySelector(selector);\n else targetEl = (this.shadowRoot || this).querySelector(selector);\n\n if (targetEl) targetEl.remove();\n }\n },\n enumerable: true,\n configurable: true\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"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAYlB,MAAM,qBAAqB,OAAO,4BAA4B;AAK/D,SAAU,MAAM,UAAkB,UAAwB,CAAA,GAAE;AAChE,SAAO,CAAC,QAAgB,aAA8B,eAA4B;AAChF,QAAI,eAAe,QAAW;AAC5B,YAAM,IAAI,MAAM,wDAAwD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a,KAAK,WAAW,cAAc,QAAQ,IAAI;mBAClF,MAAM;AAAS,uBAAW,KAAK,cAAc,QAAQ;mBACrD,MAAM;AAAO,uBAAW,KAAK,YAAY,cAAc,QAAQ,KAAK,KAAK,cAAc,QAAQ;;AACnG,wBAAY,KAAK,cAAc,MAAM,cAAc,QAAQ;AAEhE,cAAI;AAAU,qBAAS,OAAM;QAC/B;MACF;MACA,YAAY;MACZ,cAAc;KACf;EACH;AACF;AAEO,MAAM,mBAAmB,CAAC,WAA4C;AAC3E,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,oBAAoB,WAAW;AACjE;",
6
6
  "names": []
7
7
  }
@@ -45,6 +45,24 @@ function queryAll(selector, options = {}) {
45
45
  const root = this.shadowRoot || this;
46
46
  return root.querySelectorAll(selector);
47
47
  },
48
+ set(nv) {
49
+ if (nv === null || nv === void 0 || Array.isArray(nv) && nv.length === 0) {
50
+ const r = options.root || "auto";
51
+ let targets = [];
52
+ if (r === "shadow")
53
+ targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
54
+ else if (r === "light")
55
+ targets = Array.from(this.querySelectorAll(selector));
56
+ else if (r === "all") {
57
+ const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];
58
+ const lNodes = Array.from(this.querySelectorAll(selector));
59
+ targets = [...sNodes, ...lNodes];
60
+ } else {
61
+ targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));
62
+ }
63
+ targets.forEach((t) => t.remove());
64
+ }
65
+ },
48
66
  enumerable: true,
49
67
  configurable: true
50
68
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/queryAll.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getElementConfig } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\n\nexport interface QueryAllOptions {\n root?: 'light' | 'shadow' | 'all' | 'auto';\n}\n\nexport interface QueryAllMetadata {\n selector: string;\n options: QueryAllOptions;\n propertyKey: string | symbol;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol('simple-web-component:query-all');\n\n/**\n * @queryAll decorator to inject a list of elements into a class property.\n */\nexport function queryAll(selector: string, options: QueryAllOptions = {}): PropertyDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: never): void => {\n if (descriptor !== undefined) {\n throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);\n }\n\n const constructor = target.constructor;\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 });\n\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n // --- Special Selectors: HostSet ---\n const hostSet = SwcUtils.getHostSet(this);\n if (selector === ':hosts') return hostSet.$hosts;\n if (selector === ':appHosts') return hostSet.$appHosts;\n\n // --- Special Selectors: Env ---\n const config = getElementConfig(this);\n const win = config?.window || window;\n const doc = win.document;\n\n if (selector === ':window') return [win];\n if (selector === ':document') return [doc];\n if (!selector || selector === ':host') return [this];\n\n // --- Standard Selectors ---\n const r = options.root || 'auto';\n\n if (r === 'shadow') {\n return this.shadowRoot ? this.shadowRoot.querySelectorAll(selector) : [];\n }\n if (r === 'light') {\n return this.querySelectorAll(selector);\n }\n if (r === 'all') {\n const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n const lNodes = Array.from(this.querySelectorAll(selector));\n return [...sNodes, ...lNodes];\n }\n // auto\n const root = this.shadowRoot || this;\n return root.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true\n });\n };\n}\n\nexport const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata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gBAAM,SAAS,MAAM,KAAK,KAAK,iBAAiB,QAAQ,CAAC;AACzD,iBAAO,CAAC,GAAG,QAAQ,GAAG,MAAM;QAC9B;AAEA,cAAM,OAAO,KAAK,cAAc;AAChC,eAAO,KAAK,iBAAiB,QAAQ;MACvC;MACA,YAAY;MACZ,cAAc;KACf;EACH;AACF;AAEO,MAAM,sBAAsB,CAAC,WAA+C;AACjF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,wBAAwB,WAAW;AACrE;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\nimport { getElementConfig } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\n\nexport interface QueryAllOptions {\n root?: 'light' | 'shadow' | 'all' | 'auto';\n}\n\nexport interface QueryAllMetadata {\n selector: string;\n options: QueryAllOptions;\n propertyKey: string | symbol;\n}\n\nexport const QUERY_ALL_METADATA_KEY = Symbol('simple-web-component:query-all');\n\n/**\n * @queryAll decorator to inject a list of elements into a class property.\n */\nexport function queryAll(selector: string, options: QueryAllOptions = {}): PropertyDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: never): void => {\n if (descriptor !== undefined) {\n throw new Error(`@queryAll decorator cannot be used on methods. (Method: ${String(propertyKey)})`);\n }\n\n const constructor = target.constructor;\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 });\n\n Object.defineProperty(target, propertyKey, {\n get(this: HTMLElement) {\n // --- Special Selectors: HostSet ---\n const hostSet = SwcUtils.getHostSet(this);\n if (selector === ':hosts') return hostSet.$hosts;\n if (selector === ':appHosts') return hostSet.$appHosts;\n\n // --- Special Selectors: Env ---\n const config = getElementConfig(this);\n const win = config?.window || window;\n const doc = win.document;\n\n if (selector === ':window') return [win];\n if (selector === ':document') return [doc];\n if (!selector || selector === ':host') return [this];\n\n // --- Standard Selectors ---\n const r = options.root || 'auto';\n\n if (r === 'shadow') {\n return this.shadowRoot ? this.shadowRoot.querySelectorAll(selector) : [];\n }\n if (r === 'light') {\n return this.querySelectorAll(selector);\n }\n if (r === 'all') {\n const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n const lNodes = Array.from(this.querySelectorAll(selector));\n return [...sNodes, ...lNodes];\n }\n // auto\n const root = this.shadowRoot || this;\n return root.querySelectorAll(selector);\n },\n set(this: HTMLElement, nv: any) {\n if (nv === null || nv === undefined || (Array.isArray(nv) && nv.length === 0)) {\n const r = options.root || 'auto';\n let targets: (Element | Node)[] = [];\n if (r === 'shadow') targets = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n else if (r === 'light') targets = Array.from(this.querySelectorAll(selector));\n else if (r === 'all') {\n const sNodes = this.shadowRoot ? Array.from(this.shadowRoot.querySelectorAll(selector)) : [];\n const lNodes = Array.from(this.querySelectorAll(selector));\n targets = [...sNodes, ...lNodes];\n } else {\n targets = Array.from((this.shadowRoot || this).querySelectorAll(selector));\n }\n targets.forEach(t => (t as Element).remove());\n }\n },\n enumerable: true,\n configurable: true\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"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,gBAAgB;AAYlB,MAAM,yBAAyB,OAAO,gCAAgC;AAKvE,SAAU,SAAS,UAAkB,UAA2B,CAAA,GAAE;AACtE,SAAO,CAAC,QAAgB,aAA8B,eAA4B;AAChF,QAAI,eAAe,QAAW;AAC5B,YAAM,IAAI,MAAM,2DAA2D,OAAO,WAAW,CAAC,GAAG;IACnG;AAEA,UAAM,cAAc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AClC,cAAI,MAAM;AAAU,sBAAU,KAAK,aAAa,MAAM,KAAK,KAAK,WAAW,iBAAiB,QAAQ,CAAC,IAAI,CAAA;mBAChG,MAAM;AAAS,sBAAU,MAAM,KAAK,KAAK,iBAAiB,QAAQ,CAAC;mBACnE,MAAM,OAAO;AACpB,kBAAM,SAAS,KAAK,aAAa,MAAM,KAAK,KAAK,WAAW,iBAAiB,QAAQ,CAAC,IAAI,CAAA;AAC1F,kBAAM,SAAS,MAAM,KAAK,KAAK,iBAAiB,QAAQ,CAAC;AACzD,sBAAU,CAAC,GAAG,QAAQ,GAAG,MAAM;UACjC,OAAO;AACL,sBAAU,MAAM,MAAM,KAAK,cAAc,MAAM,iBAAiB,QAAQ,CAAC;UAC3E;AACA,kBAAQ,QAAQ,OAAM,EAAc,OAAM,CAAE;QAC9C;MACF;MACA,YAAY;MACZ,cAAc;KACf;EACH;AACF;AAEO,MAAM,sBAAsB,CAAC,WAA+C;AACjF,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,wBAAwB,WAAW;AACrE;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,34 @@
1
+ import { ReflectUtils } from "@dooboostore/core/reflect/ReflectUtils";
2
+ const REPLACE_CHILDREN_METADATA_KEY = Symbol("simple-web-component:replace-children");
3
+ function replaceChildren(selector) {
4
+ return (target, propertyKey) => {
5
+ const constructor = target.constructor;
6
+ let meta = ReflectUtils.getOwnMetadata(REPLACE_CHILDREN_METADATA_KEY, constructor);
7
+ if (!meta) {
8
+ meta = /* @__PURE__ */ new Map();
9
+ ReflectUtils.defineMetadata(REPLACE_CHILDREN_METADATA_KEY, meta, constructor);
10
+ }
11
+ meta.set(propertyKey, selector);
12
+ };
13
+ }
14
+ const getReplaceChildrenMetadata = (target) => {
15
+ const constructor = target instanceof Function ? target : target.constructor;
16
+ return ReflectUtils.getMetadata(REPLACE_CHILDREN_METADATA_KEY, constructor);
17
+ };
18
+ const findAllReplaceChildrenMetadata = (target) => {
19
+ const result = /* @__PURE__ */ new Map();
20
+ const maps = ReflectUtils.findAllMetadata(REPLACE_CHILDREN_METADATA_KEY, target);
21
+ maps.forEach((map) => {
22
+ if (map instanceof Map) {
23
+ map.forEach((v, k) => result.set(k, v));
24
+ }
25
+ });
26
+ return result;
27
+ };
28
+ export {
29
+ REPLACE_CHILDREN_METADATA_KEY,
30
+ findAllReplaceChildrenMetadata,
31
+ getReplaceChildrenMetadata,
32
+ replaceChildren
33
+ };
34
+ //# sourceMappingURL=replaceChildren.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/decorators/replaceChildren.ts"],
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';\n\nexport const REPLACE_CHILDREN_METADATA_KEY = Symbol('simple-web-component:replace-children');\n\n/**\n * @replaceChildren decorator to surgically replace children of a target element.\n * Usage: @replaceChildren('#container') renderPart() { return '<div>New Content</div>'; }\n */\nexport function replaceChildren(selector: string): MethodDecorator {\n return (target: Object, propertyKey: string | symbol) => {\n const constructor = target.constructor;\n let meta = ReflectUtils.getOwnMetadata(REPLACE_CHILDREN_METADATA_KEY, constructor) as Map<string | symbol, string>;\n if (!meta) {\n meta = new Map<string | symbol, string>();\n ReflectUtils.defineMetadata(REPLACE_CHILDREN_METADATA_KEY, meta, constructor);\n }\n meta.set(propertyKey, selector);\n };\n}\n\nexport const getReplaceChildrenMetadata = (target: any): Map<string | symbol, string> | undefined => {\n const constructor = target instanceof Function ? target : target.constructor;\n return ReflectUtils.getMetadata(REPLACE_CHILDREN_METADATA_KEY, constructor);\n};\n\nexport const findAllReplaceChildrenMetadata = (target: any): Map<string | symbol, string> => {\n const result = new Map<string | symbol, string>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, string>>(REPLACE_CHILDREN_METADATA_KEY, target);\n maps.forEach(map => {\n if (map instanceof Map) {\n map.forEach((v, k) => result.set(k, v));\n }\n });\n return result;\n};\n"],
5
+ "mappings": "AAAA,SAAS,oBAAoB;AAEtB,MAAM,gCAAgC,OAAO,uCAAuC;AAMpF,SAAS,gBAAgB,UAAmC;AACjE,SAAO,CAAC,QAAgB,gBAAiC;AACvD,UAAM,cAAc,OAAO;AAC3B,QAAI,OAAO,aAAa,eAAe,+BAA+B,WAAW;AACjF,QAAI,CAAC,MAAM;AACT,aAAO,oBAAI,IAA6B;AACxC,mBAAa,eAAe,+BAA+B,MAAM,WAAW;AAAA,IAC9E;AACA,SAAK,IAAI,aAAa,QAAQ;AAAA,EAChC;AACF;AAEO,MAAM,6BAA6B,CAAC,WAA0D;AACnG,QAAM,cAAc,kBAAkB,WAAW,SAAS,OAAO;AACjE,SAAO,aAAa,YAAY,+BAA+B,WAAW;AAC5E;AAEO,MAAM,iCAAiC,CAAC,WAA8C;AAC3F,QAAM,SAAS,oBAAI,IAA6B;AAChD,QAAM,OAAO,aAAa,gBAA8C,+BAA+B,MAAM;AAC7G,OAAK,QAAQ,SAAO;AAClB,QAAI,eAAe,KAAK;AACtB,UAAI,QAAQ,CAAC,GAAG,MAAM,OAAO,IAAI,GAAG,CAAC,CAAC;AAAA,IACxC;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
6
+ "names": []
7
+ }
package/dist/esm/index.js CHANGED
@@ -2,7 +2,10 @@ import "reflect-metadata";
2
2
  export * from "./decorators/elementDefine.js";
3
3
  export * from "./decorators/setAttribute.js";
4
4
  export * from "./decorators/changedAttribute.js";
5
- export * from "./decorators/innerHtml.js";
5
+ export * from "./decorators/onConnectedInnerHtml.js";
6
+ import { onConnectedInnerHtml } from "./decorators/onConnectedInnerHtml.js";
7
+ export * from "./decorators/replaceChildren.js";
8
+ export * from "./decorators/appendChild.js";
6
9
  export * from "./decorators/emitCustomEvent.js";
7
10
  export * from "./decorators/lifecycles.js";
8
11
  export * from "./decorators/query.js";
@@ -11,4 +14,7 @@ export * from "./decorators/addEventListener.js";
11
14
  export * from "./types.js";
12
15
  export * from "./elements/index.js";
13
16
  export * from "./utils/Utils.js";
17
+ export {
18
+ onConnectedInnerHtml as innerHtml
19
+ };
14
20
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import 'reflect-metadata';\n\n// Decorators\nexport * from './decorators/elementDefine';\nexport * from './decorators/setAttribute';\nexport * from './decorators/changedAttribute';\nexport * from './decorators/innerHtml';\nexport * from './decorators/emitCustomEvent';\nexport * from './decorators/lifecycles';\nexport * from './decorators/query';\nexport * from './decorators/queryAll';\nexport * from './decorators/addEventListener';\n\n// Types\nexport * from './types';\n\n// Apps (Customized Built-in Elements)\nexport * from './elements';\n\n// Utilities\nexport * from './utils/Utils';\n"],
5
- "mappings": "AAAA,OAAO;AAGP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;",
4
+ "sourcesContent": ["import 'reflect-metadata';\n\n// Decorators\nexport * from './decorators/elementDefine';\nexport * from './decorators/setAttribute';\nexport * from './decorators/changedAttribute';\nexport * from './decorators/onConnectedInnerHtml';\nexport { onConnectedInnerHtml as innerHtml } from './decorators/onConnectedInnerHtml';\nexport * from './decorators/replaceChildren';\nexport * from './decorators/appendChild';\nexport * from './decorators/emitCustomEvent';\nexport * from './decorators/lifecycles';\nexport * from './decorators/query';\nexport * from './decorators/queryAll';\nexport * from './decorators/addEventListener';\n\n// Types\nexport * from './types';\n\n// Apps (Customized Built-in Elements)\nexport * from './elements';\n\n// Utilities\nexport * from './utils/Utils';\n"],
5
+ "mappings": "AAAA,OAAO;AAGP,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAAiC,4BAAiB;AAClD,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,cAAc;AAGd,cAAc;",
6
6
  "names": []
7
7
  }