@type-dom/ui 0.0.6 → 0.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 (149) hide show
  1. package/README.md +44 -44
  2. package/package.json +1 -1
  3. package/src/components/basic/td-button/td-button.abstract.js +3 -3
  4. package/src/components/basic/td-button/td-button.class.js +1 -1
  5. package/src/components/basic/td-button-group/td-button-group.class.js +1 -1
  6. package/src/components/basic/td-container/td-aside/td-aside.class.js +2 -2
  7. package/src/components/basic/td-container/td-container.class.js +2 -2
  8. package/src/components/basic/td-container/td-footer/td-footer.class.js +3 -3
  9. package/src/components/basic/td-container/td-header/td-header.class.js +6 -6
  10. package/src/components/basic/td-container/td-main/td-main.class.js +2 -2
  11. package/src/components/basic/td-icon/td-icon.class.js +13 -13
  12. package/src/components/basic/td-layout/td-col/td-col.class.js +4 -4
  13. package/src/components/basic/td-layout/td-row/td-row.class.js +2 -2
  14. package/src/components/basic/td-link/td-link.class.js +1 -1
  15. package/src/components/basic/td-scrollbar/bar/bar.class.js +2 -2
  16. package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +1 -1
  17. package/src/components/basic/td-scrollbar/td-scrollbar.class.js +2 -2
  18. package/src/components/basic/td-scrollbar/thumb/thumb.class.js +2 -2
  19. package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +1 -1
  20. package/src/components/basic/td-space/td-space.class.js +2 -2
  21. package/src/components/basic/td-text/td-text.class.js +2 -2
  22. package/src/components/data/td-avatar/td-avatar.class.js +3 -3
  23. package/src/components/data/td-badge/td-badge.class.d.ts +1 -0
  24. package/src/components/data/td-badge/td-badge.class.js +10 -7
  25. package/src/components/data/td-card/td-card.class.js +2 -2
  26. package/src/components/data/td-check-tag/td-check-tag.class.js +2 -2
  27. package/src/components/data/td-collapse/td-collapse.class.js +2 -5
  28. package/src/components/data/td-collapse/td-collapse.interface.d.ts +1 -0
  29. package/src/components/data/td-collapse-item/td-collapse-item.class.js +3 -3
  30. package/src/components/data/td-collapse-transition/td-collapse-transition.class.js +1 -1
  31. package/src/components/data/td-count-down/td-count-down.class.js +2 -4
  32. package/src/components/data/td-descriptions/td-descriptions-row.d.ts +1 -1
  33. package/src/components/data/td-descriptions/td-descriptions-row.js +3 -3
  34. package/src/components/data/td-descriptions/td-descriptions.class.js +2 -2
  35. package/src/components/data/td-descriptions/td-descritions-cell.js +2 -2
  36. package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +3 -5
  37. package/src/components/data/td-empty/img-empty.class.js +2 -2
  38. package/src/components/data/td-empty/td-empty.class.js +2 -2
  39. package/src/components/data/td-image/td-image.class.js +3 -3
  40. package/src/components/data/td-image-viewer/td-image-viewer.class.js +3 -2
  41. package/src/components/data/td-result/td-result.class.js +5 -9
  42. package/src/components/data/td-segmented/td-segmented.class.js +14 -15
  43. package/src/components/data/td-statistic/td-statistic.abstract.d.ts +1 -1
  44. package/src/components/data/td-statistic/td-statistic.abstract.js +2 -2
  45. package/src/components/data/td-tag/td-tag.class.js +3 -3
  46. package/src/components/feedback/dialog/dialog.class.js +2 -2
  47. package/src/components/feedback/message-box/message-box.js +2 -2
  48. package/src/components/feedback/overlay/container/container.js +5 -4
  49. package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.js +6 -5
  50. package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.js +6 -5
  51. package/src/components/feedback/overlay/container/header/close-button/close-button.js +6 -5
  52. package/src/components/feedback/overlay/overlay.abstract.js +5 -4
  53. package/src/components/feedback/td-alert/td-alert.class.js +2 -2
  54. package/src/components/feedback/td-dialog/td-dialog.class.d.ts +3 -0
  55. package/src/components/feedback/td-dialog/td-dialog.class.js +20 -3
  56. package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +19 -0
  57. package/src/components/feedback/td-dialog/td-dialog.interface.js +12 -0
  58. package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +2 -2
  59. package/src/components/feedback/td-drawer/td-drawer.class.js +13 -11
  60. package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +5 -5
  61. package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +2 -2
  62. package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +5 -5
  63. package/src/components/feedback/td-focus-trap/utils.d.ts +1 -1
  64. package/src/components/feedback/td-loading/td-loading.class.js +2 -2
  65. package/src/components/feedback/td-message/td-message.class.d.ts +1 -0
  66. package/src/components/feedback/td-message/td-message.class.js +19 -12
  67. package/src/components/feedback/td-message-box/td-message-box.class.js +3 -4
  68. package/src/components/feedback/td-notification/td-notification.class.js +4 -4
  69. package/src/components/feedback/td-overlay/td-overlay.class.js +2 -2
  70. package/src/components/feedback/td-popper/arrow/arrow.class.js +2 -2
  71. package/src/components/feedback/td-popper/content/content.class.js +2 -2
  72. package/src/components/feedback/td-popper/td-popper.class.js +2 -2
  73. package/src/components/feedback/td-popper/trigger/trigger.class.js +2 -2
  74. package/src/components/feedback/td-tooltip/content/content.class.js +2 -2
  75. package/src/components/feedback/td-tooltip/td-tooltip.class.js +2 -2
  76. package/src/components/feedback/td-tooltip/trigger/trigger.class.js +2 -2
  77. package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +19 -18
  78. package/src/components/form/field-item/cascade/field-cascade.abstract.js +40 -35
  79. package/src/components/form/field-item/input/field-input.abstract.js +7 -6
  80. package/src/components/form/field-item/options/field-options.abstract.js +19 -18
  81. package/src/components/form/field-item/radio/field-radio.abstract.js +2 -3
  82. package/src/components/form/field-item/select/field-select.abstract.js +14 -14
  83. package/src/components/form/field-select/field-select.class.js +16 -16
  84. package/src/components/form/radio-group/radio-group.class.js +2 -2
  85. package/src/components/form/radio-group/radio-group.interface.d.ts +2 -2
  86. package/src/components/form/radio-group/radio-option/radio-option.class.js +10 -9
  87. package/src/components/form/select/select.class.js +17 -16
  88. package/src/components/form/td-checkbox/td-checkbox.class.js +2 -2
  89. package/src/components/form/td-checkbox/td-checkbox.style.js +2 -2
  90. package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +2 -2
  91. package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +2 -2
  92. package/src/components/form/td-form/td-form.class.js +2 -2
  93. package/src/components/form/td-form-item/td-form-item.class.js +2 -2
  94. package/src/components/form/td-input/td-input.class.js +2 -2
  95. package/src/components/form/td-input/widget/td-input-wrapper.class.js +2 -2
  96. package/src/components/form/td-input/widget/td-textarea-wrapper.js +2 -2
  97. package/src/components/form/td-input/widget/utils.js +8 -8
  98. package/src/components/form/td-option/td-option.class.js +2 -2
  99. package/src/components/form/td-option/td-option.interface.d.ts +1 -1
  100. package/src/components/form/td-option-group/td-option-group.class.js +2 -2
  101. package/src/components/form/td-radio/td-radio.class.js +2 -3
  102. package/src/components/form/td-radio-button/td-radio-button.class.js +2 -3
  103. package/src/components/form/td-radio-group/td-radio-group.class.js +2 -2
  104. package/src/components/form/td-select/dropdown/dropdown.class.js +2 -2
  105. package/src/components/form/td-select/td-select.class.js +2 -2
  106. package/src/components/form/td-switch/td-switch.class.js +8 -9
  107. package/src/components/form/td-switch/widget/td-switch-core.js +2 -2
  108. package/src/components/form/td-switch/widget/td-switch-left.js +2 -2
  109. package/src/components/form/td-switch/widget/td-switch-right.js +2 -2
  110. package/src/components/navigation/td-affix/td-affix.class.js +2 -2
  111. package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +2 -2
  112. package/src/components/navigation/td-anchor/td-anchor.class.d.ts +1 -1
  113. package/src/components/navigation/td-anchor/td-anchor.class.js +2 -2
  114. package/src/components/navigation/td-backtop/td-backtop.class.js +5 -6
  115. package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +3 -5
  116. package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +2 -2
  117. package/src/components/navigation/td-menu/td-menu.class.js +2 -2
  118. package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +1 -1
  119. package/src/components/navigation/td-tabs/td-tab-bar.class.js +7 -7
  120. package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +2 -2
  121. package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +2 -2
  122. package/src/components/navigation/td-tabs/td-tab-nav.class.js +13 -13
  123. package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +1 -1
  124. package/src/components/navigation/td-tabs/td-tab-pane.class.js +2 -2
  125. package/src/components/navigation/td-tabs/td-tabs.class.js +20 -23
  126. package/src/components/others/collapsible-box/heading/expand-heading.js +24 -23
  127. package/src/components/others/custom-block/custom-block.d.ts +11 -0
  128. package/src/components/others/custom-block/custom-block.js +58 -0
  129. package/src/components/others/example/example-float-control.d.ts +8 -0
  130. package/src/components/others/example/example-float-control.js +63 -0
  131. package/src/components/others/example/example-showcase.d.ts +7 -0
  132. package/src/components/others/example/example-showcase.js +20 -0
  133. package/src/components/others/example/example-source-wrapper.d.ts +5 -0
  134. package/src/components/others/example/example-source-wrapper.js +30 -0
  135. package/src/components/others/example/example.d.ts +15 -0
  136. package/src/components/others/example/example.js +77 -0
  137. package/src/components/others/example/index.d.ts +5 -0
  138. package/src/components/others/example/index.js +13 -0
  139. package/src/components/others/example/op-btns.d.ts +7 -0
  140. package/src/components/others/example/op-btns.js +96 -0
  141. package/src/components/others/index.d.ts +4 -0
  142. package/src/components/others/index.js +9 -1
  143. package/src/components/others/menus/menu.d.ts +16 -0
  144. package/src/components/others/menus/menu.js +123 -0
  145. package/src/components/others/menus/menus.d.ts +10 -0
  146. package/src/components/others/menus/menus.js +79 -0
  147. package/src/components/others/td-divider/td-divider.class.js +2 -2
  148. package/src/ui/ui.abstract.js +1 -1
  149. package/src/ui/ui.interface.d.ts +3 -3
package/README.md CHANGED
@@ -1,44 +1,44 @@
1
- ## 项目说明
2
-
3
- > 这是一个基于自建前端框架TypeDom创建的ui组件库。
4
-
5
- ## 安装
6
-
7
- > npm install @type-dom/ui
8
-
9
- ## 框架介绍
10
-
11
- 1、技术栈
12
- – type-dom框架
13
- – webpack
14
- – typescript
15
- – 抽象类
16
- – 实体类
17
- 2、项目结构
18
- – src
19
- – lib
20
- - basic
21
- - data
22
- - feedback
23
- - form
24
- - navigation
25
- - other
26
- - styles
27
-
28
- - test
29
-
30
- # type-dom 自定义组件
31
-
32
- ## basic 基础组件
33
-
34
- ### button 按钮组件
35
-
36
- ## data 数据组件
37
-
38
- ## form 表单组件
39
-
40
- ## feedback 反馈组件
41
-
42
- ## navigation 导航组件
43
-
44
- ## other 其它组件
1
+ ## 项目说明
2
+
3
+ > 这是一个基于自建前端框架TypeDom创建的ui组件库。
4
+
5
+ ## 安装
6
+
7
+ > npm install @type-dom/ui
8
+
9
+ ## 框架介绍
10
+
11
+ 1、技术栈
12
+ – type-dom框架
13
+ – webpack
14
+ – typescript
15
+ – 抽象类
16
+ – 实体类
17
+ 2、项目结构
18
+ – src
19
+ – lib
20
+ - basic
21
+ - data
22
+ - feedback
23
+ - form
24
+ - navigation
25
+ - other
26
+ - styles
27
+
28
+ - test
29
+
30
+ # type-dom 自定义组件
31
+
32
+ ## basic 基础组件
33
+
34
+ ### button 按钮组件
35
+
36
+ ## data 数据组件
37
+
38
+ ## form 表单组件
39
+
40
+ ## feedback 反馈组件
41
+
42
+ ## navigation 导航组件
43
+
44
+ ## other 其它组件
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@type-dom/ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "dependencies": {
5
5
  "@type-dom/svgs": "*",
6
6
  "rxjs": "^7.5.7",
@@ -10,14 +10,14 @@ const td_icon_class_1 = require("../td-icon/td-icon.class");
10
10
  const td_button_style_1 = require("./td-button.style");
11
11
  // import '../../styles/style.css';
12
12
  class TdButtonAbstract extends ui_abstract_1.UI {
13
- constructor(params) {
14
- super(params, (params === null || params === void 0 ? void 0 : params.tag) || 'button');
13
+ constructor(params = {}) {
14
+ super(params, params.tag || 'button');
15
15
  this.ctrl.addAttrObj({
16
16
  type: 'button' // 默认
17
17
  });
18
18
  this.ctrl.addStyleObj(td_button_style_1.$tdButtonBase);
19
19
  this.childNodes = [];
20
- this.props = this.setParams(params); // 这里的config赋值是要替换掉上面的config的预置值的。
20
+ this.props = this.setProps(params); // 这里的config赋值是要替换掉上面的config的预置值的。
21
21
  }
22
22
  setup() {
23
23
  var _a, _b, _c;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdButton = void 0;
4
4
  const td_button_abstract_1 = require("./td-button.abstract");
5
5
  class TdButton extends td_button_abstract_1.TdButtonAbstract {
6
- constructor(params) {
6
+ constructor(params = {}) {
7
7
  super(params);
8
8
  this.className = 'TdButton';
9
9
  }
@@ -15,7 +15,7 @@ class TdButtonGroup extends ui_abstract_1.UI {
15
15
  if (params === null || params === void 0 ? void 0 : params.slot) {
16
16
  this.slotChild(params === null || params === void 0 ? void 0 : params.slot);
17
17
  }
18
- this.setParams(params);
18
+ this.setProps(params);
19
19
  }
20
20
  created() {
21
21
  this.children.forEach((btn, index) => {
@@ -4,7 +4,7 @@ exports.TdAside = void 0;
4
4
  const utils_1 = require("@type-dom/utils");
5
5
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
6
6
  class TdAside extends ui_abstract_1.UI {
7
- constructor(params) {
7
+ constructor(params = {}) {
8
8
  super(params);
9
9
  this.className = 'TdAside';
10
10
  this.ctrl.addStyleObj({
@@ -14,7 +14,7 @@ class TdAside extends ui_abstract_1.UI {
14
14
  width: (params === null || params === void 0 ? void 0 : params.width) ? (0, utils_1.addUnit)(params.width) : '300px'
15
15
  });
16
16
  this.addChild(this.getSlotNode());
17
- this.props = this.setParams(params);
17
+ this.props = this.setProps(params);
18
18
  }
19
19
  }
20
20
  exports.TdAside = TdAside;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdContainer = void 0;
4
4
  const ui_abstract_1 = require("../../../ui/ui.abstract");
5
5
  class TdContainer extends ui_abstract_1.UI {
6
- constructor(params) {
6
+ constructor(params = {}) {
7
7
  super(params, 'section');
8
8
  this.className = 'TdContainer';
9
9
  this.ctrl.addAttrName('td-container');
@@ -23,7 +23,7 @@ class TdContainer extends ui_abstract_1.UI {
23
23
  });
24
24
  }
25
25
  this.addChild(this.getSlotNode());
26
- this.props = this.setParams(params);
26
+ this.props = this.setProps(params);
27
27
  }
28
28
  }
29
29
  exports.TdContainer = TdContainer;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdFooter = void 0;
4
4
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
5
5
  class TdFooter extends ui_abstract_1.UI {
6
- constructor(params) {
6
+ constructor(params = {}) {
7
7
  super(params, 'footer');
8
8
  this.className = 'TdFooter';
9
9
  this.ctrl.addStyleObj({
@@ -14,9 +14,9 @@ class TdFooter extends ui_abstract_1.UI {
14
14
  backgroundColor: (params === null || params === void 0 ? void 0 : params.backgroundColor) || 'fff' // '#a0cfff'
15
15
  });
16
16
  if (params === null || params === void 0 ? void 0 : params.slot) {
17
- this.slotChild(params === null || params === void 0 ? void 0 : params.slot);
17
+ this.slotChild(params.slot);
18
18
  }
19
- this.props = this.setParams(params);
19
+ this.props = this.setProps(params);
20
20
  }
21
21
  }
22
22
  exports.TdFooter = TdFooter;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdHeader = void 0;
4
4
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
5
5
  class TdHeader extends ui_abstract_1.UI {
6
- constructor(params) {
6
+ constructor(params = {}) {
7
7
  super(params, 'header');
8
8
  this.className = 'TdHeader';
9
9
  this.ctrl.addAttrName('td-header');
@@ -12,14 +12,14 @@ class TdHeader extends ui_abstract_1.UI {
12
12
  alignItems: 'center',
13
13
  padding: '0 20px',
14
14
  boxSizing: 'border-box',
15
- flexShrink: 0
15
+ flexShrink: 0,
16
+ height: 60,
17
+ backgroundColor: '#fff'
16
18
  });
17
19
  if (params === null || params === void 0 ? void 0 : params.slot) {
18
- this.slotChild(params === null || params === void 0 ? void 0 : params.slot);
20
+ this.slotChild(params.slot);
19
21
  }
20
- this.props = this.setParams(params);
21
- this.ctrl.addHeight((params === null || params === void 0 ? void 0 : params.height) || '60px');
22
- this.ctrl.addBackgroundColor((params === null || params === void 0 ? void 0 : params.backgroundColor) || 'fff');
22
+ this.props = this.setProps(params);
23
23
  }
24
24
  }
25
25
  exports.TdHeader = TdHeader;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TdMain = void 0;
4
4
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
5
5
  class TdMain extends ui_abstract_1.UI {
6
- constructor(params) {
6
+ constructor(params = {}) {
7
7
  super(params, (params === null || params === void 0 ? void 0 : params.tag) || 'main');
8
8
  this.className = 'TdMain';
9
9
  this.ctrl.addStyleObj({
@@ -16,7 +16,7 @@ class TdMain extends ui_abstract_1.UI {
16
16
  });
17
17
  this.addChild(this.getSlotNode());
18
18
  console.warn('TdMain slotNodes.default is ', this.getSlotNode());
19
- this.props = this.setParams(params);
19
+ this.props = this.setProps(params);
20
20
  }
21
21
  }
22
22
  exports.TdMain = TdMain;
@@ -14,7 +14,7 @@ class TdIcon extends ui_abstract_1.UI {
14
14
  * TdIcon 类的构造函数。
15
15
  * @param config 图标配置对象,可选参数。
16
16
  */
17
- constructor(params) {
17
+ constructor(params = {}) {
18
18
  super(params, 'i');
19
19
  this.className = 'TdIcon';
20
20
  this.ctrl.addStyleObj(td_icon_style_1.$tdIcon);
@@ -24,24 +24,24 @@ class TdIcon extends ui_abstract_1.UI {
24
24
  // 首次创建时,添加style标签;避免重复创建
25
25
  if (!TdIcon.initCalled) {
26
26
  TdIcon.initCalled = true;
27
- const cssText = `
28
- /* 选择所有带有 data-v-366071 属性的元素 */
29
- /* 在这里添加您的样式规则 */
30
- @keyframes rotating-${framework_1.vHash} {
31
- 0% {
32
- transform: rotateZ(0deg);
33
- }
34
- 100% {
35
- transform: rotateZ(360deg);
36
- }
37
- }
27
+ const cssText = `
28
+ /* 选择所有带有 data-v-366071 属性的元素 */
29
+ /* 在这里添加您的样式规则 */
30
+ @keyframes rotating-${framework_1.vHash} {
31
+ 0% {
32
+ transform: rotateZ(0deg);
33
+ }
34
+ 100% {
35
+ transform: rotateZ(360deg);
36
+ }
37
+ }
38
38
  `;
39
39
  (0, framework_1.createStyle)(cssText);
40
40
  // createClass('td-icon', $tdIcon);
41
41
  }
42
42
  this.ctrl.addAttrClass('td-icon');
43
43
  this.addChild(this.getSlotNode());
44
- this.props = this.setParams(params);
44
+ this.props = this.setProps(params);
45
45
  }
46
46
  /**
47
47
  * 根据配置更新图标的状态和样式。
@@ -5,11 +5,11 @@ const rxjs_1 = require("rxjs");
5
5
  const utils_1 = require("@type-dom/utils");
6
6
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
7
7
  class TdCol extends ui_abstract_1.UI {
8
- constructor(params) {
8
+ constructor(params = {}) {
9
9
  super(params);
10
10
  this.className = 'TdCol';
11
11
  this.addChild(this.getSlotNode());
12
- this.props = this.setParams(params);
12
+ this.props = this.setProps(params);
13
13
  }
14
14
  get screenWidth() {
15
15
  return window.innerWidth || document.documentElement.clientWidth;
@@ -119,13 +119,13 @@ class TdCol extends ui_abstract_1.UI {
119
119
  }
120
120
  }
121
121
  initEvents() {
122
- this.subscriptions.push((0, rxjs_1.fromEvent)(window, 'resize')
122
+ (0, rxjs_1.fromEvent)(window, 'resize')
123
123
  .pipe((0, rxjs_1.debounceTime)(250) // 防抖延时
124
124
  // distinctUntilChanged() // 可选,仅在窗口尺寸发生实际变化时才触发
125
125
  )
126
126
  .subscribe((event) => {
127
127
  this.resize();
128
- }));
128
+ });
129
129
  }
130
130
  }
131
131
  exports.TdCol = TdCol;
@@ -7,7 +7,7 @@ class TdRow extends ui_abstract_1.UI {
7
7
  // justify: string = 'start';
8
8
  // align: string = 'top';
9
9
  // tag: string = 'div';
10
- constructor(params) {
10
+ constructor(params = {}) {
11
11
  super(params);
12
12
  this.className = 'TdRow';
13
13
  this.ctrl.addStyleObj({
@@ -18,7 +18,7 @@ class TdRow extends ui_abstract_1.UI {
18
18
  });
19
19
  this.childNodes = [];
20
20
  this.addChild(this.getSlotNode());
21
- this.props = this.setParams(params);
21
+ this.props = this.setProps(params);
22
22
  }
23
23
  setup() {
24
24
  const props = this.props;
@@ -10,7 +10,7 @@ class TdLink extends ui_abstract_1.UI {
10
10
  this.className = 'TdLink';
11
11
  (0, td_link_style_1.useType)(params);
12
12
  this.ctrl.addStyleObj(td_link_style_1.$linkStyle);
13
- this.props = this.setParams(params);
13
+ this.props = this.setProps(params);
14
14
  }
15
15
  // override beforeCreate() {
16
16
  // this.ctrl.addStyleObj($linkStyle);
@@ -4,7 +4,7 @@ exports.TdScrollbarBar = void 0;
4
4
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
5
5
  const thumb_class_1 = require("../thumb/thumb.class");
6
6
  class TdScrollbarBar extends ui_abstract_1.UI {
7
- constructor(params) {
7
+ constructor(params = {}) {
8
8
  super(params);
9
9
  this.className = 'TdScrollbarBar';
10
10
  this.ctrl.addAttrName('td-scrollbar-bar');
@@ -26,7 +26,7 @@ class TdScrollbarBar extends ui_abstract_1.UI {
26
26
  ratio: 1
27
27
  })
28
28
  ];
29
- this.props = this.setParams(params);
29
+ this.props = this.setProps(params);
30
30
  }
31
31
  }
32
32
  exports.TdScrollbarBar = TdScrollbarBar;
@@ -4,5 +4,5 @@ export interface ITdScrollbarBar extends IUI {
4
4
  }
5
5
  export interface ITdScrollbarBarConfig extends IUIConfig {
6
6
  always?: boolean;
7
- minSize: number;
7
+ minSize?: number;
8
8
  }
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
5
5
  const ui_abstract_1 = require("../../../ui/ui.abstract");
6
6
  const bar_class_1 = require("./bar/bar.class");
7
7
  class TdScrollbar extends ui_abstract_1.UI {
8
- constructor(params) {
8
+ constructor(params = {}) {
9
9
  super(params, params === null || params === void 0 ? void 0 : params.tag);
10
10
  this.className = 'TdScrollbar';
11
11
  this.ctrl.addAttrName('td-scrollbar');
@@ -43,7 +43,7 @@ class TdScrollbar extends ui_abstract_1.UI {
43
43
  if (params === null || params === void 0 ? void 0 : params.contents) {
44
44
  this.view.addChildren(...params.contents);
45
45
  }
46
- this.props = this.setParams(params);
46
+ this.props = this.setProps(params);
47
47
  }
48
48
  }
49
49
  exports.TdScrollbar = TdScrollbar;
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
5
5
  const ui_abstract_1 = require("../../../../ui/ui.abstract");
6
6
  const var_1 = require("../../../../styles/var");
7
7
  class TdScrollbarThumb extends ui_abstract_1.UI {
8
- constructor(params) {
8
+ constructor(params = {}) {
9
9
  super(params);
10
10
  this.className = 'TdScrollbarThumb';
11
11
  this.ctrl.addAttrName('td-scrollbar-thumb');
@@ -39,7 +39,7 @@ class TdScrollbarThumb extends ui_abstract_1.UI {
39
39
  }
40
40
  });
41
41
  this.addChild(this.thumb);
42
- this.props = this.setParams(params);
42
+ this.props = this.setProps(params);
43
43
  }
44
44
  }
45
45
  exports.TdScrollbarThumb = TdScrollbarThumb;
@@ -6,6 +6,6 @@ export interface ITdScrollbarThumbConfig extends IUIConfig {
6
6
  vertical?: boolean;
7
7
  size?: string;
8
8
  move?: number;
9
- ratio: number;
9
+ ratio?: number;
10
10
  always?: boolean;
11
11
  }
@@ -6,7 +6,7 @@ const framework_1 = require("@type-dom/framework");
6
6
  const ui_abstract_1 = require("../../../ui/ui.abstract");
7
7
  const td_space_const_1 = require("./td-space.const");
8
8
  class TdSpace extends ui_abstract_1.UI {
9
- constructor(params) {
9
+ constructor(params = {}) {
10
10
  super(params);
11
11
  this.className = 'TdSpace';
12
12
  this.ctrl.addStyleObj({
@@ -14,7 +14,7 @@ class TdSpace extends ui_abstract_1.UI {
14
14
  verticalAlign: 'top'
15
15
  });
16
16
  this.addChild(this.getSlotNode());
17
- this.props = this.setParams(params);
17
+ this.props = this.setProps(params);
18
18
  }
19
19
  setup() {
20
20
  this.children.forEach((item) => {
@@ -4,12 +4,12 @@ exports.TdText = void 0;
4
4
  const ui_abstract_1 = require("../../../ui/ui.abstract");
5
5
  const td_text_style_1 = require("./td-text.style");
6
6
  class TdText extends ui_abstract_1.UI {
7
- constructor(params) {
7
+ constructor(params = {}) {
8
8
  super(params, (params === null || params === void 0 ? void 0 : params.tag) || 'span');
9
9
  this.className = 'TdText';
10
10
  this.ctrl.addStyleObj(td_text_style_1.$baseText);
11
11
  this.addChild(this.getSlotNode());
12
- this.props = this.setParams(params);
12
+ this.props = this.setProps(params);
13
13
  }
14
14
  setup() {
15
15
  const props = this.props;
@@ -6,7 +6,7 @@ const framework_1 = require("@type-dom/framework");
6
6
  const td_avatar_style_1 = require("./td-avatar.style");
7
7
  const utils_1 = require("@type-dom/utils");
8
8
  class TdAvatar extends ui_abstract_1.UI {
9
- constructor(params) {
9
+ constructor(params = {}) {
10
10
  super(params, 'span');
11
11
  this.className = 'TdAvatar';
12
12
  this.ctrl.addAttrName('td-avatar');
@@ -29,7 +29,7 @@ class TdAvatar extends ui_abstract_1.UI {
29
29
  fontSize: td_avatar_style_1.$avatar.textSize
30
30
  });
31
31
  this.hasLoadError = false;
32
- this.props = this.setParams(params);
32
+ this.props = this.setProps(params);
33
33
  }
34
34
  setup() {
35
35
  var _a, _b, _c;
@@ -100,7 +100,7 @@ class TdAvatar extends ui_abstract_1.UI {
100
100
  });
101
101
  }
102
102
  }
103
- // super.setParams(config);
103
+ // super.setProps(config);
104
104
  }
105
105
  // todo 监听 src 改变
106
106
  setSrc(src) {
@@ -6,4 +6,5 @@ export declare class TdBadge extends UI implements ITdBadge {
6
6
  private sup;
7
7
  constructor(params?: ITdBadgeConfig);
8
8
  setup(): void;
9
+ changeValue(value: number | string): void;
9
10
  }
@@ -7,7 +7,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
7
7
  const var_1 = require("../../../styles/var");
8
8
  const td_badge_style_1 = require("./td-badge.style");
9
9
  class TdBadge extends ui_abstract_1.UI {
10
- constructor(params) {
10
+ constructor(params = {}) {
11
11
  var _a, _b, _c, _d;
12
12
  super(params);
13
13
  console.log('TdBadge constructor . ');
@@ -19,7 +19,7 @@ class TdBadge extends ui_abstract_1.UI {
19
19
  display: 'inline-block',
20
20
  width: 'fit-content'
21
21
  });
22
- this.addChild(this.getSlotNode());
22
+ // this.addChild(this.getSlotNode());
23
23
  this.sup = new framework_1.Sup({
24
24
  styleObj: {
25
25
  // background-color: getCssVar('badge', 'bg-color'),
@@ -47,17 +47,17 @@ class TdBadge extends ui_abstract_1.UI {
47
47
  this.addChild(new framework_1.Transition({
48
48
  name: 'td-badge',
49
49
  parent: this,
50
- slot: this.sup
50
+ childNodes: [this.sup]
51
51
  }));
52
- this.props = this.setParams(params);
52
+ this.props = this.setProps(params);
53
53
  }
54
54
  setup() {
55
- var _a;
56
55
  console.log('TdBadge setup');
57
56
  const props = this.props;
58
57
  let content = (props === null || props === void 0 ? void 0 : props.isDot) ? '' : props === null || props === void 0 ? void 0 : props.value;
59
58
  console.warn('TdBadge setup content is ', content);
60
- this.sup.addChild(new framework_1.TextNode(content));
59
+ this.sup.getTextNode().setText(content || '');
60
+ // this.sup.addChild(new TextNode(content))
61
61
  if ((props === null || props === void 0 ? void 0 : props.max) &&
62
62
  (props === null || props === void 0 ? void 0 : props.value) &&
63
63
  (0, utils_1.isNumber)(props === null || props === void 0 ? void 0 : props.value) &&
@@ -68,7 +68,7 @@ class TdBadge extends ui_abstract_1.UI {
68
68
  else {
69
69
  content = props.value === 0 && !props.showZero ? '' : props.value;
70
70
  }
71
- (_a = this.sup.textNode) === null || _a === void 0 ? void 0 : _a.setText(content);
71
+ this.sup.getTextNode().setText(content);
72
72
  }
73
73
  if (props === null || props === void 0 ? void 0 : props.slot) {
74
74
  this.sup.ctrl.addStyleObj({
@@ -100,5 +100,8 @@ class TdBadge extends ui_abstract_1.UI {
100
100
  this.sup.ctrl.addStyleObj(props.dotStyle);
101
101
  }
102
102
  }
103
+ changeValue(value) {
104
+ this.props.value = value;
105
+ }
103
106
  }
104
107
  exports.TdBadge = TdBadge;
@@ -7,7 +7,7 @@ const transition_1 = require("../../../styles/transition");
7
7
  const var_1 = require("../../../styles/var");
8
8
  const td_card_style_1 = require("./td-card.style");
9
9
  class TdCard extends ui_abstract_1.UI {
10
- constructor(params) {
10
+ constructor(params = {}) {
11
11
  super(params);
12
12
  this.className = 'TdCard';
13
13
  this.ctrl.addAttrName('td-card');
@@ -43,7 +43,7 @@ class TdCard extends ui_abstract_1.UI {
43
43
  }
44
44
  this.addChild(this.body);
45
45
  this.addFooter(params);
46
- this.props = this.setParams(params);
46
+ this.props = this.setProps(params);
47
47
  }
48
48
  addShadow(params) {
49
49
  const shadow = (params === null || params === void 0 ? void 0 : params.shadow) || 'always';
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
6
6
  const event_1 = require("../../../constants/event");
7
7
  const td_check_tag_style_1 = require("./td-check-tag.style");
8
8
  class TdCheckTag extends ui_abstract_1.UI {
9
- constructor(params) {
9
+ constructor(params = {}) {
10
10
  super(params, 'span');
11
11
  this.className = 'TdCheckTag';
12
12
  this.ctrl.addAttrName('td-check-tag');
@@ -14,7 +14,7 @@ class TdCheckTag extends ui_abstract_1.UI {
14
14
  (0, td_check_tag_style_1.useType)();
15
15
  this.ctrl.addStyleObj(td_check_tag_style_1.$checkTag);
16
16
  this.setChecked(params === null || params === void 0 ? void 0 : params.checked);
17
- this.props = this.setParams(params);
17
+ this.props = this.setProps(params);
18
18
  }
19
19
  initEvents() {
20
20
  this.addEvents({
@@ -5,7 +5,7 @@ const utils_1 = require("@type-dom/utils");
5
5
  const ui_abstract_1 = require("../../../ui/ui.abstract");
6
6
  const td_collapse_style_1 = require("./td-collapse.style");
7
7
  class TdCollapse extends ui_abstract_1.UI {
8
- constructor(params) {
8
+ constructor(params = {}) {
9
9
  var _a;
10
10
  super(params);
11
11
  this.className = 'TdCollapse';
@@ -19,10 +19,7 @@ class TdCollapse extends ui_abstract_1.UI {
19
19
  this.activeNames = (0, utils_1.isArray)(params === null || params === void 0 ? void 0 : params.modelValue)
20
20
  ? params.modelValue
21
21
  : [(_a = params === null || params === void 0 ? void 0 : params.modelValue) !== null && _a !== void 0 ? _a : ''];
22
- if (params === null || params === void 0 ? void 0 : params.slot) {
23
- this.slotChild(params === null || params === void 0 ? void 0 : params.slot);
24
- }
25
- this.props = this.setParams(params);
22
+ this.props = this.setProps(params);
26
23
  }
27
24
  mounted() {
28
25
  this.setActiveNames(this.activeNames);
@@ -13,6 +13,7 @@ export interface ITdCollapseConfig extends IUIConfig {
13
13
  * default: () => mutable([] as const),
14
14
  */
15
15
  modelValue?: string | number | ICollapseActiveName[];
16
+ slot?: undefined;
16
17
  }
17
18
  export type ICollapseActiveName = string | number;
18
19
  export type ICollapseModelValue = Arrayable<ICollapseActiveName>;
@@ -10,7 +10,7 @@ const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
10
10
  const td_collapse_style_1 = require("../td-collapse/td-collapse.style");
11
11
  const td_collapse_transition_class_1 = require("../td-collapse-transition/td-collapse-transition.class");
12
12
  class TdCollapseItem extends ui_abstract_1.UI {
13
- constructor(params) {
13
+ constructor(params = {}) {
14
14
  var _a;
15
15
  super(params, 'fragment');
16
16
  this.className = 'TdCollapseItem';
@@ -122,10 +122,10 @@ class TdCollapseItem extends ui_abstract_1.UI {
122
122
  this.wrapper.addChild(this.content);
123
123
  this.transition = new td_collapse_transition_class_1.TdCollapseTransition({
124
124
  parent: this,
125
- slot: this.wrapper
125
+ childNodes: [this.wrapper]
126
126
  });
127
127
  this.addChild(this.transition);
128
- this.props = this.setParams(params);
128
+ this.props = this.setProps(params);
129
129
  }
130
130
  setActive(active) {
131
131
  if (active) {
@@ -4,7 +4,7 @@ exports.TdCollapseTransition = void 0;
4
4
  const framework_1 = require("@type-dom/framework");
5
5
  const td_collapse_transition_util_1 = require("./td-collapse-transition.util");
6
6
  class TdCollapseTransition extends framework_1.TypeTransition {
7
- constructor(params) {
7
+ constructor(params = {}) {
8
8
  super(Object.assign(td_collapse_transition_util_1.collapseTransitionConfig, params));
9
9
  this.className = 'TdCollapseTransition';
10
10
  }