@dooboostore/simple-web-component 1.0.16 → 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 (130) hide show
  1. package/README.md +109 -48
  2. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  3. package/dist/cjs/decorators/appendChild.js +48 -0
  4. package/dist/cjs/decorators/appendChild.js.map +7 -0
  5. package/dist/cjs/decorators/elementDefine.js +216 -67
  6. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  7. package/dist/cjs/decorators/index.js +2 -1
  8. package/dist/cjs/decorators/index.js.map +2 -2
  9. package/dist/cjs/decorators/{innerHtml.js → onConnectedInnerHtml.js} +8 -8
  10. package/dist/cjs/decorators/onConnectedInnerHtml.js.map +7 -0
  11. package/dist/cjs/decorators/query.js +38 -0
  12. package/dist/cjs/decorators/query.js.map +2 -2
  13. package/dist/cjs/decorators/queryAll.js +32 -0
  14. package/dist/cjs/decorators/queryAll.js.map +2 -2
  15. package/dist/cjs/decorators/replaceChildren.js +53 -0
  16. package/dist/cjs/decorators/replaceChildren.js.map +7 -0
  17. package/dist/cjs/elements/SwcAppEngine.js +2 -1
  18. package/dist/cjs/elements/SwcAppEngine.js.map +2 -2
  19. package/dist/cjs/elements/SwcAsync.js +188 -0
  20. package/dist/cjs/elements/SwcAsync.js.map +7 -0
  21. package/dist/cjs/elements/SwcChoose.js +155 -0
  22. package/dist/cjs/elements/SwcChoose.js.map +7 -0
  23. package/dist/cjs/elements/SwcIf.js +167 -0
  24. package/dist/cjs/elements/SwcIf.js.map +7 -0
  25. package/dist/cjs/elements/SwcLoop.js +246 -0
  26. package/dist/cjs/elements/SwcLoop.js.map +7 -0
  27. package/dist/cjs/elements/SwcSubTemplates.js +65 -0
  28. package/dist/cjs/elements/SwcSubTemplates.js.map +7 -0
  29. package/dist/cjs/elements/index.js +7 -0
  30. package/dist/cjs/elements/index.js.map +2 -2
  31. package/dist/cjs/index.js +12 -2
  32. package/dist/cjs/index.js.map +2 -2
  33. package/dist/cjs/types.js.map +1 -1
  34. package/dist/cjs/utils/Utils.js +74 -37
  35. package/dist/cjs/utils/Utils.js.map +3 -3
  36. package/dist/esm/decorators/addEventListener.js.map +2 -2
  37. package/dist/esm/decorators/appendChild.js +29 -0
  38. package/dist/esm/decorators/appendChild.js.map +7 -0
  39. package/dist/esm/decorators/elementDefine.js +216 -67
  40. package/dist/esm/decorators/elementDefine.js.map +3 -3
  41. package/dist/esm/decorators/index.js +2 -1
  42. package/dist/esm/decorators/index.js.map +2 -2
  43. package/dist/esm/decorators/{innerHtml.js → onConnectedInnerHtml.js} +5 -5
  44. package/dist/esm/decorators/onConnectedInnerHtml.js.map +7 -0
  45. package/dist/esm/decorators/query.js +38 -0
  46. package/dist/esm/decorators/query.js.map +2 -2
  47. package/dist/esm/decorators/queryAll.js +32 -0
  48. package/dist/esm/decorators/queryAll.js.map +2 -2
  49. package/dist/esm/decorators/replaceChildren.js +34 -0
  50. package/dist/esm/decorators/replaceChildren.js.map +7 -0
  51. package/dist/esm/elements/SwcAppEngine.js +2 -1
  52. package/dist/esm/elements/SwcAppEngine.js.map +2 -2
  53. package/dist/esm/elements/SwcAsync.js +169 -0
  54. package/dist/esm/elements/SwcAsync.js.map +7 -0
  55. package/dist/esm/elements/SwcChoose.js +136 -0
  56. package/dist/esm/elements/SwcChoose.js.map +7 -0
  57. package/dist/esm/elements/SwcIf.js +148 -0
  58. package/dist/esm/elements/SwcIf.js.map +7 -0
  59. package/dist/esm/elements/SwcLoop.js +227 -0
  60. package/dist/esm/elements/SwcLoop.js.map +7 -0
  61. package/dist/esm/elements/SwcSubTemplates.js +46 -0
  62. package/dist/esm/elements/SwcSubTemplates.js.map +7 -0
  63. package/dist/esm/elements/index.js +7 -0
  64. package/dist/esm/elements/index.js.map +2 -2
  65. package/dist/esm/index.js +8 -2
  66. package/dist/esm/index.js.map +2 -2
  67. package/dist/esm/types.js.map +1 -1
  68. package/dist/esm/utils/Utils.js +74 -37
  69. package/dist/esm/utils/Utils.js.map +3 -3
  70. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1226 -149
  71. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  72. package/dist/types/decorators/addEventListener.d.ts +1 -0
  73. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  74. package/dist/types/decorators/appendChild.d.ts +17 -0
  75. package/dist/types/decorators/appendChild.d.ts.map +1 -0
  76. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  77. package/dist/types/decorators/index.d.ts +2 -1
  78. package/dist/types/decorators/index.d.ts.map +1 -1
  79. package/dist/types/decorators/onConnectedInnerHtml.d.ts +15 -0
  80. package/dist/types/decorators/onConnectedInnerHtml.d.ts.map +1 -0
  81. package/dist/types/decorators/query.d.ts +0 -2
  82. package/dist/types/decorators/query.d.ts.map +1 -1
  83. package/dist/types/decorators/queryAll.d.ts +0 -2
  84. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  85. package/dist/types/decorators/replaceChildren.d.ts +9 -0
  86. package/dist/types/decorators/replaceChildren.d.ts.map +1 -0
  87. package/dist/types/elements/SwcAppEngine.d.ts.map +1 -1
  88. package/dist/types/elements/SwcAsync.d.ts +16 -0
  89. package/dist/types/elements/SwcAsync.d.ts.map +1 -0
  90. package/dist/types/elements/SwcChoose.d.ts +13 -0
  91. package/dist/types/elements/SwcChoose.d.ts.map +1 -0
  92. package/dist/types/elements/SwcIf.d.ts +15 -0
  93. package/dist/types/elements/SwcIf.d.ts.map +1 -0
  94. package/dist/types/elements/SwcLoop.d.ts +20 -0
  95. package/dist/types/elements/SwcLoop.d.ts.map +1 -0
  96. package/dist/types/elements/SwcSubTemplates.d.ts +13 -0
  97. package/dist/types/elements/SwcSubTemplates.d.ts.map +1 -0
  98. package/dist/types/elements/index.d.ts +7 -0
  99. package/dist/types/elements/index.d.ts.map +1 -1
  100. package/dist/types/index.d.ts +5 -2
  101. package/dist/types/index.d.ts.map +1 -1
  102. package/dist/types/types.d.ts +8 -0
  103. package/dist/types/types.d.ts.map +1 -1
  104. package/dist/types/utils/Utils.d.ts +16 -10
  105. package/dist/types/utils/Utils.d.ts.map +1 -1
  106. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1226 -149
  107. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  108. package/package.json +10 -3
  109. package/src/decorators/addEventListener.ts +1 -0
  110. package/src/decorators/appendChild.ts +42 -0
  111. package/src/decorators/elementDefine.ts +225 -71
  112. package/src/decorators/index.ts +2 -1
  113. package/src/decorators/{innerHtml.ts → onConnectedInnerHtml.ts} +7 -6
  114. package/src/decorators/query.ts +32 -2
  115. package/src/decorators/queryAll.ts +32 -2
  116. package/src/decorators/replaceChildren.ts +35 -0
  117. package/src/elements/SwcAppEngine.ts +2 -1
  118. package/src/elements/SwcAsync.ts +163 -0
  119. package/src/elements/SwcChoose.ts +127 -0
  120. package/src/elements/SwcIf.ts +134 -0
  121. package/src/elements/SwcLoop.ts +215 -0
  122. package/src/elements/SwcSubTemplates.ts +19 -0
  123. package/src/elements/index.ts +8 -3
  124. package/src/index.ts +5 -2
  125. package/src/types.ts +9 -1
  126. package/src/utils/Utils.ts +86 -36
  127. package/dist/cjs/decorators/innerHtml.js.map +0 -7
  128. package/dist/esm/decorators/innerHtml.js.map +0 -7
  129. package/dist/types/decorators/innerHtml.d.ts +0 -12
  130. package/dist/types/decorators/innerHtml.d.ts.map +0 -1
@@ -23,17 +23,21 @@ __export(elementDefine_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(elementDefine_exports);
25
25
  var import_ReflectUtils = require("@dooboostore/core/reflect/ReflectUtils");
26
- var import_innerHtml = require("./innerHtml");
26
+ var import_FunctionUtils = require("@dooboostore/core/function/FunctionUtils");
27
+ var import_onConnectedInnerHtml = require("./onConnectedInnerHtml");
27
28
  var import_addEventListener = require("./addEventListener");
28
29
  var import_lifecycles = require("./lifecycles");
29
30
  var import_emitCustomEvent = require("./emitCustomEvent");
30
31
  var import_changedAttribute = require("./changedAttribute");
31
32
  var import_setAttribute = require("./setAttribute");
33
+ var import_replaceChildren = require("./replaceChildren");
34
+ var import_appendChild = require("./appendChild");
32
35
  var import_Utils = require("../utils/Utils");
33
36
  var import_config = require("../config/config");
34
37
  var import_Inject = require("@dooboostore/simple-boot/decorators/inject/Inject");
35
38
  var import_types = require("../types");
36
39
  const ELEMENT_CONFIG_KEY = Symbol("simple-web-component:element-config");
40
+ const globalDelegatedRoots = /* @__PURE__ */ new WeakSet();
37
41
  function buildEnv(configWindow) {
38
42
  const win = configWindow || (typeof window !== "undefined" ? window : void 0);
39
43
  const doc = win?.document;
@@ -42,13 +46,7 @@ function buildEnv(configWindow) {
42
46
  if (win?.[cls])
43
47
  builtInTagMap.set(win[cls], tag);
44
48
  }
45
- const domHelpers = {
46
- $d: doc,
47
- $w: win,
48
- $q: (sel, root) => (root ?? doc).querySelector(sel),
49
- $qa: (sel, root) => Array.from((root ?? doc).querySelectorAll(sel)),
50
- $qi: (id, root) => (root ?? doc).getElementById(id)
51
- };
49
+ const domHelpers = import_Utils.SwcUtils.getHelperSet(win);
52
50
  return { win, doc, builtInTagMap, domHelpers };
53
51
  }
54
52
  const getHandlers = (inst) => {
@@ -60,8 +58,6 @@ const elementDefine = (inConfig) => (constructor) => {
60
58
  const config = typeof inConfig === "string" ? { name: inConfig } : inConfig;
61
59
  const { win, doc, builtInTagMap: BUILT_IN_TAG_MAP, domHelpers: SWC_DOM_HELPERS } = buildEnv(config.window);
62
60
  config.window = win;
63
- const SWC_DOM_HELPER_KEYS = Object.keys(SWC_DOM_HELPERS);
64
- const SWC_DOM_HELPER_VALS = () => SWC_DOM_HELPER_KEYS.map((k) => SWC_DOM_HELPERS[k]);
65
61
  let extendsTagName = config.extends;
66
62
  if (!extendsTagName) {
67
63
  let proto = constructor;
@@ -77,19 +73,19 @@ const elementDefine = (inConfig) => (constructor) => {
77
73
  const addEventListenerList = (0, import_addEventListener.getAddEventListenerMetadata)(constructor) || [];
78
74
  const attrChangeMap = (0, import_changedAttribute.findAllAttributeChangedMetadata)(constructor);
79
75
  const setAttrMap = (0, import_setAttribute.findAllSetAttributeMetadata)(constructor);
76
+ const replaceChildrenMap = (0, import_replaceChildren.findAllReplaceChildrenMetadata)(constructor);
77
+ const appendChildMap = (0, import_appendChild.findAllAppendChildMetadata)(constructor);
80
78
  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"];
81
79
  const swcOnEvents = import_config.DOM_EVENT_NAMES.map((e) => `swc-on-${e}`);
82
80
  const mergedObservedAttributes = [.../* @__PURE__ */ new Set([...config.observedAttributes ?? [], ...attrChangeMap.keys(), ...setAttrMap.keys(), ...emitCustomEventList.map((it) => it.options.attributeName), ...swcLifecycleAttributes, ...swcOnEvents])];
83
- const innerHtmlList = (0, import_innerHtml.getInnerHtmlMetadataList)(constructor) || [];
81
+ const connectedInnerHtmlList = (0, import_onConnectedInnerHtml.getOnConnectedInnerHtmlMetadata)(constructor) || [];
84
82
  const NewClass = class extends constructor {
85
83
  _executeSwcScript(attrName, hostSet, extraArgs = {}) {
86
84
  const script = this.getAttribute(attrName);
87
85
  if (script) {
88
86
  try {
89
87
  const args = { ...hostSet, ...SWC_DOM_HELPERS, ...extraArgs };
90
- const argNames = Object.keys(args);
91
- const argValues = Object.values(args);
92
- new Function(...argNames, script).apply(this, argValues);
88
+ import_FunctionUtils.FunctionUtils.execute({ script, context: this, args });
93
89
  } catch (e) {
94
90
  console.error(`[SWC] Failed to execute ${attrName}:`, e);
95
91
  }
@@ -131,9 +127,13 @@ const elementDefine = (inConfig) => (constructor) => {
131
127
  el.removeEventListener(eventName, oldHandler);
132
128
  const handler = (event) => {
133
129
  const hostSet = import_Utils.SwcUtils.getHostSet(el);
134
- const argNames = Object.keys(hostSet);
135
- const argValues = Object.values(hostSet);
136
- new Function("event", "$data", ...argNames, ...SWC_DOM_HELPER_KEYS, script).call(el, event, event.detail, ...argValues, ...SWC_DOM_HELPER_VALS());
130
+ const args = {
131
+ event,
132
+ $data: event.detail,
133
+ ...hostSet,
134
+ ...SWC_DOM_HELPERS
135
+ };
136
+ import_FunctionUtils.FunctionUtils.execute({ script, context: el, args });
137
137
  };
138
138
  el.addEventListener(eventName, handler);
139
139
  handlers.set(attrName, handler);
@@ -142,9 +142,10 @@ const elementDefine = (inConfig) => (constructor) => {
142
142
  super(...args);
143
143
  this._swcId = Math.random().toString(36).substring(2, 11);
144
144
  this._emitHandlers = /* @__PURE__ */ new Map();
145
+ this._boundListeners = [];
145
146
  const hostSet = import_Utils.SwcUtils.getHostSet(this);
146
147
  this._executeSwcScript("swc-on-constructor", hostSet);
147
- if (innerHtmlList.some((it) => it.options.useShadow === true) && !this.shadowRoot) {
148
+ if (connectedInnerHtmlList.some((it) => it.options.useShadow === true) && !this.shadowRoot) {
148
149
  this.attachShadow({ mode: "open" });
149
150
  }
150
151
  }
@@ -152,6 +153,9 @@ const elementDefine = (inConfig) => (constructor) => {
152
153
  return mergedObservedAttributes;
153
154
  }
154
155
  async connectedCallback() {
156
+ const conf = getElementConfig(this);
157
+ const currentWin = conf?.window || window;
158
+ const currentDoc = currentWin.document;
155
159
  const hostSet = import_Utils.SwcUtils.getHostSet(this);
156
160
  this._executeSwcScript("swc-on-before-connected", hostSet);
157
161
  const bMethods = (0, import_lifecycles.findAllLifecycleMetadata)(this, import_lifecycles.ON_BEFORE_CONNECTED_METADATA_KEY);
@@ -161,9 +165,9 @@ const elementDefine = (inConfig) => (constructor) => {
161
165
  }
162
166
  if (typeof this.initCore === "function")
163
167
  this.initCore();
164
- if (innerHtmlList.length > 0) {
168
+ if (connectedInnerHtmlList.length > 0) {
165
169
  let sContent = "", lContent = "";
166
- for (const meta of innerHtmlList) {
170
+ for (const meta of connectedInnerHtmlList) {
167
171
  const res = await this[meta.propertyKey]();
168
172
  if (res !== void 0) {
169
173
  if (meta.options.useShadow)
@@ -177,17 +181,88 @@ const elementDefine = (inConfig) => (constructor) => {
177
181
  if (lContent)
178
182
  this.innerHTML = lContent;
179
183
  }
184
+ const createDelegationHandler = (delegateHost) => (event) => {
185
+ if (event.__swc_handled)
186
+ return;
187
+ const path = event.composedPath();
188
+ const type = event.type;
189
+ const attrName = `swc-on-${type}`;
190
+ for (const node of path) {
191
+ if (node === delegateHost)
192
+ break;
193
+ if (!(node instanceof HTMLElement))
194
+ continue;
195
+ const script = node.getAttribute?.(attrName);
196
+ if (script && !getElementConfig(node)) {
197
+ const host = import_Utils.SwcUtils.findNearestSwcHost(node);
198
+ if (host) {
199
+ const childHostSet = import_Utils.SwcUtils.getHostSet(node);
200
+ const args = {
201
+ event,
202
+ $data: event.detail,
203
+ ...childHostSet,
204
+ ...SWC_DOM_HELPERS
205
+ };
206
+ import_FunctionUtils.FunctionUtils.execute({ script, context: node, args });
207
+ event.__swc_handled = true;
208
+ break;
209
+ }
210
+ }
211
+ }
212
+ };
213
+ import_config.DOM_EVENT_NAMES.forEach((type) => {
214
+ const handler = createDelegationHandler(this);
215
+ this.addEventListener(type, handler);
216
+ this._boundListeners.push({ target: this, type, handler });
217
+ });
218
+ const hasParentHost = import_Utils.SwcUtils.findAllSwcHosts(this).length > 0;
219
+ if (!hasParentHost) {
220
+ const root = this.getRootNode();
221
+ if (!globalDelegatedRoots.has(root)) {
222
+ import_config.DOM_EVENT_NAMES.forEach((type) => {
223
+ const handler = createDelegationHandler(root);
224
+ root.addEventListener(type, handler);
225
+ });
226
+ globalDelegatedRoots.add(root);
227
+ }
228
+ }
180
229
  addEventListenerList.forEach((meta) => {
181
230
  const { selector, type, options } = meta;
182
- const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate } = options;
183
- if (delegate && selector && selector !== ":host") {
231
+ const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate, removeOnDisconnected } = options;
232
+ const opts = { capture, once, passive };
233
+ const bindTargets = [];
234
+ if (selector === ":window") {
235
+ bindTargets.push(currentWin);
236
+ } else if (selector === ":document") {
237
+ bindTargets.push(currentDoc);
238
+ } else if (selector === ":parentHost") {
239
+ if (hostSet.$parentHost)
240
+ bindTargets.push(hostSet.$parentHost);
241
+ } else if (selector === ":appHost") {
242
+ if (hostSet.$appHost)
243
+ bindTargets.push(hostSet.$appHost);
244
+ } else if (selector === ":firstHost") {
245
+ if (hostSet.$firstHost)
246
+ bindTargets.push(hostSet.$firstHost);
247
+ } else if (selector === ":lastHost") {
248
+ if (hostSet.$lastHost)
249
+ bindTargets.push(hostSet.$lastHost);
250
+ } else if (selector === ":firstAppHost") {
251
+ if (hostSet.$firstAppHost)
252
+ bindTargets.push(hostSet.$firstAppHost);
253
+ } else if (selector === ":lastAppHost") {
254
+ if (hostSet.$lastAppHost)
255
+ bindTargets.push(hostSet.$lastAppHost);
256
+ } else if (!selector || selector === ":host") {
257
+ bindTargets.push(this);
258
+ } else if (delegate) {
184
259
  const bindRoots = [];
185
260
  const r = root || "auto";
186
- if (r === "auto") {
261
+ if (r === "auto")
187
262
  bindRoots.push(this.shadowRoot || this);
188
- } else if (r === "light") {
263
+ else if (r === "light")
189
264
  bindRoots.push(this);
190
- } else if (r === "shadow") {
265
+ else if (r === "shadow") {
191
266
  if (this.shadowRoot)
192
267
  bindRoots.push(this.shadowRoot);
193
268
  } else if (r === "all") {
@@ -195,62 +270,61 @@ const elementDefine = (inConfig) => (constructor) => {
195
270
  if (this.shadowRoot)
196
271
  bindRoots.push(this.shadowRoot);
197
272
  }
198
- bindRoots.forEach((bindRoot) => {
273
+ bindRoots.forEach((br) => {
199
274
  const handler = (event) => {
200
- const target = event.target;
201
- const matchedEl = target.closest(selector);
202
- if (matchedEl && bindRoot.contains(matchedEl)) {
275
+ const matchedEl = event.target.closest(selector);
276
+ if (matchedEl && br.contains(matchedEl)) {
203
277
  if (stopPropagation)
204
278
  event.stopPropagation();
205
279
  if (stopImmediatePropagation)
206
280
  event.stopImmediatePropagation();
207
281
  if (preventDefault)
208
282
  event.preventDefault();
209
- const hostSet2 = import_Utils.SwcUtils.getHostSet(this);
210
- this._invokeLifecycleMethod(meta.propertyKey, hostSet2, [event, hostSet2, matchedEl]);
283
+ const currentHostSet = import_Utils.SwcUtils.getHostSet(this);
284
+ this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet, matchedEl]);
211
285
  }
212
286
  };
213
- bindRoot.addEventListener(type, handler, { capture, once, passive });
287
+ br.addEventListener(type, handler, opts);
288
+ const self = this;
289
+ if (removeOnDisconnected === true || br !== self && br !== self.shadowRoot) {
290
+ this._boundListeners.push({ target: br, type, handler, options: opts });
291
+ }
214
292
  });
215
293
  } else {
216
- const targetEls = [];
217
- if (!selector || selector === ":host") {
218
- targetEls.push(this);
219
- } else {
220
- const searchRoots = [];
221
- const r = root || "auto";
222
- if (r === "auto") {
223
- searchRoots.push(this.shadowRoot || this);
224
- } else if (r === "light") {
225
- searchRoots.push(this);
226
- } else if (r === "shadow") {
227
- if (this.shadowRoot)
228
- searchRoots.push(this.shadowRoot);
229
- } else if (r === "all") {
230
- searchRoots.push(this);
231
- if (this.shadowRoot)
232
- searchRoots.push(this.shadowRoot);
233
- }
234
- searchRoots.forEach((sr) => {
235
- const found = sr.querySelectorAll(selector);
236
- found.forEach((el) => targetEls.push(el));
237
- });
294
+ const searchRoots = [];
295
+ const r = root || "auto";
296
+ if (r === "auto")
297
+ searchRoots.push(this.shadowRoot || this);
298
+ else if (r === "light")
299
+ searchRoots.push(this);
300
+ else if (r === "shadow") {
301
+ if (this.shadowRoot)
302
+ searchRoots.push(this.shadowRoot);
303
+ } else if (r === "all") {
304
+ searchRoots.push(this);
305
+ if (this.shadowRoot)
306
+ searchRoots.push(this.shadowRoot);
238
307
  }
239
- targetEls.forEach((el) => {
240
- const handler = (event) => {
241
- if (stopPropagation)
242
- event.stopPropagation();
243
- if (stopImmediatePropagation)
244
- event.stopImmediatePropagation();
245
- if (preventDefault)
246
- event.preventDefault();
247
- const hostSet2 = import_Utils.SwcUtils.getHostSet(this);
248
- this._invokeLifecycleMethod(meta.propertyKey, hostSet2, [event, hostSet2]);
249
- };
250
- const opts = { capture, once, passive };
251
- el.addEventListener(type, handler, opts);
308
+ searchRoots.forEach((sr) => {
309
+ sr.querySelectorAll(selector).forEach((el) => bindTargets.push(el));
252
310
  });
253
311
  }
312
+ bindTargets.forEach((target) => {
313
+ const handler = (event) => {
314
+ if (stopPropagation)
315
+ event.stopPropagation();
316
+ if (stopImmediatePropagation)
317
+ event.stopImmediatePropagation();
318
+ if (preventDefault)
319
+ event.preventDefault();
320
+ const currentHostSet = import_Utils.SwcUtils.getHostSet(this);
321
+ this._invokeLifecycleMethod(meta.propertyKey, currentHostSet, [event, currentHostSet]);
322
+ };
323
+ target.addEventListener(type, handler, opts);
324
+ if (removeOnDisconnected === true || target === currentWin || target === currentDoc) {
325
+ this._boundListeners.push({ target, type, handler, options: opts });
326
+ }
327
+ });
254
328
  });
255
329
  if (super.connectedCallback)
256
330
  await super.connectedCallback();
@@ -268,6 +342,8 @@ const elementDefine = (inConfig) => (constructor) => {
268
342
  const bMethods = (0, import_lifecycles.findAllLifecycleMetadata)(this, import_lifecycles.ON_BEFORE_DISCONNECTED_METADATA_KEY);
269
343
  if (bMethods)
270
344
  bMethods.forEach((m) => this._invokeLifecycleMethod(m, hostSet));
345
+ this._boundListeners.forEach((l) => l.target.removeEventListener(l.type, l.handler, l.options));
346
+ this._boundListeners = [];
271
347
  if (super.disconnectedCallback)
272
348
  super.disconnectedCallback();
273
349
  const aMethods = (0, import_lifecycles.findAllLifecycleMetadata)(this, import_lifecycles.ON_AFTER_DISCONNECTED_METADATA_KEY);
@@ -339,6 +415,79 @@ const elementDefine = (inConfig) => (constructor) => {
339
415
  };
340
416
  }
341
417
  });
418
+ replaceChildrenMap.forEach((selector, methodName) => {
419
+ const original = NewClass.prototype[methodName];
420
+ if (typeof original === "function") {
421
+ NewClass.prototype[methodName] = function(...args) {
422
+ const res = original.apply(this, args);
423
+ if (res !== void 0) {
424
+ const conf = getElementConfig(this);
425
+ const currentWin = conf?.window || window;
426
+ const currentDoc = currentWin.document;
427
+ let targetEl = null;
428
+ if (selector === ":host" || !selector) {
429
+ targetEl = this;
430
+ } else {
431
+ targetEl = (this.shadowRoot || this).querySelector(selector);
432
+ }
433
+ if (targetEl) {
434
+ const nodes = Array.isArray(res) ? res : [res];
435
+ const normalizedNodes = nodes.map((n) => {
436
+ if (typeof n === "string") {
437
+ const t = currentDoc.createElement("template");
438
+ t.innerHTML = n;
439
+ return t.content;
440
+ }
441
+ return n;
442
+ });
443
+ targetEl.replaceChildren(...normalizedNodes);
444
+ }
445
+ }
446
+ return res;
447
+ };
448
+ }
449
+ });
450
+ appendChildMap.forEach((meta, methodName) => {
451
+ const { selector, options } = meta;
452
+ const original = NewClass.prototype[methodName];
453
+ if (typeof original === "function") {
454
+ NewClass.prototype[methodName] = function(...args) {
455
+ const res = original.apply(this, args);
456
+ if (res !== void 0) {
457
+ const conf = getElementConfig(this);
458
+ const currentWin = conf?.window || window;
459
+ const currentDoc = currentWin.document;
460
+ let targetEl = null;
461
+ if (selector === ":host" || !selector) {
462
+ targetEl = this;
463
+ } else {
464
+ targetEl = (this.shadowRoot || this).querySelector(selector);
465
+ }
466
+ if (targetEl) {
467
+ const nodes = Array.isArray(res) ? res : [res];
468
+ const normalizedNodes = nodes.map((n) => {
469
+ if (typeof n === "string") {
470
+ const t = currentDoc.createElement("template");
471
+ t.innerHTML = n;
472
+ return t.content;
473
+ }
474
+ return n;
475
+ });
476
+ const pos = options.position || "lastChild";
477
+ if (pos === "lastChild")
478
+ targetEl.append(...normalizedNodes);
479
+ else if (pos === "firstChild")
480
+ targetEl.prepend(...normalizedNodes);
481
+ else if (pos === "nextSibling")
482
+ targetEl.after(...normalizedNodes);
483
+ else if (pos === "previousSibling")
484
+ targetEl.before(...normalizedNodes);
485
+ }
486
+ }
487
+ return res;
488
+ };
489
+ }
490
+ });
342
491
  const originalProto = constructor.prototype;
343
492
  const newProto = NewClass.prototype;
344
493
  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 { 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 { InjectSituationType, HostSet, SwcAppInterface } from '../types';\n\n// --- Core Interfaces & Types (Integrated) ---\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// --- 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 = {\n $d: doc,\n $w: win,\n $q: (sel: string, root?: Element | Document | ShadowRoot) => (root ?? doc).querySelector(sel),\n $qa: (sel: string, root?: Element | Document | ShadowRoot) => Array.from((root ?? doc).querySelectorAll(sel)),\n $qi: (id: string, root?: Document | ShadowRoot) => (root ?? doc).getElementById(id)\n } as const;\n\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 const SWC_DOM_HELPER_KEYS = Object.keys(SWC_DOM_HELPERS) as (keyof typeof SWC_DOM_HELPERS)[];\n const SWC_DOM_HELPER_VALS = () => SWC_DOM_HELPER_KEYS.map(k => (SWC_DOM_HELPERS as any)[k]);\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\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 const argNames = Object.keys(args);\n const argValues = Object.values(args);\n new Function(...argNames, script).apply(this, argValues);\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 argNames = Object.keys(hostSet);\n const argValues = Object.values(hostSet);\n new Function('event', '$data', ...argNames, ...SWC_DOM_HELPER_KEYS, script).call(el, event, (event as CustomEvent).detail, ...argValues, ...SWC_DOM_HELPER_VALS());\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 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 // --- @addEventListener binding ---\n addEventListenerList.forEach(meta => {\n const { selector, type, options } = meta;\n const { root, capture, once, passive, stopPropagation, stopImmediatePropagation, preventDefault, delegate } = options;\n\n if (delegate && selector && selector !== ':host') {\n const bindRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') {\n bindRoots.push(this.shadowRoot || (this as any));\n } else if (r === 'light') {\n 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(bindRoot => {\n const handler = (event: Event) => {\n const target = event.target as HTMLElement;\n const matchedEl = target.closest(selector);\n if (matchedEl && (bindRoot as any).contains(matchedEl)) {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n\n const hostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, hostSet, [event, hostSet, matchedEl]);\n }\n };\n bindRoot.addEventListener(type, handler, { capture, once, passive });\n });\n } else {\n const targetEls: (HTMLElement | Element | Document | ShadowRoot | Window)[] = [];\n if (!selector || selector === ':host') {\n targetEls.push(this as any);\n } else {\n const searchRoots: (HTMLElement | ShadowRoot)[] = [];\n const r = root || 'auto';\n if (r === 'auto') {\n searchRoots.push((this.shadowRoot || (this as any)) as any);\n } else if (r === 'light') {\n 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 const found = sr.querySelectorAll(selector);\n found.forEach(el => targetEls.push(el as any));\n });\n }\n\n targetEls.forEach(el => {\n const handler = (event: Event) => {\n if (stopPropagation) event.stopPropagation();\n if (stopImmediatePropagation) event.stopImmediatePropagation();\n if (preventDefault) event.preventDefault();\n\n const hostSet = SwcUtils.getHostSet(this as any);\n this._invokeLifecycleMethod(meta.propertyKey, hostSet, [event, hostSet]);\n };\n const opts = { capture, once, passive };\n el.addEventListener(type, handler, 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 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;;;;;;;0BAA6B;AAC7B,uBAAyC;AAGzC,8BAA4C;AAC5C,wBAAoT;AACpT,6BAA+C;AAC/C,8BAAkE;AAClE,0BAA0D;AAC1D,mBAAyB;AACzB,oBAAkD;AAClD,oBAA+E;AAE/E,mBAA8D;AAYvD,MAAM,qBAAqB,OAAO,qCAAqC;AAI9E,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,gCAAkB;AACzC,QAAI,MAAM,GAAG;AAAG,oBAAc,IAAI,IAAI,GAAG,GAAG,GAAG;EACjD;AAEA,QAAM,aAAa;IACjB,IAAI;IACJ,IAAI;IACJ,IAAI,CAAC,KAAa,UAA4C,QAAQ,KAAK,cAAc,GAAG;IAC5F,KAAK,CAAC,KAAa,SAA2C,MAAM,MAAM,QAAQ,KAAK,iBAAiB,GAAG,CAAC;IAC5G,KAAK,CAAC,IAAY,UAAkC,QAAQ,KAAK,eAAe,EAAE;;AAGpF,SAAO,EAAE,KAAK,KAAK,eAAe,WAAU;AAC9C;AAEA,MAAM,cAAc,CAAC,SAAa;AAChC,MAAI,CAAC,KAAK;AAA8B,SAAK,+BAA+B,oBAAI,IAAG;AACnF,SAAO,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kB,IAAI,YAAa,MAAW;AAC/D,cAAM,SAAS,SAAS,MAAM,MAAM,IAAI;AACxC,cAAM,QAAQ,IAAI,YAAY,QAAQ,MAAM;UAC1C;UACA,SAAS,QAAQ;UACjB,UAAU,QAAQ;UAClB,YAAY,QAAQ;SACrB;AACD,aAAK,cAAc,KAAK;AACxB,eAAO;MACT;IACF;EACF,CAAC;AAED,QAAM,gBAAgB,YAAY;AAClC,QAAM,WAAW,SAAS;AAC1B,SAAO,oBAAoB,aAAa,EAAE,QAAQ,UAAO;AACvD,QAAI,SAAS;AAAe;AAC5B,UAAM,OAAO,QAAQ,gBAAgB,eAAe,IAAI;AACxD,SAAK,QAAQ,SAAO,QAAQ,eAAe,KAAK,QAAQ,YAAY,KAAK,eAAe,IAAI,GAAG,UAAU,IAAI,CAAC;EAChH,CAAC;AAED,mCAAa,eAAe,oBAAoB,QAAQ,QAAQ;AAChE,mCAAa,eAAe,oBAAoB,QAAQ,WAAW;AACnE,QAAM,WAAW,OAAO,yBAA0B,KAAa;AAC/D,MAAI,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,iCAAa,YAAY,oBAAoB,WAAW;AACjE;",
6
- "names": ["hostSet"]
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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AY,KAAK,eAAe,IAAI,GAAG,UAAU,IAAI,CAAC;EAChH,CAAC;AAED,mCAAa,eAAe,oBAAoB,QAAQ,QAAQ;AAChE,mCAAa,eAAe,oBAAoB,QAAQ,WAAW;AACnE,QAAM,WAAW,OAAO,yBAA0B,KAAa;AAC/D,MAAI,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,iCAAa,YAAY,oBAAoB,WAAW;AACjE;",
6
+ "names": []
7
7
  }
@@ -19,7 +19,8 @@ __reExport(decorators_exports, require("./elementDefine"), module.exports);
19
19
  __reExport(decorators_exports, require("./changedAttribute"), module.exports);
20
20
  __reExport(decorators_exports, require("./setAttribute"), module.exports);
21
21
  __reExport(decorators_exports, require("./emitCustomEvent"), module.exports);
22
- __reExport(decorators_exports, require("./innerHtml"), module.exports);
22
+ __reExport(decorators_exports, require("./replaceChildren"), module.exports);
23
+ __reExport(decorators_exports, require("./appendChild"), module.exports);
23
24
  __reExport(decorators_exports, require("./lifecycles"), module.exports);
24
25
  __reExport(decorators_exports, require("./query"), module.exports);
25
26
  __reExport(decorators_exports, require("./queryAll"), module.exports);
@@ -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;AAAA;AAAA,+BAAc,+BAAd;AACA,+BAAc,4BADd;AAEA,+BAAc,+BAFd;AAGA,+BAAc,2BAHd;AAIA,+BAAc,8BAJd;AAKA,+BAAc,wBALd;AAMA,+BAAc,yBANd;AAOA,+BAAc,oBAPd;AAQA,+BAAc,uBARd;",
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;AAAA;AAAA,+BAAc,+BAAd;AACA,+BAAc,4BADd;AAEA,+BAAc,+BAFd;AAGA,+BAAc,2BAHd;AAIA,+BAAc,8BAJd;AAKA,+BAAc,8BALd;AAMA,+BAAc,0BANd;AAOA,+BAAc,yBAPd;AAQA,+BAAc,oBARd;AASA,+BAAc,uBATd;",
6
6
  "names": []
7
7
  }
@@ -15,16 +15,16 @@ var __copyProps = (to, from, except, desc) => {
15
15
  return to;
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var innerHtml_exports = {};
19
- __export(innerHtml_exports, {
18
+ var onConnectedInnerHtml_exports = {};
19
+ __export(onConnectedInnerHtml_exports, {
20
20
  INNER_HTML_METADATA_KEY: () => INNER_HTML_METADATA_KEY,
21
- getInnerHtmlMetadataList: () => getInnerHtmlMetadataList,
22
- innerHtml: () => innerHtml
21
+ getOnConnectedInnerHtmlMetadata: () => getOnConnectedInnerHtmlMetadata,
22
+ onConnectedInnerHtml: () => onConnectedInnerHtml
23
23
  });
24
- module.exports = __toCommonJS(innerHtml_exports);
24
+ module.exports = __toCommonJS(onConnectedInnerHtml_exports);
25
25
  var import_ReflectUtils = require("@dooboostore/core/reflect/ReflectUtils");
26
26
  const INNER_HTML_METADATA_KEY = Symbol("simple-web-component:inner-html");
27
- function innerHtml(arg1, arg2, arg3) {
27
+ function onConnectedInnerHtml(arg1, arg2, arg3) {
28
28
  const decorator = (options, target, propertyKey) => {
29
29
  const constructor = target.constructor;
30
30
  let list = import_ReflectUtils.ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);
@@ -41,8 +41,8 @@ function innerHtml(arg1, arg2, arg3) {
41
41
  decorator(arg1 || {}, target, propertyKey);
42
42
  };
43
43
  }
44
- const getInnerHtmlMetadataList = (target) => {
44
+ const getOnConnectedInnerHtmlMetadata = (target) => {
45
45
  const constructor = target instanceof Function ? target : target.constructor;
46
46
  return import_ReflectUtils.ReflectUtils.getMetadata(INNER_HTML_METADATA_KEY, constructor);
47
47
  };
48
- //# sourceMappingURL=innerHtml.js.map
48
+ //# 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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA6B;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,iCAAa,YAAiC,yBAAyB,WAAW;AAC7F,QAAI,CAAC,MAAM;AACT,aAAO,CAAC;AACR,uCAAa,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,iCAAa,YAAY,yBAAyB,WAAW;AACtE;",
6
+ "names": []
7
+ }