@type-dom/ui 0.0.10 → 0.1.0

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 (307) hide show
  1. package/package.json +3 -4
  2. package/src/aria.d.ts +2 -2
  3. package/src/components/basic/td-button/td-button.abstract.d.ts +5 -5
  4. package/src/components/basic/td-button/td-button.abstract.js +46 -42
  5. package/src/components/basic/td-button/td-button.interface.d.ts +3 -6
  6. package/src/components/basic/td-button/td-button.style.d.ts +16 -5
  7. package/src/components/basic/td-button/td-button.style.js +43 -17
  8. package/src/components/basic/td-button-group/td-button-group.class.d.ts +3 -2
  9. package/src/components/basic/td-button-group/td-button-group.class.js +34 -37
  10. package/src/components/basic/td-button-group/td-button-group.interface.d.ts +3 -3
  11. package/src/components/basic/td-container/td-aside/td-aside.class.d.ts +2 -2
  12. package/src/components/basic/td-container/td-aside/td-aside.class.js +6 -5
  13. package/src/components/basic/td-container/td-aside/td-aside.interface.d.ts +3 -3
  14. package/src/components/basic/td-container/td-container.class.d.ts +2 -3
  15. package/src/components/basic/td-container/td-container.class.js +9 -7
  16. package/src/components/basic/td-container/td-container.interface.d.ts +3 -4
  17. package/src/components/basic/td-container/td-container.js +3 -2
  18. package/src/components/basic/td-container/td-footer/td-footer.class.d.ts +2 -2
  19. package/src/components/basic/td-container/td-footer/td-footer.class.js +4 -3
  20. package/src/components/basic/td-container/td-footer/td-footer.interface.d.ts +3 -3
  21. package/src/components/basic/td-container/td-header/td-header.class.d.ts +2 -2
  22. package/src/components/basic/td-container/td-header/td-header.class.js +3 -3
  23. package/src/components/basic/td-container/td-header/td-header.interface.d.ts +3 -3
  24. package/src/components/basic/td-container/td-main/td-main.class.d.ts +4 -2
  25. package/src/components/basic/td-container/td-main/td-main.class.js +8 -5
  26. package/src/components/basic/td-container/td-main/td-main.interface.d.ts +3 -3
  27. package/src/components/basic/td-icon/td-icon.class.d.ts +4 -6
  28. package/src/components/basic/td-icon/td-icon.class.js +21 -18
  29. package/src/components/basic/td-icon/td-icon.interface.d.ts +3 -4
  30. package/src/components/basic/td-layout/td-col/td-col.class.d.ts +2 -3
  31. package/src/components/basic/td-layout/td-col/td-col.class.js +4 -4
  32. package/src/components/basic/td-layout/td-col/td-col.interface.d.ts +3 -3
  33. package/src/components/basic/td-layout/td-row/td-row.class.d.ts +2 -2
  34. package/src/components/basic/td-layout/td-row/td-row.class.js +5 -4
  35. package/src/components/basic/td-layout/td-row/td-row.interface.d.ts +3 -3
  36. package/src/components/basic/td-link/td-link.class.d.ts +2 -2
  37. package/src/components/basic/td-link/td-link.class.js +6 -10
  38. package/src/components/basic/td-link/td-link.interface.d.ts +3 -3
  39. package/src/components/basic/td-link/td-link.style.js +1 -1
  40. package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +2 -2
  41. package/src/components/basic/td-scrollbar/bar/bar.class.js +4 -4
  42. package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +3 -3
  43. package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +4 -2
  44. package/src/components/basic/td-scrollbar/td-scrollbar.class.js +4 -3
  45. package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +3 -4
  46. package/src/components/basic/td-scrollbar/td-scrollbar.interface.js +1 -1
  47. package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +2 -2
  48. package/src/components/basic/td-scrollbar/thumb/thumb.class.js +2 -3
  49. package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +3 -3
  50. package/src/components/basic/td-space/td-space.class.d.ts +2 -2
  51. package/src/components/basic/td-space/td-space.class.js +11 -5
  52. package/src/components/basic/td-space/td-space.interface.d.ts +3 -4
  53. package/src/components/basic/td-text/td-text.class.d.ts +4 -2
  54. package/src/components/basic/td-text/td-text.class.js +6 -4
  55. package/src/components/basic/td-text/td-text.interface.d.ts +3 -3
  56. package/src/components/data/td-avatar/td-avatar.class.d.ts +2 -2
  57. package/src/components/data/td-avatar/td-avatar.class.js +19 -25
  58. package/src/components/data/td-avatar/td-avatar.interface.d.ts +3 -3
  59. package/src/components/data/td-avatar/td-avatar.style.d.ts +2 -0
  60. package/src/components/data/td-avatar/td-avatar.style.js +19 -1
  61. package/src/components/data/td-badge/td-badge.class.d.ts +2 -2
  62. package/src/components/data/td-badge/td-badge.class.js +4 -4
  63. package/src/components/data/td-badge/td-badge.interface.d.ts +3 -3
  64. package/src/components/data/td-card/td-card.class.d.ts +4 -5
  65. package/src/components/data/td-card/td-card.class.js +16 -30
  66. package/src/components/data/td-card/td-card.interface.d.ts +3 -3
  67. package/src/components/data/td-card/td-card.style.d.ts +3 -2
  68. package/src/components/data/td-card/td-card.style.js +17 -3
  69. package/src/components/data/td-check-tag/td-check-tag.class.d.ts +2 -2
  70. package/src/components/data/td-check-tag/td-check-tag.class.js +5 -5
  71. package/src/components/data/td-check-tag/td-check-tag.interface.d.ts +3 -3
  72. package/src/components/data/td-check-tag/td-check-tag.style.d.ts +2 -2
  73. package/src/components/data/td-check-tag/td-check-tag.style.js +3 -3
  74. package/src/components/data/td-collapse/td-collapse.class.d.ts +2 -2
  75. package/src/components/data/td-collapse/td-collapse.class.js +20 -20
  76. package/src/components/data/td-collapse/td-collapse.interface.d.ts +3 -3
  77. package/src/components/data/td-collapse/td-collapse.style.d.ts +2 -0
  78. package/src/components/data/td-collapse/td-collapse.style.js +9 -1
  79. package/src/components/data/td-collapse-item/td-collapse-item.class.d.ts +4 -5
  80. package/src/components/data/td-collapse-item/td-collapse-item.class.js +8 -7
  81. package/src/components/data/td-collapse-item/td-collapse-item.interface.d.ts +3 -3
  82. package/src/components/data/td-count-down/td-count-down.class.d.ts +1 -1
  83. package/src/components/data/td-count-down/td-count-down.class.js +1 -1
  84. package/src/components/data/td-descriptions/td-descriptions-row.d.ts +4 -5
  85. package/src/components/data/td-descriptions/td-descriptions-row.js +1 -1
  86. package/src/components/data/td-descriptions/td-descriptions.class.d.ts +3 -3
  87. package/src/components/data/td-descriptions/td-descriptions.class.js +2 -3
  88. package/src/components/data/td-descriptions/td-descriptions.interface.d.ts +3 -4
  89. package/src/components/data/td-descriptions/td-descritions-cell.d.ts +6 -5
  90. package/src/components/data/td-descriptions/td-descritions-cell.js +5 -4
  91. package/src/components/data/td-descriptions-item/td-descriptions-item.class.d.ts +2 -3
  92. package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +5 -4
  93. package/src/components/data/td-descriptions-item/td-descriptions-item.interface.d.ts +3 -4
  94. package/src/components/data/td-empty/td-empty.class.d.ts +2 -2
  95. package/src/components/data/td-empty/td-empty.class.js +2 -3
  96. package/src/components/data/td-empty/td-empty.interface.d.ts +3 -4
  97. package/src/components/data/td-image/td-image.class.d.ts +2 -3
  98. package/src/components/data/td-image/td-image.class.js +4 -22
  99. package/src/components/data/td-image/td-image.interface.d.ts +3 -3
  100. package/src/components/data/td-image/td-image.style.d.ts +2 -0
  101. package/src/components/data/td-image/td-image.style.js +19 -1
  102. package/src/components/data/td-image-viewer/td-image-viewer.class.d.ts +3 -5
  103. package/src/components/data/td-image-viewer/td-image-viewer.class.js +20 -17
  104. package/src/components/data/td-image-viewer/td-image-viewer.interface.d.ts +3 -3
  105. package/src/components/data/td-result/td-result.class.d.ts +2 -2
  106. package/src/components/data/td-result/td-result.class.js +4 -3
  107. package/src/components/data/td-result/td-result.interface.d.ts +3 -4
  108. package/src/components/data/td-segmented/td-segmented.class.d.ts +2 -3
  109. package/src/components/data/td-segmented/td-segmented.class.js +7 -8
  110. package/src/components/data/td-segmented/td-segmented.interface.d.ts +2 -3
  111. package/src/components/data/td-statistic/td-statistic.abstract.d.ts +3 -4
  112. package/src/components/data/td-statistic/td-statistic.abstract.js +15 -14
  113. package/src/components/data/td-statistic/td-statistic.class.js +1 -0
  114. package/src/components/data/td-statistic/td-statistic.interface.d.ts +3 -4
  115. package/src/components/data/td-tag/td-tag.class.d.ts +3 -4
  116. package/src/components/data/td-tag/td-tag.class.js +13 -13
  117. package/src/components/data/td-tag/td-tag.interface.d.ts +3 -3
  118. package/src/components/feedback/index.d.ts +2 -0
  119. package/src/components/feedback/index.js +3 -1
  120. package/src/components/feedback/td-alert/td-alert.class.d.ts +2 -3
  121. package/src/components/feedback/td-alert/td-alert.class.js +19 -17
  122. package/src/components/feedback/td-alert/td-alert.interface.d.ts +3 -3
  123. package/src/components/feedback/td-dialog/td-dialog.class.d.ts +3 -3
  124. package/src/components/feedback/td-dialog/td-dialog.class.js +25 -29
  125. package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +3 -3
  126. package/src/components/feedback/td-dialog/td-dialog.interface.js +1 -1
  127. package/src/components/feedback/td-dialog-content/td-dialog-content.class.d.ts +2 -3
  128. package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +10 -7
  129. package/src/components/feedback/td-dialog-content/td-dialog-content.interface.d.ts +3 -4
  130. package/src/components/feedback/td-drawer/td-drawer.class.d.ts +3 -3
  131. package/src/components/feedback/td-drawer/td-drawer.class.js +5 -5
  132. package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +2 -2
  133. package/src/components/feedback/td-focus-trap/focus-trap.d.ts +15 -0
  134. package/src/components/feedback/td-focus-trap/focus-trap.js +71 -0
  135. package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +8 -7
  136. package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +129 -129
  137. package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +3 -3
  138. package/src/components/feedback/td-loading/td-loading.class.d.ts +2 -3
  139. package/src/components/feedback/td-loading/td-loading.class.js +21 -17
  140. package/src/components/feedback/td-loading/td-loading.interface.d.ts +3 -4
  141. package/src/components/feedback/td-message/td-message.class.d.ts +4 -4
  142. package/src/components/feedback/td-message/td-message.class.js +31 -31
  143. package/src/components/feedback/td-message/td-message.interface.d.ts +3 -4
  144. package/src/components/feedback/td-message-box/td-message-box.class.d.ts +10 -12
  145. package/src/components/feedback/td-message-box/td-message-box.class.js +30 -52
  146. package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +4 -5
  147. package/src/components/feedback/td-notification/td-notification.class.d.ts +4 -5
  148. package/src/components/feedback/td-notification/td-notification.class.js +17 -18
  149. package/src/components/feedback/td-notification/td-notification.interface.d.ts +3 -4
  150. package/src/components/feedback/td-only-child/td-only-child.class.d.ts +3 -3
  151. package/src/components/feedback/td-only-child/td-only-child.class.js +3 -3
  152. package/src/components/feedback/td-overlay/td-overlay.class.d.ts +2 -3
  153. package/src/components/feedback/td-overlay/td-overlay.class.js +6 -5
  154. package/src/components/feedback/td-overlay/td-overlay.interface.d.ts +3 -3
  155. package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +2 -2
  156. package/src/components/feedback/td-popper/arrow/arrow.class.js +7 -6
  157. package/src/components/feedback/td-popper/arrow/arrow.const.d.ts +3 -0
  158. package/src/components/feedback/td-popper/arrow/arrow.const.js +6 -0
  159. package/src/components/feedback/td-popper/arrow/arrow.interface.d.ts +3 -4
  160. package/src/components/feedback/td-popper/constants.d.ts +25 -0
  161. package/src/components/feedback/td-popper/constants.js +5 -0
  162. package/src/components/feedback/td-popper/content/content.class.d.ts +2 -2
  163. package/src/components/feedback/td-popper/content/content.class.js +7 -13
  164. package/src/components/feedback/td-popper/content/content.const.d.ts +2 -2
  165. package/src/components/feedback/td-popper/content/content.const.js +3 -4
  166. package/src/components/feedback/td-popper/content/content.interface.d.ts +24 -11
  167. package/src/components/feedback/td-popper/content/content.interface.js +4 -0
  168. package/src/components/feedback/td-popper/td-popper.class.d.ts +3 -2
  169. package/src/components/feedback/td-popper/td-popper.class.js +9 -7
  170. package/src/components/feedback/td-popper/td-popper.const.d.ts +5 -20
  171. package/src/components/feedback/td-popper/td-popper.const.js +8 -3
  172. package/src/components/feedback/td-popper/td-popper.interface.d.ts +6 -4
  173. package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +2 -2
  174. package/src/components/feedback/td-popper/trigger/trigger.class.js +6 -6
  175. package/src/components/feedback/td-popper/trigger/trigger.const.d.ts +1 -0
  176. package/src/components/feedback/td-popper/trigger/trigger.const.js +4 -1
  177. package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +3 -3
  178. package/src/components/feedback/td-tooltip/content/content.class.d.ts +2 -2
  179. package/src/components/feedback/td-tooltip/content/content.class.js +4 -3
  180. package/src/components/feedback/td-tooltip/content/content.const.d.ts +55 -0
  181. package/src/components/feedback/td-tooltip/content/content.const.js +6 -0
  182. package/src/components/feedback/td-tooltip/content/content.interface.d.ts +19 -3
  183. package/src/components/feedback/td-tooltip/td-tooltip.class.d.ts +5 -3
  184. package/src/components/feedback/td-tooltip/td-tooltip.class.js +84 -9
  185. package/src/components/feedback/td-tooltip/td-tooltip.const.d.ts +77 -0
  186. package/src/components/feedback/td-tooltip/td-tooltip.const.js +9 -0
  187. package/src/components/feedback/td-tooltip/td-tooltip.interface.d.ts +6 -3
  188. package/src/components/feedback/td-tooltip/trigger/trigger.class.d.ts +3 -2
  189. package/src/components/feedback/td-tooltip/trigger/trigger.class.js +56 -3
  190. package/src/components/feedback/td-tooltip/trigger/trigger.const.d.ts +4 -0
  191. package/src/components/feedback/td-tooltip/trigger/trigger.const.js +6 -0
  192. package/src/components/feedback/td-tooltip/trigger/trigger.interface.d.ts +7 -2
  193. package/src/components/form/index.d.ts +17 -16
  194. package/src/components/form/index.js +19 -17
  195. package/src/components/form/td-checkbox/composables/use-checkbox-status.js +1 -1
  196. package/src/components/form/td-checkbox/composables/use-checkbox.js +1 -1
  197. package/src/components/form/td-checkbox/td-checkbox.class.d.ts +18 -3
  198. package/src/components/form/td-checkbox/td-checkbox.class.js +231 -9
  199. package/src/components/form/td-checkbox/td-checkbox.const.d.ts +63 -0
  200. package/src/components/form/td-checkbox/td-checkbox.const.js +88 -0
  201. package/src/components/form/td-checkbox/td-checkbox.interface.d.ts +5 -5
  202. package/src/components/form/td-checkbox/td-checkbox.style.d.ts +9 -0
  203. package/src/components/form/td-checkbox/td-checkbox.style.js +165 -12
  204. package/src/components/form/td-checkbox-button/td-checkbox-button.class.d.ts +9 -3
  205. package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +114 -26
  206. package/src/components/form/td-checkbox-button/td-checkbox-button.interface.d.ts +2 -4
  207. package/src/components/form/td-checkbox-button/td-checkbox-button.style.d.ts +8 -1
  208. package/src/components/form/td-checkbox-button/td-checkbox-button.style.js +89 -12
  209. package/src/components/form/td-checkbox-group/td-checkbox-group.class.d.ts +11 -3
  210. package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +118 -5
  211. package/src/components/form/td-checkbox-group/td-checkbox-group.interface.d.ts +8 -5
  212. package/src/components/form/td-form/td-form.class.d.ts +4 -2
  213. package/src/components/form/td-form/td-form.class.js +9 -5
  214. package/src/components/form/td-form/td-form.interface.d.ts +7 -4
  215. package/src/components/form/td-form-item/td-form-item.class.d.ts +4 -5
  216. package/src/components/form/td-form-item/td-form-item.class.js +34 -27
  217. package/src/components/form/td-form-item/td-form-item.interface.d.ts +3 -3
  218. package/src/components/form/td-input/td-input.class.d.ts +3 -4
  219. package/src/components/form/td-input/td-input.class.js +30 -26
  220. package/src/components/form/td-input/td-input.interface.d.ts +3 -4
  221. package/src/components/form/td-input/widget/suffix.d.ts +1 -0
  222. package/src/components/form/td-input/widget/suffix.js +6 -1
  223. package/src/components/form/td-input/widget/td-input-wrapper.class.js +5 -5
  224. package/src/components/form/td-option/td-option.class.d.ts +2 -2
  225. package/src/components/form/td-option/td-option.class.js +3 -3
  226. package/src/components/form/td-option/td-option.interface.d.ts +3 -3
  227. package/src/components/form/td-option-group/td-option-group.class.d.ts +2 -2
  228. package/src/components/form/td-option-group/td-option-group.class.js +2 -3
  229. package/src/components/form/td-option-group/td-option-group.interface.d.ts +3 -3
  230. package/src/components/form/td-radio/td-radio.class.d.ts +2 -3
  231. package/src/components/form/td-radio/td-radio.class.js +8 -5
  232. package/src/components/form/td-radio/td-radio.interface.d.ts +3 -3
  233. package/src/components/form/td-radio-button/td-radio-button.class.d.ts +2 -3
  234. package/src/components/form/td-radio-button/td-radio-button.class.js +9 -9
  235. package/src/components/form/td-radio-button/td-radio-button.interface.d.ts +3 -3
  236. package/src/components/form/td-radio-group/td-radio-group.class.d.ts +2 -5
  237. package/src/components/form/td-radio-group/td-radio-group.class.js +14 -11
  238. package/src/components/form/td-radio-group/td-radio-group.interface.d.ts +3 -4
  239. package/src/components/form/td-select/dropdown/dropdown.class.d.ts +2 -2
  240. package/src/components/form/td-select/dropdown/dropdown.class.js +2 -3
  241. package/src/components/form/td-select/dropdown/dropdown.interface.d.ts +3 -4
  242. package/src/components/form/td-select/td-select.class.d.ts +4 -6
  243. package/src/components/form/td-select/td-select.class.js +4 -6
  244. package/src/components/form/td-select/td-select.interface.d.ts +13 -5
  245. package/src/components/form/td-select/td-select.style.d.ts +23 -0
  246. package/src/components/form/td-select/td-select.style.js +170 -1
  247. package/src/components/form/td-switch/td-switch.class.d.ts +2 -3
  248. package/src/components/form/td-switch/td-switch.class.js +2 -3
  249. package/src/components/form/td-switch/td-switch.interface.d.ts +3 -4
  250. package/src/components/navigation/td-affix/td-affix.class.d.ts +2 -3
  251. package/src/components/navigation/td-affix/td-affix.class.js +2 -3
  252. package/src/components/navigation/td-affix/td-affix.interface.d.ts +3 -4
  253. package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.d.ts +2 -2
  254. package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +2 -3
  255. package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.interface.d.ts +3 -4
  256. package/src/components/navigation/td-anchor/td-anchor.class.d.ts +2 -2
  257. package/src/components/navigation/td-anchor/td-anchor.class.js +6 -4
  258. package/src/components/navigation/td-anchor/td-anchor.function.js +1 -1
  259. package/src/components/navigation/td-anchor/td-anchor.interface.d.ts +3 -3
  260. package/src/components/navigation/td-backtop/td-backtop.class.d.ts +5 -6
  261. package/src/components/navigation/td-backtop/td-backtop.class.js +36 -59
  262. package/src/components/navigation/td-backtop/td-backtop.const.d.ts +18 -0
  263. package/src/components/navigation/td-backtop/td-backtop.const.js +21 -0
  264. package/src/components/navigation/td-backtop/td-backtop.interface.d.ts +3 -3
  265. package/src/components/navigation/td-backtop/td-backtop.style.d.ts +2 -0
  266. package/src/components/navigation/td-backtop/td-backtop.style.js +19 -1
  267. package/src/components/navigation/td-backtop/use-backtop.d.ts +2 -3
  268. package/src/components/navigation/td-backtop/use-backtop.js +2 -2
  269. package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.d.ts +3 -3
  270. package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +12 -8
  271. package/src/components/navigation/td-breadcrumb/td-breadcrumb.interface.d.ts +3 -4
  272. package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.d.ts +2 -2
  273. package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +2 -3
  274. package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.d.ts +3 -4
  275. package/src/components/navigation/td-menu/td-menu.class.d.ts +2 -2
  276. package/src/components/navigation/td-menu/td-menu.class.js +4 -3
  277. package/src/components/navigation/td-menu/td-menu.interface.d.ts +3 -4
  278. package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +2 -2
  279. package/src/components/navigation/td-tabs/td-tab-bar.class.js +3 -3
  280. package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +3 -3
  281. package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +2 -3
  282. package/src/components/navigation/td-tabs/td-tab-nav.class.js +3 -4
  283. package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +3 -3
  284. package/src/components/navigation/td-tabs/td-tab-pane.class.d.ts +2 -3
  285. package/src/components/navigation/td-tabs/td-tab-pane.class.js +12 -16
  286. package/src/components/navigation/td-tabs/td-tab-pane.interface.d.ts +3 -4
  287. package/src/components/navigation/td-tabs/td-tabs.class.d.ts +2 -2
  288. package/src/components/navigation/td-tabs/td-tabs.class.js +6 -4
  289. package/src/components/navigation/td-tabs/td-tabs.interface.d.ts +3 -3
  290. package/src/components/others/example/example-source-wrapper.js +2 -1
  291. package/src/components/others/td-divider/td-divider.class.d.ts +2 -2
  292. package/src/components/others/td-divider/td-divider.class.js +2 -3
  293. package/src/components/others/td-divider/td-divider.interface.d.ts +3 -3
  294. package/src/constants/aria.d.ts +17 -0
  295. package/src/constants/aria.js +20 -0
  296. package/src/hooks/index.d.ts +1 -0
  297. package/src/hooks/index.js +1 -0
  298. package/src/hooks/use-delayed-toggle.d.ts +23 -0
  299. package/src/hooks/use-delayed-toggle.js +52 -0
  300. package/src/styles/var.d.ts +1 -15
  301. package/src/styles/var.js +6 -16
  302. package/src/utils/dom/event.d.ts +6 -0
  303. package/src/utils/dom/event.js +17 -0
  304. package/src/ui/ui.abstract.d.ts +0 -18
  305. package/src/ui/ui.abstract.js +0 -50
  306. package/src/ui/ui.interface.d.ts +0 -12
  307. package/src/ui/ui.interface.js +0 -2
@@ -1,20 +1,133 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdCheckboxGroup = void 0;
4
- const ui_abstract_1 = require("../../../ui/ui.abstract");
4
+ const tslib_1 = require("tslib");
5
+ const framework_1 = require("@type-dom/framework");
6
+ const utils_1 = require("@type-dom/utils");
7
+ const event_1 = require("../../../constants/event");
5
8
  const td_checkbox_style_1 = require("../td-checkbox/td-checkbox.style");
6
- class TdCheckboxGroup extends ui_abstract_1.UI {
7
- constructor(params = {}) {
8
- super(params);
9
+ const td_checkbox_button_class_1 = require("../td-checkbox-button/td-checkbox-button.class");
10
+ class TdCheckboxGroup extends framework_1.TypeHtml {
11
+ constructor(params = { modelValue: [] }) {
12
+ var _a;
13
+ super();
14
+ this.changeEvent = (value) => tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ this.emit(event_1.UPDATE_MODEL_EVENT, value);
16
+ yield (0, framework_1.nextTick)();
17
+ this.emit('change', value);
18
+ });
9
19
  this.className = 'TdCheckboxGroup';
20
+ this.nodeName = (_a = params.tag) !== null && _a !== void 0 ? _a : 'div';
21
+ this.dom = document.createElement(this.nodeName);
10
22
  this.attr.addObj({
23
+ name: 'td-checkbox-group',
11
24
  role: 'group',
12
25
  // ariaLabel: !config.isLabeledByFormItem ? config?.ariaLabel || 'checkbox-group' : undefined,
13
26
  // aria-labelledby="isLabeledByFormItem ? formItem?.labelId : undefined"
14
27
  });
15
28
  this.style.addObj(td_checkbox_style_1.$checkboxGroupStyle);
16
- this.addChild(this.getSlotNode());
29
+ this.childNodes = [];
30
+ // this.addChild(this.getSlotNode());
31
+ if (params.slot) { // 这样子节点就是TdCheckbox组件了,不需要 SlotNode 再包一层;哪怕 SlotNode只是虚拟节点;
32
+ this.slotChild(params.slot);
33
+ }
34
+ if (params.size) {
35
+ this.childNodes.map((item) => {
36
+ item.props.size = params.size;
37
+ });
38
+ }
39
+ this.assignProps({
40
+ modelValue: [],
41
+ tag: 'div',
42
+ validateEvent: true,
43
+ });
17
44
  this.props = this.useParams(params);
45
+ this.addEmits({
46
+ [event_1.UPDATE_MODEL_EVENT]: (val) => (0, utils_1.isArray)(val),
47
+ change: (val) => (0, utils_1.isArray)(val),
48
+ });
49
+ }
50
+ setup() {
51
+ // 处理子节点和组合框的属性关系
52
+ this.childNodes.forEach((child, index) => {
53
+ const value = child.props.value;
54
+ if (index === 0 && child instanceof td_checkbox_button_class_1.TdCheckboxButton) {
55
+ child.setFirstStyle();
56
+ }
57
+ else if (index === this.childNodes.length - 1 && child instanceof td_checkbox_button_class_1.TdCheckboxButton) {
58
+ child.setLastStyle();
59
+ }
60
+ if (this.props.modelValue.includes(value)) {
61
+ child.setChecked(true);
62
+ }
63
+ if (this.props.size) {
64
+ child.setSize(this.props.size);
65
+ }
66
+ if (this.props.disabled) {
67
+ child.setDisabled(true);
68
+ }
69
+ if (this.props.min || this.props.max) {
70
+ this.setMinMax(child);
71
+ }
72
+ child.addEvents({
73
+ click: (evt) => {
74
+ console.log('child click', evt, child);
75
+ if (child.props.disabled) {
76
+ return;
77
+ }
78
+ const checked = child.checkedValue;
79
+ // 处理 modelValue 的更新
80
+ if (checked) {
81
+ if (this.props.modelValue.indexOf(value) === -1) {
82
+ this.props.modelValue.push(value);
83
+ }
84
+ this.childNodes.forEach(chd => {
85
+ if (this.props.min || this.props.max) {
86
+ this.setMinMax(chd);
87
+ }
88
+ });
89
+ }
90
+ else {
91
+ if (this.props.modelValue.indexOf(value) > -1) {
92
+ this.props.modelValue.splice(this.props.modelValue.indexOf(value), 1);
93
+ }
94
+ this.childNodes.forEach(chd => {
95
+ if (this.props.min || this.props.max) {
96
+ this.setMinMax(chd);
97
+ }
98
+ });
99
+ }
100
+ this.changeEvent(this.props.modelValue);
101
+ }
102
+ });
103
+ });
104
+ }
105
+ setMinMax(checkbox) {
106
+ const value = checkbox.props.value;
107
+ if (this.props.modelValue.includes(value)) {
108
+ if (this.props.min && this.props.min === this.props.modelValue.length) {
109
+ checkbox.setDisabled(true);
110
+ }
111
+ else if (this.props.max && this.props.max === this.props.modelValue.length) {
112
+ checkbox.setDisabled(false);
113
+ }
114
+ else {
115
+ checkbox.setDisabled(false);
116
+ }
117
+ checkbox.setChecked(true);
118
+ }
119
+ else {
120
+ if (this.props.min && this.props.min === this.props.modelValue.length) {
121
+ checkbox.setDisabled(false);
122
+ }
123
+ else if (this.props.max && this.props.max === this.props.modelValue.length) {
124
+ checkbox.setDisabled(true);
125
+ }
126
+ else {
127
+ checkbox.setDisabled(false);
128
+ }
129
+ // checkbox.setChecked(checkbox.props.checked);
130
+ }
18
131
  }
19
132
  }
20
133
  exports.TdCheckboxGroup = TdCheckboxGroup;
@@ -1,14 +1,16 @@
1
- import { IPrimitive } from '@type-dom/framework';
2
- import { IUI, IUIConfig } from '../../../ui/ui.interface';
1
+ import { ITypeConfig, ITypeHtml } from '@type-dom/framework';
3
2
  import { ISize } from '../../../styles/size';
4
- export interface ITdCheckboxGroup extends IUI {
3
+ import { TdCheckbox } from '../td-checkbox/td-checkbox.class';
4
+ import { CheckboxValueType } from '../td-checkbox/td-checkbox.interface';
5
+ export interface ITdCheckboxGroup extends ITypeHtml {
5
6
  className: 'TdCheckboxGroup';
6
7
  }
7
- export interface ITdCheckboxGroupConfig extends IUIConfig {
8
+ export type CheckboxGroupValueType = Exclude<CheckboxValueType, boolean>[];
9
+ export interface ITdCheckboxGroupConfig extends ITypeConfig {
8
10
  /**
9
11
  * @description binding value
10
12
  */
11
- modelValue?: IPrimitive[];
13
+ modelValue: (string | boolean | number | undefined | object)[];
12
14
  /**
13
15
  * @description whether the nesting checkboxes are disabled
14
16
  */
@@ -47,4 +49,5 @@ export interface ITdCheckboxGroupConfig extends IUIConfig {
47
49
  * default: true,
48
50
  */
49
51
  validateEvent?: boolean;
52
+ slot?: TdCheckbox[];
50
53
  }
@@ -1,12 +1,14 @@
1
- import { UI } from '../../../ui/ui.abstract';
1
+ import { TypeForm } from '@type-dom/framework';
2
2
  import { ITdForm, ITdFormConfig } from './td-form.interface';
3
+ import { TdFormItem } from '../td-form-item/td-form-item.class';
3
4
  /**
4
5
  * TdForm类继承自UI抽象类,实现ITdForm接口,用于创建和管理表单。
5
6
  * 提交表单时,应该要获取所有子元素 form-item 里的 如 TdInput 这些可输入的组件的值。
6
7
  * 表单提交地址也应该是可以配置的。
7
8
  */
8
- export declare class TdForm extends UI implements ITdForm {
9
+ export declare class TdForm extends TypeForm implements ITdForm {
9
10
  className: 'TdForm';
11
+ childNodes: TdFormItem[];
10
12
  props: ITdFormConfig;
11
13
  private model?;
12
14
  /**
@@ -1,23 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdForm = void 0;
4
- const ui_abstract_1 = require("../../../ui/ui.abstract");
4
+ const framework_1 = require("@type-dom/framework");
5
5
  const td_form_const_1 = require("./td-form.const");
6
6
  /**
7
7
  * TdForm类继承自UI抽象类,实现ITdForm接口,用于创建和管理表单。
8
8
  * 提交表单时,应该要获取所有子元素 form-item 里的 如 TdInput 这些可输入的组件的值。
9
9
  * 表单提交地址也应该是可以配置的。
10
10
  */
11
- class TdForm extends ui_abstract_1.UI {
11
+ class TdForm extends framework_1.TypeForm {
12
12
  /**
13
13
  * 构造函数,初始化表单配置。
14
14
  * @param params
15
15
  */
16
16
  constructor(params = {}) {
17
- super(params, 'form');
17
+ super();
18
+ // this.useTag('form');
18
19
  this.className = 'TdForm';
19
- this.attr.addName('td-form');
20
- this.provide(td_form_const_1.formContextKey, params); // 要在form-item 中 inject
20
+ this.attr.addObj({
21
+ name: 'td-form',
22
+ });
23
+ this.childNodes = [];
21
24
  if (params.slot) {
22
25
  this.slotChild(params.slot);
23
26
  }
@@ -25,6 +28,7 @@ class TdForm extends ui_abstract_1.UI {
25
28
  this.model = params.model;
26
29
  }
27
30
  this.props = this.useParams(params);
31
+ this.provide(td_form_const_1.formContextKey, params); // 要在form-item 中 inject
28
32
  }
29
33
  }
30
34
  exports.TdForm = TdForm;
@@ -1,8 +1,10 @@
1
- import { IUI, IUIConfig } from '../../../ui/ui.interface';
2
1
  import { ISize } from '../../../styles/size';
3
- import { ITdFormItemConfig } from '../td-form-item/td-form-item.interface';
4
- export interface ITdForm extends IUI {
2
+ import { ITdFormItem, ITdFormItemConfig } from '../td-form-item/td-form-item.interface';
3
+ import { TdFormItem } from '../td-form-item/td-form-item.class';
4
+ import { ITypeConfig, ITypeForm } from '@type-dom/framework';
5
+ export interface ITdForm extends ITypeForm {
5
6
  className: 'TdForm';
7
+ childNodes: ITdFormItem[];
6
8
  }
7
9
  export interface IFormRule {
8
10
  required?: boolean;
@@ -17,7 +19,7 @@ export interface IFormRule {
17
19
  export interface IFormRules {
18
20
  [propName: string]: IFormRule[];
19
21
  }
20
- export interface ITdFormConfig extends IUIConfig {
22
+ export interface ITdFormConfig extends ITypeConfig {
21
23
  /**
22
24
  * @description Control the size of components in this form.
23
25
  */
@@ -89,4 +91,5 @@ export interface ITdFormConfig extends IUIConfig {
89
91
  */
90
92
  scrollIntoViewOptions?: object | boolean;
91
93
  options?: Array<ITdFormItemConfig>;
94
+ slot?: Array<TdFormItem>;
92
95
  }
@@ -1,18 +1,17 @@
1
- import { Label } from '@type-dom/framework';
2
- import { UI } from '../../../ui/ui.abstract';
1
+ import { Label, TypeDiv } from '@type-dom/framework';
3
2
  import { ISize } from '../../../styles/size';
4
3
  import { TdForm } from '../td-form/td-form.class';
5
4
  import { ILabelPosition, ITdFormItem, ITdFormItemConfig } from './td-form-item.interface';
6
- export declare class TdFormItem extends UI implements ITdFormItem {
5
+ export declare class TdFormItem extends TypeDiv implements ITdFormItem {
7
6
  className: 'TdFormItem';
8
7
  props: ITdFormItemConfig;
9
- label?: Label;
10
8
  parent?: TdForm;
9
+ private formConfig?;
10
+ label?: Label;
11
11
  private labelWrap?;
12
12
  private content;
13
13
  private error?;
14
14
  constructor(params?: ITdFormItemConfig);
15
- created(): void;
16
15
  setup(): void;
17
16
  setLabelWidth(width?: string | number): void;
18
17
  setLabelPosition(position?: ILabelPosition): void;
@@ -3,15 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdFormItem = void 0;
4
4
  const utils_1 = require("@type-dom/utils");
5
5
  const framework_1 = require("@type-dom/framework");
6
- const ui_abstract_1 = require("../../../ui/ui.abstract");
7
6
  const var_1 = require("../../../styles/var");
8
- // import { formContextKey } from '../td-form/td-form.const';
9
- // import { ITdFormConfig } from '../td-form/td-form.interface';
7
+ const td_form_const_1 = require("../td-form/td-form.const");
10
8
  const td_form_item_style_1 = require("./td-form-item.style");
11
- class TdFormItem extends ui_abstract_1.UI {
9
+ class TdFormItem extends framework_1.TypeDiv {
12
10
  // new TdFormItem 是 发生在 TdForm slotChild 之前的。
13
11
  constructor(params = {}) {
14
- super(params);
12
+ var _a;
13
+ super();
15
14
  this.className = 'TdFormItem';
16
15
  this.attr.addName('td-form-item');
17
16
  this.style.addObj({
@@ -20,15 +19,23 @@ class TdFormItem extends ui_abstract_1.UI {
20
19
  fontSize: var_1.$fontSizes[(params === null || params === void 0 ? void 0 : params.size) || 'base'],
21
20
  marginBottom: td_form_item_style_1.$formItemMarginBottom[(params === null || params === void 0 ? void 0 : params.size) || 'default'],
22
21
  });
23
- if (params === null || params === void 0 ? void 0 : params.label) {
24
- this.labelWrap = new framework_1.Div({
25
- name: 'td-form-item-label-wrap',
22
+ this.labelWrap = new framework_1.Div({
23
+ name: 'td-form-item-label-wrap',
24
+ styleObj: {
25
+ display: 'flex',
26
+ alignItems: 'center'
27
+ // marginLeft: '11px', // 这个是动态计算的
28
+ },
29
+ });
30
+ this.addChild(this.labelWrap);
31
+ if (!params.label && params.required) {
32
+ (_a = this.labelWrap) === null || _a === void 0 ? void 0 : _a.addChild(new framework_1.Span({
33
+ text: '*',
26
34
  styleObj: {
27
- display: 'flex',
28
- // marginLeft: '11px', // 这个是动态计算的
35
+ color: var_1.$colors.danger.base,
36
+ marginRight: '4px',
29
37
  },
30
- });
31
- this.addChild(this.labelWrap);
38
+ }));
32
39
  }
33
40
  this.content = new framework_1.Div({
34
41
  name: 'td-form-item-content',
@@ -46,9 +53,10 @@ class TdFormItem extends ui_abstract_1.UI {
46
53
  },
47
54
  });
48
55
  this.error = new framework_1.Div({
49
- text: 'Please input the ... ',
56
+ text: params.error || '',
50
57
  name: 'td-form-item-error',
51
58
  styleObj: {
59
+ display: 'none',
52
60
  // color: getCssVar('color-danger');
53
61
  color: var_1.$colors.danger.base,
54
62
  fontSize: '12px',
@@ -61,21 +69,20 @@ class TdFormItem extends ui_abstract_1.UI {
61
69
  },
62
70
  });
63
71
  // todo 动态加载
64
- // this.content.addChild(this.error);
72
+ this.content.addChild(this.error);
73
+ this.content.slotChild(params.slot);
74
+ // this.content.addChild(this.getSlotNode());
65
75
  this.addChild(this.content);
66
- this.content.addChild(this.getSlotNode());
67
76
  this.props = this.useParams(params);
68
77
  }
69
- created() {
78
+ setup() {
79
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
70
80
  // inject 要在 created 之中,否则无法确定 parent .
71
- // this.formConfig = this.inject(formContextKey);
81
+ this.formConfig = this.inject(td_form_const_1.formContextKey);
72
82
  // 就是 this.parent.params , 有必要单独引入一次吗?
73
- // console.log('this.formConfig is ', this.formConfig);
83
+ console.log('this.formConfig is ', this.formConfig);
74
84
  // this.childNodes = [this.labelWrap, this.content];
75
85
  // 下面的方法要调用到 this.parent 才能获取到。需要 form的setConfig 方法调用后
76
- }
77
- setup() {
78
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
79
86
  const props = this.props;
80
87
  if (props === null || props === void 0 ? void 0 : props.label) {
81
88
  this.label = new framework_1.Label({
@@ -136,31 +143,31 @@ class TdFormItem extends ui_abstract_1.UI {
136
143
  if (width === undefined) {
137
144
  return;
138
145
  }
139
- (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.addObj({
146
+ (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.setObj({
140
147
  width: (0, utils_1.addUnit)(width),
141
148
  });
142
149
  }
143
150
  setLabelPosition(position) {
144
151
  var _a;
145
152
  // todo top 怎么处理 ?
146
- (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.addObj({
153
+ (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.setObj({
147
154
  justifyContent: position === 'left' ? 'flex-start' : 'flex-end',
148
155
  });
149
156
  }
150
157
  setSize(size = 'default') {
151
158
  var _a, _b;
152
- this.style.addObj({
159
+ this.style.setObj({
153
160
  fontSize: var_1.$fontSizes[size],
154
161
  marginBottom: td_form_item_style_1.$formItemMarginBottom[size],
155
162
  });
156
- (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.addObj({
163
+ (_a = this.label) === null || _a === void 0 ? void 0 : _a.style.setObj({
157
164
  height: td_form_item_style_1.$formItemLineHeight[size],
158
165
  lineHeight: td_form_item_style_1.$formItemLineHeight[size],
159
166
  });
160
- this.content.style.addObj({
167
+ this.content.style.setObj({
161
168
  lineHeight: td_form_item_style_1.$formItemLineHeight[size],
162
169
  });
163
- (_b = this.error) === null || _b === void 0 ? void 0 : _b.style.addObj({
170
+ (_b = this.error) === null || _b === void 0 ? void 0 : _b.style.setObj({
164
171
  paddingTop: td_form_item_style_1.$formItemErrorPaddingTop[size],
165
172
  });
166
173
  }
@@ -1,11 +1,11 @@
1
- import { IUI, IUIConfig } from '../../../ui/ui.interface';
1
+ import { ITypeConfig, ITypeElement } from '@type-dom/framework';
2
2
  import { ISize } from '../../../styles/size';
3
3
  export declare const formItemValidateStates: readonly ["", "error", "validating", "success"];
4
4
  export type IFormItemValidateState = (typeof formItemValidateStates)[number];
5
- export interface ITdFormItem extends IUI {
5
+ export interface ITdFormItem extends ITypeElement {
6
6
  className: 'TdFormItem';
7
7
  }
8
- export interface ITdFormItemConfig extends IUIConfig {
8
+ export interface ITdFormItemConfig extends ITypeConfig {
9
9
  /**
10
10
  * @description Label text.
11
11
  */
@@ -1,9 +1,8 @@
1
- import { IJsonDataProp } from '@type-dom/framework';
2
- import { UI } from '../../../ui/ui.abstract';
1
+ import { IJsonDataProp, TypeDiv } from '@type-dom/framework';
3
2
  import { TdInputWrapper } from './widget/td-input-wrapper.class';
4
3
  import { TdTextareaWrapper } from './widget/td-textarea-wrapper';
5
4
  import { ITdInput, ITdInputConfig } from './td-input.interface';
6
- export declare class TdInput extends UI implements ITdInput {
5
+ export declare class TdInput extends TypeDiv implements ITdInput {
7
6
  className: 'TdInput';
8
7
  props: ITdInputConfig;
9
8
  private isWordLimitVisible?;
@@ -13,9 +12,9 @@ export declare class TdInput extends UI implements ITdInput {
13
12
  private placeholder?;
14
13
  constructor(params?: ITdInputConfig);
15
14
  get value(): string;
16
- setup(): void;
17
15
  setModelValue(value: IJsonDataProp): void;
18
16
  setHovering(hovering: boolean): void;
19
17
  setFocus(isFocused: boolean): void;
18
+ setShow(show: boolean, display?: string): void;
20
19
  created(): void;
21
20
  }
@@ -3,24 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdInput = void 0;
4
4
  const utils_1 = require("@type-dom/utils");
5
5
  const framework_1 = require("@type-dom/framework");
6
- const ui_abstract_1 = require("../../../ui/ui.abstract");
7
6
  const var_1 = require("../../../styles/var");
8
7
  const td_input_wrapper_class_1 = require("./widget/td-input-wrapper.class");
9
8
  const td_input_style_1 = require("./td-input.style");
10
9
  const td_textarea_wrapper_1 = require("./widget/td-textarea-wrapper");
11
- class TdInput extends ui_abstract_1.UI {
10
+ class TdInput extends framework_1.TypeDiv {
12
11
  constructor(params = {}) {
13
- super(params);
12
+ super();
14
13
  console.log('TdInput constructor . ');
15
14
  this.className = 'TdInput';
16
- this.attr.addName('td-input');
17
15
  this.attr.addObj({
16
+ name: 'td-input',
18
17
  tabIndex: 0
19
18
  });
20
19
  this.style.addObj({
21
20
  position: 'relative',
22
21
  display: 'inline-flex',
23
22
  width: '100%',
23
+ // width: '95%',
24
24
  boxSizing: 'border-box',
25
25
  verticalAlign: 'middle',
26
26
  // fontSize: var(--el-font-size-base),
@@ -33,35 +33,27 @@ class TdInput extends ui_abstract_1.UI {
33
33
  if (params === null || params === void 0 ? void 0 : params.modelValue) {
34
34
  this.modelValue = params.modelValue;
35
35
  }
36
- this.props = this.useParams(params);
37
- }
38
- get value() {
39
- return this.panel.inner.value;
40
- }
41
- setup() {
42
- const props = this.props;
43
- if (props === null || props === void 0 ? void 0 : props.width) {
44
- this.style.addWidth(props.width);
45
- }
46
36
  // todo
47
- if ((props === null || props === void 0 ? void 0 : props.type) === 'textarea') {
48
- props.parent = this;
49
- this.panel = new td_textarea_wrapper_1.TdTextareaWrapper(props);
37
+ if ((params === null || params === void 0 ? void 0 : params.type) === 'textarea') {
38
+ params.parent = this;
39
+ this.panel = new td_textarea_wrapper_1.TdTextareaWrapper(params);
50
40
  // this.textareaWrapper = new TdTextareaWrapper(props);
51
41
  }
52
42
  else {
53
- this.panel = new td_input_wrapper_class_1.TdInputWrapper(props);
43
+ this.panel = new td_input_wrapper_class_1.TdInputWrapper(params);
54
44
  }
55
- if (props === null || props === void 0 ? void 0 : props.placeholder) {
56
- this.placeholder = props.placeholder;
45
+ if (params === null || params === void 0 ? void 0 : params.placeholder) {
46
+ this.placeholder = params.placeholder;
57
47
  }
58
- this.panel.setParent(this);
59
48
  this.addChild(this.panel);
60
- if (!(props === null || props === void 0 ? void 0 : props.formatter) && (props === null || props === void 0 ? void 0 : props.parser)) {
49
+ if (params === null || params === void 0 ? void 0 : params.width) {
50
+ this.style.addWidth(params.width);
51
+ }
52
+ if (!(params === null || params === void 0 ? void 0 : params.formatter) && (params === null || params === void 0 ? void 0 : params.parser)) {
61
53
  throw new Error('If you set the parser, you also need to set the formatter');
62
54
  }
63
- if (this.props.disabled) {
64
- return;
55
+ if (params.disabled) {
56
+ // this.panel.setDisabled(true);
65
57
  }
66
58
  this.addEvents({
67
59
  mouseleave: (evt) => {
@@ -138,9 +130,13 @@ class TdInput extends ui_abstract_1.UI {
138
130
  this.emit('keydown', evt, element);
139
131
  }
140
132
  });
141
- if (this.props.type === 'textarea') {
142
- return; // ????
133
+ if (params.type === 'textarea') {
134
+ // ????
143
135
  }
136
+ this.props = this.useParams(params);
137
+ }
138
+ get value() {
139
+ return this.panel.inner.value;
144
140
  }
145
141
  setModelValue(value) {
146
142
  console.log('setModelValue . value is ', value);
@@ -197,6 +193,14 @@ class TdInput extends ui_abstract_1.UI {
197
193
  });
198
194
  }
199
195
  }
196
+ setShow(show, display = 'inline-flex') {
197
+ this.style.setObj({
198
+ display: show ? display : 'none'
199
+ });
200
+ this.panel.style.setObj({
201
+ display: show ? display : 'none'
202
+ });
203
+ }
200
204
  created() {
201
205
  // 注: 绑定变量要渲染前处理,而不是创建对象时处理
202
206
  if (this.props.modelValue) {
@@ -1,11 +1,10 @@
1
- import { IJsonDataProp, InputEnum, IObDataProp, Span, TypeSvgSvg } from '@type-dom/framework';
1
+ import { IJsonDataProp, InputEnum, IObDataProp, ITypeConfig, ITypeDiv, Span, TypeSvgSvg } from '@type-dom/framework';
2
2
  import { ISize } from '../../../styles/size';
3
- import { IUI, IUIConfig } from '../../../ui/ui.interface';
4
3
  import { TdInput } from './td-input.class';
5
- export interface ITdInput extends IUI {
4
+ export interface ITdInput extends ITypeDiv {
6
5
  className: 'TdInput';
7
6
  }
8
- export interface ITdInputConfig extends IUIConfig {
7
+ export interface ITdInputConfig extends ITypeConfig {
9
8
  parent?: TdInput;
10
9
  /**
11
10
  * @description native input id
@@ -10,4 +10,5 @@ export declare class TdInputSuffix extends TypeSpan {
10
10
  clearIcon?: TdIcon;
11
11
  passwordIcon?: TdIcon;
12
12
  constructor(parent: TdInputWrapper, config?: ITdInputConfig);
13
+ setup(): void;
13
14
  }
@@ -11,7 +11,7 @@ class TdInputSuffix extends framework_1.TypeSpan {
11
11
  this.parent = parent;
12
12
  this.className = 'TdInputSuffix';
13
13
  this.style.addObj({
14
- display: this.parent.suffixVisible ? 'inline-flex' : 'none',
14
+ display: 'inline-flex',
15
15
  whiteSpace: 'nowrap',
16
16
  flexShrink: 0,
17
17
  flexWrap: 'nowrap',
@@ -116,5 +116,10 @@ class TdInputSuffix extends framework_1.TypeSpan {
116
116
  this.suffixInner.addChild(this.suffixIcon);
117
117
  }
118
118
  }
119
+ setup() {
120
+ this.style.addObj({
121
+ display: this.parent.suffixVisible ? 'inline-flex' : 'none' // constructor 中this.parent.suffixVisible是undefined
122
+ });
123
+ }
119
124
  }
120
125
  exports.TdInputSuffix = TdInputSuffix;
@@ -182,7 +182,7 @@ class TdInputWrapper extends framework_1.TypeDiv {
182
182
  color: var_1.$textColor.disabled,
183
183
  // -webkit-text-fill-color: var(--el-disabled-text-color),
184
184
  WebkitTextFillColor: var_1.$textColor.disabled,
185
- cursor: 'notAllowed'
185
+ cursor: 'not-allowed'
186
186
  });
187
187
  }
188
188
  else {
@@ -226,14 +226,14 @@ class TdInputWrapper extends framework_1.TypeDiv {
226
226
  // }
227
227
  // }
228
228
  setShowClear(showClear) {
229
- var _a;
229
+ var _a, _b, _c;
230
230
  console.log('setShowClear . showClear is ', showClear);
231
231
  this.suffix.style.show(this.suffixVisible ? 'inline-flex' : 'none');
232
- (_a = this.suffix.clearIcon) === null || _a === void 0 ? void 0 : _a.style.show(showClear ? 'inline-flex' : 'none');
232
+ (_c = (_b = (_a = this.suffix) === null || _a === void 0 ? void 0 : _a.clearIcon) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.show(showClear ? 'inline-flex' : 'none');
233
233
  }
234
234
  setShowPassword(showPassword) {
235
- var _a;
236
- (_a = this.suffix.passwordIcon) === null || _a === void 0 ? void 0 : _a.style.show(showPassword ? 'inline-flex' : 'none');
235
+ var _a, _b;
236
+ (_b = (_a = this.suffix.passwordIcon) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.show(showPassword ? 'inline-flex' : 'none');
237
237
  }
238
238
  setNativeInputValue() {
239
239
  console.log('setNativeInputValue . ');
@@ -1,6 +1,6 @@
1
- import { UI } from '../../../ui/ui.abstract';
2
1
  import { ITdOption, ITdOptionConfig } from './td-option.interface';
3
- export declare class TdOption extends UI implements ITdOption {
2
+ import { TypeLI } from '@type-dom/framework';
3
+ export declare class TdOption extends TypeLI implements ITdOption {
4
4
  className: 'TdOption';
5
5
  props: ITdOptionConfig;
6
6
  constructor(params?: ITdOptionConfig);
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdOption = void 0;
4
- const ui_abstract_1 = require("../../../ui/ui.abstract");
5
4
  const td_select_style_1 = require("../td-select/td-select.style");
6
- class TdOption extends ui_abstract_1.UI {
5
+ const framework_1 = require("@type-dom/framework");
6
+ class TdOption extends framework_1.TypeLI {
7
7
  constructor(params = {}) {
8
- super(params, 'li');
8
+ super();
9
9
  this.className = 'TdOption';
10
10
  this.attr.addObj({
11
11
  name: 'td-option',