@dooboostore/simple-web-component 1.0.6 → 1.0.8

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 (346) hide show
  1. package/README.md +161 -84
  2. package/dist/cjs/decorators/addEventListener.js.map +1 -1
  3. package/dist/cjs/decorators/elementDefine.js +78 -44
  4. package/dist/cjs/decorators/elementDefine.js.map +2 -2
  5. package/dist/cjs/decorators/query.js +27 -5
  6. package/dist/cjs/decorators/query.js.map +2 -2
  7. package/dist/cjs/decorators/queryAll.js +27 -5
  8. package/dist/cjs/decorators/queryAll.js.map +2 -2
  9. package/dist/cjs/decorators/state.js.map +1 -1
  10. package/dist/cjs/elements/SwcChoose.js.map +2 -2
  11. package/dist/cjs/elements/SwcForOf.js +3 -1
  12. package/dist/cjs/elements/SwcForOf.js.map +2 -2
  13. package/dist/cjs/elements/SwcObject.js +8 -6
  14. package/dist/cjs/elements/SwcObject.js.map +2 -2
  15. package/dist/cjs/index.js +3 -6
  16. package/dist/cjs/index.js.map +2 -2
  17. package/dist/cjs/is/SwcIfAnchor.js +1 -1
  18. package/dist/cjs/is/SwcIfAnchor.js.map +2 -2
  19. package/dist/cjs/is/SwcIfArea.js +1 -1
  20. package/dist/cjs/is/SwcIfArea.js.map +2 -2
  21. package/dist/cjs/is/SwcIfAudio.js +1 -1
  22. package/dist/cjs/is/SwcIfAudio.js.map +2 -2
  23. package/dist/cjs/is/SwcIfBase.js +1 -1
  24. package/dist/cjs/is/SwcIfBase.js.map +2 -2
  25. package/dist/cjs/is/SwcIfButton.js +1 -1
  26. package/dist/cjs/is/SwcIfButton.js.map +2 -2
  27. package/dist/cjs/is/SwcIfCanvas.js +1 -1
  28. package/dist/cjs/is/SwcIfCanvas.js.map +2 -2
  29. package/dist/cjs/is/SwcIfData.js +1 -1
  30. package/dist/cjs/is/SwcIfData.js.map +2 -2
  31. package/dist/cjs/is/SwcIfDataList.js +1 -1
  32. package/dist/cjs/is/SwcIfDataList.js.map +2 -2
  33. package/dist/cjs/is/SwcIfDetails.js +1 -1
  34. package/dist/cjs/is/SwcIfDetails.js.map +2 -2
  35. package/dist/cjs/is/SwcIfDialog.js +1 -1
  36. package/dist/cjs/is/SwcIfDialog.js.map +2 -2
  37. package/dist/cjs/is/SwcIfDiv.js +1 -1
  38. package/dist/cjs/is/SwcIfDiv.js.map +2 -2
  39. package/dist/cjs/is/SwcIfDl.js +1 -1
  40. package/dist/cjs/is/SwcIfDl.js.map +2 -2
  41. package/dist/cjs/is/SwcIfEmbed.js +1 -1
  42. package/dist/cjs/is/SwcIfEmbed.js.map +2 -2
  43. package/dist/cjs/is/SwcIfFieldSet.js +1 -1
  44. package/dist/cjs/is/SwcIfFieldSet.js.map +2 -2
  45. package/dist/cjs/is/SwcIfForm.js +1 -1
  46. package/dist/cjs/is/SwcIfForm.js.map +2 -2
  47. package/dist/cjs/is/SwcIfHeading.js +1 -1
  48. package/dist/cjs/is/SwcIfHeading.js.map +2 -2
  49. package/dist/cjs/is/SwcIfHr.js +1 -1
  50. package/dist/cjs/is/SwcIfHr.js.map +2 -2
  51. package/dist/cjs/is/SwcIfIFrame.js +1 -1
  52. package/dist/cjs/is/SwcIfIFrame.js.map +2 -2
  53. package/dist/cjs/is/SwcIfImage.js +1 -1
  54. package/dist/cjs/is/SwcIfImage.js.map +2 -2
  55. package/dist/cjs/is/SwcIfInput.js +1 -1
  56. package/dist/cjs/is/SwcIfInput.js.map +2 -2
  57. package/dist/cjs/is/SwcIfLabel.js +1 -1
  58. package/dist/cjs/is/SwcIfLabel.js.map +2 -2
  59. package/dist/cjs/is/SwcIfLegend.js +1 -1
  60. package/dist/cjs/is/SwcIfLegend.js.map +2 -2
  61. package/dist/cjs/is/SwcIfLi.js +1 -1
  62. package/dist/cjs/is/SwcIfLi.js.map +2 -2
  63. package/dist/cjs/is/SwcIfLink.js +1 -1
  64. package/dist/cjs/is/SwcIfLink.js.map +2 -2
  65. package/dist/cjs/is/SwcIfMap.js +1 -1
  66. package/dist/cjs/is/SwcIfMap.js.map +2 -2
  67. package/dist/cjs/is/SwcIfMeta.js +1 -1
  68. package/dist/cjs/is/SwcIfMeta.js.map +2 -2
  69. package/dist/cjs/is/SwcIfMeter.js +1 -1
  70. package/dist/cjs/is/SwcIfMeter.js.map +2 -2
  71. package/dist/cjs/is/SwcIfMod.js +1 -1
  72. package/dist/cjs/is/SwcIfMod.js.map +2 -2
  73. package/dist/cjs/is/SwcIfObject.js +1 -1
  74. package/dist/cjs/is/SwcIfObject.js.map +2 -2
  75. package/dist/cjs/is/SwcIfOl.js +1 -1
  76. package/dist/cjs/is/SwcIfOl.js.map +2 -2
  77. package/dist/cjs/is/SwcIfOptGroup.js +1 -1
  78. package/dist/cjs/is/SwcIfOptGroup.js.map +2 -2
  79. package/dist/cjs/is/SwcIfOption.js +1 -1
  80. package/dist/cjs/is/SwcIfOption.js.map +2 -2
  81. package/dist/cjs/is/SwcIfOutput.js +1 -1
  82. package/dist/cjs/is/SwcIfOutput.js.map +2 -2
  83. package/dist/cjs/is/SwcIfParagraph.js +1 -1
  84. package/dist/cjs/is/SwcIfParagraph.js.map +2 -2
  85. package/dist/cjs/is/SwcIfParam.js +1 -1
  86. package/dist/cjs/is/SwcIfParam.js.map +2 -2
  87. package/dist/cjs/is/SwcIfPicture.js +1 -1
  88. package/dist/cjs/is/SwcIfPicture.js.map +2 -2
  89. package/dist/cjs/is/SwcIfPre.js +1 -1
  90. package/dist/cjs/is/SwcIfPre.js.map +2 -2
  91. package/dist/cjs/is/SwcIfProgress.js +1 -1
  92. package/dist/cjs/is/SwcIfProgress.js.map +2 -2
  93. package/dist/cjs/is/SwcIfQuote.js +1 -1
  94. package/dist/cjs/is/SwcIfQuote.js.map +2 -2
  95. package/dist/cjs/is/SwcIfScript.js +1 -1
  96. package/dist/cjs/is/SwcIfScript.js.map +2 -2
  97. package/dist/cjs/is/SwcIfSelect.js +1 -1
  98. package/dist/cjs/is/SwcIfSelect.js.map +2 -2
  99. package/dist/cjs/is/SwcIfSlot.js +1 -1
  100. package/dist/cjs/is/SwcIfSlot.js.map +2 -2
  101. package/dist/cjs/is/SwcIfSource.js +1 -1
  102. package/dist/cjs/is/SwcIfSource.js.map +2 -2
  103. package/dist/cjs/is/SwcIfSpan.js +1 -1
  104. package/dist/cjs/is/SwcIfSpan.js.map +2 -2
  105. package/dist/cjs/is/SwcIfStyle.js +1 -1
  106. package/dist/cjs/is/SwcIfStyle.js.map +2 -2
  107. package/dist/cjs/is/SwcIfTable.js +1 -1
  108. package/dist/cjs/is/SwcIfTable.js.map +2 -2
  109. package/dist/cjs/is/SwcIfTableCell.js +1 -1
  110. package/dist/cjs/is/SwcIfTableCell.js.map +2 -2
  111. package/dist/cjs/is/SwcIfTableRow.js +1 -1
  112. package/dist/cjs/is/SwcIfTableRow.js.map +2 -2
  113. package/dist/cjs/is/SwcIfTableSection.js +1 -1
  114. package/dist/cjs/is/SwcIfTableSection.js.map +2 -2
  115. package/dist/cjs/is/SwcIfTemplate.js +1 -1
  116. package/dist/cjs/is/SwcIfTemplate.js.map +2 -2
  117. package/dist/cjs/is/SwcIfTextArea.js +1 -1
  118. package/dist/cjs/is/SwcIfTextArea.js.map +2 -2
  119. package/dist/cjs/is/SwcIfTime.js +1 -1
  120. package/dist/cjs/is/SwcIfTime.js.map +2 -2
  121. package/dist/cjs/is/SwcIfTitle.js +1 -1
  122. package/dist/cjs/is/SwcIfTitle.js.map +2 -2
  123. package/dist/cjs/is/SwcIfTrack.js +1 -1
  124. package/dist/cjs/is/SwcIfTrack.js.map +2 -2
  125. package/dist/cjs/is/SwcIfUl.js +1 -1
  126. package/dist/cjs/is/SwcIfUl.js.map +2 -2
  127. package/dist/cjs/is/SwcIfVideo.js +1 -1
  128. package/dist/cjs/is/SwcIfVideo.js.map +2 -2
  129. package/dist/cjs/utils/Utils.js +13 -22
  130. package/dist/cjs/utils/Utils.js.map +2 -2
  131. package/dist/esm/decorators/addEventListener.js.map +1 -1
  132. package/dist/esm/decorators/elementDefine.js +78 -44
  133. package/dist/esm/decorators/elementDefine.js.map +2 -2
  134. package/dist/esm/decorators/query.js +27 -5
  135. package/dist/esm/decorators/query.js.map +2 -2
  136. package/dist/esm/decorators/queryAll.js +27 -5
  137. package/dist/esm/decorators/queryAll.js.map +2 -2
  138. package/dist/esm/decorators/state.js.map +1 -1
  139. package/dist/esm/elements/SwcChoose.js.map +2 -2
  140. package/dist/esm/elements/SwcForOf.js +3 -1
  141. package/dist/esm/elements/SwcForOf.js.map +2 -2
  142. package/dist/esm/elements/SwcObject.js +8 -6
  143. package/dist/esm/elements/SwcObject.js.map +2 -2
  144. package/dist/esm/index.js +3 -6
  145. package/dist/esm/index.js.map +2 -2
  146. package/dist/esm/is/SwcIfAnchor.js +1 -1
  147. package/dist/esm/is/SwcIfAnchor.js.map +2 -2
  148. package/dist/esm/is/SwcIfArea.js +1 -1
  149. package/dist/esm/is/SwcIfArea.js.map +2 -2
  150. package/dist/esm/is/SwcIfAudio.js +1 -1
  151. package/dist/esm/is/SwcIfAudio.js.map +2 -2
  152. package/dist/esm/is/SwcIfBase.js +1 -1
  153. package/dist/esm/is/SwcIfBase.js.map +2 -2
  154. package/dist/esm/is/SwcIfButton.js +1 -1
  155. package/dist/esm/is/SwcIfButton.js.map +2 -2
  156. package/dist/esm/is/SwcIfCanvas.js +1 -1
  157. package/dist/esm/is/SwcIfCanvas.js.map +2 -2
  158. package/dist/esm/is/SwcIfData.js +1 -1
  159. package/dist/esm/is/SwcIfData.js.map +2 -2
  160. package/dist/esm/is/SwcIfDataList.js +1 -1
  161. package/dist/esm/is/SwcIfDataList.js.map +2 -2
  162. package/dist/esm/is/SwcIfDetails.js +1 -1
  163. package/dist/esm/is/SwcIfDetails.js.map +2 -2
  164. package/dist/esm/is/SwcIfDialog.js +1 -1
  165. package/dist/esm/is/SwcIfDialog.js.map +2 -2
  166. package/dist/esm/is/SwcIfDiv.js +1 -1
  167. package/dist/esm/is/SwcIfDiv.js.map +2 -2
  168. package/dist/esm/is/SwcIfDl.js +1 -1
  169. package/dist/esm/is/SwcIfDl.js.map +2 -2
  170. package/dist/esm/is/SwcIfEmbed.js +1 -1
  171. package/dist/esm/is/SwcIfEmbed.js.map +2 -2
  172. package/dist/esm/is/SwcIfFieldSet.js +1 -1
  173. package/dist/esm/is/SwcIfFieldSet.js.map +2 -2
  174. package/dist/esm/is/SwcIfForm.js +1 -1
  175. package/dist/esm/is/SwcIfForm.js.map +2 -2
  176. package/dist/esm/is/SwcIfHeading.js +1 -1
  177. package/dist/esm/is/SwcIfHeading.js.map +2 -2
  178. package/dist/esm/is/SwcIfHr.js +1 -1
  179. package/dist/esm/is/SwcIfHr.js.map +2 -2
  180. package/dist/esm/is/SwcIfIFrame.js +1 -1
  181. package/dist/esm/is/SwcIfIFrame.js.map +2 -2
  182. package/dist/esm/is/SwcIfImage.js +1 -1
  183. package/dist/esm/is/SwcIfImage.js.map +2 -2
  184. package/dist/esm/is/SwcIfInput.js +1 -1
  185. package/dist/esm/is/SwcIfInput.js.map +2 -2
  186. package/dist/esm/is/SwcIfLabel.js +1 -1
  187. package/dist/esm/is/SwcIfLabel.js.map +2 -2
  188. package/dist/esm/is/SwcIfLegend.js +1 -1
  189. package/dist/esm/is/SwcIfLegend.js.map +2 -2
  190. package/dist/esm/is/SwcIfLi.js +1 -1
  191. package/dist/esm/is/SwcIfLi.js.map +2 -2
  192. package/dist/esm/is/SwcIfLink.js +1 -1
  193. package/dist/esm/is/SwcIfLink.js.map +2 -2
  194. package/dist/esm/is/SwcIfMap.js +1 -1
  195. package/dist/esm/is/SwcIfMap.js.map +2 -2
  196. package/dist/esm/is/SwcIfMeta.js +1 -1
  197. package/dist/esm/is/SwcIfMeta.js.map +2 -2
  198. package/dist/esm/is/SwcIfMeter.js +1 -1
  199. package/dist/esm/is/SwcIfMeter.js.map +2 -2
  200. package/dist/esm/is/SwcIfMod.js +1 -1
  201. package/dist/esm/is/SwcIfMod.js.map +2 -2
  202. package/dist/esm/is/SwcIfObject.js +1 -1
  203. package/dist/esm/is/SwcIfObject.js.map +2 -2
  204. package/dist/esm/is/SwcIfOl.js +1 -1
  205. package/dist/esm/is/SwcIfOl.js.map +2 -2
  206. package/dist/esm/is/SwcIfOptGroup.js +1 -1
  207. package/dist/esm/is/SwcIfOptGroup.js.map +2 -2
  208. package/dist/esm/is/SwcIfOption.js +1 -1
  209. package/dist/esm/is/SwcIfOption.js.map +2 -2
  210. package/dist/esm/is/SwcIfOutput.js +1 -1
  211. package/dist/esm/is/SwcIfOutput.js.map +2 -2
  212. package/dist/esm/is/SwcIfParagraph.js +1 -1
  213. package/dist/esm/is/SwcIfParagraph.js.map +2 -2
  214. package/dist/esm/is/SwcIfParam.js +1 -1
  215. package/dist/esm/is/SwcIfParam.js.map +2 -2
  216. package/dist/esm/is/SwcIfPicture.js +1 -1
  217. package/dist/esm/is/SwcIfPicture.js.map +2 -2
  218. package/dist/esm/is/SwcIfPre.js +1 -1
  219. package/dist/esm/is/SwcIfPre.js.map +2 -2
  220. package/dist/esm/is/SwcIfProgress.js +1 -1
  221. package/dist/esm/is/SwcIfProgress.js.map +2 -2
  222. package/dist/esm/is/SwcIfQuote.js +1 -1
  223. package/dist/esm/is/SwcIfQuote.js.map +2 -2
  224. package/dist/esm/is/SwcIfScript.js +1 -1
  225. package/dist/esm/is/SwcIfScript.js.map +2 -2
  226. package/dist/esm/is/SwcIfSelect.js +1 -1
  227. package/dist/esm/is/SwcIfSelect.js.map +2 -2
  228. package/dist/esm/is/SwcIfSlot.js +1 -1
  229. package/dist/esm/is/SwcIfSlot.js.map +2 -2
  230. package/dist/esm/is/SwcIfSource.js +1 -1
  231. package/dist/esm/is/SwcIfSource.js.map +2 -2
  232. package/dist/esm/is/SwcIfSpan.js +1 -1
  233. package/dist/esm/is/SwcIfSpan.js.map +2 -2
  234. package/dist/esm/is/SwcIfStyle.js +1 -1
  235. package/dist/esm/is/SwcIfStyle.js.map +2 -2
  236. package/dist/esm/is/SwcIfTable.js +1 -1
  237. package/dist/esm/is/SwcIfTable.js.map +2 -2
  238. package/dist/esm/is/SwcIfTableCell.js +1 -1
  239. package/dist/esm/is/SwcIfTableCell.js.map +2 -2
  240. package/dist/esm/is/SwcIfTableRow.js +1 -1
  241. package/dist/esm/is/SwcIfTableRow.js.map +2 -2
  242. package/dist/esm/is/SwcIfTableSection.js +1 -1
  243. package/dist/esm/is/SwcIfTableSection.js.map +2 -2
  244. package/dist/esm/is/SwcIfTemplate.js +1 -1
  245. package/dist/esm/is/SwcIfTemplate.js.map +2 -2
  246. package/dist/esm/is/SwcIfTextArea.js +1 -1
  247. package/dist/esm/is/SwcIfTextArea.js.map +2 -2
  248. package/dist/esm/is/SwcIfTime.js +1 -1
  249. package/dist/esm/is/SwcIfTime.js.map +2 -2
  250. package/dist/esm/is/SwcIfTitle.js +1 -1
  251. package/dist/esm/is/SwcIfTitle.js.map +2 -2
  252. package/dist/esm/is/SwcIfTrack.js +1 -1
  253. package/dist/esm/is/SwcIfTrack.js.map +2 -2
  254. package/dist/esm/is/SwcIfUl.js +1 -1
  255. package/dist/esm/is/SwcIfUl.js.map +2 -2
  256. package/dist/esm/is/SwcIfVideo.js +1 -1
  257. package/dist/esm/is/SwcIfVideo.js.map +2 -2
  258. package/dist/esm/utils/Utils.js +13 -22
  259. package/dist/esm/utils/Utils.js.map +2 -2
  260. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +1970 -2045
  261. package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
  262. package/dist/types/decorators/addEventListener.d.ts +1 -1
  263. package/dist/types/decorators/addEventListener.d.ts.map +1 -1
  264. package/dist/types/decorators/elementDefine.d.ts.map +1 -1
  265. package/dist/types/decorators/query.d.ts +5 -2
  266. package/dist/types/decorators/query.d.ts.map +1 -1
  267. package/dist/types/decorators/queryAll.d.ts +5 -2
  268. package/dist/types/decorators/queryAll.d.ts.map +1 -1
  269. package/dist/types/decorators/state.d.ts +1 -1
  270. package/dist/types/decorators/state.d.ts.map +1 -1
  271. package/dist/types/elements/SwcChoose.d.ts.map +1 -1
  272. package/dist/types/elements/SwcForOf.d.ts.map +1 -1
  273. package/dist/types/elements/SwcObject.d.ts.map +1 -1
  274. package/dist/types/index.d.ts +3 -6
  275. package/dist/types/index.d.ts.map +1 -1
  276. package/dist/types/utils/Utils.d.ts +1 -1
  277. package/dist/types/utils/Utils.d.ts.map +1 -1
  278. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +1970 -2045
  279. package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
  280. package/package.json +4 -4
  281. package/src/decorators/addEventListener.ts +1 -1
  282. package/src/decorators/elementDefine.ts +105 -44
  283. package/src/decorators/query.ts +35 -8
  284. package/src/decorators/queryAll.ts +35 -8
  285. package/src/decorators/state.ts +1 -1
  286. package/src/elements/SwcChoose.ts +1 -5
  287. package/src/elements/SwcForOf.ts +2 -1
  288. package/src/elements/SwcObject.ts +8 -6
  289. package/src/index.ts +3 -6
  290. package/src/is/SwcIfAnchor.ts +1 -1
  291. package/src/is/SwcIfArea.ts +1 -1
  292. package/src/is/SwcIfAudio.ts +1 -1
  293. package/src/is/SwcIfBase.ts +1 -1
  294. package/src/is/SwcIfButton.ts +1 -1
  295. package/src/is/SwcIfCanvas.ts +1 -1
  296. package/src/is/SwcIfData.ts +1 -1
  297. package/src/is/SwcIfDataList.ts +1 -1
  298. package/src/is/SwcIfDetails.ts +1 -1
  299. package/src/is/SwcIfDialog.ts +1 -1
  300. package/src/is/SwcIfDiv.ts +1 -1
  301. package/src/is/SwcIfDl.ts +1 -1
  302. package/src/is/SwcIfEmbed.ts +1 -1
  303. package/src/is/SwcIfFieldSet.ts +1 -1
  304. package/src/is/SwcIfForm.ts +1 -1
  305. package/src/is/SwcIfHeading.ts +1 -1
  306. package/src/is/SwcIfHr.ts +1 -1
  307. package/src/is/SwcIfIFrame.ts +1 -1
  308. package/src/is/SwcIfImage.ts +1 -1
  309. package/src/is/SwcIfInput.ts +1 -1
  310. package/src/is/SwcIfLabel.ts +1 -1
  311. package/src/is/SwcIfLegend.ts +1 -1
  312. package/src/is/SwcIfLi.ts +1 -1
  313. package/src/is/SwcIfLink.ts +1 -1
  314. package/src/is/SwcIfMap.ts +1 -1
  315. package/src/is/SwcIfMeta.ts +1 -1
  316. package/src/is/SwcIfMeter.ts +1 -1
  317. package/src/is/SwcIfMod.ts +1 -1
  318. package/src/is/SwcIfObject.ts +1 -1
  319. package/src/is/SwcIfOl.ts +1 -1
  320. package/src/is/SwcIfOptGroup.ts +1 -1
  321. package/src/is/SwcIfOption.ts +1 -1
  322. package/src/is/SwcIfOutput.ts +1 -1
  323. package/src/is/SwcIfParagraph.ts +1 -1
  324. package/src/is/SwcIfParam.ts +1 -1
  325. package/src/is/SwcIfPicture.ts +1 -1
  326. package/src/is/SwcIfPre.ts +1 -1
  327. package/src/is/SwcIfProgress.ts +1 -1
  328. package/src/is/SwcIfQuote.ts +1 -1
  329. package/src/is/SwcIfScript.ts +1 -1
  330. package/src/is/SwcIfSelect.ts +1 -1
  331. package/src/is/SwcIfSlot.ts +1 -1
  332. package/src/is/SwcIfSource.ts +1 -1
  333. package/src/is/SwcIfSpan.ts +1 -1
  334. package/src/is/SwcIfStyle.ts +1 -1
  335. package/src/is/SwcIfTable.ts +1 -1
  336. package/src/is/SwcIfTableCell.ts +1 -1
  337. package/src/is/SwcIfTableRow.ts +1 -1
  338. package/src/is/SwcIfTableSection.ts +1 -1
  339. package/src/is/SwcIfTemplate.ts +1 -1
  340. package/src/is/SwcIfTextArea.ts +1 -1
  341. package/src/is/SwcIfTime.ts +1 -1
  342. package/src/is/SwcIfTitle.ts +1 -1
  343. package/src/is/SwcIfTrack.ts +1 -1
  344. package/src/is/SwcIfUl.ts +1 -1
  345. package/src/is/SwcIfVideo.ts +1 -1
  346. package/src/utils/Utils.ts +18 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dooboostore/simple-web-component",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",
@@ -22,7 +22,7 @@
22
22
  "bugs": {
23
23
  "url": "https://github.com/dooboostore-develop/packages/issues"
24
24
  },
25
- "homepage": "https://github.com/dooboostore-develop/packages#readme",
25
+ "homepage": "https://github.com/dooboostore-develop/packages/tree/main/%40dooboostore/simple-web-component",
26
26
  "keywords": [
27
27
  "front",
28
28
  "web-components",
@@ -79,9 +79,9 @@
79
79
  "esbuild-plugin-tsc": "^0.5.0",
80
80
  "esbuild": "^0.23.0",
81
81
  "reflect-metadata": "^0.2.2",
82
+ "@dooboostore/core-web": "1.0.9",
82
83
  "@dooboostore/core": "1.0.28",
83
- "@dooboostore/core-node": "1.0.10",
84
- "@dooboostore/core-web": "1.0.9"
84
+ "@dooboostore/core-node": "1.0.10"
85
85
  },
86
86
  "scripts": {
87
87
  "clean": "rm -rf dist",
@@ -3,7 +3,7 @@ import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';
3
3
  export interface AddEventListenerOptions extends EventListenerOptions {
4
4
  query?: string;
5
5
  type: string;
6
- useShadow?: boolean;
6
+ root?: 'light' | 'shadow' | 'all' | 'auto';
7
7
  capture?: boolean;
8
8
  once?: boolean;
9
9
  passive?: boolean;
@@ -125,15 +125,19 @@ export const elementDefine =
125
125
 
126
126
  constructor(...args: any[]) {
127
127
  super(...args);
128
+
128
129
  if (stateList) {
129
130
  stateList.forEach(meta => {
130
131
  const key = meta.propertyKey;
131
132
  const stateName = meta.options.name!;
133
+
134
+ // 필드 초기화로 덮어씌워지기 전/후의 값을 확실히 낚아챔
132
135
  const initialVal = (this as any)[key];
133
136
  this._internalStates.set(
134
137
  key,
135
138
  SwcUtils.createReactiveProxy(initialVal, () => this._updateState(stateName))
136
139
  );
140
+
137
141
  Object.defineProperty(this, key, {
138
142
  get: () => this._internalStates.get(key),
139
143
  set: newVal => {
@@ -149,6 +153,7 @@ export const elementDefine =
149
153
  });
150
154
  });
151
155
  }
156
+
152
157
  const innerHtmlList = getInnerHtmlMetadataList(this);
153
158
  if (innerHtmlList?.some(it => it.options.useShadow === true) && !this.shadowRoot) {
154
159
  this.attachShadow({ mode: 'open' });
@@ -157,74 +162,100 @@ export const elementDefine =
157
162
 
158
163
  private _syncDecorators() {
159
164
  this._buildStateMap();
165
+ const getSearchRoots = (rootOption?: string): Node[] => {
166
+ const roots: Node[] = [];
167
+ if (rootOption === 'shadow') {
168
+ if (this.shadowRoot) roots.push(this.shadowRoot);
169
+ } else if (rootOption === 'light') {
170
+ roots.push(this as any as Node);
171
+ } else if (rootOption === 'all') {
172
+ if (this.shadowRoot) roots.push(this.shadowRoot);
173
+ roots.push(this as any as Node);
174
+ } else {
175
+ roots.push(this.shadowRoot || (this as any as Node));
176
+ }
177
+ return roots;
178
+ };
179
+
160
180
  const queryMetadata = getQueryMetadata(this);
161
181
  if (queryMetadata) {
162
182
  queryMetadata
163
183
  .filter(it => it.isMethod)
164
184
  .forEach(it => {
165
- const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;
166
- const element = root.querySelector(it.selector);
167
- if (element) {
168
- let bound = this._boundElements.get(element);
185
+ const searchRoots = getSearchRoots(it.options.root);
186
+ let foundEl: Element | null = null;
187
+ for (const root of searchRoots) {
188
+ foundEl = it.selector ? (root as HTMLElement).querySelector(it.selector) : (this as any as Element);
189
+ if (foundEl) break;
190
+ }
191
+ if (foundEl) {
192
+ let bound = this._boundElements.get(foundEl);
169
193
  if (!bound) {
170
194
  bound = new Set();
171
- this._boundElements.set(element, bound);
195
+ this._boundElements.set(foundEl, bound);
172
196
  }
173
197
  if (!bound.has(it.propertyKey)) {
174
- (this as any)[it.propertyKey](element);
198
+ (this as any)[it.propertyKey](foundEl);
175
199
  bound.add(it.propertyKey);
176
200
  }
177
201
  }
178
202
  });
179
203
  }
204
+
180
205
  const queryAllMetadata = getQueryAllMetadata(this);
181
206
  if (queryAllMetadata) {
182
207
  queryAllMetadata
183
208
  .filter(it => it.isMethod)
184
209
  .forEach(it => {
185
- const root = it.options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;
186
- const elements = root.querySelectorAll(it.selector);
187
- (this as any)[it.propertyKey](elements);
210
+ const searchRoots = getSearchRoots(it.options.root);
211
+ const allElements: Element[] = [];
212
+ searchRoots.forEach(root => {
213
+ const found = it.selector ? (root as HTMLElement).querySelectorAll(it.selector) : [this as any as Element];
214
+ allElements.push(...Array.from(found));
215
+ });
216
+ (this as any)[it.propertyKey](allElements);
188
217
  });
189
218
  }
219
+
190
220
  const eventListeners = getAddEventListenerMetadata(this);
191
221
  if (eventListeners) {
192
222
  eventListeners.forEach(it => {
193
- const { query, type, useShadow, ...options } = it.options;
194
- const root = useShadow !== false && this.shadowRoot ? this.shadowRoot : this;
195
- const targetElements = query ? root.querySelectorAll(query) : [this as any as Element];
196
- targetElements.forEach(targetElement => {
197
- if (targetElement) {
198
- let bound = this._boundElements.get(targetElement);
199
- if (!bound) {
200
- bound = new Set();
201
- this._boundElements.set(targetElement, bound);
223
+ const { query, type, root: rootOption, ...options } = it.options;
224
+ const searchRoots = getSearchRoots(rootOption);
225
+ searchRoots.forEach(root => {
226
+ const targetElements = query ? (root as HTMLElement).querySelectorAll(query) : [this as any as Element];
227
+ targetElements.forEach(targetElement => {
228
+ if (targetElement) {
229
+ let bound = this._boundElements.get(targetElement);
230
+ if (!bound) {
231
+ bound = new Set();
232
+ this._boundElements.set(targetElement, bound);
233
+ }
234
+ const eventKey = `event:${String(it.propertyKey)}:${type}`;
235
+ if (!bound.has(eventKey)) {
236
+ const handler = (event: any) => {
237
+ if (it.options.stopImmediatePropagation) event.stopImmediatePropagation();
238
+ if (it.options.stopPropagation) event.stopPropagation();
239
+ if (it.options.preventDefault) event.preventDefault();
240
+ (this as any)[it.propertyKey](event, targetElement);
241
+ };
242
+ targetElement.addEventListener(type, handler, options);
243
+ bound.add(eventKey);
244
+ if (config.autoRemoveEventListeners) this._activeListeners.push({ el: targetElement, type, handler, options });
245
+ const addEventMethods = getLifecycleMetadata(this, ON_ADD_EVENT_LISTENER_METADATA_KEY);
246
+ addEventMethods?.forEach(m => {
247
+ if (typeof (this as any)[m] === 'function') (this as any)[m](targetElement, type, handler);
248
+ });
249
+ }
202
250
  }
203
- const eventKey = `event:${String(it.propertyKey)}:${type}`;
204
- if (!bound.has(eventKey)) {
205
- const handler = (event: any) => {
206
- if (it.options.stopImmediatePropagation) event.stopImmediatePropagation();
207
- if (it.options.stopPropagation) event.stopPropagation();
208
- if (it.options.preventDefault) event.preventDefault();
209
- (this as any)[it.propertyKey](event, targetElement);
210
- };
211
- targetElement.addEventListener(type, handler, options);
212
- bound.add(eventKey);
213
- if (config.autoRemoveEventListeners) this._activeListeners.push({ el: targetElement, type, handler, options });
214
- const addEventMethods = getLifecycleMetadata(this, ON_ADD_EVENT_LISTENER_METADATA_KEY);
215
- addEventMethods?.forEach(m => {
216
- if (typeof (this as any)[m] === 'function') (this as any)[m](targetElement, type, handler);
217
- });
218
- }
219
- }
251
+ });
220
252
  });
221
253
  });
222
254
  }
223
255
  }
224
256
 
225
257
  private _buildStateMap() {
226
- this._stateBindings.clear();
227
- this._externalSources.clear();
258
+ // 기존 바인딩 맵을 완전히 비우지 않고 유지하면서 새로운 노드만 추가함 (바인딩 소실 방지 핵심)
228
259
  const scan = (root: Node) => {
229
260
  const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT);
230
261
  let node: Node | null = null;
@@ -233,7 +264,7 @@ export const elementDefine =
233
264
  else if (node.nodeType === Node.ELEMENT_NODE) {
234
265
  const el = node as HTMLElement;
235
266
  const alias = el.getAttribute('as');
236
- if (alias) {
267
+ if (alias && !this._externalSources.has(alias)) {
237
268
  this._externalSources.set(alias, el);
238
269
  el.addEventListener(STATE_CHANGE_EVENT, () => this._updateState(alias));
239
270
  }
@@ -246,20 +277,36 @@ export const elementDefine =
246
277
  }
247
278
 
248
279
  private _parseAndBind(node: Node | Attr, type: 'text' | 'attribute', owner?: HTMLElement) {
249
- const content = node.textContent || '';
280
+ const tplKey = `__swc_original_${this._swcId}`;
281
+ // 이미 이 인스턴스에 의해 바인딩된 노드라면 스킵 (중복 방지)
282
+ const isAlreadyBound = (node as any).__swc_bound_ids?.has(this._swcId);
283
+
284
+ // 텍스트는 원본 템플릿(tplKey)에서, 없으면 현재 내용에서 추출
285
+ const content = (node as any)[tplKey] || node.textContent || '';
250
286
  const matches = Array.from(content.matchAll(/{{(.*?)}}/g));
251
287
  if (matches.length === 0) return;
288
+
289
+ if (isAlreadyBound) return;
290
+
252
291
  matches.forEach(match => {
253
292
  const fullPath = match[1].trim();
254
293
  const rootName = fullPath.split('.')[0];
294
+
255
295
  const isState = stateList?.some(s => s.options.name === rootName);
256
296
  const isLogicKey = (this as any)._asKey === rootName || (this as any)._asIndexKey === rootName;
257
297
  const isExternal = this._externalSources.has(rootName);
258
298
  const isSelfAlias = this.getAttribute('as') === rootName;
299
+
259
300
  if (!isState && !isLogicKey && !isExternal && !isSelfAlias) return;
301
+
260
302
  if (!this._stateBindings.has(rootName)) this._stateBindings.set(rootName, []);
261
- const tplKey = `__swc_original_${this._swcId}`;
303
+
262
304
  if (!(node as any)[tplKey]) (node as any)[tplKey] = content;
305
+
306
+ // 바인딩 ID 기록
307
+ if (!(node as any).__swc_bound_ids) (node as any).__swc_bound_ids = new Set();
308
+ (node as any).__swc_bound_ids.add(this._swcId);
309
+
263
310
  this._stateBindings.get(rootName)!.push({ node, type, owner, path: fullPath });
264
311
  this._updateState(rootName);
265
312
  });
@@ -277,14 +324,20 @@ export const elementDefine =
277
324
  const bindings = this._stateBindings.get(stateName);
278
325
  if (!bindings) return;
279
326
  const tplKey = `__swc_original_${this._swcId}`;
327
+
280
328
  bindings.forEach(bin => {
281
329
  let text = (bin.node as any)[tplKey];
330
+ if (!text) return;
331
+
282
332
  const matches = Array.from(text.matchAll(/{{(.*?)}}/g));
333
+ let updatedText = text;
334
+
283
335
  for (const match of matches) {
284
336
  const path = match[1].trim();
285
337
  const root = path.split('.')[0];
286
338
  let val: any = undefined;
287
339
  let current: HTMLElement | null = this as any as HTMLElement;
340
+
288
341
  while (current) {
289
342
  const currentNewClass = current as any;
290
343
  if (current.getAttribute('as') === root) {
@@ -309,16 +362,24 @@ export const elementDefine =
309
362
  }
310
363
  current = current.parentElement || (current.getRootNode() as any).host;
311
364
  }
365
+
312
366
  if (val !== undefined) {
313
367
  const strVal = val === null || val === undefined ? '' : typeof val === 'object' ? '[Object]' : String(val);
314
- text = text.replace(match[0], strVal);
368
+ updatedText = updatedText.replace(match[0], strVal);
369
+
315
370
  if (bin.type === 'attribute' && bin.owner) {
316
- if (val === null || val === undefined) bin.owner.removeAttribute(bin.attrName!);
317
- else bin.owner.setAttribute(bin.attrName!, text);
371
+ const attrName = (bin.node as Attr).name;
372
+ if (val === null || val === undefined) bin.owner.removeAttribute(attrName);
373
+ else {
374
+ bin.owner.setAttribute(attrName, updatedText);
375
+ if ((attrName === 'value' || attrName === 'checked') && bin.owner.tagName.match(/INPUT|TEXTAREA|SELECT/)) {
376
+ (bin.owner as any)[attrName] = updatedText;
377
+ }
378
+ }
318
379
  }
319
380
  }
320
381
  }
321
- if (bin.type === 'text') bin.node.textContent = text;
382
+ if (bin.type === 'text') bin.node.textContent = updatedText;
322
383
  });
323
384
  }
324
385
 
@@ -1,7 +1,8 @@
1
1
  import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';
2
2
 
3
3
  export interface QueryOptions {
4
- useShadow?: boolean;
4
+ selector?: string;
5
+ root?: 'light' | 'shadow' | 'all' | 'auto';
5
6
  }
6
7
 
7
8
  export interface QueryMetadata {
@@ -13,12 +14,14 @@ export interface QueryMetadata {
13
14
 
14
15
  export const QUERY_METADATA_KEY = Symbol('simple-web-component:query');
15
16
 
16
- export const query = (selector: string, options: QueryOptions = { useShadow: true }): any => {
17
- return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
17
+ export function query(selector: string): any;
18
+ export function query(options: QueryOptions): any;
19
+ export function query(target: Object, propertyKey: string | symbol): void;
20
+ export function query(arg1?: string | QueryOptions | Object, arg2?: string | symbol): any {
21
+ const decorator = (selector: string, options: QueryOptions, target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
18
22
  const isMethod = !!descriptor;
19
23
  const constructor = target.constructor;
20
24
 
21
- // 메타데이터 저장 (나중에 elementDefine에서 사용)
22
25
  let queries = ReflectUtils.getMetadata<QueryMetadata[]>(QUERY_METADATA_KEY, constructor);
23
26
  if (!queries) {
24
27
  queries = [];
@@ -27,18 +30,42 @@ export const query = (selector: string, options: QueryOptions = { useShadow: tru
27
30
  queries.push({ selector, options, propertyKey, isMethod });
28
31
 
29
32
  if (!isMethod) {
30
- // 속성 데코레이터인 경우: 기존처럼 Lazy Getter 설정
31
33
  Object.defineProperty(target, propertyKey, {
32
34
  get(this: HTMLElement) {
33
- const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;
34
- return root.querySelector(selector);
35
+ if (!selector) return this;
36
+ let searchRoot: Node = this;
37
+ if (options.root === 'shadow') searchRoot = this.shadowRoot || this;
38
+ else if (options.root === 'light') searchRoot = this;
39
+ else searchRoot = this.shadowRoot || this; // Default: Auto (Shadow-First)
40
+
41
+ return (searchRoot as HTMLElement).querySelector(selector);
35
42
  },
36
43
  enumerable: true,
37
44
  configurable: true
38
45
  });
39
46
  }
40
47
  };
41
- };
48
+
49
+ // Case: @query (parameterless decorator)
50
+ if (arg1 && typeof arg2 === 'string') {
51
+ return decorator('', {}, arg1 as Object, arg2 as string | symbol);
52
+ }
53
+
54
+ // Case: @query('selector') or @query({ selector: '...', ... })
55
+ return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
56
+ let selector = '';
57
+ let options: QueryOptions = {};
58
+
59
+ if (typeof arg1 === 'string') {
60
+ selector = arg1;
61
+ } else if (typeof arg1 === 'object') {
62
+ options = arg1 as QueryOptions;
63
+ selector = options.selector || '';
64
+ }
65
+
66
+ decorator(selector, options, target, propertyKey, descriptor);
67
+ };
68
+ }
42
69
 
43
70
  export const getQueryMetadata = (target: any): QueryMetadata[] | undefined => {
44
71
  const constructor = target instanceof Function ? target : target.constructor;
@@ -1,7 +1,8 @@
1
1
  import { ReflectUtils } from '@dooboostore/core/reflect/ReflectUtils';
2
2
 
3
3
  export interface QueryAllOptions {
4
- useShadow?: boolean;
4
+ selector?: string;
5
+ root?: 'light' | 'shadow' | 'all' | 'auto';
5
6
  }
6
7
 
7
8
  export interface QueryAllMetadata {
@@ -13,12 +14,14 @@ export interface QueryAllMetadata {
13
14
 
14
15
  export const QUERY_ALL_METADATA_KEY = Symbol('simple-web-component:query-all');
15
16
 
16
- export const queryAll = (selector: string, options: QueryAllOptions = { useShadow: true }): any => {
17
- return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
17
+ export function queryAll(selector: string): any;
18
+ export function queryAll(options: QueryAllOptions): any;
19
+ export function queryAll(target: Object, propertyKey: string | symbol): void;
20
+ export function queryAll(arg1?: string | QueryAllOptions | Object, arg2?: string | symbol): any {
21
+ const decorator = (selector: string, options: QueryAllOptions, target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
18
22
  const isMethod = !!descriptor;
19
23
  const constructor = target.constructor;
20
24
 
21
- // 메타데이터 저장 (나중에 elementDefine에서 사용)
22
25
  let queries = ReflectUtils.getMetadata<QueryAllMetadata[]>(QUERY_ALL_METADATA_KEY, constructor);
23
26
  if (!queries) {
24
27
  queries = [];
@@ -27,18 +30,42 @@ export const queryAll = (selector: string, options: QueryAllOptions = { useShado
27
30
  queries.push({ selector, options, propertyKey, isMethod });
28
31
 
29
32
  if (!isMethod) {
30
- // 속성 데코레이터인 경우: 기존처럼 Lazy Getter 설정
31
33
  Object.defineProperty(target, propertyKey, {
32
34
  get(this: HTMLElement) {
33
- const root = options.useShadow !== false && this.shadowRoot ? this.shadowRoot : this;
34
- return root.querySelectorAll(selector);
35
+ if (!selector) return [this];
36
+ let searchRoot: Node = this;
37
+ if (options.root === 'shadow') searchRoot = this.shadowRoot || this;
38
+ else if (options.root === 'light') searchRoot = this;
39
+ else searchRoot = this.shadowRoot || this; // Default: Auto (Shadow-First)
40
+
41
+ return (searchRoot as HTMLElement).querySelectorAll(selector);
35
42
  },
36
43
  enumerable: true,
37
44
  configurable: true
38
45
  });
39
46
  }
40
47
  };
41
- };
48
+
49
+ // Case: @queryAll (parameterless decorator)
50
+ if (arg1 && typeof arg2 === 'string') {
51
+ return decorator('', {}, arg1 as Object, arg2 as string | symbol);
52
+ }
53
+
54
+ // Case: @queryAll('selector') or @queryAll({ selector: '...', ... })
55
+ return (target: Object, propertyKey: string | symbol, descriptor?: PropertyDescriptor) => {
56
+ let selector = '';
57
+ let options: QueryAllOptions = {};
58
+
59
+ if (typeof arg1 === 'string') {
60
+ selector = arg1;
61
+ } else if (typeof arg1 === 'object') {
62
+ options = arg1 as QueryAllOptions;
63
+ selector = options.selector || '';
64
+ }
65
+
66
+ decorator(selector, options, target, propertyKey, descriptor);
67
+ };
68
+ }
42
69
 
43
70
  export const getQueryAllMetadata = (target: any): QueryAllMetadata[] | undefined => {
44
71
  const constructor = target instanceof Function ? target : target.constructor;
@@ -11,7 +11,7 @@ export interface StateMetadata {
11
11
 
12
12
  export const STATE_METADATA_KEY = Symbol('simple-web-component:state');
13
13
 
14
- export function state(nameOrOptions: string | StateOptions): PropertyDecorator;
14
+ export function state(nameOrOptions?: string | StateOptions): PropertyDecorator;
15
15
  export function state(target: Object, propertyKey: string | symbol): void;
16
16
  export function state(arg1?: string | StateOptions | Object, arg2?: string | symbol): PropertyDecorator | void {
17
17
  const decorator = (options: StateOptions, target: Object, propertyKey: string | symbol) => {
@@ -37,7 +37,6 @@ export class SwcChoose extends HTMLElement {
37
37
  const other = this.querySelector('swc-other');
38
38
  let matched = false;
39
39
 
40
- // 현재 choose에 설정된 value (swc-value 우선)
41
40
  const chooseValue = this.getAttribute('swc-value') ?? this.getAttribute('value') ?? this._swcValue;
42
41
 
43
42
  whens.forEach(when => {
@@ -48,15 +47,12 @@ export class SwcChoose extends HTMLElement {
48
47
 
49
48
  const testAttr = when.getAttribute('test');
50
49
  if (testAttr === null) return;
51
- if (testAttr.includes('{{')) return; // 아직 치환 전이면 스킵
50
+ if (testAttr.includes('{{')) return;
52
51
 
53
52
  let isConditionMet = false;
54
-
55
53
  if (chooseValue !== undefined && chooseValue !== null) {
56
- // 1. 매칭 모드: choose의 value와 when의 test값이 같은지 비교
57
54
  isConditionMet = String(chooseValue) === String(testAttr);
58
55
  } else {
59
- // 2. 표현식 모드: testAttr 자체가 실행 가능한 코드인 경우
60
56
  try {
61
57
  if (testAttr === 'true') isConditionMet = true;
62
58
  else if (testAttr === 'false') isConditionMet = false;
@@ -13,9 +13,10 @@ export class SwcForOf extends SwcHTMLElementBase {
13
13
  if (!Array.isArray(val)) val = [];
14
14
  this._swcValue = this.createReactiveProxy(
15
15
  val,
16
- () => this.renderAll(),
16
+ () => (this as any)._updateState((this as any)._asKey),
17
17
  (idx, v) => this.updateSingleRow(idx, v)
18
18
  );
19
+ if (this._masterTplNodes.length === 0) this.initCore();
19
20
  this.renderAll();
20
21
  }
21
22
 
@@ -12,7 +12,12 @@ export class SwcObject extends SwcHTMLElementBase {
12
12
 
13
13
  set swcValue(val: any) {
14
14
  if (typeof val !== 'object' || val === null) val = {};
15
- this._swcValue = this.createReactiveProxy(val, () => this.updateUI());
15
+ this._swcValue = this.createReactiveProxy(val, () => {
16
+ if (typeof (this as any)._updateState === 'function') {
17
+ (this as any)._updateState((this as any)._asKey);
18
+ }
19
+ this.updateUI();
20
+ });
16
21
  if (this._masterTplNodes.length === 0) this.initCore();
17
22
  this.render();
18
23
  }
@@ -41,12 +46,9 @@ export class SwcObject extends SwcHTMLElementBase {
41
46
  }
42
47
 
43
48
  private render() {
44
- if (!this.shadowRoot || this._masterTplNodes.length === 0) return;
45
-
46
- this._renderedNodes.forEach(n => {
47
- if (n.parentElement === this) this.removeChild(n);
48
- });
49
+ this.innerHTML = '';
49
50
  this._renderedNodes = [];
51
+ if (!this.shadowRoot || this._masterTplNodes.length === 0) return;
50
52
 
51
53
  let slot = this.shadowRoot.querySelector('slot[name="obj-content"]');
52
54
  if (!slot) {
package/src/index.ts CHANGED
@@ -8,13 +8,10 @@ export * from './decorators/lifecycles';
8
8
  export * from './decorators/query';
9
9
  export * from './decorators/queryAll';
10
10
  export * from './decorators/addEventListener';
11
- export * from './elements/SwcForOf';
12
- export * from './elements/SwcIf';
13
- export * from './elements/SwcChoose';
14
- export * from './elements/SwcWhen';
15
- export * from './elements/SwcOther';
16
- export * from './elements/SwcObject';
17
11
  export * from './elements/SwcHTMLElementBase';
12
+ export * from './elements/SwcObject';
13
+ export * from './elements/SwcIf';
14
+ export * from './elements/SwcForOf';
18
15
  export * from './utils/Utils';
19
16
  export * from './is/SwcHTMLAnchorElementBase';
20
17
  export * from './is/SwcForOfAnchor';
@@ -53,8 +53,8 @@ export class SwcIfAnchor extends SwcHTMLAnchorElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfArea extends SwcHTMLAreaElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfAudio extends SwcHTMLAudioElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfBase extends SwcHTMLBaseElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfButton extends SwcHTMLButtonElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfCanvas extends SwcHTMLCanvasElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfData extends SwcHTMLDataElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfDataList extends SwcHTMLDataListElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfDetails extends SwcHTMLDetailsElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }
@@ -53,8 +53,8 @@ export class SwcIfDialog extends SwcHTMLDialogElementBase {
53
53
  if (isTruthy && this._masterTplNodes.length > 0) {
54
54
  this._masterTplNodes.forEach(tplNode => {
55
55
  const clone = tplNode.cloneNode(true) as HTMLElement;
56
- if (clone.style) clone.style.display = 'contents';
57
56
  this.appendChild(clone);
57
+ if (clone.style) clone.style.display = 'contents';
58
58
  this.applyData(clone, this._swcValue);
59
59
  });
60
60
  }