@type-dom/ui 0.0.8 → 0.0.9
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/package.json +1 -2
- package/src/aria.d.ts +0 -17
- package/src/aria.js +0 -18
- package/src/components/basic/td-button/td-button.abstract.d.ts +2 -3
- package/src/components/basic/td-button/td-button.abstract.js +30 -26
- package/src/components/basic/td-button/td-button.interface.d.ts +0 -1
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +2 -3
- package/src/components/basic/td-button-group/td-button-group.class.js +14 -16
- package/src/components/basic/td-container/td-aside/td-aside.class.js +2 -2
- package/src/components/basic/td-container/td-container.class.js +5 -5
- package/src/components/basic/td-container/td-container.js +1 -1
- package/src/components/basic/td-container/td-footer/td-footer.class.js +2 -2
- package/src/components/basic/td-container/td-header/td-header.class.js +3 -3
- package/src/components/basic/td-container/td-main/td-main.class.js +2 -2
- package/src/components/basic/td-icon/td-icon.class.js +9 -9
- package/src/components/basic/td-layout/td-col/td-col.class.d.ts +5 -2
- package/src/components/basic/td-layout/td-col/td-col.class.js +80 -80
- package/src/components/basic/td-layout/td-row/td-row.class.js +13 -13
- package/src/components/basic/td-link/td-link.class.d.ts +0 -1
- package/src/components/basic/td-link/td-link.class.js +17 -19
- package/src/components/basic/td-scrollbar/bar/bar.class.js +3 -3
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +5 -5
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +3 -3
- package/src/components/basic/td-space/td-space.class.js +10 -10
- package/src/components/basic/td-text/td-text.class.js +12 -9
- package/src/components/data/td-avatar/td-avatar.class.js +12 -13
- package/src/components/data/td-badge/td-badge.class.js +9 -8
- package/src/components/data/td-card/td-card.class.js +7 -7
- package/src/components/data/td-check-tag/td-check-tag.class.d.ts +0 -1
- package/src/components/data/td-check-tag/td-check-tag.class.js +9 -11
- package/src/components/data/td-collapse/td-collapse.class.js +2 -2
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +7 -7
- package/src/components/data/td-collapse-transition/td-collapse-transition.util.js +14 -14
- package/src/components/data/td-count-down/td-count-down.class.js +1 -1
- package/src/components/data/td-descriptions/td-descriptions-row.js +2 -2
- package/src/components/data/td-descriptions/td-descriptions.class.js +8 -8
- package/src/components/data/td-descriptions/td-descritions-cell.js +14 -14
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +1 -1
- package/src/components/data/td-empty/img-empty.class.js +3 -3
- package/src/components/data/td-empty/td-empty.class.js +4 -4
- package/src/components/data/td-image/td-image.class.js +6 -6
- package/src/components/data/td-image-viewer/td-image-viewer.class.d.ts +2 -1
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +13 -10
- package/src/components/data/td-result/td-result.class.js +3 -3
- package/src/components/data/td-segmented/td-segmented.class.js +14 -17
- package/src/components/data/td-statistic/td-statistic.abstract.js +2 -2
- package/src/components/data/td-tag/td-tag.class.js +9 -9
- package/src/components/feedback/index.d.ts +0 -2
- package/src/components/feedback/index.js +3 -5
- package/src/components/feedback/td-alert/td-alert.class.js +9 -9
- package/src/components/feedback/td-dialog/td-dialog.class.js +5 -5
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +4 -4
- package/src/components/feedback/td-drawer/td-drawer.class.js +10 -12
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.d.ts +19 -1
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +223 -48
- package/src/components/feedback/td-focus-trap/tokens.d.ts +2 -1
- package/src/components/feedback/td-focus-trap/utils.d.ts +1 -1
- package/src/components/feedback/td-focus-trap/utils.js +9 -11
- package/src/components/feedback/td-loading/td-loading.class.js +1 -1
- package/src/components/feedback/td-message/td-message.class.d.ts +3 -2
- package/src/components/feedback/td-message/td-message.class.js +18 -18
- package/src/components/feedback/td-message/td-message.style.js +2 -1
- package/src/components/feedback/td-message-box/td-message-box.class.d.ts +3 -1
- package/src/components/feedback/td-message-box/td-message-box.class.js +79 -74
- package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +2 -1
- package/src/components/feedback/td-notification/td-notification.class.d.ts +3 -2
- package/src/components/feedback/td-notification/td-notification.class.js +26 -26
- package/src/components/feedback/td-only-child/td-only-child.class.d.ts +7 -0
- package/src/components/feedback/td-only-child/td-only-child.class.js +74 -0
- package/src/components/feedback/td-overlay/td-overlay.class.d.ts +1 -1
- package/src/components/feedback/td-overlay/td-overlay.class.js +5 -5
- package/src/components/feedback/td-popper/arrow/arrow.class.d.ts +6 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.js +22 -3
- package/src/components/feedback/td-popper/composable/use-focus-trap.d.ts +0 -0
- package/src/components/feedback/td-popper/composable/use-focus-trap.js +1 -0
- package/src/components/feedback/td-popper/content/content.class.d.ts +1 -0
- package/src/components/feedback/td-popper/content/content.class.js +25 -4
- package/src/components/feedback/td-popper/content/content.const.d.ts +3 -0
- package/src/components/feedback/td-popper/content/content.const.js +29 -0
- package/src/components/feedback/td-popper/content/content.interface.d.ts +9 -0
- package/src/components/feedback/td-popper/td-popper.class.d.ts +1 -1
- package/src/components/feedback/td-popper/td-popper.class.js +35 -2
- package/src/components/feedback/td-popper/td-popper.const.d.ts +21 -0
- package/src/components/feedback/td-popper/td-popper.const.js +5 -0
- package/src/components/feedback/td-popper/trigger/trigger.class.d.ts +11 -0
- package/src/components/feedback/td-popper/trigger/trigger.class.js +96 -1
- package/src/components/feedback/td-popper/trigger/trigger.const.d.ts +1 -0
- package/src/components/feedback/td-popper/trigger/trigger.const.js +12 -0
- package/src/components/feedback/td-popper/trigger/trigger.interface.d.ts +1 -0
- package/src/components/feedback/td-tooltip/content/content.class.js +1 -1
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +1 -1
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +1 -1
- package/src/components/form/checkbox-group/checkbox-group.class.js +6 -7
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.d.ts +1 -1
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +4 -4
- package/src/components/form/field-item/cascade/field-cascade.abstract.d.ts +1 -1
- package/src/components/form/field-item/cascade/field-cascade.abstract.js +8 -8
- package/src/components/form/field-item/field-item.abstract.js +3 -3
- package/src/components/form/field-item/input/field-input.abstract.d.ts +1 -1
- package/src/components/form/field-item/input/field-input.abstract.js +8 -8
- package/src/components/form/field-item/options/field-options.abstract.d.ts +1 -3
- package/src/components/form/field-item/options/field-options.abstract.js +32 -30
- package/src/components/form/field-item/radio/field-radio.abstract.d.ts +1 -1
- package/src/components/form/field-item/radio/field-radio.abstract.js +32 -35
- package/src/components/form/field-item/select/field-select.abstract.d.ts +1 -1
- package/src/components/form/field-item/select/field-select.abstract.js +5 -5
- package/src/components/form/field-item/span/field-span.abstract.js +5 -5
- package/src/components/form/field-item/textarea/field-textarea.abstract.js +5 -5
- package/src/components/form/field-select/field-select.class.d.ts +1 -1
- package/src/components/form/field-select/field-select.class.js +7 -8
- package/src/components/form/field-select/option/option.class.js +1 -3
- package/src/components/form/radio-group/radio-group.class.js +6 -7
- package/src/components/form/radio-group/radio-option/radio-option.class.d.ts +0 -1
- package/src/components/form/radio-group/radio-option/radio-option.class.js +6 -8
- package/src/components/form/select/select.class.d.ts +1 -1
- package/src/components/form/select/select.class.js +4 -4
- package/src/components/form/td-checkbox/td-checkbox.class.js +3 -3
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +3 -3
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +3 -3
- package/src/components/form/td-form/td-form.class.js +5 -3
- package/src/components/form/td-form-item/td-form-item.class.js +16 -16
- package/src/components/form/td-input/td-input-field.class.js +8 -8
- package/src/components/form/td-input/td-input.class.d.ts +0 -1
- package/src/components/form/td-input/td-input.class.js +9 -11
- package/src/components/form/td-input/widget/prefix.js +1 -1
- package/src/components/form/td-input/widget/suffix.js +3 -3
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +12 -11
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +3 -3
- package/src/components/form/td-option/td-option.class.js +3 -3
- package/src/components/form/td-option-group/td-option-group.class.js +3 -3
- package/src/components/form/td-radio/td-radio.class.d.ts +0 -1
- package/src/components/form/td-radio/td-radio.class.js +50 -53
- package/src/components/form/td-radio-button/td-radio-button.class.d.ts +0 -1
- package/src/components/form/td-radio-button/td-radio-button.class.js +46 -49
- package/src/components/form/td-radio-group/td-radio-group.class.js +3 -4
- 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.d.ts +1 -1
- package/src/components/form/td-switch/td-switch.class.js +21 -21
- package/src/components/form/td-switch/widget/td-switch-core.js +6 -6
- package/src/components/form/td-switch/widget/td-switch-left.js +3 -3
- package/src/components/form/td-switch/widget/td-switch-right.js +2 -2
- package/src/components/navigation/td-affix/td-affix.class.d.ts +3 -0
- package/src/components/navigation/td-affix/td-affix.class.js +22 -20
- package/src/components/navigation/td-anchor/td-anchor-link/td-anchor-link.class.js +1 -1
- package/src/components/navigation/td-anchor/td-anchor.class.js +10 -10
- package/src/components/navigation/td-backtop/td-backtop.class.d.ts +5 -3
- package/src/components/navigation/td-backtop/td-backtop.class.js +41 -32
- package/src/components/navigation/td-backtop/td-backtop.interface.d.ts +3 -0
- package/src/components/navigation/td-backtop/use-backtop.d.ts +7 -0
- package/src/components/navigation/td-backtop/use-backtop.js +44 -0
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +4 -4
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +3 -3
- package/src/components/navigation/td-menu/td-menu.class.js +5 -5
- package/src/components/navigation/td-menu/td-menu.interface.d.ts +2 -1
- package/src/components/navigation/td-tabs/td-tab-bar.class.js +5 -5
- package/src/components/navigation/td-tabs/td-tab-nav.class.js +14 -14
- package/src/components/navigation/td-tabs/td-tab-pane.class.js +3 -3
- package/src/components/navigation/td-tabs/td-tabs.class.js +4 -4
- package/src/components/others/collapsible-box/collapsible-box.js +2 -2
- package/src/components/others/collapsible-box/contents/contents.js +2 -2
- package/src/components/others/collapsible-box/heading/expand-heading.d.ts +1 -1
- package/src/components/others/collapsible-box/heading/expand-heading.js +11 -11
- package/src/components/others/custom-block/custom-block.js +2 -2
- package/src/components/others/example/example-float-control.d.ts +1 -1
- package/src/components/others/example/example-float-control.js +8 -8
- package/src/components/others/example/example-showcase.js +3 -3
- package/src/components/others/example/example-source-wrapper.d.ts +6 -2
- package/src/components/others/example/example-source-wrapper.js +3 -3
- package/src/components/others/example/example.d.ts +1 -2
- package/src/components/others/example/example.js +4 -4
- package/src/components/others/example/op-btns.js +9 -10
- package/src/components/others/menus/menu.d.ts +10 -5
- package/src/components/others/menus/menu.js +35 -33
- package/src/components/others/menus/menus.d.ts +6 -1
- package/src/components/others/menus/menus.js +46 -24
- package/src/components/others/td-divider/td-divider.class.js +8 -8
- package/src/hooks/index.d.ts +3 -0
- package/src/hooks/index.js +6 -0
- package/src/hooks/use-cursor.d.ts +1 -0
- package/src/hooks/use-cursor.js +56 -0
- package/src/hooks/use-escape-keydown.d.ts +4 -0
- package/src/hooks/use-escape-keydown.js +31 -0
- package/src/hooks/use-forward-ref.d.ts +13 -0
- package/src/hooks/use-forward-ref.js +27 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/ui/ui.abstract.d.ts +1 -1
- package/src/ui/ui.abstract.js +2 -2
- package/src/components/feedback/dialog/dialog.class.d.ts +0 -7
- package/src/components/feedback/dialog/dialog.class.js +0 -21
- package/src/components/feedback/dialog/dialog.interface.d.ts +0 -4
- package/src/components/feedback/dialog/dialog.interface.js +0 -2
- package/src/components/feedback/message-box/message-box.d.ts +0 -9
- package/src/components/feedback/message-box/message-box.interface.d.ts +0 -4
- package/src/components/feedback/message-box/message-box.interface.js +0 -2
- package/src/components/feedback/message-box/message-box.js +0 -33
- package/src/components/feedback/overlay/container/body/body.d.ts +0 -7
- package/src/components/feedback/overlay/container/body/body.js +0 -17
- package/src/components/feedback/overlay/container/container.d.ts +0 -15
- package/src/components/feedback/overlay/container/container.js +0 -38
- package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.d.ts +0 -8
- package/src/components/feedback/overlay/container/footer/cancel-button/cancel-button.js +0 -32
- package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.d.ts +0 -9
- package/src/components/feedback/overlay/container/footer/confirm-button/confirm-button.js +0 -32
- package/src/components/feedback/overlay/container/footer/footer.d.ts +0 -10
- package/src/components/feedback/overlay/container/footer/footer.js +0 -47
- package/src/components/feedback/overlay/container/header/close-button/close-button.d.ts +0 -11
- package/src/components/feedback/overlay/container/header/close-button/close-button.js +0 -34
- package/src/components/feedback/overlay/container/header/header.d.ts +0 -12
- package/src/components/feedback/overlay/container/header/header.js +0 -25
- package/src/components/feedback/overlay/container/header/title/title.d.ts +0 -9
- package/src/components/feedback/overlay/container/header/title/title.js +0 -19
- package/src/components/feedback/overlay/overlay.abstract.d.ts +0 -13
- package/src/components/feedback/overlay/overlay.abstract.js +0 -60
|
@@ -11,14 +11,14 @@ class TdEmpty extends ui_abstract_1.UI {
|
|
|
11
11
|
var _a, _b;
|
|
12
12
|
super(params);
|
|
13
13
|
this.className = 'TdEmpty';
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
14
|
+
this.attr.addName('td-empty');
|
|
15
|
+
this.style.addObj(td_empty_style_1.$emptyStyle);
|
|
16
16
|
this.image = new framework_1.Div({
|
|
17
17
|
name: 'image',
|
|
18
18
|
styleObj: td_empty_style_1.$emptyImageStyle
|
|
19
19
|
});
|
|
20
20
|
if (params === null || params === void 0 ? void 0 : params.imageSize) {
|
|
21
|
-
this.image.
|
|
21
|
+
this.image.style.addObj(this.imageStyle);
|
|
22
22
|
}
|
|
23
23
|
this.addChild(this.image);
|
|
24
24
|
if (params === null || params === void 0 ? void 0 : params.image) {
|
|
@@ -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.useParams(params);
|
|
69
69
|
}
|
|
70
70
|
get emptyDescription() {
|
|
71
71
|
return this.props.description || 'No Data'; // || t('el.table.emptyText')
|
|
@@ -8,11 +8,11 @@ class TdImage extends ui_abstract_1.UI {
|
|
|
8
8
|
constructor(params = {}) {
|
|
9
9
|
super(params);
|
|
10
10
|
this.className = 'TdImage';
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
11
|
+
this.attr.addName('td-image');
|
|
12
|
+
this.attr.addObj({
|
|
13
13
|
ref: 'container'
|
|
14
14
|
});
|
|
15
|
-
this.
|
|
15
|
+
this.style.addObj({
|
|
16
16
|
display: 'inline-flex',
|
|
17
17
|
justifyContent: 'center',
|
|
18
18
|
alignItems: 'center',
|
|
@@ -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.useParams(params);
|
|
36
36
|
}
|
|
37
37
|
setup() {
|
|
38
38
|
var _a, _b;
|
|
@@ -73,10 +73,10 @@ class TdImage extends ui_abstract_1.UI {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
const fit = (props === null || props === void 0 ? void 0 : props.fit) || 'cover';
|
|
76
|
-
(_b = this.img) === null || _b === void 0 ? void 0 : _b.
|
|
76
|
+
(_b = this.img) === null || _b === void 0 ? void 0 : _b.style.addObj({
|
|
77
77
|
objectFit: fit
|
|
78
78
|
});
|
|
79
|
-
|
|
79
|
+
this.useParams(props);
|
|
80
80
|
}
|
|
81
81
|
// todo 监听 src 改变
|
|
82
82
|
setSrc(src) {
|
|
@@ -12,8 +12,9 @@ export declare class TdImageViewer extends UI<undefined> implements ITdImageView
|
|
|
12
12
|
loading: boolean;
|
|
13
13
|
private transition;
|
|
14
14
|
private teleport;
|
|
15
|
+
private wrapper;
|
|
15
16
|
constructor(params?: ITdImageViewerConfig);
|
|
16
|
-
get imgStyle(): IStyle<
|
|
17
|
+
get imgStyle(): IStyle<string | 0, string>;
|
|
17
18
|
toggleMode(): void;
|
|
18
19
|
reset(): void;
|
|
19
20
|
handleActions(action: TdImageViewerAction, options?: {}): void;
|
|
@@ -36,15 +36,18 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
this.mode = this.modes.CONTAIN;
|
|
39
|
-
this.
|
|
39
|
+
this.wrapper = new framework_1.Div();
|
|
40
|
+
this.transition = new framework_1.Transition({
|
|
41
|
+
slot: this.wrapper,
|
|
42
|
+
});
|
|
40
43
|
this.teleport = new framework_1.Teleport({
|
|
41
44
|
to: document.body,
|
|
42
45
|
});
|
|
43
46
|
this.teleport.addChild(this.transition);
|
|
44
47
|
// this.mount(document.body);
|
|
45
|
-
// this.
|
|
48
|
+
// this.attr.addName('wrapper');
|
|
46
49
|
// todo transition 如何设置样式 ??? developing ......
|
|
47
|
-
this.
|
|
50
|
+
this.wrapper.style.addObj({
|
|
48
51
|
position: 'fixed',
|
|
49
52
|
top: 0,
|
|
50
53
|
right: 0,
|
|
@@ -52,12 +55,12 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
52
55
|
left: 0,
|
|
53
56
|
zIndex: 2000
|
|
54
57
|
});
|
|
55
|
-
this.
|
|
58
|
+
this.wrapper.addChildren(new framework_1.Div({
|
|
56
59
|
name: 'mask',
|
|
57
60
|
events: {
|
|
58
61
|
click: (evt, element) => {
|
|
59
62
|
//
|
|
60
|
-
element === null || element === void 0 ? void 0 : element.
|
|
63
|
+
element === null || element === void 0 ? void 0 : element.style.hide();
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}),
|
|
@@ -69,7 +72,7 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
69
72
|
top: '40px', right: '40px', width: '40px', height: '40px', fontSize: '40px' }),
|
|
70
73
|
events: {
|
|
71
74
|
click: (evt, element) => {
|
|
72
|
-
element === null || element === void 0 ? void 0 : element.
|
|
75
|
+
element === null || element === void 0 ? void 0 : element.style.hide();
|
|
73
76
|
}
|
|
74
77
|
},
|
|
75
78
|
childNodes: [
|
|
@@ -86,7 +89,7 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
86
89
|
this.isSingle = urlList.length <= 1;
|
|
87
90
|
// <!-- ARROW -->
|
|
88
91
|
if (!this.isSingle) {
|
|
89
|
-
this.
|
|
92
|
+
this.wrapper.addChildren(new framework_1.Span({
|
|
90
93
|
styleObj: Object.assign(Object.assign({}, td_image_viewer_style_1.$btn), td_image_viewer_style_1.$prev),
|
|
91
94
|
events: {
|
|
92
95
|
click: () => {
|
|
@@ -113,7 +116,7 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
113
116
|
}));
|
|
114
117
|
}
|
|
115
118
|
// <!-- ACTIONS -->
|
|
116
|
-
this.
|
|
119
|
+
this.wrapper.addChild(new framework_1.Div({
|
|
117
120
|
styleObj: Object.assign(Object.assign({}, td_image_viewer_style_1.$btn), td_image_viewer_style_1.$actions),
|
|
118
121
|
childNodes: [
|
|
119
122
|
new framework_1.Div({
|
|
@@ -177,10 +180,10 @@ class TdImageViewer extends ui_abstract_1.UI {
|
|
|
177
180
|
styleObj: Object.assign({ display: index === this.activeIndex ? 'block' : 'none' }, this.imgStyle)
|
|
178
181
|
}));
|
|
179
182
|
});
|
|
180
|
-
this.
|
|
183
|
+
this.wrapper.addChild(new framework_1.Div({
|
|
181
184
|
childNodes: imgList
|
|
182
185
|
}));
|
|
183
|
-
this.props = this.
|
|
186
|
+
this.props = this.useParams(params);
|
|
184
187
|
}
|
|
185
188
|
get imgStyle() {
|
|
186
189
|
const { scale, deg, offsetX, offsetY, enableTransition } = this.transform;
|
|
@@ -12,8 +12,8 @@ class TdResult extends ui_abstract_1.UI {
|
|
|
12
12
|
var _a, _b, _c, _d, _e, _f;
|
|
13
13
|
super(params);
|
|
14
14
|
this.className = 'TdResult';
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
15
|
+
this.attr.addName('td-result');
|
|
16
|
+
this.style.addObj({
|
|
17
17
|
display: 'flex',
|
|
18
18
|
justifyContent: 'center',
|
|
19
19
|
alignItems: 'center',
|
|
@@ -72,7 +72,7 @@ class TdResult extends ui_abstract_1.UI {
|
|
|
72
72
|
}));
|
|
73
73
|
// this.getSlotNode('extra').addSlot(params.slots.extra);
|
|
74
74
|
}
|
|
75
|
-
this.props = this.
|
|
75
|
+
this.props = this.useParams(params);
|
|
76
76
|
}
|
|
77
77
|
resultIcon(params) {
|
|
78
78
|
const icon = params === null || params === void 0 ? void 0 : params.icon;
|
|
@@ -10,9 +10,9 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
10
10
|
super(params);
|
|
11
11
|
this.className = 'TdSegmented';
|
|
12
12
|
(0, td_segmented_style_1.useStyle)(params);
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
13
|
+
this.attr.addName('td-segmented');
|
|
14
|
+
this.style.addObj(td_segmented_style_1.$segmentedStyle);
|
|
15
|
+
this.attr.addObj({
|
|
16
16
|
role: 'radiogroup',
|
|
17
17
|
ariaLabel: 'Segmented',
|
|
18
18
|
ariaLabelledby: 'Segmented'
|
|
@@ -62,7 +62,7 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
62
62
|
});
|
|
63
63
|
if (typeof option === 'object' && option.slot) {
|
|
64
64
|
label.addChild(option.slot);
|
|
65
|
-
option.slot.
|
|
65
|
+
option.slot.style.addObj({
|
|
66
66
|
zIndex: 1 // todo ????? 否则显示不出来
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -74,7 +74,7 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
74
74
|
}));
|
|
75
75
|
}
|
|
76
76
|
if (this.getDisabled(option)) {
|
|
77
|
-
label.
|
|
77
|
+
label.style.addObj({
|
|
78
78
|
color: td_segmented_style_1.$segmented.itemDisabledColor,
|
|
79
79
|
cursor: 'not-allowed'
|
|
80
80
|
});
|
|
@@ -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.useParams(params);
|
|
86
86
|
}
|
|
87
87
|
mounted() {
|
|
88
88
|
console.log('TdSegmented created');
|
|
@@ -104,17 +104,16 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
104
104
|
}
|
|
105
105
|
getOption(value) {
|
|
106
106
|
var _a;
|
|
107
|
-
return (_a = this.props.options) === null || _a === void 0 ? void 0 : _a.find((item) => this.getValue(item) === value);
|
|
107
|
+
return this.props.options && ((_a = this.props.options) === null || _a === void 0 ? void 0 : _a.find((item) => this.getValue(item) === value));
|
|
108
108
|
}
|
|
109
109
|
updateSelect() {
|
|
110
110
|
console.log('updateSelect');
|
|
111
111
|
const labels = this.group.findChildNodes('Label');
|
|
112
112
|
labels.forEach((label, index) => {
|
|
113
|
-
var _a, _b, _c;
|
|
114
113
|
const input = label.findChildNode('Input');
|
|
115
|
-
if ((
|
|
114
|
+
if ((input === null || input === void 0 ? void 0 : input.attr.get('value')) === this.modelValue) {
|
|
116
115
|
const rect = label.dom.getBoundingClientRect();
|
|
117
|
-
label.
|
|
116
|
+
label.style.setObj({
|
|
118
117
|
color: td_segmented_style_1.$segmented.itemSelectedColor
|
|
119
118
|
});
|
|
120
119
|
this.state.isInit = true;
|
|
@@ -123,18 +122,17 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
123
122
|
this.state.disabled = this.getDisabled(this.getOption(this.modelValue));
|
|
124
123
|
}
|
|
125
124
|
else {
|
|
126
|
-
|
|
127
|
-
(_c = input === null || input === void 0 ? void 0 : input.props.attrObj) === null || _c === void 0 ? true : delete _c.checked;
|
|
125
|
+
input === null || input === void 0 ? void 0 : input.attr.remove('checked');
|
|
128
126
|
const options = this.props.options || [];
|
|
129
127
|
if (options[index]) {
|
|
130
128
|
const disabled = this.getDisabled(options[index]);
|
|
131
129
|
if (disabled) {
|
|
132
|
-
label.
|
|
130
|
+
label.style.setObj({
|
|
133
131
|
color: td_segmented_style_1.$segmented.itemDisabledColor,
|
|
134
132
|
});
|
|
135
133
|
}
|
|
136
134
|
else {
|
|
137
|
-
label.
|
|
135
|
+
label.style.setObj({
|
|
138
136
|
color: undefined // remove color
|
|
139
137
|
});
|
|
140
138
|
}
|
|
@@ -146,7 +144,7 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
146
144
|
transform: `translateX(${this.state.translateX}px)`,
|
|
147
145
|
display: this.state.isInit ? 'block' : 'none'
|
|
148
146
|
};
|
|
149
|
-
this.selectedDiv.
|
|
147
|
+
this.selectedDiv.style.setObj(this.selectedStyle);
|
|
150
148
|
}
|
|
151
149
|
handleChange(item, element) {
|
|
152
150
|
const value = this.getValue(item);
|
|
@@ -154,8 +152,7 @@ class TdSegmented extends ui_abstract_1.UI {
|
|
|
154
152
|
this.emit(event_1.CHANGE_EVENT, value);
|
|
155
153
|
console.log('handleChange ', item);
|
|
156
154
|
this.modelValue = this.getValue(item);
|
|
157
|
-
|
|
158
|
-
element.ctrl.addAttribute('checked', true);
|
|
155
|
+
element.attr.add('checked', true);
|
|
159
156
|
this.updateSelect();
|
|
160
157
|
// const value = this.getValue(item);
|
|
161
158
|
// const update = this.props.emits?.[UPDATE_MODEL_EVENT];
|
|
@@ -43,7 +43,7 @@ class TdStatisticAbstract extends ui_abstract_1.UI {
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
if (params === null || params === void 0 ? void 0 : params.valueStyle) {
|
|
46
|
-
this.content.
|
|
46
|
+
this.content.style.addObj(params.valueStyle);
|
|
47
47
|
}
|
|
48
48
|
this.addChild(this.content);
|
|
49
49
|
if (params === null || params === void 0 ? void 0 : params.prefix) {
|
|
@@ -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.useParams(params);
|
|
95
95
|
}
|
|
96
96
|
formatValue(value) {
|
|
97
97
|
const { formatter, precision, decimalSeparator, groupSeparator } = this.props;
|
|
@@ -11,7 +11,7 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
11
11
|
constructor(params = {}) {
|
|
12
12
|
super(params, 'span');
|
|
13
13
|
this.className = 'TdTag';
|
|
14
|
-
this.
|
|
14
|
+
this.attr.addName('td-tag');
|
|
15
15
|
(0, td_tag_style_1.useType)();
|
|
16
16
|
const type = (params === null || params === void 0 ? void 0 : params.type) || 'primary';
|
|
17
17
|
const effect = (params === null || params === void 0 ? void 0 : params.effect) || 'light'; // 默认;
|
|
@@ -29,7 +29,7 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
29
29
|
console.log('genThem . then $tag is ', td_tag_style_1.$tag);
|
|
30
30
|
console.log('$tagTypes is ', td_tag_style_1.$tagTypes);
|
|
31
31
|
}
|
|
32
|
-
this.
|
|
32
|
+
this.style.addObj({
|
|
33
33
|
// background-color: getCssVar('tag-bg-color'),
|
|
34
34
|
backgroundColor: td_tag_style_1.$tagTypes[type].bgColor,
|
|
35
35
|
// border-color: getCssVar('tag-border-color'),
|
|
@@ -69,25 +69,25 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
69
69
|
}
|
|
70
70
|
// style样式应该在 style类中处理, useConfig useType useSize ....
|
|
71
71
|
if (params === null || params === void 0 ? void 0 : params.hit) {
|
|
72
|
-
this.
|
|
72
|
+
this.style.addObj({
|
|
73
73
|
borderColor: var_1.$colorPrimary
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
if (params === null || params === void 0 ? void 0 : params.round) {
|
|
77
|
-
this.
|
|
77
|
+
this.style.addObj({
|
|
78
78
|
borderRadius: td_tag_style_1.$tag.borderRadiusRounded
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
const size = (params === null || params === void 0 ? void 0 : params.size) || 'default';
|
|
82
|
-
this.
|
|
82
|
+
this.style.addObj(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.useParams(params);
|
|
89
89
|
if (params === null || params === void 0 ? void 0 : params.closable) {
|
|
90
|
-
this.
|
|
90
|
+
this.style.addObj({
|
|
91
91
|
paddingRight: parseFloat(td_tag_style_1.$tagIconSpanGap.default) - parseFloat(var_1.$borderWidth) + 'px'
|
|
92
92
|
});
|
|
93
93
|
this.closeIcon = new td_icon_class_1.TdIcon({
|
|
@@ -110,7 +110,7 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
110
110
|
mouseenter: (evt, element) => {
|
|
111
111
|
// console.log('mouseenter . ');
|
|
112
112
|
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
113
|
-
element === null || element === void 0 ? void 0 : element.
|
|
113
|
+
element === null || element === void 0 ? void 0 : element.style.setObj({
|
|
114
114
|
backgroundColor: td_tag_style_1.$tagTypes[type].hoverColor,
|
|
115
115
|
color: var_1.$colorWhite
|
|
116
116
|
});
|
|
@@ -118,7 +118,7 @@ class TdTag extends ui_abstract_1.UI {
|
|
|
118
118
|
mouseleave: (evt, element) => {
|
|
119
119
|
// console.log('mouseleave . ');
|
|
120
120
|
evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
|
|
121
|
-
element === null || element === void 0 ? void 0 : element.
|
|
121
|
+
element === null || element === void 0 ? void 0 : element.style.setObj({
|
|
122
122
|
backgroundColor: td_tag_style_1.$tagTypes[type].bgColor,
|
|
123
123
|
color: td_tag_style_1.$tagTypes[type].textColor
|
|
124
124
|
});
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { Dialog } from './dialog/dialog.class';
|
|
2
|
-
export { MessageBox } from './message-box/message-box';
|
|
3
1
|
export { TdAlert } from './td-alert/td-alert.class';
|
|
4
2
|
export type * from './td-alert/td-alert.interface';
|
|
5
3
|
export { TdDialog } from './td-dialog/td-dialog.class';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// export { Dialog } from './dialog/dialog.class';
|
|
3
|
+
// export { MessageBox } from './message-box/message-box';
|
|
2
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TdNotification = exports.TdMessageBox = exports.TdMessage = exports.TdDialog = exports.TdAlert =
|
|
5
|
+
exports.TdNotification = exports.TdMessageBox = exports.TdMessage = exports.TdDialog = exports.TdAlert = void 0;
|
|
4
6
|
const tslib_1 = require("tslib");
|
|
5
|
-
var dialog_class_1 = require("./dialog/dialog.class");
|
|
6
|
-
Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return dialog_class_1.Dialog; } });
|
|
7
|
-
var message_box_1 = require("./message-box/message-box");
|
|
8
|
-
Object.defineProperty(exports, "MessageBox", { enumerable: true, get: function () { return message_box_1.MessageBox; } });
|
|
9
7
|
var td_alert_class_1 = require("./td-alert/td-alert.class");
|
|
10
8
|
Object.defineProperty(exports, "TdAlert", { enumerable: true, get: function () { return td_alert_class_1.TdAlert; } });
|
|
11
9
|
var td_dialog_class_1 = require("./td-dialog/td-dialog.class");
|
|
@@ -10,10 +10,6 @@ class TdAlert extends ui_abstract_1.UI {
|
|
|
10
10
|
constructor(params = {}) {
|
|
11
11
|
super(params, 'fragment');
|
|
12
12
|
this.className = 'TdAlert';
|
|
13
|
-
this.transition = new framework_1.Transition({
|
|
14
|
-
name: 'td-alert-fade'
|
|
15
|
-
});
|
|
16
|
-
this.addChild(this.transition);
|
|
17
13
|
(0, td_alert_style_1.useStyle)(params);
|
|
18
14
|
this.alertDiv = new framework_1.Div({
|
|
19
15
|
attrObj: {
|
|
@@ -22,9 +18,13 @@ class TdAlert extends ui_abstract_1.UI {
|
|
|
22
18
|
styleObj: td_alert_style_1.$alertStyle,
|
|
23
19
|
});
|
|
24
20
|
if (params === null || params === void 0 ? void 0 : params.styleObj) {
|
|
25
|
-
this.alertDiv.
|
|
21
|
+
this.alertDiv.style.addObj(params.styleObj);
|
|
26
22
|
}
|
|
27
|
-
this.transition.
|
|
23
|
+
this.transition = new framework_1.Transition({
|
|
24
|
+
name: 'td-alert-fade',
|
|
25
|
+
slot: this.alertDiv,
|
|
26
|
+
});
|
|
27
|
+
this.addChild(this.transition);
|
|
28
28
|
const IconComponent = svgs_1.TypeComponentsMap[(params === null || params === void 0 ? void 0 : params.type) || 'info'];
|
|
29
29
|
if ((params === null || params === void 0 ? void 0 : params.showIcon) && IconComponent) {
|
|
30
30
|
this.alertDiv.addChild(new td_icon_class_1.TdIcon({
|
|
@@ -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.useParams(params);
|
|
43
43
|
}
|
|
44
44
|
addTitle(params) {
|
|
45
45
|
var _a, _b;
|
|
@@ -85,7 +85,7 @@ class TdAlert extends ui_abstract_1.UI {
|
|
|
85
85
|
if ((_a = params.emits) === null || _a === void 0 ? void 0 : _a.close) {
|
|
86
86
|
params.emits.close();
|
|
87
87
|
}
|
|
88
|
-
this.alertDiv.
|
|
88
|
+
this.alertDiv.style.hide();
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
@@ -100,7 +100,7 @@ class TdAlert extends ui_abstract_1.UI {
|
|
|
100
100
|
if ((_a = params === null || params === void 0 ? void 0 : params.emits) === null || _a === void 0 ? void 0 : _a.close) {
|
|
101
101
|
params.emits.close();
|
|
102
102
|
}
|
|
103
|
-
this.alertDiv.
|
|
103
|
+
this.alertDiv.style.hide();
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}));
|
|
@@ -21,7 +21,7 @@ class TdDialog extends ui_abstract_1.UI {
|
|
|
21
21
|
slot: this.dialogContent,
|
|
22
22
|
});
|
|
23
23
|
if (params === null || params === void 0 ? void 0 : params.appendToBody) {
|
|
24
|
-
this.overlay.
|
|
24
|
+
this.overlay.style.addObj({
|
|
25
25
|
zIndex: td_overlay_class_1.overlayZIndex + 1000,
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -45,19 +45,19 @@ class TdDialog extends ui_abstract_1.UI {
|
|
|
45
45
|
this.beforeLeave();
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
slot: this.overlay,
|
|
49
49
|
}),
|
|
50
50
|
]
|
|
51
51
|
});
|
|
52
52
|
this.addChild(this.teleport);
|
|
53
|
-
this.props = this.
|
|
53
|
+
this.props = this.useParams(params);
|
|
54
54
|
}
|
|
55
55
|
show() {
|
|
56
56
|
console.log('TdDialog . show . ');
|
|
57
|
-
this.overlay.
|
|
57
|
+
this.overlay.style.show();
|
|
58
58
|
}
|
|
59
59
|
handleClose() {
|
|
60
|
-
this.overlay.
|
|
60
|
+
this.overlay.style.hide();
|
|
61
61
|
// function hide(shouldCancel?: boolean) {
|
|
62
62
|
// if (shouldCancel) return
|
|
63
63
|
// // closed.value = true
|
|
@@ -11,13 +11,13 @@ class TdDialogContent extends ui_abstract_1.UI {
|
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
super(params);
|
|
13
13
|
this.className = 'TdDialogContent';
|
|
14
|
-
this.
|
|
14
|
+
this.style.addObj(td_dialog_style_1.$dialogStyle);
|
|
15
15
|
this.header = new framework_1.Header({
|
|
16
16
|
className: 'td-dialog-content',
|
|
17
17
|
styleObj: td_dialog_style_1.$dialogHeaderStyle,
|
|
18
18
|
});
|
|
19
19
|
if (params === null || params === void 0 ? void 0 : params.width) {
|
|
20
|
-
this.
|
|
20
|
+
this.style.addObj({
|
|
21
21
|
width: params.width,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
@@ -40,7 +40,7 @@ class TdDialogContent extends ui_abstract_1.UI {
|
|
|
40
40
|
svgObj: new svgs_1.ElCloseSvg(),
|
|
41
41
|
});
|
|
42
42
|
if (showClose) {
|
|
43
|
-
this.header.
|
|
43
|
+
this.header.style.addObj(td_dialog_style_1.$dialogHeaderCloseStyle);
|
|
44
44
|
this.header.addChild(new framework_1.Button({
|
|
45
45
|
className: 'td-dialog-close',
|
|
46
46
|
attrObj: {
|
|
@@ -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.useParams(params);
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
exports.TdDialogContent = TdDialogContent;
|
|
@@ -21,21 +21,19 @@ class TdDrawer extends ui_abstract_1.UI {
|
|
|
21
21
|
console.log('beforeEnter');
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
console.log('click . ');
|
|
32
|
-
}
|
|
24
|
+
slot: new td_overlay_class_1.TdOverlay({
|
|
25
|
+
mask: params === null || params === void 0 ? void 0 : params.modal,
|
|
26
|
+
zIndex: 1000, // todo zIndex
|
|
27
|
+
events: {
|
|
28
|
+
click: () => {
|
|
29
|
+
//
|
|
30
|
+
console.log('click . ');
|
|
33
31
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
32
|
+
}
|
|
33
|
+
})
|
|
36
34
|
});
|
|
37
35
|
this.addChild(this.transition);
|
|
38
|
-
this.props = this.
|
|
36
|
+
this.props = this.useParams(params);
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
exports.TdDrawer = TdDrawer;
|
|
@@ -4,6 +4,24 @@ export declare class TdFocusTrap extends UI<undefined> implements ITdFocusTrap {
|
|
|
4
4
|
className: 'TdFocusTrap';
|
|
5
5
|
props: ITdFocusTrapConfig;
|
|
6
6
|
inheritAttrs: boolean;
|
|
7
|
+
forwardRef?: HTMLElement;
|
|
8
|
+
lastFocusBeforeTrapped?: HTMLElement;
|
|
9
|
+
lastFocusAfterTrapped?: HTMLElement;
|
|
10
|
+
handelKeydown?: (e: KeyboardEvent) => void;
|
|
11
|
+
private escapeKeydown?;
|
|
12
|
+
private focusLayer?;
|
|
13
|
+
private focusReason?;
|
|
7
14
|
constructor(params?: ITdFocusTrapConfig);
|
|
8
|
-
|
|
15
|
+
setup(): void;
|
|
16
|
+
mounted(): void;
|
|
17
|
+
beforeDestroy(): void;
|
|
18
|
+
onKeydown(e: KeyboardEvent): void;
|
|
19
|
+
setFocusTrapEl(el: HTMLElement): void;
|
|
20
|
+
setForwardRef(newEl: HTMLElement, oldEl: HTMLElement): void;
|
|
21
|
+
trapOnFocus(e: Event): void;
|
|
22
|
+
releaseOnFocus(e: Event): void;
|
|
23
|
+
onFocusIn(e: FocusEvent): void;
|
|
24
|
+
onFocusOut(e: Event): void;
|
|
25
|
+
startTrap(): Promise<void>;
|
|
26
|
+
stopTrap(): void;
|
|
9
27
|
}
|