@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.
- package/README.md +44 -44
- package/package.json +1 -1
- package/src/components/basic/td-button/td-button.abstract.js +3 -3
- package/src/components/basic/td-button/td-button.class.js +1 -1
- package/src/components/basic/td-button-group/td-button-group.class.js +1 -1
- package/src/components/basic/td-container/td-aside/td-aside.class.js +2 -2
- package/src/components/basic/td-container/td-container.class.js +2 -2
- package/src/components/basic/td-container/td-footer/td-footer.class.js +3 -3
- package/src/components/basic/td-container/td-header/td-header.class.js +6 -6
- package/src/components/basic/td-container/td-main/td-main.class.js +2 -2
- package/src/components/basic/td-icon/td-icon.class.js +13 -13
- package/src/components/basic/td-layout/td-col/td-col.class.js +4 -4
- package/src/components/basic/td-layout/td-row/td-row.class.js +2 -2
- package/src/components/basic/td-link/td-link.class.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.js +2 -2
- package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +1 -1
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +2 -2
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +2 -2
- package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +1 -1
- package/src/components/basic/td-space/td-space.class.js +2 -2
- package/src/components/basic/td-text/td-text.class.js +2 -2
- package/src/components/data/td-avatar/td-avatar.class.js +3 -3
- package/src/components/data/td-badge/td-badge.class.d.ts +1 -0
- package/src/components/data/td-badge/td-badge.class.js +10 -7
- package/src/components/data/td-card/td-card.class.js +2 -2
- package/src/components/data/td-check-tag/td-check-tag.class.js +2 -2
- package/src/components/data/td-collapse/td-collapse.class.js +2 -5
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +1 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +3 -3
- package/src/components/data/td-collapse-transition/td-collapse-transition.class.js +1 -1
- package/src/components/data/td-count-down/td-count-down.class.js +2 -4
- package/src/components/data/td-descriptions/td-descriptions-row.d.ts +1 -1
- package/src/components/data/td-descriptions/td-descriptions-row.js +3 -3
- package/src/components/data/td-descriptions/td-descriptions.class.js +2 -2
- package/src/components/data/td-descriptions/td-descritions-cell.js +2 -2
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +3 -5
- package/src/components/data/td-empty/img-empty.class.js +2 -2
- package/src/components/data/td-empty/td-empty.class.js +2 -2
- package/src/components/data/td-image/td-image.class.js +3 -3
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +3 -2
- package/src/components/data/td-result/td-result.class.js +5 -9
- package/src/components/data/td-segmented/td-segmented.class.js +14 -15
- package/src/components/data/td-statistic/td-statistic.abstract.d.ts +1 -1
- package/src/components/data/td-statistic/td-statistic.abstract.js +2 -2
- package/src/components/data/td-tag/td-tag.class.js +3 -3
- package/src/components/feedback/dialog/dialog.class.js +2 -2
- package/src/components/feedback/message-box/message-box.js +2 -2
- package/src/components/feedback/overlay/container/container.js +5 -4
- package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.js +6 -5
- package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.js +6 -5
- package/src/components/feedback/overlay/container/header/close-button/close-button.js +6 -5
- package/src/components/feedback/overlay/overlay.abstract.js +5 -4
- package/src/components/feedback/td-alert/td-alert.class.js +2 -2
- package/src/components/feedback/td-dialog/td-dialog.class.d.ts +3 -0
- package/src/components/feedback/td-dialog/td-dialog.class.js +20 -3
- package/src/components/feedback/td-dialog/td-dialog.interface.d.ts +19 -0
- package/src/components/feedback/td-dialog/td-dialog.interface.js +12 -0
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +2 -2
- package/src/components/feedback/td-drawer/td-drawer.class.js +13 -11
- package/src/components/feedback/td-drawer/td-drawer.interface.d.ts +5 -5
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +2 -2
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +5 -5
- package/src/components/feedback/td-focus-trap/utils.d.ts +1 -1
- package/src/components/feedback/td-loading/td-loading.class.js +2 -2
- package/src/components/feedback/td-message/td-message.class.d.ts +1 -0
- package/src/components/feedback/td-message/td-message.class.js +19 -12
- package/src/components/feedback/td-message-box/td-message-box.class.js +3 -4
- package/src/components/feedback/td-notification/td-notification.class.js +4 -4
- package/src/components/feedback/td-overlay/td-overlay.class.js +2 -2
- package/src/components/feedback/td-popper/arrow/arrow.class.js +2 -2
- package/src/components/feedback/td-popper/content/content.class.js +2 -2
- package/src/components/feedback/td-popper/td-popper.class.js +2 -2
- package/src/components/feedback/td-popper/trigger/trigger.class.js +2 -2
- package/src/components/feedback/td-tooltip/content/content.class.js +2 -2
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +2 -2
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +2 -2
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +19 -18
- package/src/components/form/field-item/cascade/field-cascade.abstract.js +40 -35
- package/src/components/form/field-item/input/field-input.abstract.js +7 -6
- package/src/components/form/field-item/options/field-options.abstract.js +19 -18
- package/src/components/form/field-item/radio/field-radio.abstract.js +2 -3
- package/src/components/form/field-item/select/field-select.abstract.js +14 -14
- package/src/components/form/field-select/field-select.class.js +16 -16
- package/src/components/form/radio-group/radio-group.class.js +2 -2
- package/src/components/form/radio-group/radio-group.interface.d.ts +2 -2
- package/src/components/form/radio-group/radio-option/radio-option.class.js +10 -9
- package/src/components/form/select/select.class.js +17 -16
- package/src/components/form/td-checkbox/td-checkbox.class.js +2 -2
- package/src/components/form/td-checkbox/td-checkbox.style.js +2 -2
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +2 -2
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +2 -2
- package/src/components/form/td-form/td-form.class.js +2 -2
- package/src/components/form/td-form-item/td-form-item.class.js +2 -2
- package/src/components/form/td-input/td-input.class.js +2 -2
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +2 -2
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +2 -2
- package/src/components/form/td-input/widget/utils.js +8 -8
- package/src/components/form/td-option/td-option.class.js +2 -2
- package/src/components/form/td-option/td-option.interface.d.ts +1 -1
- package/src/components/form/td-option-group/td-option-group.class.js +2 -2
- package/src/components/form/td-radio/td-radio.class.js +2 -3
- package/src/components/form/td-radio-button/td-radio-button.class.js +2 -3
- package/src/components/form/td-radio-group/td-radio-group.class.js +2 -2
- package/src/components/form/td-select/dropdown/dropdown.class.js +2 -2
- package/src/components/form/td-select/td-select.class.js +2 -2
- package/src/components/form/td-switch/td-switch.class.js +8 -9
- package/src/components/form/td-switch/widget/td-switch-core.js +2 -2
- package/src/components/form/td-switch/widget/td-switch-left.js +2 -2
- package/src/components/form/td-switch/widget/td-switch-right.js +2 -2
- package/src/components/navigation/td-affix/td-affix.class.js +2 -2
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +2 -2
- package/src/components/navigation/td-anchor/td-anchor.class.d.ts +1 -1
- package/src/components/navigation/td-anchor/td-anchor.class.js +2 -2
- package/src/components/navigation/td-backtop/td-backtop.class.js +5 -6
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +3 -5
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +2 -2
- package/src/components/navigation/td-menu/td-menu.class.js +2 -2
- package/src/components/navigation/td-tabs/td-tab-bar.class.d.ts +1 -1
- package/src/components/navigation/td-tabs/td-tab-bar.class.js +7 -7
- package/src/components/navigation/td-tabs/td-tab-bar.interface.d.ts +2 -2
- package/src/components/navigation/td-tabs/td-tab-nav.class.d.ts +2 -2
- package/src/components/navigation/td-tabs/td-tab-nav.class.js +13 -13
- package/src/components/navigation/td-tabs/td-tab-nav.interface.d.ts +1 -1
- package/src/components/navigation/td-tabs/td-tab-pane.class.js +2 -2
- package/src/components/navigation/td-tabs/td-tabs.class.js +20 -23
- package/src/components/others/collapsible-box/heading/expand-heading.js +24 -23
- package/src/components/others/custom-block/custom-block.d.ts +11 -0
- package/src/components/others/custom-block/custom-block.js +58 -0
- package/src/components/others/example/example-float-control.d.ts +8 -0
- package/src/components/others/example/example-float-control.js +63 -0
- package/src/components/others/example/example-showcase.d.ts +7 -0
- package/src/components/others/example/example-showcase.js +20 -0
- package/src/components/others/example/example-source-wrapper.d.ts +5 -0
- package/src/components/others/example/example-source-wrapper.js +30 -0
- package/src/components/others/example/example.d.ts +15 -0
- package/src/components/others/example/example.js +77 -0
- package/src/components/others/example/index.d.ts +5 -0
- package/src/components/others/example/index.js +13 -0
- package/src/components/others/example/op-btns.d.ts +7 -0
- package/src/components/others/example/op-btns.js +96 -0
- package/src/components/others/index.d.ts +4 -0
- package/src/components/others/index.js +9 -1
- package/src/components/others/menus/menu.d.ts +16 -0
- package/src/components/others/menus/menu.js +123 -0
- package/src/components/others/menus/menus.d.ts +10 -0
- package/src/components/others/menus/menus.js +79 -0
- package/src/components/others/td-divider/td-divider.class.js +2 -2
- package/src/ui/ui.abstract.js +1 -1
- package/src/ui/ui.interface.d.ts +3 -3
|
@@ -13,10 +13,8 @@ class TdCountDown extends td_statistic_abstract_1.TdStatisticAbstract {
|
|
|
13
13
|
this.className = 'TdCountDown';
|
|
14
14
|
this.rawValue = (0, utils_2.getTime)((params === null || params === void 0 ? void 0 : params.value) || 0) - Date.now();
|
|
15
15
|
this.setNumber(this.rawValue);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
this.props = this.setParams(params);
|
|
16
|
+
this.addChild(this.getSlotNode());
|
|
17
|
+
this.props = this.setProps(params);
|
|
20
18
|
}
|
|
21
19
|
mounted() {
|
|
22
20
|
this.stopTimer();
|
|
@@ -9,11 +9,11 @@ const td_descritions_cell_1 = require("./td-descritions-cell");
|
|
|
9
9
|
* @author darcrand
|
|
10
10
|
*/
|
|
11
11
|
class TdDescriptionsRow extends framework_1.TypeFragment {
|
|
12
|
-
constructor(params) {
|
|
12
|
+
constructor(params = {}) {
|
|
13
13
|
super();
|
|
14
14
|
this.className = 'TdDescriptionsRow';
|
|
15
15
|
this.childNodes = [];
|
|
16
|
-
this.props = this.
|
|
16
|
+
this.props = this.setProps(params);
|
|
17
17
|
}
|
|
18
18
|
created() {
|
|
19
19
|
var _a;
|
|
@@ -74,7 +74,7 @@ class TdDescriptionsRow extends framework_1.TypeFragment {
|
|
|
74
74
|
});
|
|
75
75
|
this.addChild(tr);
|
|
76
76
|
}
|
|
77
|
-
// this.
|
|
77
|
+
// this.setProps(this.config);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
exports.TdDescriptionsRow = TdDescriptionsRow;
|
|
@@ -10,7 +10,7 @@ class TdDescriptions extends ui_abstract_1.UI {
|
|
|
10
10
|
constructor(params) {
|
|
11
11
|
super(params);
|
|
12
12
|
this.className = 'TdDescriptions';
|
|
13
|
-
this.props = this.
|
|
13
|
+
this.props = this.setProps(params);
|
|
14
14
|
}
|
|
15
15
|
created() {
|
|
16
16
|
var _a, _b, _c, _d;
|
|
@@ -85,7 +85,7 @@ class TdDescriptions extends ui_abstract_1.UI {
|
|
|
85
85
|
});
|
|
86
86
|
this.body.addChild(this.bodyTable);
|
|
87
87
|
this.addChild(this.body);
|
|
88
|
-
this.
|
|
88
|
+
this.setProps(props); // todo ????
|
|
89
89
|
}
|
|
90
90
|
filledNode(node, span, count, isLast = false) {
|
|
91
91
|
if (!node.props) {
|
|
@@ -5,10 +5,10 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
6
|
const td_descriptions_style_1 = require("./td-descriptions.style");
|
|
7
7
|
class TdDescriptionsCell extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params, (params === null || params === void 0 ? void 0 : params.tag) || 'td');
|
|
10
10
|
this.className = 'TdDescriptionsCell';
|
|
11
|
-
this.props = this.
|
|
11
|
+
this.props = this.setProps(params);
|
|
12
12
|
}
|
|
13
13
|
created() {
|
|
14
14
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TdDescriptionsItem = void 0;
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
class TdDescriptionsItem extends ui_abstract_1.UI {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.className = 'TdDescriptionsItem';
|
|
9
9
|
// if (config?.slots?.label) {
|
|
@@ -11,10 +11,8 @@ class TdDescriptionsItem extends ui_abstract_1.UI {
|
|
|
11
11
|
// } else if (config?.label) {
|
|
12
12
|
// this.label = new TextNode(config.label);
|
|
13
13
|
// }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
this.props = this.setParams(params);
|
|
14
|
+
this.addChild(this.getSlotNode());
|
|
15
|
+
this.props = this.setProps(params);
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
exports.TdDescriptionsItem = TdDescriptionsItem;
|
|
@@ -4,7 +4,7 @@ exports.ImgEmpty = void 0;
|
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const td_empty_style_1 = require("./td-empty.style");
|
|
6
6
|
class ImgEmpty extends framework_1.TypeSvgSvg {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'ImgEmpty';
|
|
10
10
|
this.ctrl.addAttrObj({
|
|
@@ -198,7 +198,7 @@ class ImgEmpty extends framework_1.TypeSvgSvg {
|
|
|
198
198
|
})
|
|
199
199
|
]
|
|
200
200
|
}));
|
|
201
|
-
// this.
|
|
201
|
+
// this.setProps(params);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
exports.ImgEmpty = ImgEmpty;
|
|
@@ -7,7 +7,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
7
7
|
const td_empty_style_1 = require("./td-empty.style");
|
|
8
8
|
const img_empty_class_1 = require("./img-empty.class");
|
|
9
9
|
class TdEmpty extends ui_abstract_1.UI {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
super(params);
|
|
13
13
|
this.className = 'TdEmpty';
|
|
@@ -65,7 +65,7 @@ class TdEmpty extends ui_abstract_1.UI {
|
|
|
65
65
|
this.addChild(this.bottom);
|
|
66
66
|
this.bottom.slotChild(params.slot);
|
|
67
67
|
}
|
|
68
|
-
this.props = this.
|
|
68
|
+
this.props = this.setProps(params);
|
|
69
69
|
}
|
|
70
70
|
get emptyDescription() {
|
|
71
71
|
return this.props.description || 'No Data'; // || t('el.table.emptyText')
|
|
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
6
|
const td_image_style_1 = require("./td-image.style");
|
|
7
7
|
class TdImage extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params);
|
|
10
10
|
this.className = 'TdImage';
|
|
11
11
|
this.ctrl.addAttrName('td-image');
|
|
@@ -32,7 +32,7 @@ class TdImage extends ui_abstract_1.UI {
|
|
|
32
32
|
});
|
|
33
33
|
this.hasLoadError = false;
|
|
34
34
|
// todo preview
|
|
35
|
-
this.props = this.
|
|
35
|
+
this.props = this.setProps(params);
|
|
36
36
|
}
|
|
37
37
|
setup() {
|
|
38
38
|
var _a, _b;
|
|
@@ -76,7 +76,7 @@ class TdImage extends ui_abstract_1.UI {
|
|
|
76
76
|
(_b = this.img) === null || _b === void 0 ? void 0 : _b.ctrl.addStyleObj({
|
|
77
77
|
objectFit: fit
|
|
78
78
|
});
|
|
79
|
-
super.
|
|
79
|
+
super.setProps(props);
|
|
80
80
|
}
|
|
81
81
|
// todo 监听 src 改变
|
|
82
82
|
setSrc(src) {
|
|
@@ -8,7 +8,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
8
8
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
9
9
|
const td_image_viewer_style_1 = require("./td-image-viewer.style");
|
|
10
10
|
class TdImageViewer extends ui_abstract_1.UI {
|
|
11
|
-
constructor(params) {
|
|
11
|
+
constructor(params = {}) {
|
|
12
12
|
super(params, 'fragment');
|
|
13
13
|
this.loading = false;
|
|
14
14
|
this.className = 'TdImageViewer';
|
|
@@ -43,6 +43,7 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
43
43
|
this.teleport.addChild(this.transition);
|
|
44
44
|
// this.mount(document.body);
|
|
45
45
|
// this.ctrl.addAttrName('wrapper');
|
|
46
|
+
// todo transition 如何设置样式 ??? developing ......
|
|
46
47
|
this.transition.ctrl.addStyleObj({
|
|
47
48
|
position: 'fixed',
|
|
48
49
|
top: 0,
|
|
@@ -179,7 +180,7 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
179
180
|
this.transition.addChild(new framework_1.Div({
|
|
180
181
|
childNodes: imgList
|
|
181
182
|
}));
|
|
182
|
-
this.props = this.
|
|
183
|
+
this.props = this.setProps(params);
|
|
183
184
|
}
|
|
184
185
|
get imgStyle() {
|
|
185
186
|
const { scale, deg, offsetX, offsetY, enableTransition } = this.transform;
|
|
@@ -8,7 +8,7 @@ const td_result_constant_1 = require("./td-result.constant");
|
|
|
8
8
|
class TdResult extends ui_abstract_1.UI {
|
|
9
9
|
// private iconSlot?: SlotNode;
|
|
10
10
|
// private titleSlot?: SlotNode;
|
|
11
|
-
constructor(params) {
|
|
11
|
+
constructor(params = {}) {
|
|
12
12
|
var _a, _b, _c, _d, _e, _f;
|
|
13
13
|
super(params);
|
|
14
14
|
this.className = 'TdResult';
|
|
@@ -28,9 +28,7 @@ class TdResult extends ui_abstract_1.UI {
|
|
|
28
28
|
name: 'icon',
|
|
29
29
|
childNodes: [this.getSlotNode('icon')]
|
|
30
30
|
}));
|
|
31
|
-
if ((_a = params === null || params === void 0 ? void 0 : params.slots) === null || _a === void 0 ? void 0 : _a.icon) {
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
31
|
+
if (!((_a = params === null || params === void 0 ? void 0 : params.slots) === null || _a === void 0 ? void 0 : _a.icon)) {
|
|
34
32
|
const resultIcon = this.resultIcon(params);
|
|
35
33
|
this.getSlotNode('icon').addSlot(resultIcon);
|
|
36
34
|
}
|
|
@@ -41,9 +39,7 @@ class TdResult extends ui_abstract_1.UI {
|
|
|
41
39
|
styleObj: td_result_style_1.$titleStyle,
|
|
42
40
|
childNodes: [this.getSlotNode('title')]
|
|
43
41
|
}));
|
|
44
|
-
if ((_c = params.slots) === null || _c === void 0 ? void 0 : _c.title) {
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
42
|
+
if (!((_c = params.slots) === null || _c === void 0 ? void 0 : _c.title)) {
|
|
47
43
|
this.getSlotNode('title').addSlot(new framework_1.P({
|
|
48
44
|
name: 'title',
|
|
49
45
|
text: params.title,
|
|
@@ -74,9 +70,9 @@ class TdResult extends ui_abstract_1.UI {
|
|
|
74
70
|
styleObj: td_result_style_1.$extraStyle,
|
|
75
71
|
childNodes: [this.getSlotNode('extra')]
|
|
76
72
|
}));
|
|
77
|
-
this.getSlotNode('extra').addSlot(params.slots.extra);
|
|
73
|
+
// this.getSlotNode('extra').addSlot(params.slots.extra);
|
|
78
74
|
}
|
|
79
|
-
this.props = this.
|
|
75
|
+
this.props = this.setProps(params);
|
|
80
76
|
}
|
|
81
77
|
resultIcon(params) {
|
|
82
78
|
const icon = params === null || params === void 0 ? void 0 : params.icon;
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const event_1 = require("../../../constants/event");
|
|
7
7
|
const td_segmented_style_1 = require("./td-segmented.style");
|
|
8
8
|
class TdSegmented extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params);
|
|
11
11
|
this.className = 'TdSegmented';
|
|
12
12
|
(0, td_segmented_style_1.useStyle)(params);
|
|
@@ -82,7 +82,7 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
82
82
|
labels.push(label);
|
|
83
83
|
});
|
|
84
84
|
this.group.addChildren(...labels);
|
|
85
|
-
this.props = this.
|
|
85
|
+
this.props = this.setProps(params);
|
|
86
86
|
}
|
|
87
87
|
mounted() {
|
|
88
88
|
console.log('TdSegmented created');
|
|
@@ -149,24 +149,23 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
149
149
|
this.selectedDiv.ctrl.setStyleObj(this.selectedStyle);
|
|
150
150
|
}
|
|
151
151
|
handleChange(item, element) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
// emit(CHANGE_EVENT, value)
|
|
152
|
+
const value = this.getValue(item);
|
|
153
|
+
this.emit(event_1.UPDATE_MODEL_EVENT, value);
|
|
154
|
+
this.emit(event_1.CHANGE_EVENT, value);
|
|
156
155
|
console.log('handleChange ', item);
|
|
157
156
|
this.modelValue = this.getValue(item);
|
|
158
157
|
// element.attrObj?.checked = true;
|
|
159
158
|
element.ctrl.addAttribute('checked', true);
|
|
160
159
|
this.updateSelect();
|
|
161
|
-
const value = this.getValue(item);
|
|
162
|
-
const update =
|
|
163
|
-
if (update) {
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
const change =
|
|
167
|
-
if (change) {
|
|
168
|
-
|
|
169
|
-
}
|
|
160
|
+
// const value = this.getValue(item);
|
|
161
|
+
// const update = this.props.emits?.[UPDATE_MODEL_EVENT];
|
|
162
|
+
// if (update) {
|
|
163
|
+
// update(value);
|
|
164
|
+
// }
|
|
165
|
+
// const change = this.props.emits?.[CHANGE_EVENT];
|
|
166
|
+
// if (change) {
|
|
167
|
+
// change(value);
|
|
168
|
+
// }
|
|
170
169
|
}
|
|
171
170
|
}
|
|
172
171
|
exports.TdSegmented = TdSegmented;
|
|
@@ -10,6 +10,6 @@ export declare abstract class TdStatisticAbstract extends UI implements ITdStati
|
|
|
10
10
|
number: Span;
|
|
11
11
|
suffix?: TypeElement;
|
|
12
12
|
props: ITdStatisticConfig;
|
|
13
|
-
protected constructor(params
|
|
13
|
+
protected constructor(params?: ITdStatisticConfig);
|
|
14
14
|
formatValue(value: number | string | Dayjs): string;
|
|
15
15
|
}
|
|
@@ -6,7 +6,7 @@ const utils_1 = require("@type-dom/utils");
|
|
|
6
6
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
7
|
const td_statistic_style_1 = require("./td-statistic.style");
|
|
8
8
|
class TdStatisticAbstract extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
var _a, _b, _c, _d;
|
|
11
11
|
super(params);
|
|
12
12
|
if (params === null || params === void 0 ? void 0 : params.title) {
|
|
@@ -91,7 +91,7 @@ class TdStatisticAbstract extends ui_abstract_1.UI {
|
|
|
91
91
|
this.suffix = params.slots.suffix;
|
|
92
92
|
this.content.addChild(params.slots.suffix);
|
|
93
93
|
}
|
|
94
|
-
this.props = this.
|
|
94
|
+
this.props = this.setProps(params);
|
|
95
95
|
}
|
|
96
96
|
formatValue(value) {
|
|
97
97
|
const { formatter, precision, decimalSeparator, groupSeparator } = this.props;
|
|
@@ -8,7 +8,7 @@ const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
|
8
8
|
const var_1 = require("../../../styles/var");
|
|
9
9
|
const td_tag_style_1 = require("./td-tag.style");
|
|
10
10
|
class TdTag extends ui_abstract_1.UI {
|
|
11
|
-
constructor(params) {
|
|
11
|
+
constructor(params = {}) {
|
|
12
12
|
super(params, 'span');
|
|
13
13
|
this.className = 'TdTag';
|
|
14
14
|
this.ctrl.addAttrName('td-tag');
|
|
@@ -82,10 +82,10 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
82
82
|
this.ctrl.addStyleObj(td_tag_style_1.$tagSizes[size]);
|
|
83
83
|
// if (!params?.disableTransitions) { // TODO: 添加过渡
|
|
84
84
|
// params?.parent?.addChild(new Transition({
|
|
85
|
-
//
|
|
85
|
+
// childNodes: [this],
|
|
86
86
|
// }))
|
|
87
87
|
// }
|
|
88
|
-
this.props = this.
|
|
88
|
+
this.props = this.setProps(params);
|
|
89
89
|
if (params === null || params === void 0 ? void 0 : params.closable) {
|
|
90
90
|
this.ctrl.addStyleObj({
|
|
91
91
|
paddingRight: parseFloat(td_tag_style_1.$tagIconSpanGap.default) - parseFloat(var_1.$borderWidth) + 'px'
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Dialog = void 0;
|
|
4
4
|
const overlay_abstract_1 = require("../overlay/overlay.abstract");
|
|
5
5
|
class Dialog extends overlay_abstract_1.Overlay {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super();
|
|
8
8
|
this.className = 'Dialog';
|
|
9
9
|
this.ctrl.addAttrObj({
|
|
10
10
|
name: 'dialog'
|
|
11
11
|
});
|
|
12
|
-
this.props = this.
|
|
12
|
+
this.props = this.setProps(params);
|
|
13
13
|
if (params === null || params === void 0 ? void 0 : params.to) {
|
|
14
14
|
this.mount(params.to);
|
|
15
15
|
}
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MessageBox = void 0;
|
|
4
4
|
const overlay_abstract_1 = require("../overlay/overlay.abstract");
|
|
5
5
|
class MessageBox extends overlay_abstract_1.Overlay {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super();
|
|
8
8
|
this.className = 'MessageBox';
|
|
9
9
|
this.ctrl.addAttrObj({
|
|
10
10
|
name: 'message-box'
|
|
11
11
|
});
|
|
12
|
-
this.props = this.
|
|
12
|
+
this.props = this.setProps(params);
|
|
13
13
|
if (params === null || params === void 0 ? void 0 : params.el) {
|
|
14
14
|
this.mount(params.el);
|
|
15
15
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OverlayContainer = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const header_1 = require("./header/header");
|
|
7
6
|
const body_1 = require("./body/body");
|
|
@@ -29,9 +28,11 @@ class OverlayContainer extends framework_1.TypeDiv {
|
|
|
29
28
|
this.childNodes = [this.header, this.body, this.footer];
|
|
30
29
|
}
|
|
31
30
|
initEvents() {
|
|
32
|
-
this.
|
|
33
|
-
e
|
|
34
|
-
|
|
31
|
+
this.addEvents({
|
|
32
|
+
click: (e) => {
|
|
33
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
34
|
+
}
|
|
35
|
+
});
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
exports.OverlayContainer = OverlayContainer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CancelButton = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
class CancelButton extends framework_1.TypeButton {
|
|
7
6
|
constructor() {
|
|
@@ -22,10 +21,12 @@ class CancelButton extends framework_1.TypeButton {
|
|
|
22
21
|
if (!((_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent)) {
|
|
23
22
|
console.error('this.parent?.parent?.parent is undefined . ');
|
|
24
23
|
}
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
this.addEvents({
|
|
25
|
+
click: () => {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
(_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.ctrl.hide();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
exports.CancelButton = CancelButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConfirmButton = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
class ConfirmButton extends framework_1.TypeButton {
|
|
7
6
|
constructor() {
|
|
@@ -22,10 +21,12 @@ class ConfirmButton extends framework_1.TypeButton {
|
|
|
22
21
|
if (!((_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent)) {
|
|
23
22
|
console.error('this.parent?.parent?.parent is undefined . ');
|
|
24
23
|
}
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
this.addEvents({
|
|
25
|
+
click: () => {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
(_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.ctrl.hide();
|
|
28
|
+
}
|
|
29
|
+
});
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
exports.ConfirmButton = ConfirmButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CloseButton = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
6
|
class CloseButton extends framework_1.TypeButton {
|
|
@@ -24,10 +23,12 @@ class CloseButton extends framework_1.TypeButton {
|
|
|
24
23
|
this.childNodes = [this.svg];
|
|
25
24
|
}
|
|
26
25
|
initEvents() {
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
this.addEvents({
|
|
27
|
+
click: () => {
|
|
28
|
+
var _a, _b, _c;
|
|
29
|
+
(_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.ctrl.hide();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
exports.CloseButton = CloseButton;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Overlay = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const container_1 = require("./container/container");
|
|
7
6
|
class Overlay extends framework_1.TypeDiv {
|
|
@@ -51,9 +50,11 @@ class Overlay extends framework_1.TypeDiv {
|
|
|
51
50
|
// this.container.body.clearChildDom();
|
|
52
51
|
}
|
|
53
52
|
initEvents() {
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
this.addEvents({
|
|
54
|
+
click: () => {
|
|
55
|
+
this.ctrl.hide();
|
|
56
|
+
}
|
|
57
|
+
});
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
exports.Overlay = Overlay;
|
|
@@ -7,7 +7,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
7
7
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
8
|
const td_alert_style_1 = require("./td-alert.style");
|
|
9
9
|
class TdAlert extends ui_abstract_1.UI {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
super(params, 'fragment');
|
|
12
12
|
this.className = 'TdAlert';
|
|
13
13
|
this.transition = new framework_1.Transition({
|
|
@@ -39,7 +39,7 @@ class TdAlert extends ui_abstract_1.UI {
|
|
|
39
39
|
this.addTitle(params);
|
|
40
40
|
this.addDescription(params);
|
|
41
41
|
this.addCloseElement(params);
|
|
42
|
-
this.props = this.
|
|
42
|
+
this.props = this.setProps(params);
|
|
43
43
|
}
|
|
44
44
|
addTitle(params) {
|
|
45
45
|
var _a, _b;
|
|
@@ -5,8 +5,9 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
6
|
const td_dialog_content_class_1 = require("../td-dialog-content/td-dialog-content.class");
|
|
7
7
|
const td_overlay_class_1 = require("../td-overlay/td-overlay.class");
|
|
8
|
+
const event_1 = require("../../../constants/event");
|
|
8
9
|
class TdDialog extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
10
11
|
super(params, 'fragment');
|
|
11
12
|
console.log('TdDialog . ');
|
|
12
13
|
this.className = 'TdDialog';
|
|
@@ -33,20 +34,23 @@ class TdDialog extends ui_abstract_1.UI {
|
|
|
33
34
|
emits: {
|
|
34
35
|
afterEnter: () => {
|
|
35
36
|
console.log('afterEnter . ');
|
|
37
|
+
this.afterEnter();
|
|
36
38
|
},
|
|
37
39
|
afterLeave: () => {
|
|
38
40
|
console.log('afterLeave . ');
|
|
41
|
+
this.afterLeave();
|
|
39
42
|
},
|
|
40
43
|
beforeLeave: () => {
|
|
41
44
|
console.log('beforeLeave . ');
|
|
45
|
+
this.beforeLeave();
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
|
-
|
|
48
|
+
childNodes: [this.overlay],
|
|
45
49
|
}),
|
|
46
50
|
]
|
|
47
51
|
});
|
|
48
52
|
this.addChild(this.teleport);
|
|
49
|
-
this.props = this.
|
|
53
|
+
this.props = this.setProps(params);
|
|
50
54
|
}
|
|
51
55
|
show() {
|
|
52
56
|
console.log('TdDialog . show . ');
|
|
@@ -66,5 +70,18 @@ class TdDialog extends ui_abstract_1.UI {
|
|
|
66
70
|
// close()
|
|
67
71
|
// }
|
|
68
72
|
}
|
|
73
|
+
afterEnter() {
|
|
74
|
+
this.emit('opened');
|
|
75
|
+
}
|
|
76
|
+
afterLeave() {
|
|
77
|
+
this.emit('closed');
|
|
78
|
+
this.emit(event_1.UPDATE_MODEL_EVENT, false);
|
|
79
|
+
if (this.props.destroyOnClose) {
|
|
80
|
+
this.rendered = false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
beforeLeave() {
|
|
84
|
+
this.emit('close');
|
|
85
|
+
}
|
|
69
86
|
}
|
|
70
87
|
exports.TdDialog = TdDialog;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IUI } from '../../../ui/ui.interface';
|
|
2
2
|
import { ITdDialogContentConfig } from '../td-dialog-content/td-dialog-content.interface';
|
|
3
|
+
import { UPDATE_MODEL_EVENT } from '../../../constants/event';
|
|
3
4
|
export interface ITdDialog extends IUI {
|
|
4
5
|
className: 'TdDialog';
|
|
5
6
|
}
|
|
@@ -76,4 +77,22 @@ export interface ITdDialogConfig extends ITdDialogContentConfig {
|
|
|
76
77
|
* default: '2',
|
|
77
78
|
*/
|
|
78
79
|
headerAriaLevel?: string;
|
|
80
|
+
emits?: {
|
|
81
|
+
open?: () => void;
|
|
82
|
+
opened?: () => void;
|
|
83
|
+
close?: () => void;
|
|
84
|
+
closed?: () => void;
|
|
85
|
+
[UPDATE_MODEL_EVENT]?: (value: boolean) => void;
|
|
86
|
+
openAutoFocus?: () => void;
|
|
87
|
+
closeAutoFocus?: () => void;
|
|
88
|
+
};
|
|
79
89
|
}
|
|
90
|
+
export declare const dialogEmits: {
|
|
91
|
+
open: () => boolean;
|
|
92
|
+
opened: () => boolean;
|
|
93
|
+
close: () => boolean;
|
|
94
|
+
closed: () => boolean;
|
|
95
|
+
"update:modelValue": (value: boolean) => boolean;
|
|
96
|
+
openAutoFocus: () => boolean;
|
|
97
|
+
closeAutoFocus: () => boolean;
|
|
98
|
+
};
|
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dialogEmits = void 0;
|
|
4
|
+
const event_1 = require("../../../constants/event");
|
|
5
|
+
const utils_1 = require("@type-dom/utils");
|
|
6
|
+
exports.dialogEmits = {
|
|
7
|
+
open: () => true,
|
|
8
|
+
opened: () => true,
|
|
9
|
+
close: () => true,
|
|
10
|
+
closed: () => true,
|
|
11
|
+
[event_1.UPDATE_MODEL_EVENT]: (value) => (0, utils_1.isBoolean)(value),
|
|
12
|
+
openAutoFocus: () => true,
|
|
13
|
+
closeAutoFocus: () => true,
|
|
14
|
+
};
|
|
@@ -7,7 +7,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
7
7
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
8
|
const td_dialog_style_1 = require("../td-dialog/td-dialog.style");
|
|
9
9
|
class TdDialogContent extends ui_abstract_1.UI {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
super(params);
|
|
13
13
|
this.className = 'TdDialogContent';
|
|
@@ -73,7 +73,7 @@ class TdDialogContent extends ui_abstract_1.UI {
|
|
|
73
73
|
this.footer.addChild(this.getSlotNode('footer'));
|
|
74
74
|
this.addChild(this.footer);
|
|
75
75
|
}
|
|
76
|
-
this.props = this.
|
|
76
|
+
this.props = this.setProps(params);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
exports.TdDialogContent = TdDialogContent;
|