@dooboostore/simple-web-component 1.0.50 → 1.0.52

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 (241) hide show
  1. package/README.md +735 -354
  2. package/dist/cjs/SwcAppEngine.js.map +2 -2
  3. package/dist/cjs/decorators/addEventListener.js +64 -146
  4. package/dist/cjs/decorators/addEventListener.js.map +2 -2
  5. package/dist/cjs/decorators/applyAttribute.js +36 -48
  6. package/dist/cjs/decorators/applyAttribute.js.map +2 -2
  7. package/dist/cjs/decorators/applyClass.js +9 -12
  8. package/dist/cjs/decorators/applyClass.js.map +2 -2
  9. package/dist/cjs/decorators/applyNode.js +14 -22
  10. package/dist/cjs/decorators/applyNode.js.map +2 -2
  11. package/dist/cjs/decorators/applyProperty.js +12 -42
  12. package/dist/cjs/decorators/applyProperty.js.map +2 -2
  13. package/dist/cjs/decorators/applySlot.js +3 -3
  14. package/dist/cjs/decorators/applySlot.js.map +2 -2
  15. package/dist/cjs/decorators/applyStyle.js +9 -12
  16. package/dist/cjs/decorators/applyStyle.js.map +2 -2
  17. package/dist/cjs/decorators/around.js +124 -0
  18. package/dist/cjs/decorators/around.js.map +7 -0
  19. package/dist/cjs/decorators/changedAttribute.js +40 -12
  20. package/dist/cjs/decorators/changedAttribute.js.map +2 -2
  21. package/dist/cjs/decorators/elementDefine.js +224 -195
  22. package/dist/cjs/decorators/elementDefine.js.map +3 -3
  23. package/dist/cjs/decorators/emitCustomEvent.js +14 -12
  24. package/dist/cjs/decorators/emitCustomEvent.js.map +2 -2
  25. package/dist/cjs/decorators/eventMedia.js +36 -8
  26. package/dist/cjs/decorators/eventMedia.js.map +2 -2
  27. package/dist/cjs/decorators/fetch.js +278 -0
  28. package/dist/cjs/decorators/fetch.js.map +7 -0
  29. package/dist/cjs/decorators/index.js +5 -2
  30. package/dist/cjs/decorators/index.js.map +2 -2
  31. package/dist/cjs/decorators/intersectionObserver.js +33 -13
  32. package/dist/cjs/decorators/intersectionObserver.js.map +2 -2
  33. package/dist/cjs/decorators/lifecycles.js +11 -11
  34. package/dist/cjs/decorators/lifecycles.js.map +2 -2
  35. package/dist/cjs/decorators/mutationObserver.js +55 -39
  36. package/dist/cjs/decorators/mutationObserver.js.map +3 -3
  37. package/dist/cjs/decorators/parameter.js +92 -9
  38. package/dist/cjs/decorators/parameter.js.map +2 -2
  39. package/dist/cjs/decorators/publishSwcAppMessage.js +2 -2
  40. package/dist/cjs/decorators/publishSwcAppMessage.js.map +2 -2
  41. package/dist/cjs/decorators/query.js +11 -5
  42. package/dist/cjs/decorators/query.js.map +2 -2
  43. package/dist/cjs/decorators/requestAnimationFrame.js +7 -16
  44. package/dist/cjs/decorators/requestAnimationFrame.js.map +2 -2
  45. package/dist/cjs/decorators/resizeObserver.js +41 -17
  46. package/dist/cjs/decorators/resizeObserver.js.map +3 -3
  47. package/dist/cjs/decorators/setInterval.js +36 -25
  48. package/dist/cjs/decorators/setInterval.js.map +2 -2
  49. package/dist/cjs/decorators/setTimeout.js +36 -25
  50. package/dist/cjs/decorators/setTimeout.js.map +2 -2
  51. package/dist/cjs/decorators/state.js +13 -10
  52. package/dist/cjs/decorators/state.js.map +2 -2
  53. package/dist/cjs/decorators/{subscribeSwcAppMessageWhileConnected.js → subscribeSwcAppMessage.js} +20 -21
  54. package/dist/cjs/decorators/subscribeSwcAppMessage.js.map +7 -0
  55. package/dist/cjs/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +23 -19
  56. package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +7 -0
  57. package/dist/cjs/decorators/swcAppRoute.js +149 -0
  58. package/dist/cjs/decorators/swcAppRoute.js.map +7 -0
  59. package/dist/cjs/elements/SwcApp.js +70 -0
  60. package/dist/cjs/elements/SwcApp.js.map +2 -2
  61. package/dist/cjs/elements/SwcAppMixin.js +262 -83
  62. package/dist/cjs/elements/SwcAppMixin.js.map +3 -3
  63. package/dist/cjs/types/index.js +5 -1
  64. package/dist/cjs/types/index.js.map +2 -2
  65. package/dist/cjs/utils/Utils.js +36 -15
  66. package/dist/cjs/utils/Utils.js.map +2 -2
  67. package/dist/esm/SwcAppEngine.js.map +2 -2
  68. package/dist/esm/decorators/addEventListener.js +64 -146
  69. package/dist/esm/decorators/addEventListener.js.map +2 -2
  70. package/dist/esm/decorators/applyAttribute.js +36 -48
  71. package/dist/esm/decorators/applyAttribute.js.map +2 -2
  72. package/dist/esm/decorators/applyClass.js +9 -12
  73. package/dist/esm/decorators/applyClass.js.map +2 -2
  74. package/dist/esm/decorators/applyNode.js +15 -23
  75. package/dist/esm/decorators/applyNode.js.map +2 -2
  76. package/dist/esm/decorators/applyProperty.js +12 -42
  77. package/dist/esm/decorators/applyProperty.js.map +2 -2
  78. package/dist/esm/decorators/applySlot.js +3 -3
  79. package/dist/esm/decorators/applySlot.js.map +2 -2
  80. package/dist/esm/decorators/applyStyle.js +9 -12
  81. package/dist/esm/decorators/applyStyle.js.map +2 -2
  82. package/dist/esm/decorators/around.js +105 -0
  83. package/dist/esm/decorators/around.js.map +7 -0
  84. package/dist/esm/decorators/changedAttribute.js +40 -12
  85. package/dist/esm/decorators/changedAttribute.js.map +2 -2
  86. package/dist/esm/decorators/elementDefine.js +222 -193
  87. package/dist/esm/decorators/elementDefine.js.map +3 -3
  88. package/dist/esm/decorators/emitCustomEvent.js +15 -13
  89. package/dist/esm/decorators/emitCustomEvent.js.map +2 -2
  90. package/dist/esm/decorators/eventMedia.js +36 -8
  91. package/dist/esm/decorators/eventMedia.js.map +2 -2
  92. package/dist/esm/decorators/fetch.js +259 -0
  93. package/dist/esm/decorators/fetch.js.map +7 -0
  94. package/dist/esm/decorators/index.js +5 -2
  95. package/dist/esm/decorators/index.js.map +2 -2
  96. package/dist/esm/decorators/intersectionObserver.js +33 -13
  97. package/dist/esm/decorators/intersectionObserver.js.map +2 -2
  98. package/dist/esm/decorators/lifecycles.js +11 -11
  99. package/dist/esm/decorators/lifecycles.js.map +2 -2
  100. package/dist/esm/decorators/mutationObserver.js +55 -39
  101. package/dist/esm/decorators/mutationObserver.js.map +3 -3
  102. package/dist/esm/decorators/parameter.js +92 -9
  103. package/dist/esm/decorators/parameter.js.map +2 -2
  104. package/dist/esm/decorators/publishSwcAppMessage.js +2 -2
  105. package/dist/esm/decorators/publishSwcAppMessage.js.map +2 -2
  106. package/dist/esm/decorators/query.js +11 -5
  107. package/dist/esm/decorators/query.js.map +2 -2
  108. package/dist/esm/decorators/requestAnimationFrame.js +8 -17
  109. package/dist/esm/decorators/requestAnimationFrame.js.map +2 -2
  110. package/dist/esm/decorators/resizeObserver.js +41 -17
  111. package/dist/esm/decorators/resizeObserver.js.map +2 -2
  112. package/dist/esm/decorators/setInterval.js +37 -26
  113. package/dist/esm/decorators/setInterval.js.map +2 -2
  114. package/dist/esm/decorators/setTimeout.js +37 -26
  115. package/dist/esm/decorators/setTimeout.js.map +2 -2
  116. package/dist/esm/decorators/state.js +13 -10
  117. package/dist/esm/decorators/state.js.map +2 -2
  118. package/dist/esm/decorators/subscribeSwcAppMessage.js +53 -0
  119. package/dist/esm/decorators/subscribeSwcAppMessage.js.map +7 -0
  120. package/dist/esm/decorators/{subscribeSwcAppRouteChangeWhileConnected.js → subscribeSwcAppRouteChange.js} +20 -16
  121. package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +7 -0
  122. package/dist/esm/decorators/swcAppRoute.js +130 -0
  123. package/dist/esm/decorators/swcAppRoute.js.map +7 -0
  124. package/dist/esm/elements/SwcApp.js +70 -0
  125. package/dist/esm/elements/SwcApp.js.map +2 -2
  126. package/dist/esm/elements/SwcAppMixin.js +264 -85
  127. package/dist/esm/elements/SwcAppMixin.js.map +3 -3
  128. package/dist/esm/types/index.js +5 -1
  129. package/dist/esm/types/index.js.map +2 -2
  130. package/dist/esm/utils/Utils.js +36 -15
  131. package/dist/esm/utils/Utils.js.map +2 -2
  132. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1893 -1000
  133. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  134. package/dist/types/SwcAppEngine.d.ts +1 -0
  135. package/dist/types/SwcAppEngine.d.ts.map +1 -1
  136. package/dist/types/decorators/addEventListener.d.ts +923 -960
  137. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  138. package/dist/types/decorators/applyAttribute.d.ts +26 -38
  139. package/dist/types/decorators/applyAttribute.d.ts.map +1 -1
  140. package/dist/types/decorators/applyClass.d.ts +1 -3
  141. package/dist/types/decorators/applyClass.d.ts.map +1 -1
  142. package/dist/types/decorators/applyNode.d.ts +15 -17
  143. package/dist/types/decorators/applyNode.d.ts.map +1 -1
  144. package/dist/types/decorators/applyProperty.d.ts +25 -45
  145. package/dist/types/decorators/applyProperty.d.ts.map +1 -1
  146. package/dist/types/decorators/applyStyle.d.ts +1 -3
  147. package/dist/types/decorators/applyStyle.d.ts.map +1 -1
  148. package/dist/types/decorators/around.d.ts +87 -0
  149. package/dist/types/decorators/around.d.ts.map +1 -0
  150. package/dist/types/decorators/changedAttribute.d.ts +21 -1
  151. package/dist/types/decorators/changedAttribute.d.ts.map +1 -1
  152. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  153. package/dist/types/decorators/emitCustomEvent.d.ts +0 -1
  154. package/dist/types/decorators/emitCustomEvent.d.ts.map +1 -1
  155. package/dist/types/decorators/eventMedia.d.ts +24 -1
  156. package/dist/types/decorators/eventMedia.d.ts.map +1 -1
  157. package/dist/types/decorators/fetch.d.ts +139 -0
  158. package/dist/types/decorators/fetch.d.ts.map +1 -0
  159. package/dist/types/decorators/index.d.ts +5 -2
  160. package/dist/types/decorators/index.d.ts.map +1 -1
  161. package/dist/types/decorators/intersectionObserver.d.ts +24 -11
  162. package/dist/types/decorators/intersectionObserver.d.ts.map +1 -1
  163. package/dist/types/decorators/lifecycles.d.ts +8 -7
  164. package/dist/types/decorators/lifecycles.d.ts.map +1 -1
  165. package/dist/types/decorators/mutationObserver.d.ts +26 -13
  166. package/dist/types/decorators/mutationObserver.d.ts.map +1 -1
  167. package/dist/types/decorators/parameter.d.ts +84 -6
  168. package/dist/types/decorators/parameter.d.ts.map +1 -1
  169. package/dist/types/decorators/publishSwcAppMessage.d.ts +0 -1
  170. package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -1
  171. package/dist/types/decorators/query.d.ts +7 -7
  172. package/dist/types/decorators/query.d.ts.map +1 -1
  173. package/dist/types/decorators/requestAnimationFrame.d.ts +1 -1
  174. package/dist/types/decorators/requestAnimationFrame.d.ts.map +1 -1
  175. package/dist/types/decorators/resizeObserver.d.ts +26 -13
  176. package/dist/types/decorators/resizeObserver.d.ts.map +1 -1
  177. package/dist/types/decorators/setInterval.d.ts +10 -0
  178. package/dist/types/decorators/setInterval.d.ts.map +1 -1
  179. package/dist/types/decorators/setTimeout.d.ts +10 -0
  180. package/dist/types/decorators/setTimeout.d.ts.map +1 -1
  181. package/dist/types/decorators/state.d.ts.map +1 -1
  182. package/dist/types/decorators/subscribeSwcAppMessage.d.ts +44 -0
  183. package/dist/types/decorators/subscribeSwcAppMessage.d.ts.map +1 -0
  184. package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +60 -0
  185. package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +1 -0
  186. package/dist/types/decorators/swcAppRoute.d.ts +94 -0
  187. package/dist/types/decorators/swcAppRoute.d.ts.map +1 -0
  188. package/dist/types/elements/SwcApp.d.ts.map +1 -1
  189. package/dist/types/elements/SwcAppMixin.d.ts +423 -388
  190. package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
  191. package/dist/types/types/index.d.ts +43 -4
  192. package/dist/types/types/index.d.ts.map +1 -1
  193. package/dist/types/utils/Utils.d.ts +15 -5
  194. package/dist/types/utils/Utils.d.ts.map +1 -1
  195. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1893 -1000
  196. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  197. package/package.json +8 -6
  198. package/src/SwcAppEngine.ts +1 -0
  199. package/src/decorators/addEventListener.ts +102 -96
  200. package/src/decorators/applyAttribute.ts +76 -138
  201. package/src/decorators/applyClass.ts +8 -14
  202. package/src/decorators/applyNode.ts +33 -41
  203. package/src/decorators/applyProperty.ts +51 -99
  204. package/src/decorators/applySlot.ts +3 -3
  205. package/src/decorators/applyStyle.ts +8 -14
  206. package/src/decorators/around.ts +196 -0
  207. package/src/decorators/changedAttribute.ts +39 -15
  208. package/src/decorators/elementDefine.ts +270 -219
  209. package/src/decorators/emitCustomEvent.ts +17 -13
  210. package/src/decorators/eventMedia.ts +50 -9
  211. package/src/decorators/fetch.ts +454 -0
  212. package/src/decorators/index.ts +5 -2
  213. package/src/decorators/intersectionObserver.ts +38 -24
  214. package/src/decorators/lifecycles.ts +24 -22
  215. package/src/decorators/mutationObserver.ts +71 -52
  216. package/src/decorators/parameter.ts +145 -14
  217. package/src/decorators/publishSwcAppMessage.ts +3 -4
  218. package/src/decorators/query.ts +22 -14
  219. package/src/decorators/requestAnimationFrame.ts +10 -19
  220. package/src/decorators/resizeObserver.ts +50 -29
  221. package/src/decorators/setInterval.ts +37 -26
  222. package/src/decorators/setTimeout.ts +37 -26
  223. package/src/decorators/state.ts +19 -13
  224. package/src/decorators/subscribeSwcAppMessage.ts +106 -0
  225. package/src/decorators/subscribeSwcAppRouteChange.ts +131 -0
  226. package/src/decorators/swcAppRoute.ts +231 -0
  227. package/src/elements/SwcApp.ts +40 -10
  228. package/src/elements/SwcAppMixin.ts +340 -101
  229. package/src/types/index.ts +38 -5
  230. package/src/utils/Utils.ts +50 -18
  231. package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
  232. package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
  233. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +0 -54
  234. package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +0 -7
  235. package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +0 -7
  236. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +0 -23
  237. package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +0 -1
  238. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +0 -31
  239. package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +0 -1
  240. package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +0 -91
  241. package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +0 -107
@@ -24,15 +24,14 @@ __export(applyAttribute_exports, {
24
24
  attrAppHost: () => attrAppHost,
25
25
  attrLight: () => attrLight,
26
26
  attrShadow: () => attrShadow,
27
- attrThis: () => attrThis,
28
27
  attribute: () => attribute,
29
28
  convertValue: () => convertValue,
30
29
  default: () => applyAttribute_default,
31
30
  findAllAttributeApplyMetadata: () => findAllAttributeApplyMetadata,
32
31
  findAllAttributeMetadata: () => findAllAttributeMetadata,
33
32
  getAttributeValue: () => getAttributeValue,
34
- resolveAttributeTargets: () => resolveAttributeTargets,
35
- setAttribute: () => setAttribute
33
+ removeAttribute: () => removeAttribute,
34
+ resolveAttributeTargets: () => resolveAttributeTargets
36
35
  });
37
36
  module.exports = __toCommonJS(applyAttribute_exports);
38
37
  var import_core = require("@dooboostore/core");
@@ -40,22 +39,14 @@ var import_elementDefine = require("./elementDefine");
40
39
  var import_Utils = require("../utils/Utils");
41
40
  var import_core_web = require("@dooboostore/core-web");
42
41
  const ATTRIBUTE_METADATA_KEY = Symbol.for("simple-web-component:attribute");
43
- const isCssSelector = (str) => {
44
- if (!str) return false;
45
- if (str.startsWith("$")) return true;
46
- if (/^[#.\[\:>+~]/.test(str)) return true;
47
- if (/[>+~:\[\]]/.test(str)) return true;
48
- return false;
49
- };
50
42
  const convertValue = (val, type) => {
51
43
  if (val === null || val === void 0) return val;
52
44
  if (type === Number) return Number(val);
53
- if (type === Boolean) return val === "false" || val === "0" ? false : true;
45
+ if (type === Boolean) return typeof val === "string" ? !(val === "false" || val === "0") : Boolean(val);
54
46
  return val;
55
47
  };
56
48
  const getAttributeValue = (inst, attrName, options) => {
57
- const conf = (0, import_elementDefine.getElementConfig)(inst);
58
- const currentWin = inst._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
49
+ const currentWin = import_Utils.SwcUtils.resolveWindow(inst);
59
50
  const targets = options?.selector ? resolveAttributeTargets(inst, options.selector, options) : [inst];
60
51
  const primaryTarget = targets[0];
61
52
  if (primaryTarget && typeof primaryTarget.hasAttribute === "function" && primaryTarget.hasAttribute(attrName)) {
@@ -67,7 +58,7 @@ const getAttributeValue = (inst, attrName, options) => {
67
58
  const result = import_core.FunctionUtils.executeReturn({
68
59
  script: import_core_web.ConvertUtils.decodeHtmlEntity(expr.script, currentWin.document),
69
60
  context: inst,
70
- args: import_Utils.SwcUtils.getHelperAndHostSet(currentWin, inst)
61
+ args: import_Utils.SwcUtils.getHelperAndHostSet(inst)
71
62
  });
72
63
  return convertValue(result, options?.type);
73
64
  } catch (err) {
@@ -86,7 +77,7 @@ const resolveAttributeTargets = (inst, selector, options) => {
86
77
  const results = [];
87
78
  let resolvedSelector = selector;
88
79
  if (typeof selector === "function") {
89
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(currentWin, inst);
80
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(inst);
90
81
  resolvedSelector = selector(inst, hostSet);
91
82
  }
92
83
  if (resolvedSelector instanceof currentWin.Element) {
@@ -176,10 +167,8 @@ function applyAttribute(selector, targetAttributeNameOrOptions, options) {
176
167
  type: metaType
177
168
  });
178
169
  const applyValueToTargets = (inst, resolvedValue) => {
179
- const conf = (0, import_elementDefine.getElementConfig)(inst);
180
- const currentWin = conf.window;
181
170
  const targetEls = resolveAttributeTargets(inst, selector, finalOptions);
182
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(currentWin, inst);
171
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(inst);
183
172
  targetEls.forEach((targetEl) => {
184
173
  if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, { currentThis: inst, helper: hostSet })) {
185
174
  return;
@@ -239,37 +228,42 @@ function applyAttribute(selector, targetAttributeNameOrOptions, options) {
239
228
  };
240
229
  }
241
230
  function attribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor) {
242
- if (optionsOrDescriptor !== void 0 && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
243
- return applyAttribute("$this", void 0, {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
244
- }
245
231
  if (typeof selectorOrAttributeOrTarget === "string") {
246
- const isSelector = isCssSelector(selectorOrAttributeOrTarget);
247
- if (isSelector) {
248
- return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
249
- } else {
250
- const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
251
- return applyAttribute("$this", selectorOrAttributeOrTarget, options);
232
+ if (typeof attributeNameOrOptions !== "string") {
233
+ return applyAttribute("$this", selectorOrAttributeOrTarget, attributeNameOrOptions);
252
234
  }
235
+ return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
253
236
  }
254
- return applyAttribute("$this", void 0, selectorOrAttributeOrTarget);
255
- }
256
- function setAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined) {
257
- if (typeof selectorOrAttributeOrOptions === "function") {
258
- return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
237
+ if (typeof selectorOrAttributeOrTarget === "function") {
238
+ return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
259
239
  }
260
- if (typeof selectorOrAttributeOrOptions === "string") {
261
- const isSelector = isCssSelector(selectorOrAttributeOrOptions);
262
- if (isSelector) {
263
- return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions, optionsOrUndefined);
264
- } else {
265
- const options = typeof attributeNameOrOptions === "object" && attributeNameOrOptions !== null ? attributeNameOrOptions : {};
266
- return applyAttribute("$this", selectorOrAttributeOrOptions, options);
267
- }
240
+ if (selectorOrAttributeOrTarget && (typeof attributeNameOrOptions === "string" || typeof attributeNameOrOptions === "symbol")) {
241
+ return applyAttribute("$this", {})(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor);
268
242
  }
269
- return applyAttribute("$this", void 0, selectorOrAttributeOrOptions);
243
+ return applyAttribute("$this", selectorOrAttributeOrTarget);
244
+ }
245
+ function removeAttribute(selector, attributeName, options) {
246
+ return (target, propertyKey, descriptor) => {
247
+ const original = descriptor.value;
248
+ descriptor.value = function(...args) {
249
+ const res = original.apply(this, args);
250
+ const doRemove = () => {
251
+ resolveAttributeTargets(this, selector, options ?? {}).forEach((el) => el.removeAttribute(attributeName));
252
+ };
253
+ if (res instanceof Promise) {
254
+ return res.then((v) => {
255
+ doRemove();
256
+ return v;
257
+ });
258
+ }
259
+ doRemove();
260
+ return res;
261
+ };
262
+ return descriptor;
263
+ };
270
264
  }
271
265
  const findAllAttributeMetadata = (target) => {
272
- const actualTarget = target instanceof Function ? target : target.constructor;
266
+ const actualTarget = typeof target === "function" ? target : target.constructor;
273
267
  return import_core.ReflectUtils.findAllMetadata(ATTRIBUTE_METADATA_KEY, actualTarget).flat();
274
268
  };
275
269
  const findAllAttributeApplyMetadata = (target) => {
@@ -280,12 +274,6 @@ const findAllAttributeApplyMetadata = (target) => {
280
274
  return result;
281
275
  };
282
276
  const attr = applyAttribute;
283
- function attrThis(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor) {
284
- if ((typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor !== void 0) {
285
- return applyAttribute("$this", void 0, {})(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor);
286
- }
287
- return applyAttribute("$this", targetAttributeNameOrTarget, optionsOrPropertyKey);
288
- }
289
277
  function attrAppHost(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor) {
290
278
  if ((typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor !== void 0) {
291
279
  return applyAttribute("$appHost", void 0, {})(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/applyAttribute.ts"],
4
- "sourcesContent": ["import {ReflectUtils, FunctionUtils, ActionExpression} from '@dooboostore/core';\nimport {ensureInit, getElementConfig} from './elementDefine';\nimport {SwcUtils} from '../utils/Utils';\nimport {SwcQueryOptions, HelperHostSet, SwcFnSelector, SwcSelector} from '../types';\nimport {ConvertUtils} from '@dooboostore/core-web';\n\n// ============================================\n// Types & Interfaces\n// ============================================\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface AttributeBaseOptions {\n name?: string;\n type?: typeof Number | typeof Boolean | typeof String;\n filter?: (target: HTMLElement, value: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9 (\uCEF4\uD3EC\uB10C\uD2B8 DOM \uD2B8\uB9AC \uC548\uC5D0\uC11C \uD0D0\uC0C9)\nexport type AttributeQueryOptions = AttributeBaseOptions & SwcQueryOptions;\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0 (\uC774\uBBF8 \uC694\uC18C\uB97C \uC9C1\uC811 \uBC18\uD658)\nexport type AttributeNonQueryOptions = AttributeBaseOptions;\n// \uB0B4\uBD80 \uC800\uC7A5/\uD574\uC11D\uC6A9 \u2014 root optional\uC774\uB77C \uB450 \uC885\uB958 \uBAA8\uB450 \uC800\uC7A5 \uAC00\uB2A5\nexport type AttributeOptions = AttributeQueryOptions;\n\nexport type AttributeFnSelector = SwcFnSelector;\nexport type AttributeSelector = SwcSelector;\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type AttributeOptionsOf<S extends AttributeSelector> = S extends string ? AttributeQueryOptions : AttributeNonQueryOptions;\n\nexport interface AttributeMetadata {\n propertyKey: string | symbol;\n selector: AttributeSelector;\n targetAttributeName: string;\n options: AttributeOptions;\n type: 'property' | 'method';\n}\n\nexport const ATTRIBUTE_METADATA_KEY = Symbol.for('simple-web-component:attribute');\n\n// ============================================\n// Utilities\n// ============================================\n\n/**\n * Determine if a string is a CSS selector or an attribute name\n * \n * CSS selectors typically:\n * - Start with: #, ., [, :, >, +, ~\n * - Contain special chars: >, +, ~, :, [, ]\n * - Are special keywords: $this, $host, $parentHost, etc.\n * \n * Attribute names are typically:\n * - kebab-case (lowercase with hyphens)\n * - No special selector syntax\n * \n * @param str - String to check\n * @returns true if it's a CSS selector, false if it's an attribute name\n */\nconst isCssSelector = (str: string): boolean => {\n if (!str) return false;\n \n // Special keywords\n if (str.startsWith('$')) return true;\n \n // CSS selector syntax\n if (/^[#.\\[\\:>+~]/.test(str)) return true;\n \n // Contains CSS combinator or pseudo-selector syntax\n if (/[>+~:\\[\\]]/.test(str)) return true;\n \n return false;\n};\n\nconst convertValue = (val: string | null, type: any): any => {\n if (val === null || val === undefined) return val;\n if (type === Number) return Number(val);\n if (type === Boolean) return val === 'false' || val === '0' ? false : true;\n return val;\n};\n\nexport {convertValue};\n\nexport const getAttributeValue = (inst: any, attrName: string, options?: AttributeOptions & { selector?: AttributeSelector }): any => {\n const conf = getElementConfig(inst);\n const currentWin = inst._resolveWindow?.(conf) || ((typeof window !== 'undefined' ? window : undefined) as any);\n\n // If selector is not provided, use inst itself\n const targets = options?.selector ? resolveAttributeTargets(inst, options.selector, options) : [inst];\n\n const primaryTarget = targets[0];\n\n if (primaryTarget && typeof (primaryTarget as any).hasAttribute === 'function' && (primaryTarget as any).hasAttribute(attrName)) {\n let domVal = (primaryTarget as any).getAttribute(attrName);\n\n // \uD45C\uD604\uC2DD \uCCB4\uD06C\n const ae = new ActionExpression(domVal);\n const expr = ae.getFirstExpression('callReturn');\n if (expr) {\n try {\n const result = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, currentWin.document),\n context: inst,\n args: SwcUtils.getHelperAndHostSet(currentWin, inst)\n });\n return convertValue(result, options?.type);\n } catch (err) {\n console.error(`[SWC] Failed to execute directive {{= ${expr.script} }}:`, err);\n return convertValue(domVal, options?.type);\n }\n }\n\n return convertValue(domVal, options?.type);\n }\n\n // If no target found, return null\n return null;\n};\n\n/**\n * Resolve target elements based on selector and options\n * Handles special selectors ($this, $host, etc.), CSS selectors, and function-based selectors\n * Returns HTMLElement[] for attribute operations\n */\nexport const resolveAttributeTargets = (inst: any, selector: AttributeSelector, options: AttributeOptions): HTMLElement[] => {\n const conf = getElementConfig(inst);\n const currentWin = conf.window;\n const r = options.root || 'auto';\n const results: HTMLElement[] = [];\n\n // Resolve selector if it's a function\n let resolvedSelector: string | Node | Element | NodeList | Element[] | null = selector as any;\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, inst);\n resolvedSelector = selector(inst, hostSet);\n }\n\n // If selector function returned elements directly, use them\n if (resolvedSelector instanceof currentWin.Element) {\n results.push(resolvedSelector as HTMLElement);\n return results;\n }\n if (resolvedSelector instanceof currentWin.NodeList) {\n results.push(...(Array.from(resolvedSelector) as HTMLElement[]));\n return results;\n }\n if (Array.isArray(resolvedSelector)) {\n results.push(...(resolvedSelector as HTMLElement[]));\n return results;\n }\n if (resolvedSelector === null) {\n return results;\n }\n\n // Handle string selector\n const stringSelector = resolvedSelector as string;\n\n const applyRoot = (target: any) => {\n if (!target) return;\n if (r === 'auto') {\n results.push(target);\n } else {\n if (r === 'light' || r === 'all') results.push(target);\n if ((r === 'shadow' || r === 'all') && target.shadowRoot) results.push(target.shadowRoot);\n }\n };\n\n if (stringSelector === '$this' || !stringSelector) {\n applyRoot(inst);\n } else {\n const hostSet = SwcUtils.getHostSet(inst);\n if (stringSelector === '$host') applyRoot(hostSet.$host);\n else if (stringSelector === '$parentHost') applyRoot(hostSet.$parentHost);\n else if (stringSelector === '$appHost') applyRoot(hostSet.$appHost as any);\n else if (stringSelector === '$firstHost') applyRoot(hostSet.$firstHost);\n else if (stringSelector === '$lastHost') applyRoot(hostSet.$lastHost);\n else if (stringSelector === '$firstAppHost') applyRoot(hostSet.$firstAppHost as any);\n else if (stringSelector === '$lastAppHost') applyRoot(hostSet.$lastAppHost as any);\n else if (stringSelector === '$hosts') hostSet.$hosts.forEach(applyRoot);\n else if (stringSelector === '$appHosts') hostSet.$appHosts.forEach(applyRoot);\n else {\n if (r === 'shadow') {\n const found = inst.shadowRoot?.querySelectorAll(stringSelector);\n if (found) results.push(...found);\n } else if (r === 'light') {\n const found = inst.querySelectorAll(stringSelector);\n if (found) results.push(...found);\n } else if (r === 'all') {\n const sMatch = inst.shadowRoot?.querySelectorAll(stringSelector);\n const lMatch = inst.querySelectorAll(stringSelector);\n if (sMatch) results.push(...sMatch);\n if (lMatch) results.push(...lMatch);\n } else {\n const found = (inst.shadowRoot || inst).querySelectorAll(stringSelector);\n if (found) results.push(...found);\n }\n }\n }\n return results;\n};\n\n/**\n * @applyAttribute decorator - set/get element attributes\n *\n * Usage:\n * - @applyAttribute('selector', 'attrName') - Set attribute with explicit name\n * - @applyAttribute('selector') - Use property name as attribute name\n * - @applyAttribute('selector', { name: 'attrName' }) - Set attribute via options\n * - @applyAttribute((this, helper) => 'selector', 'attrName') - Function-based selector\n * - Return null to remove attribute\n */\nexport function applyAttribute<S extends AttributeSelector>(selector: S, targetAttributeName: string, options?: AttributeOptionsOf<S>): MethodDecorator & PropertyDecorator;\nexport function applyAttribute<S extends AttributeSelector>(selector: S, options?: AttributeOptionsOf<S>): MethodDecorator & PropertyDecorator;\nexport function applyAttribute(selector: AttributeSelector, targetAttributeNameOrOptions?: string | AttributeOptions, options?: AttributeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n // ensureInit(target as any);\n\n const constructor = target.constructor;\n const designType = (Reflect as any).getMetadata('design:type', target, propertyKey);\n const metaType: 'property' | 'method' = descriptor && typeof descriptor.value === 'function' ? 'method' : 'property';\n\n // Parse arguments\n let finalOptions: AttributeOptions = {};\n let targetAttributeName: string;\n\n if (typeof targetAttributeNameOrOptions === 'string') {\n // applyAttribute('selector', 'attrName', options?)\n targetAttributeName = targetAttributeNameOrOptions;\n finalOptions = options || {};\n } else if (targetAttributeNameOrOptions) {\n // applyAttribute('selector', options)\n finalOptions = targetAttributeNameOrOptions;\n targetAttributeName = finalOptions.name || String(propertyKey);\n } else {\n // applyAttribute('selector')\n targetAttributeName = String(propertyKey);\n }\n\n // Store metadata\n let metaList = ReflectUtils.getOwnMetadata(ATTRIBUTE_METADATA_KEY, constructor) as AttributeMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(ATTRIBUTE_METADATA_KEY, metaList, constructor);\n }\n metaList.push({\n propertyKey,\n selector: selector as AttributeSelector,\n targetAttributeName,\n options: finalOptions,\n type: metaType\n });\n\n // Helper: Apply resolved value to targets\n const applyValueToTargets = (inst: any, resolvedValue: any) => {\n const conf = getElementConfig(inst);\n const currentWin = conf.window;\n const targetEls = resolveAttributeTargets(inst, selector, finalOptions);\n const hostSet = SwcUtils.getHelperAndHostSet(currentWin, inst);\n\n targetEls.forEach(targetEl => {\n // Apply filter if provided\n if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, {currentThis: inst, helper: hostSet})) {\n return;\n }\n\n if (resolvedValue === null) {\n // Remove attribute if value is null\n targetEl.removeAttribute(targetAttributeName);\n } else if (resolvedValue !== undefined) {\n // Set attribute\n targetEl.setAttribute(targetAttributeName, resolvedValue === true ? '' : String(resolvedValue));\n }\n });\n\n return resolvedValue;\n };\n\n // Method decorator: wrap method to apply its return value to attributes\n if (descriptor && typeof descriptor.value === 'function') {\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = (original as any).apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses ATTRIBUTE_METADATA_KEY.\n * \n * Example:\n * @setAttribute('selector1', { valueKey: 'attr1' })\n * @setAttribute('selector2', { valueKey: 'attr2' })\n * myMethod() {\n * return {\n * attr1: 'attribute-value1',\n * attr2: 'attribute-value2'\n * };\n * }\n * \n * First decorator will use 'attribute-value1', second will use 'attribute-value2'\n */\n const extractValue = (v: any) => {\n const keyToUse = finalOptions.valueKey ?? ATTRIBUTE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n if (res instanceof Promise) {\n return res.then((v: any) => {\n const extracted = extractValue(v);\n applyValueToTargets(this, extracted);\n return v;\n });\n } else {\n const extracted = extractValue(res);\n applyValueToTargets(this, extracted);\n return res;\n }\n };\n return;\n }\n\n // Property decorator: define getter/setter to proxy to element attributes\n Object.defineProperty(target, propertyKey, {\n configurable: true,\n enumerable: true,\n get(this: any) {\n ensureInit(this);\n const mergedOptions = {...finalOptions, selector, type: finalOptions.type || designType};\n return getAttributeValue(this, targetAttributeName, mergedOptions);\n },\n set(this: any, value: any) {\n ensureInit(this);\n\n if (value instanceof Promise) {\n value.then((v: any) => applyValueToTargets(this, v)).catch(() => { /* swallow */\n });\n } else {\n applyValueToTargets(this, value);\n }\n }\n });\n };\n}\n\n// ============================================\n// Convenience Aliases\n// ============================================\n\n/**\n * @attribute - Field decorator for binding element attributes (read/write)\n * \n * Intelligently distinguishes between attribute names and CSS selectors:\n * \n * Usage patterns:\n * - @attribute('product-id') - Attribute name on $this (auto-detected)\n * - @attribute('#user', 'product-id') - Attribute name on selector\n * - @attribute('product-id', options) - Attribute name on $this with options\n * - @attribute('#user', 'product-id', options) - Attribute name on selector with options\n * - @attribute((this, helper) => 'selector', 'product-id') - Function-based selector\n * - @attribute - Bare decorator (uses property name as attribute on $this)\n * \n * Note: This decorator is for FIELDS ONLY. For methods, use @setAttribute.\n */\nexport function attribute(target: Object, propertyKey: string | symbol): void;\nexport function attribute(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function attribute(attributeName: string, options?: AttributeQueryOptions): PropertyDecorator;\nexport function attribute(selector: string, attributeName: string, options?: AttributeQueryOptions): PropertyDecorator;\nexport function attribute(selector: AttributeFnSelector, attributeName: string, options?: AttributeNonQueryOptions): PropertyDecorator;\nexport function attribute(selectorOrAttributeOrTarget?: AttributeSelector | Object, attributeNameOrOptions?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @attribute\n if (optionsOrDescriptor !== undefined && (typeof attributeNameOrOptions === 'string' || typeof attributeNameOrOptions === 'symbol')) {\n return applyAttribute('$this', undefined as any, {})(selectorOrAttributeOrTarget as Object, attributeNameOrOptions, optionsOrDescriptor as PropertyDescriptor);\n }\n \n // With string as first parameter\n if (typeof selectorOrAttributeOrTarget === 'string') {\n // Check if first parameter is a CSS selector or attribute name\n const isSelector = isCssSelector(selectorOrAttributeOrTarget);\n \n if (isSelector) {\n // First param is a selector: @attribute('#user', 'product-id', options?)\n return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions as any, optionsOrDescriptor as AttributeOptions);\n } else {\n // First param is an attribute name: @attribute('product-id', options?)\n // Treat as attribute name on $this\n const options = (typeof attributeNameOrOptions === 'object' && attributeNameOrOptions !== null) \n ? attributeNameOrOptions \n : {};\n return applyAttribute('$this', selectorOrAttributeOrTarget, options);\n }\n }\n \n // Without selector (defaults to $this with options)\n return applyAttribute('$this', undefined as any, selectorOrAttributeOrTarget as AttributeOptions);\n}\n\n/**\n * @setAttribute - Method decorator for setting element attributes from method return value\n * \n * Intelligently distinguishes between attribute names and CSS selectors:\n * \n * Usage patterns:\n * - @setAttribute('data-id') - Attribute name on $this (auto-detected)\n * - @setAttribute('#user', 'data-id') - Attribute name on selector\n * - @setAttribute('data-id', options) - Attribute name on $this with options\n * - @setAttribute('#user', 'data-id', options) - Attribute name on selector with options\n * - @setAttribute((this, helper) => 'selector', 'data-id') - Function-based selector\n * - @setAttribute - Bare decorator (uses method name as attribute on $this)\n * \n * Note: This decorator is for METHODS ONLY. For fields, use @attribute.\n * \n * Example:\n * @setAttribute('data-status')\n * updateStatus() {\n * return 'active';\n * }\n */\nexport function setAttribute(selector: string, attributeName: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function setAttribute(selector: AttributeFnSelector, attributeName: string, options?: AttributeNonQueryOptions): MethodDecorator;\nexport function setAttribute(attributeName: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function setAttribute(selectorOrAttributeOrOptions?: AttributeSelector | AttributeOptions, attributeNameOrOptions?: any, optionsOrUndefined?: AttributeOptions): MethodDecorator {\n // Function selector: @setAttribute((c, helper) => ..., 'attr', options?)\n if (typeof selectorOrAttributeOrOptions === 'function') {\n return applyAttribute(selectorOrAttributeOrOptions as AttributeSelector, attributeNameOrOptions as any, optionsOrUndefined as AttributeOptions) as MethodDecorator;\n }\n // With string as first parameter\n if (typeof selectorOrAttributeOrOptions === 'string') {\n // Check if first parameter is a CSS selector or attribute name\n const isSelector = isCssSelector(selectorOrAttributeOrOptions);\n \n if (isSelector) {\n // First param is a selector: @setAttribute('#user', 'data-id', options?)\n return applyAttribute(selectorOrAttributeOrOptions, attributeNameOrOptions as any, optionsOrUndefined as AttributeOptions) as MethodDecorator;\n } else {\n // First param is an attribute name: @setAttribute('data-id', options?)\n // Treat as attribute name on $this\n const options = (typeof attributeNameOrOptions === 'object' && attributeNameOrOptions !== null) \n ? attributeNameOrOptions \n : {};\n return applyAttribute('$this', selectorOrAttributeOrOptions, options) as MethodDecorator;\n }\n }\n \n // Without selector (defaults to $this with options)\n return applyAttribute('$this', undefined as any, selectorOrAttributeOrOptions as AttributeOptions) as MethodDecorator;\n}\n\n// ============================================\n// Metadata Helpers\n// ============================================\n\nexport const findAllAttributeMetadata = (target: any): AttributeMetadata[] => {\n const actualTarget = target instanceof Function ? target : target.constructor;\n return ReflectUtils.findAllMetadata<AttributeMetadata[]>(ATTRIBUTE_METADATA_KEY, actualTarget).flat();\n};\n\n// Backward compatibility alias\nexport const findAllAttributeApplyMetadata = (target: any): Map<string | symbol, AttributeMetadata> => {\n const result = new Map<string | symbol, AttributeMetadata>();\n findAllAttributeMetadata(target).forEach(meta => {\n result.set(meta.propertyKey, meta);\n });\n return result;\n};\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\n// attribute(\uD544\uB4DC) / setAttribute(\uBA54\uC11C\uB4DC)\uC640 \uAD6C\uBD84\uB418\uB294 \uC77C\uBC18 \uB370\uCF54\uB808\uC774\uD130 \uB2E8\uCD95\uBA85\nexport const attr = applyAttribute;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function attrThis(targetAttributeName?: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function attrThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function attrThis(targetAttributeNameOrTarget?: string | Object, optionsOrPropertyKey?: AttributeQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyAttribute('$this', undefined as any, {}) as any)(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyAttribute('$this', targetAttributeNameOrTarget as any, optionsOrPropertyKey as AttributeQueryOptions);\n}\nexport function attrAppHost(targetAttributeName?: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function attrAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function attrAppHost(targetAttributeNameOrTarget?: string | Object, optionsOrPropertyKey?: AttributeQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyAttribute('$appHost', undefined as any, {}) as any)(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyAttribute('$appHost', targetAttributeNameOrTarget as any, optionsOrPropertyKey as AttributeQueryOptions);\n}\nexport function attrLight(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'light'});\n}\nexport function attrShadow(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'shadow'});\n}\nexport function attrAll(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'all'});\n}\n\nexport default applyAttribute;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,2BAA2C;AAC3C,mBAAuB;AAEvB,sBAA2B;AAmCpB,MAAM,yBAAyB,OAAO,IAAI,gCAAgC;AAqBjF,MAAM,gBAAgB,CAAC,QAAyB;AAC9C,MAAI,CAAC,IAAK,QAAO;AAGjB,MAAI,IAAI,WAAW,GAAG,EAAG,QAAO;AAGhC,MAAI,eAAe,KAAK,GAAG,EAAG,QAAO;AAGrC,MAAI,aAAa,KAAK,GAAG,EAAG,QAAO;AAEnC,SAAO;AACT;AAEA,MAAM,eAAe,CAAC,KAAoB,SAAmB;AAC3D,MAAI,QAAQ,QAAQ,QAAQ,OAAW,QAAO;AAC9C,MAAI,SAAS,OAAQ,QA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B,qBAA8B,SAAgE;AACzI,SAAO,eAAe,UAAU,qBAAqB,EAAC,GAAG,WAAW,CAAC,GAAG,MAAM,SAAQ,CAAC;AACzF;AACO,SAAS,QAAQ,UAAkB,qBAA8B,SAAgE;AACtI,SAAO,eAAe,UAAU,qBAAqB,EAAC,GAAG,WAAW,CAAC,GAAG,MAAM,MAAK,CAAC;AACtF;AAEA,IAAO,yBAAQ;",
4
+ "sourcesContent": ["import {ReflectUtils, FunctionUtils, ActionExpression} from '@dooboostore/core';\nimport {ensureInit, getElementConfig} from './elementDefine';\nimport {SwcUtils} from '../utils/Utils';\nimport {SwcQueryOptions, HelperHostSet, SwcFnSelector, SwcSelector} from '../types';\nimport {ConvertUtils} from '@dooboostore/core-web';\n\n// ============================================\n// Types & Interfaces\n// ============================================\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface AttributeBaseOptions {\n name?: string;\n type?: typeof Number | typeof Boolean | typeof String;\n filter?: (target: HTMLElement, value: any, meta: { currentThis: any, helper: HelperHostSet }) => boolean;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9 (\uCEF4\uD3EC\uB10C\uD2B8 DOM \uD2B8\uB9AC \uC548\uC5D0\uC11C \uD0D0\uC0C9)\nexport type AttributeQueryOptions = AttributeBaseOptions & SwcQueryOptions;\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0 (\uC774\uBBF8 \uC694\uC18C\uB97C \uC9C1\uC811 \uBC18\uD658)\nexport type AttributeNonQueryOptions = AttributeBaseOptions;\n// \uB0B4\uBD80 \uC800\uC7A5/\uD574\uC11D\uC6A9 \u2014 root optional\uC774\uB77C \uB450 \uC885\uB958 \uBAA8\uB450 \uC800\uC7A5 \uAC00\uB2A5\nexport type AttributeOptions = AttributeQueryOptions;\n\nexport type AttributeFnSelector = SwcFnSelector;\nexport type AttributeSelector = SwcSelector;\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type AttributeOptionsOf<S extends AttributeSelector> = S extends string ? AttributeQueryOptions : AttributeNonQueryOptions;\n\nexport interface AttributeMetadata {\n propertyKey: string | symbol;\n selector: AttributeSelector;\n targetAttributeName: string;\n options: AttributeOptions;\n type: 'property' | 'method';\n}\n\nexport const ATTRIBUTE_METADATA_KEY = Symbol.for('simple-web-component:attribute');\n\n// ============================================\n// Utilities\n// ============================================\n\n\n// \uBB38\uC790\uC5F4(attribute \uC6D0\uBB38)\uC740 'false'/'0' \uB9CC false. {{= }} \uACB0\uACFC\uCC98\uB7FC \uC774\uBBF8 JS \uAC12\uC774\uBA74 \uADF8 \uAC12\uC758 \uCC38/\uAC70\uC9D3\uC744 \uB530\uB978\uB2E4\nconst convertValue = (val: any, type: any): any => {\n if (val === null || val === undefined) return val;\n if (type === Number) return Number(val);\n if (type === Boolean) return typeof val === 'string' ? !(val === 'false' || val === '0') : Boolean(val);\n return val;\n};\n\nexport {convertValue};\n\nexport const getAttributeValue = (inst: any, attrName: string, options?: AttributeOptions & { selector?: AttributeSelector }): any => {\n const currentWin = SwcUtils.resolveWindow(inst);\n\n // If selector is not provided, use inst itself\n const targets = options?.selector ? resolveAttributeTargets(inst, options.selector, options) : [inst];\n\n const primaryTarget = targets[0];\n\n if (primaryTarget && typeof (primaryTarget as any).hasAttribute === 'function' && (primaryTarget as any).hasAttribute(attrName)) {\n let domVal = (primaryTarget as any).getAttribute(attrName);\n\n // \uD45C\uD604\uC2DD \uCCB4\uD06C\n const ae = new ActionExpression(domVal);\n const expr = ae.getFirstExpression('callReturn');\n if (expr) {\n try {\n const result = FunctionUtils.executeReturn({\n script: ConvertUtils.decodeHtmlEntity(expr.script, currentWin.document),\n context: inst,\n args: SwcUtils.getHelperAndHostSet(inst)\n });\n return convertValue(result, options?.type);\n } catch (err) {\n console.error(`[SWC] Failed to execute directive {{= ${expr.script} }}:`, err);\n return convertValue(domVal, options?.type);\n }\n }\n\n return convertValue(domVal, options?.type);\n }\n\n // If no target found, return null\n return null;\n};\n\n/**\n * Resolve target elements based on selector and options\n * Handles special selectors ($this, $host, etc.), CSS selectors, and function-based selectors\n * Returns HTMLElement[] for attribute operations\n */\nexport const resolveAttributeTargets = (inst: any, selector: AttributeSelector, options: AttributeOptions): HTMLElement[] => {\n const conf = getElementConfig(inst);\n const currentWin = conf.window;\n const r = options.root || 'auto';\n const results: HTMLElement[] = [];\n\n // Resolve selector if it's a function\n let resolvedSelector: string | Node | Element | NodeList | Element[] | null = selector as any;\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n resolvedSelector = selector(inst, hostSet);\n }\n\n // If selector function returned elements directly, use them\n if (resolvedSelector instanceof currentWin.Element) {\n results.push(resolvedSelector as HTMLElement);\n return results;\n }\n if (resolvedSelector instanceof currentWin.NodeList) {\n results.push(...(Array.from(resolvedSelector) as HTMLElement[]));\n return results;\n }\n if (Array.isArray(resolvedSelector)) {\n results.push(...(resolvedSelector as HTMLElement[]));\n return results;\n }\n if (resolvedSelector === null) {\n return results;\n }\n\n // Handle string selector\n const stringSelector = resolvedSelector as string;\n\n const applyRoot = (target: any) => {\n if (!target) return;\n if (r === 'auto') {\n results.push(target);\n } else {\n if (r === 'light' || r === 'all') results.push(target);\n if ((r === 'shadow' || r === 'all') && target.shadowRoot) results.push(target.shadowRoot);\n }\n };\n\n if (stringSelector === '$this' || !stringSelector) {\n applyRoot(inst);\n } else {\n const hostSet = SwcUtils.getHostSet(inst);\n if (stringSelector === '$host') applyRoot(hostSet.$host);\n else if (stringSelector === '$parentHost') applyRoot(hostSet.$parentHost);\n else if (stringSelector === '$appHost') applyRoot(hostSet.$appHost as any);\n else if (stringSelector === '$firstHost') applyRoot(hostSet.$firstHost);\n else if (stringSelector === '$lastHost') applyRoot(hostSet.$lastHost);\n else if (stringSelector === '$firstAppHost') applyRoot(hostSet.$firstAppHost as any);\n else if (stringSelector === '$lastAppHost') applyRoot(hostSet.$lastAppHost as any);\n else if (stringSelector === '$hosts') hostSet.$hosts.forEach(applyRoot);\n else if (stringSelector === '$appHosts') hostSet.$appHosts.forEach(applyRoot);\n else {\n if (r === 'shadow') {\n const found = inst.shadowRoot?.querySelectorAll(stringSelector);\n if (found) results.push(...found);\n } else if (r === 'light') {\n const found = inst.querySelectorAll(stringSelector);\n if (found) results.push(...found);\n } else if (r === 'all') {\n const sMatch = inst.shadowRoot?.querySelectorAll(stringSelector);\n const lMatch = inst.querySelectorAll(stringSelector);\n if (sMatch) results.push(...sMatch);\n if (lMatch) results.push(...lMatch);\n } else {\n const found = (inst.shadowRoot || inst).querySelectorAll(stringSelector);\n if (found) results.push(...found);\n }\n }\n }\n return results;\n};\n\n/**\n * @applyAttribute decorator - set/get element attributes\n *\n * Usage:\n * - @applyAttribute('selector', 'attrName') - Set attribute with explicit name\n * - @applyAttribute('selector') - Use property name as attribute name\n * - @applyAttribute('selector', { name: 'attrName' }) - Set attribute via options\n * - @applyAttribute((this, helper) => 'selector', 'attrName') - Function-based selector\n * - Return null to remove attribute\n */\nexport function applyAttribute<S extends AttributeSelector>(selector: S, targetAttributeName: string, options?: AttributeOptionsOf<S>): MethodDecorator & PropertyDecorator;\nexport function applyAttribute<S extends AttributeSelector>(selector: S, options?: AttributeOptionsOf<S>): MethodDecorator & PropertyDecorator;\nexport function applyAttribute(selector: AttributeSelector, targetAttributeNameOrOptions?: string | AttributeOptions, options?: AttributeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {\n // ensureInit(target as any);\n\n const constructor = target.constructor;\n const designType = (Reflect as any).getMetadata('design:type', target, propertyKey);\n const metaType: 'property' | 'method' = descriptor && typeof descriptor.value === 'function' ? 'method' : 'property';\n\n // Parse arguments\n let finalOptions: AttributeOptions = {};\n let targetAttributeName: string;\n\n if (typeof targetAttributeNameOrOptions === 'string') {\n // applyAttribute('selector', 'attrName', options?)\n targetAttributeName = targetAttributeNameOrOptions;\n finalOptions = options || {};\n } else if (targetAttributeNameOrOptions) {\n // applyAttribute('selector', options)\n finalOptions = targetAttributeNameOrOptions;\n targetAttributeName = finalOptions.name || String(propertyKey);\n } else {\n // applyAttribute('selector')\n targetAttributeName = String(propertyKey);\n }\n\n // Store metadata\n let metaList = ReflectUtils.getOwnMetadata(ATTRIBUTE_METADATA_KEY, constructor) as AttributeMetadata[];\n if (!metaList) {\n metaList = [];\n ReflectUtils.defineMetadata(ATTRIBUTE_METADATA_KEY, metaList, constructor);\n }\n metaList.push({\n propertyKey,\n selector: selector as AttributeSelector,\n targetAttributeName,\n options: finalOptions,\n type: metaType\n });\n\n // Helper: Apply resolved value to targets\n const applyValueToTargets = (inst: any, resolvedValue: any) => {\n const targetEls = resolveAttributeTargets(inst, selector, finalOptions);\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n\n targetEls.forEach(targetEl => {\n // Apply filter if provided\n if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, {currentThis: inst, helper: hostSet})) {\n return;\n }\n\n if (resolvedValue === null) {\n // Remove attribute if value is null\n targetEl.removeAttribute(targetAttributeName);\n } else if (resolvedValue !== undefined) {\n // Set attribute\n targetEl.setAttribute(targetAttributeName, resolvedValue === true ? '' : String(resolvedValue));\n }\n });\n\n return resolvedValue;\n };\n\n // Method decorator: wrap method to apply its return value to attributes\n if (descriptor && typeof descriptor.value === 'function') {\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = (original as any).apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses ATTRIBUTE_METADATA_KEY.\n * \n * Example:\n * @attribute('selector1', 'attr1-name', { valueKey: 'attr1' })\n * @attribute('selector2', 'attr2-name', { valueKey: 'attr2' })\n * myMethod() {\n * return {\n * attr1: 'attribute-value1',\n * attr2: 'attribute-value2'\n * };\n * }\n * \n * First decorator will use 'attribute-value1', second will use 'attribute-value2'\n */\n const extractValue = (v: any) => {\n const keyToUse = finalOptions.valueKey ?? ATTRIBUTE_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n if (res instanceof Promise) {\n return res.then((v: any) => {\n const extracted = extractValue(v);\n applyValueToTargets(this, extracted);\n return v;\n });\n } else {\n const extracted = extractValue(res);\n applyValueToTargets(this, extracted);\n return res;\n }\n };\n return;\n }\n\n // Property decorator: define getter/setter to proxy to element attributes\n Object.defineProperty(target, propertyKey, {\n configurable: true,\n enumerable: true,\n get(this: any) {\n ensureInit(this);\n const mergedOptions = {...finalOptions, selector, type: finalOptions.type || designType};\n return getAttributeValue(this, targetAttributeName, mergedOptions);\n },\n set(this: any, value: any) {\n ensureInit(this);\n\n if (value instanceof Promise) {\n value.then((v: any) => applyValueToTargets(this, v)).catch(() => { /* swallow */\n });\n } else {\n applyValueToTargets(this, value);\n }\n }\n });\n };\n}\n\n// ============================================\n// Convenience Aliases\n// ============================================\n\n/**\n * @attribute - \uD544\uB4DC/\uBA54\uC11C\uB4DC \uACF5\uC6A9. \uBD99\uC740 \uACF3\uC5D0 \uB530\uB77C \uB3D9\uC791\uC774 \uAC08\uB9B0\uB2E4.\n * - \uD544\uB4DC: \uC5D8\uB9AC\uBA3C\uD2B8 attribute \uB97C \uC77D\uACE0 \uC4F0\uB294 getter/setter\n * - \uBA54\uC11C\uB4DC: \uB9AC\uD134\uAC12\uC744 \uC5D8\uB9AC\uBA3C\uD2B8 attribute \uC5D0 \uC801\uC6A9 (null \uC774\uBA74 \uC81C\uAC70, undefined \uBA74 \uBB34\uC2DC)\n *\n * \uBB38\uC790\uC5F4\uC774 \uD558\uB098\uBA74 \uC790\uAE30 \uC790\uC2E0($this)\uC758 attribute \uC774\uB984, \uB458\uC774\uBA74 (\uC140\uB809\uD130, attribute \uC774\uB984).\n * - @attribute - $this \uC758 attribute, \uC774\uB984\uC740 \uD544\uB4DC/\uBA54\uC11C\uB4DC \uC774\uB984\n * - @attribute('product-id') / @attribute('product-id', options) - $this \uC758 product-id\n * - @attribute('#user', 'product-id', options?) - \uC140\uB809\uD130 \uB300\uC0C1\uC758 product-id\n * - @attribute((this, helper) => el, 'product-id') - \uD568\uC218 \uC140\uB809\uD130\n * - @attribute(options) - $this, \uC774\uB984\uC740 options.name \uB610\uB294 \uD544\uB4DC/\uBA54\uC11C\uB4DC \uC774\uB984\n *\n * Example:\n * @attribute('product-id') productId: string;\n *\n * @attribute('.card', 'data-status')\n * updateStatus() { return 'active'; }\n */\nexport function attribute(attributeName: string, options?: AttributeQueryOptions): MethodDecorator & PropertyDecorator;\nexport function attribute(selector: string, attributeName: string, options?: AttributeQueryOptions): MethodDecorator & PropertyDecorator;\nexport function attribute(selector: AttributeFnSelector, attributeName: string, options?: AttributeNonQueryOptions): MethodDecorator & PropertyDecorator;\nexport function attribute(options: AttributeOptions): MethodDecorator & PropertyDecorator;\n// bare(@attribute) \uC2DC\uADF8\uB2C8\uCC98\uB294 \uB9E8 \uB4A4 \u2014 \uC55E\uC5D0 \uC788\uC73C\uBA74 \uBB38\uC790\uC5F4 \uB450 \uAC1C\uC9DC\uB9AC \uD638\uCD9C\uC774 (target, key) \uB85C \uBA3C\uC800 \uC7A1\uD600 TS1240\nexport function attribute(target: Object, propertyKey: string | symbol): void;\nexport function attribute(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function attribute(selectorOrAttributeOrTarget?: AttributeSelector | AttributeOptions | Object, attributeNameOrOptions?: any, optionsOrDescriptor?: any): any {\n // \uBB38\uC790\uC5F4: \uD558\uB098\uBA74 $this \uC758 attribute \uC774\uB984, \uB458\uC774\uBA74 (\uC140\uB809\uD130, attribute \uC774\uB984)\n if (typeof selectorOrAttributeOrTarget === 'string') {\n if (typeof attributeNameOrOptions !== 'string') {\n return applyAttribute('$this', selectorOrAttributeOrTarget, attributeNameOrOptions as AttributeOptions);\n }\n return applyAttribute(selectorOrAttributeOrTarget, attributeNameOrOptions, optionsOrDescriptor as AttributeOptions);\n }\n // \uD568\uC218 \uC140\uB809\uD130\n if (typeof selectorOrAttributeOrTarget === 'function') {\n return applyAttribute(selectorOrAttributeOrTarget as AttributeFnSelector, attributeNameOrOptions, optionsOrDescriptor as AttributeOptions);\n }\n // bare: @attribute \u2014 \uB370\uCF54\uB808\uC774\uD130\uB85C \uBC14\uB85C \uD638\uCD9C\uB428 (target=prototype, key[, descriptor])\n if (selectorOrAttributeOrTarget && (typeof attributeNameOrOptions === 'string' || typeof attributeNameOrOptions === 'symbol')) {\n return applyAttribute('$this', {})(selectorOrAttributeOrTarget as Object, attributeNameOrOptions, optionsOrDescriptor as PropertyDescriptor);\n }\n // \uC635\uC158\uB9CC: $this\n return applyAttribute('$this', selectorOrAttributeOrTarget as AttributeOptions);\n}\n\n/**\n * @removeAttribute - \uBA54\uC11C\uB4DC \uC2E4\uD589 \uC2DC \uC5D8\uB9AC\uBA3C\uD2B8 \uC18D\uC131 \uC81C\uAC70 (\uBC18\uD658\uAC12 \uADF8\uB300\uB85C \uD1B5\uACFC).\n * \uB77C\uC6B0\uD2B8 \uAD6C\uB3C5\uCC98\uB7FC \uAC12\uC744 \uB9AC\uD134\uD558\uBA74 \uC548 \uB418\uB294 \uACF3\uC5D0\uC11C @attribute \uC5D0 null \uC744 \uB9AC\uD134\uD558\uB294 \uB300\uC2E0 \uBA85\uC2DC\uC801\uC73C\uB85C \uC0AC\uC6A9.\n *\n * Usage:\n * - @removeAttribute('nav', 'href') - Remove attribute from selector\n * - @removeAttribute('$this', 'href') - Remove attribute from $this\n */\nexport function removeAttribute(selector: string, attributeName: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function removeAttribute(selector: AttributeFnSelector, attributeName: string, options?: AttributeNonQueryOptions): MethodDecorator;\nexport function removeAttribute(selector: AttributeSelector, attributeName: string, options?: AttributeOptions): MethodDecorator {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n const res = (original as any).apply(this, args);\n const doRemove = () => {\n resolveAttributeTargets(this, selector, options ?? {}).forEach((el) => el.removeAttribute(attributeName));\n };\n if (res instanceof Promise) {\n return res.then((v: any) => {\n doRemove();\n return v;\n });\n }\n doRemove();\n return res;\n };\n return descriptor;\n };\n}\n\n// ============================================\n// Metadata Helpers\n// ============================================\n\nexport const findAllAttributeMetadata = (target: any): AttributeMetadata[] => {\n const actualTarget = typeof target === 'function' ? target : target.constructor;\n return ReflectUtils.findAllMetadata<AttributeMetadata[]>(ATTRIBUTE_METADATA_KEY, actualTarget).flat();\n};\n\n// Backward compatibility alias\nexport const findAllAttributeApplyMetadata = (target: any): Map<string | symbol, AttributeMetadata> => {\n const result = new Map<string | symbol, AttributeMetadata>();\n findAllAttributeMetadata(target).forEach(meta => {\n result.set(meta.propertyKey, meta);\n });\n return result;\n};\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\n// applyAttribute \uB2E8\uCD95\uBA85\nexport const attr = applyAttribute;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function attrAppHost(targetAttributeName: string, options?: AttributeQueryOptions): MethodDecorator;\nexport function attrAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function attrAppHost(targetAttributeNameOrTarget?: string | Object, optionsOrPropertyKey?: AttributeQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyAttribute('$appHost', undefined as any, {}) as any)(targetAttributeNameOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyAttribute('$appHost', targetAttributeNameOrTarget as any, optionsOrPropertyKey as AttributeQueryOptions);\n}\nexport function attrLight(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'light'});\n}\nexport function attrShadow(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'shadow'});\n}\nexport function attrAll(selector: string, targetAttributeName?: string, options?: Omit<AttributeQueryOptions, 'root'>): MethodDecorator {\n return applyAttribute(selector, targetAttributeName, {...options ?? {}, root: 'all'});\n}\n\nexport default applyAttribute;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4D;AAC5D,2BAA2C;AAC3C,mBAAuB;AAEvB,sBAA2B;AAmCpB,MAAM,yBAAyB,OAAO,IAAI,gCAAgC;AAQjF,MAAM,eAAe,CAAC,KAAU,SAAmB;AACjD,MAAI,QAAQ,QAAQ,QAAQ,OAAW,QAAO;AAC9C,MAAI,SAAS,OAAQ,QAAO,OAAO,GAAG;AACtC,MAAI,SAAS,QAAS,QAAO,OAAO,QAAQ,WAAW,EAAE,QAAQ,WAAW,QAAQ,OAAO,QAAQ,GAAG;AACtG,SAAO;AACT;AAIO,MAAM,oBAAoB,CAAC,MAAW,UAAkB,YAAuE;AACpI,QAAM,aAAa,sBAAS,cAAc,IAAI;AAG9C,QAAM,UAAU,SAAS,WAAW,wBAAwB,MAAM,QAAQ,UAAU,OAAO,IAAI,CAAC,IAAI;AAEpG,QAAM,gBAAgB,QAAQ,CAAC;AAE/B,MAAI,iBAAiB,OAAQ,cAAsB,iBAAiB,cAAe,cAAsB,aAAa,QAAQ,GAAG;AAC/H,QAAI,SAAU,cAAsB,aAAa,QAAQ;AAGzD,UAAM,KAAK,IAAI,6BAAiB,MAA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AACT;AAIO,MAAM,OAAO;AAMb,SAAS,YAAY,6BAA+C,sBAAgE,YAAsC;AAC/K,OAAK,OAAO,yBAAyB,YAAY,OAAO,yBAAyB,aAAa,eAAe,QAAW;AACtH,WAAQ,eAAe,YAAY,QAAkB,CAAC,CAAC,EAAU,6BAA6B,sBAAsB,UAAU;AAAA,EAChI;AACA,SAAO,eAAe,YAAY,6BAAoC,oBAA6C;AACrH;AACO,SAAS,UAAU,UAAkB,qBAA8B,SAAgE;AACxI,SAAO,eAAe,UAAU,qBAAqB,EAAC,GAAG,WAAW,CAAC,GAAG,MAAM,QAAO,CAAC;AACxF;AACO,SAAS,WAAW,UAAkB,qBAA8B,SAAgE;AACzI,SAAO,eAAe,UAAU,qBAAqB,EAAC,GAAG,WAAW,CAAC,GAAG,MAAM,SAAQ,CAAC;AACzF;AACO,SAAS,QAAQ,UAAkB,qBAA8B,SAAgE;AACtI,SAAO,eAAe,UAAU,qBAAqB,EAAC,GAAG,WAAW,CAAC,GAAG,MAAM,MAAK,CAAC;AACtF;AAEA,IAAO,yBAAQ;",
6
6
  "names": []
7
7
  }
@@ -25,7 +25,6 @@ __export(applyClass_exports, {
25
25
  clsAppHost: () => clsAppHost,
26
26
  clsLight: () => clsLight,
27
27
  clsShadow: () => clsShadow,
28
- clsThis: () => clsThis,
29
28
  findAllClassMetadata: () => findAllClassMetadata,
30
29
  removeClass: () => removeClass,
31
30
  setClass: () => setClass,
@@ -39,7 +38,7 @@ var import_Utils = require("../utils/Utils");
39
38
  const CLASS_METADATA_KEY = Symbol.for("simple-web-component:class");
40
39
  const resolveSelector = (selector, inst, win) => {
41
40
  if (typeof selector === "function") {
42
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(win, inst);
41
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(inst);
43
42
  const result = selector(inst, hostSet);
44
43
  if (result instanceof win.Element) {
45
44
  return [result];
@@ -68,7 +67,7 @@ const getTargetElements = (selector, inst, win, root) => {
68
67
  const stringSelector = resolved;
69
68
  const targetEls = [];
70
69
  const host = inst;
71
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(win, inst);
70
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(inst);
72
71
  const applyRoot = (t) => {
73
72
  if (!t || !(t instanceof win.HTMLElement)) return;
74
73
  targetEls.push(t);
@@ -124,7 +123,7 @@ function createClassDecorator(action) {
124
123
  if (resolvedValue !== void 0) {
125
124
  const win = this.ownerDocument?.defaultView || window;
126
125
  const host = this;
127
- const hostSet = { ...import_Utils.SwcUtils.getHelperAndHostSet(win, host), $this: this };
126
+ const hostSet = { ...import_Utils.SwcUtils.getHelperAndHostSet(host), $this: this };
128
127
  const r = finalOptions.root || "auto";
129
128
  const targetEls = getTargetElements(selector, this, win, r);
130
129
  targetEls.forEach((targetEl) => {
@@ -178,9 +177,13 @@ function createClassDecorator(action) {
178
177
  return resolvedValue;
179
178
  };
180
179
  if (res instanceof Promise) {
181
- return res.then((v) => handleResult(extractValue(v)));
180
+ return res.then((v) => {
181
+ handleResult(extractValue(v));
182
+ return v;
183
+ });
182
184
  } else {
183
- return handleResult(extractValue(res));
185
+ handleResult(extractValue(res));
186
+ return res;
184
187
  }
185
188
  };
186
189
  return descriptor;
@@ -246,12 +249,6 @@ function toggleClass(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOr
246
249
  return createClassDecorator("toggle")("$this", selectorOrTarget);
247
250
  }
248
251
  const cls = applyClass;
249
- function clsThis(actionOrTarget, optionsOrPropertyKey, descriptor) {
250
- if ((typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor !== void 0) {
251
- return applyClass("$this", void 0, {})(actionOrTarget, optionsOrPropertyKey, descriptor);
252
- }
253
- return applyClass("$this", actionOrTarget, optionsOrPropertyKey);
254
- }
255
252
  function clsAppHost(actionOrTarget, optionsOrPropertyKey, descriptor) {
256
253
  if ((typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor !== void 0) {
257
254
  return applyClass("$appHost", void 0, {})(actionOrTarget, optionsOrPropertyKey, descriptor);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/decorators/applyClass.ts"],
4
- "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';\n\nexport const CLASS_METADATA_KEY = Symbol.for('simple-web-component:class');\n\nexport type ClassAction = 'set' | 'update' | 'add' | 'remove' | 'toggle';\n\n/**\n * Resolve selector to string or elements\n * Handles function-based selectors and returns elements if applicable\n */\nconst resolveSelector = (selector: ClassSelector, inst: any, win: Window): string | HTMLElement[] => {\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(win, inst);\n const result = selector(inst, hostSet);\n \n if (result instanceof win.Element) {\n return [result as HTMLElement];\n }\n if (result instanceof win.NodeList) {\n return Array.from(result) as HTMLElement[];\n }\n if (Array.isArray(result)) {\n return result as HTMLElement[];\n }\n if (result === null) {\n return [];\n }\n if (result instanceof win.Node) {\n return [];\n }\n return result as string;\n }\n return selector as string;\n};\n\n/**\n * Get target elements from selector\n */\nconst getTargetElements = (selector: ClassSelector, inst: any, win: Window, root: string): HTMLElement[] => {\n const resolved = resolveSelector(selector, inst, win);\n \n if (Array.isArray(resolved)) {\n return resolved;\n }\n\n const stringSelector = resolved as string;\n const targetEls: HTMLElement[] = [];\n const host = inst as unknown as HTMLElement;\n const hostSet = SwcUtils.getHelperAndHostSet(win, inst);\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof win.HTMLElement)) return;\n targetEls.push(t);\n };\n\n if (stringSelector === '$this' || !stringSelector) applyRoot(host);\n else if (stringSelector === '$host') applyRoot(hostSet.$host);\n else if (stringSelector === '$parentHost') applyRoot(hostSet.$parentHost);\n else if (stringSelector === '$appHost') applyRoot(hostSet.$appHost);\n else if (stringSelector === '$firstHost') applyRoot(hostSet.$firstHost);\n else if (stringSelector === '$lastHost') applyRoot(hostSet.$lastHost);\n else if (stringSelector === '$firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (stringSelector === '$lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (stringSelector === '$hosts') hostSet.$hosts.forEach(applyRoot);\n else if (stringSelector === '$appHosts') hostSet.$appHosts.forEach(applyRoot);\n else {\n const targetRoot = root === 'auto' ? (host.shadowRoot || host) : (root === 'shadow' ? host.shadowRoot : host);\n if (targetRoot) {\n const found = targetRoot.querySelectorAll(stringSelector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n return targetEls;\n};\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface ClassBaseOptions {\n filter?: (target: HTMLElement, value: any, meta: {currentThis: any, helper: HelperHostSet}) => boolean;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9 (classMapOrOptions \uD310\uBCC4\uC744 \uC704\uD574 root \uD544\uC694)\nexport type ClassQueryOptions = ClassBaseOptions & SwcQueryOptions;\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0. \uB2E8, classMapOrOptions\uC758 options \uC790\uB9AC\uC5D0 \uC62C \uC218 \uC5C6\uC74C(root\uAC00 \uC5C6\uC5B4 classMap\uACFC \uD310\uBCC4 \uBD88\uAC00)\nexport type ClassNonQueryOptions = ClassBaseOptions;\nexport type ClassApplyOptions = ClassQueryOptions;\n\nexport type ClassFnSelector = SwcFnSelector;\nexport type ClassSelector = SwcSelector;\nexport type ClassMapType = { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean };\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type ClassOptionsOf<S extends ClassSelector> = S extends string ? ClassQueryOptions : ClassNonQueryOptions;\n\nexport interface ClassApplyMetadata {\n propertyKey: string | symbol;\n selector: ClassSelector;\n action: ClassAction;\n options: ClassApplyOptions;\n}\n\nfunction createClassDecorator(action: ClassAction) {\n return (selector: ClassSelector, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(CLASS_METADATA_KEY, constructor) as Map<string | symbol, ClassApplyMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ClassApplyMetadata>();\n ReflectUtils.defineMetadata(CLASS_METADATA_KEY, metaList, constructor);\n }\n\n let classMap: any = undefined;\n let finalOptions = options;\n\n if (typeof classMapOrOptions === 'string' || (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && !('root' in classMapOrOptions))) {\n classMap = classMapOrOptions;\n } else if (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && 'root' in classMapOrOptions) {\n finalOptions = classMapOrOptions as ClassApplyOptions;\n }\n\n metaList.set(propertyKey, { propertyKey, selector, action, options: finalOptions });\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = (original as any).apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses CLASS_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = finalOptions.valueKey ?? CLASS_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const handleResult = (resolvedValue: any) => {\n if (resolvedValue !== undefined) {\n const win = (this as any).ownerDocument?.defaultView || window;\n const host = this as unknown as HTMLElement;\n const hostSet = { ...SwcUtils.getHelperAndHostSet(win, host), $this: this };\n const r = finalOptions.root || 'auto';\n const targetEls = getTargetElements(selector, this, win, r);\n\n targetEls.forEach(targetEl => {\n if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, {currentThis: this, helper: hostSet})) {\n return;\n }\n const resolvedRes = typeof resolvedValue === 'function' ? (resolvedValue as any)(targetEl, hostSet) : resolvedValue;\n\n if (action === 'set') {\n let classes = '';\n if (classMap && typeof classMap === 'string') {\n classes = resolvedRes ? classMap : '';\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n classes = Object.entries(resolvedRes as any)\n .filter(([_, force]) => typeof force === 'function' ? force(targetEl, hostSet) : !!force)\n .map(([cls]) => cls)\n .join(' ');\n } else {\n classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).join(' ') : String(resolvedRes);\n }\n targetEl.className = classes;\n } else if (action === 'update' || action === 'toggle') {\n if (classMap && typeof classMap === 'string') {\n targetEl.classList.toggle(classMap, !!resolvedRes);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const isActive = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n targetEl.classList.toggle(cls, isActive);\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'update') targetEl.classList.add(...classes);\n else classes.forEach(c => targetEl.classList.toggle(c));\n }\n } else if (action === 'add' || action === 'remove') {\n if (classMap && typeof classMap === 'string' && !!resolvedRes) {\n if (action === 'add') targetEl.classList.add(classMap);\n else targetEl.classList.remove(classMap);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const shouldExecute = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n if (shouldExecute) {\n if (action === 'add') targetEl.classList.add(cls);\n else targetEl.classList.remove(cls);\n }\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'add') targetEl.classList.add(...classes);\n else targetEl.classList.remove(...classes);\n }\n }\n });\n }\n return resolvedValue;\n };\n\n if (res instanceof Promise) {\n return res.then((v: any) => handleResult(extractValue(v)));\n } else {\n return handleResult(extractValue(res));\n }\n };\n return descriptor;\n };\n };\n}\n\nexport function applyClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function applyClass(selector: string, action?: ClassAction, options?: ClassQueryOptions): MethodDecorator;\nexport function applyClass(selector: ClassFnSelector, action?: ClassAction, options?: ClassNonQueryOptions): MethodDecorator;\nexport function applyClass(selectorOrTarget?: any, actionOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @applyClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof actionOrPropertyKey === 'string' || typeof actionOrPropertyKey === 'symbol')) {\n return createClassDecorator('update')('$this', {})(selectorOrTarget as Object, actionOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n const action = (typeof actionOrPropertyKey === 'string' ? actionOrPropertyKey : 'update') as ClassAction;\n const options = (typeof actionOrPropertyKey === 'object' ? actionOrPropertyKey : optionsOrDescriptor) as ClassApplyOptions | undefined;\n return createClassDecorator(action)(selectorOrTarget, options);\n }\n // Without selector (defaults to $this)\n const action = (typeof selectorOrTarget === 'string' ? selectorOrTarget : 'update') as ClassAction;\n const options = (typeof selectorOrTarget === 'object' ? selectorOrTarget : actionOrPropertyKey) as ClassApplyOptions | undefined;\n return createClassDecorator(action)('$this', options);\n}\n\nexport function setClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function setClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function setClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function setClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @setClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('set')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('set')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('set')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function updateClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function updateClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function updateClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function updateClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @updateClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('update')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('update')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('update')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function addClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function addClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function addClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function addClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @addClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('add')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('add')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('add')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function removeClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function removeClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function removeClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function removeClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @removeClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('remove')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('remove')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('remove')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function toggleClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function toggleClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function toggleClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function toggleClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @toggleClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('toggle')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('toggle')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('toggle')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\n// class\uB294 \uC608\uC57D\uC5B4\uB77C cls \uC0AC\uC6A9\nexport const cls = applyClass;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function clsThis(action?: ClassAction, options?: ClassQueryOptions): MethodDecorator;\nexport function clsThis(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clsThis(actionOrTarget?: ClassAction | Object, optionsOrPropertyKey?: ClassQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyClass('$this', undefined as any, {}) as any)(actionOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyClass('$this', actionOrTarget as any, optionsOrPropertyKey as ClassQueryOptions);\n}\nexport function clsAppHost(action?: ClassAction, options?: ClassQueryOptions): MethodDecorator;\nexport function clsAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clsAppHost(actionOrTarget?: ClassAction | Object, optionsOrPropertyKey?: ClassQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyClass('$appHost', undefined as any, {}) as any)(actionOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyClass('$appHost', actionOrTarget as any, optionsOrPropertyKey as ClassQueryOptions);\n}\nexport function clsLight(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsLight(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsLight(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'light'});\n}\nexport function clsShadow(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsShadow(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsShadow(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'shadow'});\n}\nexport function clsAll(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsAll(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsAll(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'all'});\n}\n\nexport const findAllClassMetadata = (target: any): Map<string | symbol, ClassApplyMetadata> => {\n const result = new Map<string | symbol, ClassApplyMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ClassApplyMetadata>>(CLASS_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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,2BAA2B;AAC3B,mBAAyB;AAGlB,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAQzE,MAAM,kBAAkB,CAAC,UAAyB,MAAW,QAAwC;AACnG,MAAI,OAAO,aAAa,YAAY;AAClC,UAAM,UAAU,sBAAS,o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AU,UAAkB,iBAAiE,SAA4D;AACvK,QAAM,SAAU,OAAO,oBAAoB,WAAW,kBAAkB;AACxE,QAAM,OAAQ,OAAO,oBAAoB,WAAW,kBAAkB;AACtE,SAAO,WAAW,UAAU,QAAQ,EAAC,GAAG,QAAQ,CAAC,GAAG,MAAM,SAAQ,CAAC;AACrE;AAGO,SAAS,OAAO,UAAkB,iBAAiE,SAA4D;AACpK,QAAM,SAAU,OAAO,oBAAoB,WAAW,kBAAkB;AACxE,QAAM,OAAQ,OAAO,oBAAoB,WAAW,kBAAkB;AACtE,SAAO,WAAW,UAAU,QAAQ,EAAC,GAAG,QAAQ,CAAC,GAAG,MAAM,MAAK,CAAC;AAClE;AAEO,MAAM,uBAAuB,CAAC,WAA0D;AAC7F,QAAM,SAAS,oBAAI,IAAyC;AAC5D,QAAM,OAAO,yBAAa,gBAA0D,oBAAoB,MAAM;AAC9G,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;",
4
+ "sourcesContent": ["import { ReflectUtils } from '@dooboostore/core';\nimport { ensureInit } from './elementDefine';\nimport { SwcUtils } from '../utils/Utils';\nimport { SpecialSelector, SwcQueryOptions, SwcFnSelector, SwcSelector, HelperHostSet } from '../types';\n\nexport const CLASS_METADATA_KEY = Symbol.for('simple-web-component:class');\n\nexport type ClassAction = 'set' | 'update' | 'add' | 'remove' | 'toggle';\n\n/**\n * Resolve selector to string or elements\n * Handles function-based selectors and returns elements if applicable\n */\nconst resolveSelector = (selector: ClassSelector, inst: any, win: Window): string | HTMLElement[] => {\n if (typeof selector === 'function') {\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n const result = selector(inst, hostSet);\n \n if (result instanceof win.Element) {\n return [result as HTMLElement];\n }\n if (result instanceof win.NodeList) {\n return Array.from(result) as HTMLElement[];\n }\n if (Array.isArray(result)) {\n return result as HTMLElement[];\n }\n if (result === null) {\n return [];\n }\n if (result instanceof win.Node) {\n return [];\n }\n return result as string;\n }\n return selector as string;\n};\n\n/**\n * Get target elements from selector\n */\nconst getTargetElements = (selector: ClassSelector, inst: any, win: Window, root: string): HTMLElement[] => {\n const resolved = resolveSelector(selector, inst, win);\n \n if (Array.isArray(resolved)) {\n return resolved;\n }\n\n const stringSelector = resolved as string;\n const targetEls: HTMLElement[] = [];\n const host = inst as unknown as HTMLElement;\n const hostSet = SwcUtils.getHelperAndHostSet(inst);\n\n const applyRoot = (t: any) => {\n if (!t || !(t instanceof win.HTMLElement)) return;\n targetEls.push(t);\n };\n\n if (stringSelector === '$this' || !stringSelector) applyRoot(host);\n else if (stringSelector === '$host') applyRoot(hostSet.$host);\n else if (stringSelector === '$parentHost') applyRoot(hostSet.$parentHost);\n else if (stringSelector === '$appHost') applyRoot(hostSet.$appHost);\n else if (stringSelector === '$firstHost') applyRoot(hostSet.$firstHost);\n else if (stringSelector === '$lastHost') applyRoot(hostSet.$lastHost);\n else if (stringSelector === '$firstAppHost') applyRoot(hostSet.$firstAppHost);\n else if (stringSelector === '$lastAppHost') applyRoot(hostSet.$lastAppHost);\n else if (stringSelector === '$hosts') hostSet.$hosts.forEach(applyRoot);\n else if (stringSelector === '$appHosts') hostSet.$appHosts.forEach(applyRoot);\n else {\n const targetRoot = root === 'auto' ? (host.shadowRoot || host) : (root === 'shadow' ? host.shadowRoot : host);\n if (targetRoot) {\n const found = targetRoot.querySelectorAll(stringSelector);\n if (found) targetEls.push(...(Array.from(found) as HTMLElement[]));\n }\n }\n\n return targetEls;\n};\n\n// \uACF5\uD1B5 \uC635\uC158 \u2014 root \uC5C6\uC74C\nexport interface ClassBaseOptions {\n filter?: (target: HTMLElement, value: any, meta: {currentThis: any, helper: HelperHostSet}) => boolean;\n valueKey?: symbol | string;\n}\n\n// \uBB38\uC790\uC5F4 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uD5C8\uC6A9 (classMapOrOptions \uD310\uBCC4\uC744 \uC704\uD574 root \uD544\uC694)\nexport type ClassQueryOptions = ClassBaseOptions & SwcQueryOptions;\n// \uD568\uC218 \uC140\uB809\uD130 \uC804\uC6A9 \u2014 root \uAE08\uC9C0. \uB2E8, classMapOrOptions\uC758 options \uC790\uB9AC\uC5D0 \uC62C \uC218 \uC5C6\uC74C(root\uAC00 \uC5C6\uC5B4 classMap\uACFC \uD310\uBCC4 \uBD88\uAC00)\nexport type ClassNonQueryOptions = ClassBaseOptions;\nexport type ClassApplyOptions = ClassQueryOptions;\n\nexport type ClassFnSelector = SwcFnSelector;\nexport type ClassSelector = SwcSelector;\nexport type ClassMapType = { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean };\n\n// \uC140\uB809\uD130 \uC885\uB958\uC5D0 \uB530\uB77C \uC635\uC158 \uD0C0\uC785 \uBD84\uAE30\nexport type ClassOptionsOf<S extends ClassSelector> = S extends string ? ClassQueryOptions : ClassNonQueryOptions;\n\nexport interface ClassApplyMetadata {\n propertyKey: string | symbol;\n selector: ClassSelector;\n action: ClassAction;\n options: ClassApplyOptions;\n}\n\nfunction createClassDecorator(action: ClassAction) {\n return (selector: ClassSelector, classMapOrOptions?: string | { [className: string]: (el: HTMLElement, value: any, helper: HelperHostSet & { $this: any }) => boolean } | ClassApplyOptions, options: ClassApplyOptions = {}): MethodDecorator => {\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const constructor = target.constructor;\n let metaList = ReflectUtils.getOwnMetadata(CLASS_METADATA_KEY, constructor) as Map<string | symbol, ClassApplyMetadata>;\n if (!metaList) {\n metaList = new Map<string | symbol, ClassApplyMetadata>();\n ReflectUtils.defineMetadata(CLASS_METADATA_KEY, metaList, constructor);\n }\n\n let classMap: any = undefined;\n let finalOptions = options;\n\n if (typeof classMapOrOptions === 'string' || (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && !('root' in classMapOrOptions))) {\n classMap = classMapOrOptions;\n } else if (typeof classMapOrOptions === 'object' && classMapOrOptions !== null && 'root' in classMapOrOptions) {\n finalOptions = classMapOrOptions as ClassApplyOptions;\n }\n\n metaList.set(propertyKey, { propertyKey, selector, action, options: finalOptions });\n\n const original = descriptor.value;\n descriptor.value = function (...args: any[]) {\n ensureInit(this);\n const res = (original as any).apply(this, args);\n\n /**\n * Extract value for this decorator from method return value\n * \n * If return value is an object with this decorator's key,\n * use that value. Otherwise use the entire return value.\n * \n * Uses valueKey from options if provided, otherwise uses CLASS_METADATA_KEY.\n */\n const extractValue = (v: any) => {\n const keyToUse = finalOptions.valueKey ?? CLASS_METADATA_KEY;\n if (v && typeof v === 'object' && keyToUse in v) {\n return v[keyToUse];\n }\n return v;\n };\n\n const handleResult = (resolvedValue: any) => {\n if (resolvedValue !== undefined) {\n const win = (this as any).ownerDocument?.defaultView || window;\n const host = this as unknown as HTMLElement;\n const hostSet = { ...SwcUtils.getHelperAndHostSet(host), $this: this };\n const r = finalOptions.root || 'auto';\n const targetEls = getTargetElements(selector, this, win, r);\n\n targetEls.forEach(targetEl => {\n if (finalOptions.filter && !finalOptions.filter(targetEl, resolvedValue, {currentThis: this, helper: hostSet})) {\n return;\n }\n const resolvedRes = typeof resolvedValue === 'function' ? (resolvedValue as any)(targetEl, hostSet) : resolvedValue;\n\n if (action === 'set') {\n let classes = '';\n if (classMap && typeof classMap === 'string') {\n classes = resolvedRes ? classMap : '';\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n classes = Object.entries(resolvedRes as any)\n .filter(([_, force]) => typeof force === 'function' ? force(targetEl, hostSet) : !!force)\n .map(([cls]) => cls)\n .join(' ');\n } else {\n classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).join(' ') : String(resolvedRes);\n }\n targetEl.className = classes;\n } else if (action === 'update' || action === 'toggle') {\n if (classMap && typeof classMap === 'string') {\n targetEl.classList.toggle(classMap, !!resolvedRes);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const isActive = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n targetEl.classList.toggle(cls, isActive);\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'update') targetEl.classList.add(...classes);\n else classes.forEach(c => targetEl.classList.toggle(c));\n }\n } else if (action === 'add' || action === 'remove') {\n if (classMap && typeof classMap === 'string' && !!resolvedRes) {\n if (action === 'add') targetEl.classList.add(classMap);\n else targetEl.classList.remove(classMap);\n } else if (typeof resolvedRes === 'object' && resolvedRes !== null && !Array.isArray(resolvedRes)) {\n Object.entries(resolvedRes as any).forEach(([cls, force]) => {\n const shouldExecute = typeof force === 'function' ? force(targetEl, hostSet) : !!force;\n if (shouldExecute) {\n if (action === 'add') targetEl.classList.add(cls);\n else targetEl.classList.remove(cls);\n }\n });\n } else {\n const classes = Array.isArray(resolvedRes) ? (resolvedRes as any[]).map(String) : [String(resolvedRes)];\n if (action === 'add') targetEl.classList.add(...classes);\n else targetEl.classList.remove(...classes);\n }\n }\n });\n }\n return resolvedValue;\n };\n\n if (res instanceof Promise) {\n // \uC790\uAE30 \uBAAB(valueKey)\uB9CC \uC801\uC6A9\uD558\uACE0 \uC6D0\uB798 \uBC18\uD658\uAC12\uC740 \uADF8\uB300\uB85C \uC704\uB85C \uB118\uAE34\uB2E4 \u2014 \uC704\uC5D0 \uC313\uC778 \uB2E4\uB978 \uC544\uC6C3\uD48B\uB3C4 \uC790\uAE30 \uD0A4\uB97C \uCC3E\uAC8C\n return res.then((v: any) => { handleResult(extractValue(v)); return v; });\n } else {\n handleResult(extractValue(res));\n return res;\n }\n };\n return descriptor;\n };\n };\n}\n\nexport function applyClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function applyClass(selector: string, action?: ClassAction, options?: ClassQueryOptions): MethodDecorator;\nexport function applyClass(selector: ClassFnSelector, action?: ClassAction, options?: ClassNonQueryOptions): MethodDecorator;\nexport function applyClass(selectorOrTarget?: any, actionOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @applyClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof actionOrPropertyKey === 'string' || typeof actionOrPropertyKey === 'symbol')) {\n return createClassDecorator('update')('$this', {})(selectorOrTarget as Object, actionOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n const action = (typeof actionOrPropertyKey === 'string' ? actionOrPropertyKey : 'update') as ClassAction;\n const options = (typeof actionOrPropertyKey === 'object' ? actionOrPropertyKey : optionsOrDescriptor) as ClassApplyOptions | undefined;\n return createClassDecorator(action)(selectorOrTarget, options);\n }\n // Without selector (defaults to $this)\n const action = (typeof selectorOrTarget === 'string' ? selectorOrTarget : 'update') as ClassAction;\n const options = (typeof selectorOrTarget === 'object' ? selectorOrTarget : actionOrPropertyKey) as ClassApplyOptions | undefined;\n return createClassDecorator(action)('$this', options);\n}\n\nexport function setClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function setClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function setClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function setClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @setClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('set')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('set')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('set')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function updateClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function updateClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function updateClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function updateClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @updateClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('update')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('update')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('update')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function addClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function addClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function addClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function addClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @addClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('add')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('add')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('add')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function removeClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function removeClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function removeClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function removeClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @removeClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('remove')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('remove')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('remove')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\nexport function toggleClass(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function toggleClass(selector: string, classMapOrOptions?: string | ClassMapType | ClassQueryOptions, options?: ClassQueryOptions): MethodDecorator;\nexport function toggleClass(selector: ClassFnSelector, classMap: string | ClassMapType): MethodDecorator;\nexport function toggleClass(selectorOrTarget?: any, classMapOrOptionsOrPropertyKey?: any, optionsOrDescriptor?: any): any {\n // Bare decorator: @toggleClass\n if (optionsOrDescriptor !== undefined && typeof selectorOrTarget !== 'string' && typeof selectorOrTarget !== 'function' && (typeof classMapOrOptionsOrPropertyKey === 'string' || typeof classMapOrOptionsOrPropertyKey === 'symbol')) {\n return createClassDecorator('toggle')('$this', {})(selectorOrTarget as Object, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as PropertyDescriptor);\n }\n // With selector\n if (typeof selectorOrTarget === 'string' || typeof selectorOrTarget === 'function') {\n return createClassDecorator('toggle')(selectorOrTarget, classMapOrOptionsOrPropertyKey, optionsOrDescriptor as ClassApplyOptions);\n }\n // Without selector (defaults to $this)\n return createClassDecorator('toggle')('$this', selectorOrTarget as ClassApplyOptions);\n}\n\n// \u2500\u2500\u2500 Aliases \u2500\u2500\u2500\n// class\uB294 \uC608\uC57D\uC5B4\uB77C cls \uC0AC\uC6A9\nexport const cls = applyClass;\n\n// \u2500\u2500\u2500 \uD3B8\uC758 \uD5EC\uD37C (selector/root \uC0DD\uB7B5) \u2500\u2500\u2500\n\nexport function clsAppHost(action: ClassAction, options?: ClassQueryOptions): MethodDecorator;\nexport function clsAppHost(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;\nexport function clsAppHost(actionOrTarget?: ClassAction | Object, optionsOrPropertyKey?: ClassQueryOptions | string | symbol, descriptor?: PropertyDescriptor): any {\n if ((typeof optionsOrPropertyKey === 'string' || typeof optionsOrPropertyKey === 'symbol') && descriptor !== undefined) {\n return (applyClass('$appHost', undefined as any, {}) as any)(actionOrTarget, optionsOrPropertyKey, descriptor);\n }\n return applyClass('$appHost', actionOrTarget as any, optionsOrPropertyKey as ClassQueryOptions);\n}\nexport function clsLight(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsLight(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsLight(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'light'});\n}\nexport function clsShadow(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsShadow(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsShadow(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'shadow'});\n}\nexport function clsAll(selector: string, action?: ClassAction, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsAll(selector: string, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator;\nexport function clsAll(selector: string, actionOrOptions?: ClassAction | Omit<ClassQueryOptions, 'root'>, options?: Omit<ClassQueryOptions, 'root'>): MethodDecorator {\n const action = (typeof actionOrOptions === 'string' ? actionOrOptions : undefined) as ClassAction | undefined;\n const opts = (typeof actionOrOptions === 'object' ? actionOrOptions : options) as Omit<ClassQueryOptions, 'root'> | undefined;\n return applyClass(selector, action, {...opts ?? {}, root: 'all'});\n}\n\nexport const findAllClassMetadata = (target: any): Map<string | symbol, ClassApplyMetadata> => {\n const result = new Map<string | symbol, ClassApplyMetadata>();\n const maps = ReflectUtils.findAllMetadata<Map<string | symbol, ClassApplyMetadata>>(CLASS_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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAC7B,2BAA2B;AAC3B,mBAAyB;AAGlB,MAAM,qBAAqB,OAAO,IAAI,4BAA4B;AAQzE,MAAM,kBAAkB,CAAC,UAAyB,MAAW,QAAwC;AACnG,MAAI,OAAO,aAAa,YAAY;AAClC,UAAM,UAAU,sBAAS,oBAAoB,IAAI;AACjD,UAAM,SAAS,SAAS,MAAM,OAAO;AAErC,QAAI,kBAAkB,IAAI,SAAS;AACjC,aAAO,CAAC,MAAqB;AAAA,IAC/B;AACA,QAAI,kBAAkB,IAAI,UAAU;AAClC,aAAO,MAAM,KAAK,MAAM;AAAA,IAC1B;AACA,QAAI,MAAM,QAAQ,MAAM,GAAG;AACzB,aAAO;AAAA,IACT;AACA,QAAI,WAAW,MAAM;AACnB,aAAO,CAAC;AAAA,IACV;AACA,QAAI,kBAAkB,IAAI,MAAM;AAC9B,aAAO,CAAC;AAAA,IACV;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAKA,MAAM,oBAAoB,CAAC,UAAyB,MAAW,KAAa,SAAgC;AAC1G,QAAM,WAAW,gBAAgB,UAAU,MAAM,GAAG;AAEpD,MAAI,MAAM,QAAQ,QAAQ,GAAG;AAC3B,WAAO;AAAA,EACT;AAEA,QAAM,iBAAiB;AACvB,QAAM,YAA2B,CAAC;AAClC,QAAM,OAAO;AACb,QAAM,UAAU,sBAAS,oBAAoB,IAAI;AAEjD,QAAM,YAAY,CAAC,MAAW;AAC5B,QAAI,CAAC,KAAK,EAAE,aAAa,IAAI,aAAc;AAC3C,cAAU,KAAK,CAAC;AAAA,EAClB;AAEA,MAAI,mBAA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E,SAA4D;AACtK,QAAM,SAAU,OAAO,oBAAoB,WAAW,kBAAkB;AACxE,QAAM,OAAQ,OAAO,oBAAoB,WAAW,kBAAkB;AACtE,SAAO,WAAW,UAAU,QAAQ,EAAC,GAAG,QAAQ,CAAC,GAAG,MAAM,QAAO,CAAC;AACpE;AAGO,SAAS,UAAU,UAAkB,iBAAiE,SAA4D;AACvK,QAAM,SAAU,OAAO,oBAAoB,WAAW,kBAAkB;AACxE,QAAM,OAAQ,OAAO,oBAAoB,WAAW,kBAAkB;AACtE,SAAO,WAAW,UAAU,QAAQ,EAAC,GAAG,QAAQ,CAAC,GAAG,MAAM,SAAQ,CAAC;AACrE;AAGO,SAAS,OAAO,UAAkB,iBAAiE,SAA4D;AACpK,QAAM,SAAU,OAAO,oBAAoB,WAAW,kBAAkB;AACxE,QAAM,OAAQ,OAAO,oBAAoB,WAAW,kBAAkB;AACtE,SAAO,WAAW,UAAU,QAAQ,EAAC,GAAG,QAAQ,CAAC,GAAG,MAAM,MAAK,CAAC;AAClE;AAEO,MAAM,uBAAuB,CAAC,WAA0D;AAC7F,QAAM,SAAS,oBAAI,IAAyC;AAC5D,QAAM,OAAO,yBAAa,gBAA0D,oBAAoB,MAAM;AAC9G,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
6
  "names": ["cls", "action", "options"]
7
7
  }
@@ -25,7 +25,6 @@ __export(applyNode_exports, {
25
25
  applyLight: () => applyLight,
26
26
  applyNode: () => applyNode,
27
27
  applyShadow: () => applyShadow,
28
- applyThis: () => applyThis,
29
28
  clearChildrenLight: () => clearChildrenLight,
30
29
  clearChildrenNode: () => clearChildrenNode,
31
30
  clearNode: () => clearNode,
@@ -57,7 +56,7 @@ var import_core_web = require("@dooboostore/core-web");
57
56
  const APPLY_NODE_METADATA_KEY = Symbol.for("simple-web-component:apply-node");
58
57
  const resolveSelector = (selector, inst, win) => {
59
58
  if (typeof selector === "function") {
60
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(win, inst);
59
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(inst);
61
60
  const result = selector(inst, hostSet);
62
61
  if (result instanceof win.Element) {
63
62
  return result;
@@ -82,18 +81,18 @@ const applyToDom = (currentThis, targetEl, res, pos, win, host) => {
82
81
  return [];
83
82
  }
84
83
  const doc = win.document;
85
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(win, currentThis);
84
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(currentThis);
86
85
  const id = currentThis._swcId;
87
- const nodes = [];
88
- if (res instanceof win.Node) {
89
- nodes.push(res);
90
- } else if (typeof res === "string" && pos === "innerHtml") {
91
- const t = win.document.createElement("template");
92
- t.innerHTML = res;
93
- nodes.push(...Array.from(t.content.childNodes));
94
- } else if (typeof res === "string" && pos === "innerText") {
95
- nodes.push(win.document.createTextNode(res));
96
- }
86
+ const toNodes = (v) => {
87
+ if (v === null || v === void 0 || v === false) return [];
88
+ if (typeof v === "object" && typeof v.nodeType === "number") return [v];
89
+ if (typeof v === "object" && typeof v.length === "number") return Array.from(v).flatMap(toNodes);
90
+ if (pos === "innerText") return [doc.createTextNode(String(v))];
91
+ const t = doc.createElement("template");
92
+ t.innerHTML = String(v);
93
+ return Array.from(t.content.childNodes);
94
+ };
95
+ const nodes = toNodes(res);
97
96
  import_Utils.SwcUtils.projectProcessHtml(id, nodes, doc);
98
97
  const isShadowRoot = targetEl instanceof win.ShadowRoot;
99
98
  if (pos === "replace") {
@@ -139,10 +138,9 @@ function applyNode(selectorOrOptions, maybeOptions) {
139
138
  const original = descriptor.value;
140
139
  descriptor.value = function(...args) {
141
140
  (0, import_elementDefine.ensureInit)(this);
142
- const conf = (0, import_elementDefine.getElementConfig)(this);
143
- const currentWin = this._resolveWindow?.(conf) || (typeof window !== "undefined" ? window : void 0);
141
+ const currentWin = import_Utils.SwcUtils.resolveWindow(this);
144
142
  const currentDoc = currentWin.document;
145
- const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(currentWin, this);
143
+ const hostSet = import_Utils.SwcUtils.getHelperAndHostSet(this);
146
144
  const getTarget = () => {
147
145
  const r = options.root || "auto";
148
146
  const applyRoot = (t) => {
@@ -344,12 +342,6 @@ function clearChildrenLight(selectorOrOptions, maybeOptions, descriptor) {
344
342
  }
345
343
  const apply = applyNode;
346
344
  const node = applyNode;
347
- function applyThis(optionsOrTarget, propertyKey, descriptor) {
348
- if ((typeof propertyKey === "string" || typeof propertyKey === "symbol") && descriptor !== void 0) {
349
- return applyNode("$this", {})(optionsOrTarget, propertyKey, descriptor);
350
- }
351
- return applyNode("$this", optionsOrTarget);
352
- }
353
345
  function applyAppHost(optionsOrTarget, propertyKey, descriptor) {
354
346
  if ((typeof propertyKey === "string" || typeof propertyKey === "symbol") && descriptor !== void 0) {
355
347
  return applyNode("$appHost", {})(optionsOrTarget, propertyKey, descriptor);