@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
package/package.json
CHANGED
package/src/aria.d.ts
CHANGED
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { IUIConfig } from './ui/ui.interface';
|
|
2
|
-
export declare const EVENT_CODE: {
|
|
3
|
-
tab: string;
|
|
4
|
-
enter: string;
|
|
5
|
-
space: string;
|
|
6
|
-
left: string;
|
|
7
|
-
up: string;
|
|
8
|
-
right: string;
|
|
9
|
-
down: string;
|
|
10
|
-
esc: string;
|
|
11
|
-
delete: string;
|
|
12
|
-
backspace: string;
|
|
13
|
-
numpadEnter: string;
|
|
14
|
-
pageUp: string;
|
|
15
|
-
pageDown: string;
|
|
16
|
-
home: string;
|
|
17
|
-
end: string;
|
|
18
|
-
};
|
|
19
2
|
export interface IAriaConfig extends IUIConfig {
|
|
20
3
|
/**
|
|
21
4
|
* @description native `aria-label` attribute
|
package/src/aria.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EVENT_CODE = void 0;
|
|
4
|
-
exports.EVENT_CODE = {
|
|
5
|
-
tab: 'Tab',
|
|
6
|
-
enter: 'Enter',
|
|
7
|
-
space: 'Space',
|
|
8
|
-
left: 'ArrowLeft', // 37
|
|
9
|
-
up: 'ArrowUp', // 38
|
|
10
|
-
right: 'ArrowRight', // 39
|
|
11
|
-
down: 'ArrowDown', // 40
|
|
12
|
-
esc: 'Escape',
|
|
13
|
-
delete: 'Delete',
|
|
14
|
-
backspace: 'Backspace',
|
|
15
|
-
numpadEnter: 'NumpadEnter',
|
|
16
|
-
pageUp: 'PageUp',
|
|
17
|
-
pageDown: 'PageDown',
|
|
18
|
-
home: 'Home',
|
|
19
|
-
end: 'End',
|
|
20
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Span, TextNode } from '@type-dom/framework';
|
|
1
|
+
import { SlotNode, Span, TextNode } from '@type-dom/framework';
|
|
2
2
|
import { UI } from '../../../ui/ui.abstract';
|
|
3
3
|
import { TdIcon } from '../td-icon/td-icon.class';
|
|
4
4
|
import { ITdButtonAbstract, ITdButtonConfig } from './td-button.interface';
|
|
@@ -11,9 +11,8 @@ export declare abstract class TdButtonAbstract extends UI implements ITdButtonAb
|
|
|
11
11
|
private type?;
|
|
12
12
|
private plain?;
|
|
13
13
|
private disabled?;
|
|
14
|
-
|
|
14
|
+
icon?: TdIcon | SlotNode;
|
|
15
15
|
protected constructor(params?: ITdButtonConfig);
|
|
16
16
|
setup(): void;
|
|
17
|
-
initEvents(): void;
|
|
18
17
|
useType(params?: ITdButtonConfig): void;
|
|
19
18
|
}
|
|
@@ -6,18 +6,19 @@ const svgs_1 = require("@type-dom/svgs");
|
|
|
6
6
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
7
|
const var_1 = require("../../../styles/var");
|
|
8
8
|
const td_input_style_1 = require("../../form/td-input/td-input.style");
|
|
9
|
+
// import { $iconLeft, $iconLoading, $iconRight } from '../td-icon/td-icon.style';
|
|
9
10
|
const td_icon_class_1 = require("../td-icon/td-icon.class");
|
|
10
11
|
const td_button_style_1 = require("./td-button.style");
|
|
11
12
|
// import '../../styles/style.css';
|
|
12
13
|
class TdButtonAbstract extends ui_abstract_1.UI {
|
|
13
14
|
constructor(params = {}) {
|
|
14
15
|
super(params, params.tag || 'button');
|
|
15
|
-
this.
|
|
16
|
+
this.attr.addObj({
|
|
16
17
|
type: 'button' // 默认
|
|
17
18
|
});
|
|
18
|
-
this.
|
|
19
|
+
this.style.addObj(td_button_style_1.$tdButtonBase);
|
|
19
20
|
this.childNodes = [];
|
|
20
|
-
this.props = this.
|
|
21
|
+
this.props = this.useParams(params); // 这里的config赋值是要替换掉上面的config的预置值的。
|
|
21
22
|
}
|
|
22
23
|
setup() {
|
|
23
24
|
var _a, _b, _c;
|
|
@@ -57,7 +58,7 @@ class TdButtonAbstract extends ui_abstract_1.UI {
|
|
|
57
58
|
// this.useIcon(props);
|
|
58
59
|
if (props === null || props === void 0 ? void 0 : props.slot) {
|
|
59
60
|
// this.defaultSlot = new SlotNode('default', props.slot);
|
|
60
|
-
// this.icon?.
|
|
61
|
+
// this.icon?.style.addObj($iconLeft);
|
|
61
62
|
// todo 会运行 2 次;
|
|
62
63
|
const span = new framework_1.Span({
|
|
63
64
|
name: 'text-expand',
|
|
@@ -75,39 +76,42 @@ class TdButtonAbstract extends ui_abstract_1.UI {
|
|
|
75
76
|
this.useType(props);
|
|
76
77
|
if (props === null || props === void 0 ? void 0 : props.disabled) {
|
|
77
78
|
this.disabled = props.disabled;
|
|
78
|
-
this.
|
|
79
|
+
this.style.addObj({
|
|
80
|
+
// color: $button.disabled.textColor,
|
|
81
|
+
// backgroundColor: $button.disabled.bgColor,
|
|
82
|
+
// borderColor: $button.disabled.borderColor,
|
|
83
|
+
});
|
|
79
84
|
}
|
|
80
85
|
const size = (props === null || props === void 0 ? void 0 : props.size) ? props.size : 'default';
|
|
81
|
-
this.
|
|
86
|
+
this.style.addObj(td_button_style_1.$sizeOpts[size]);
|
|
82
87
|
if (props === null || props === void 0 ? void 0 : props.round) {
|
|
83
|
-
this.
|
|
88
|
+
this.style.addObj({
|
|
84
89
|
borderRadius: var_1.$borderRadius.round
|
|
85
90
|
});
|
|
86
91
|
}
|
|
87
92
|
else if (props === null || props === void 0 ? void 0 : props.circle) {
|
|
88
|
-
this.
|
|
93
|
+
this.style.addObj({
|
|
89
94
|
width: td_input_style_1.$inputHeight[props.size || 'default'], // map.get($input-height, 'default');
|
|
90
95
|
borderRadius: var_1.$borderRadius.circle,
|
|
91
96
|
padding: var_1.$paddingVerticalMap.default
|
|
92
97
|
});
|
|
93
98
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
initEvents() {
|
|
99
|
+
// 悬浮、聚焦、激活状态样式
|
|
100
|
+
// console.log('then td-button add events . ');
|
|
97
101
|
this.addEvents({
|
|
98
|
-
|
|
99
|
-
// console.log('td-button
|
|
102
|
+
mouseenter: (evt) => {
|
|
103
|
+
// console.log('td-button mouseenter . ');
|
|
100
104
|
if (this.disabled) {
|
|
101
|
-
this.
|
|
102
|
-
cursor: '
|
|
105
|
+
this.style.setObj({
|
|
106
|
+
cursor: 'not-allowed'
|
|
103
107
|
});
|
|
104
108
|
}
|
|
105
109
|
else {
|
|
106
110
|
if (this.type) {
|
|
107
|
-
this.
|
|
111
|
+
this.style.setObj(td_button_style_1.$buttonStateColors[this.type].hover);
|
|
108
112
|
}
|
|
109
113
|
else {
|
|
110
|
-
this.
|
|
114
|
+
this.style.setObj({
|
|
111
115
|
color: var_1.$button.hover.textColor,
|
|
112
116
|
backgroundColor: var_1.$button.hover.borderColor, // $colors['primary']['light-3'],
|
|
113
117
|
borderColor: var_1.$button.hover.borderColor
|
|
@@ -115,24 +119,24 @@ class TdButtonAbstract extends ui_abstract_1.UI {
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
},
|
|
118
|
-
|
|
122
|
+
mouseleave: () => {
|
|
119
123
|
// console.log('td-button mouseout . ');
|
|
120
124
|
if (this.disabled) {
|
|
121
|
-
this.
|
|
125
|
+
this.style.setObj({
|
|
122
126
|
cursor: 'auto'
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
129
|
else {
|
|
126
130
|
if (this.type) {
|
|
127
131
|
if (this.plain) {
|
|
128
|
-
this.
|
|
132
|
+
this.style.setObj(td_button_style_1.$buttonPlainColors[this.type].default);
|
|
129
133
|
}
|
|
130
134
|
else {
|
|
131
|
-
this.
|
|
135
|
+
this.style.setObj(td_button_style_1.$buttonStateColors[this.type].default);
|
|
132
136
|
}
|
|
133
137
|
}
|
|
134
138
|
else {
|
|
135
|
-
this.
|
|
139
|
+
this.style.setObj({
|
|
136
140
|
color: var_1.$button.textColor,
|
|
137
141
|
backgroundColor: var_1.$button.bgColor,
|
|
138
142
|
borderColor: var_1.$button.borderColor
|
|
@@ -152,21 +156,21 @@ class TdButtonAbstract extends ui_abstract_1.UI {
|
|
|
152
156
|
this.plain = params.plain;
|
|
153
157
|
if (params.disabled) {
|
|
154
158
|
this.disabled = params.disabled;
|
|
155
|
-
this.
|
|
159
|
+
this.style.addObj(td_button_style_1.$buttonPlainColors[params.type].disabled);
|
|
156
160
|
}
|
|
157
161
|
else {
|
|
158
162
|
console.log(td_button_style_1.$buttonPlainColors[params.type].default);
|
|
159
|
-
this.
|
|
163
|
+
this.style.addObj(td_button_style_1.$buttonPlainColors[params.type].default);
|
|
160
164
|
}
|
|
161
165
|
}
|
|
162
166
|
else {
|
|
163
167
|
if (params === null || params === void 0 ? void 0 : params.disabled) {
|
|
164
168
|
console.log('params?.disabled is true . $button.disabled is ', var_1.$button.disabled);
|
|
165
169
|
this.disabled = params.disabled;
|
|
166
|
-
this.
|
|
170
|
+
this.style.addObj(td_button_style_1.$buttonStateColors[params.type].disabled);
|
|
167
171
|
}
|
|
168
172
|
else {
|
|
169
|
-
this.
|
|
173
|
+
this.style.addObj(td_button_style_1.$buttonStateColors[params.type].default);
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { UI } from '../../../ui/ui.abstract';
|
|
2
|
-
import { ITdButtonGroup, ITdButtonGroupConfig } from './td-button-group.interface';
|
|
3
2
|
import { TdButton } from '../td-button/td-button.class';
|
|
3
|
+
import { ITdButtonGroup, ITdButtonGroupConfig } from './td-button-group.interface';
|
|
4
4
|
export declare class TdButtonGroup extends UI implements ITdButtonGroup {
|
|
5
5
|
className: 'TdButtonGroup';
|
|
6
6
|
constructor(params: ITdButtonGroupConfig);
|
|
7
|
-
|
|
8
|
-
mounted(): void;
|
|
7
|
+
setup(): void;
|
|
9
8
|
addBtnStyle(btn: TdButton, index: number): void;
|
|
10
9
|
setBtnStyle(btn: TdButton, index: number): void;
|
|
11
10
|
}
|
|
@@ -8,16 +8,16 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
8
8
|
constructor(params) {
|
|
9
9
|
super(params);
|
|
10
10
|
this.className = 'TdButtonGroup';
|
|
11
|
-
this.
|
|
11
|
+
this.style.addObj({
|
|
12
12
|
display: 'inline-block',
|
|
13
13
|
verticalAlign: 'middle'
|
|
14
14
|
});
|
|
15
15
|
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
16
|
-
this.slotChild(params
|
|
16
|
+
this.slotChild(params.slot);
|
|
17
17
|
}
|
|
18
|
-
this.
|
|
18
|
+
this.useParams(params);
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
setup() {
|
|
21
21
|
this.children.forEach((btn, index) => {
|
|
22
22
|
if (btn instanceof td_button_class_1.TdButton) {
|
|
23
23
|
if (this.children.length > 1) {
|
|
@@ -25,21 +25,19 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
}
|
|
29
|
-
mounted() {
|
|
30
28
|
this.children.forEach((btn, index) => {
|
|
31
29
|
if (btn instanceof td_button_class_1.TdButton) {
|
|
32
30
|
btn.addEvents({
|
|
33
|
-
|
|
34
|
-
btn.
|
|
31
|
+
mouseenter: () => {
|
|
32
|
+
btn.style.setObj({
|
|
35
33
|
zIndex: 1
|
|
36
34
|
});
|
|
37
35
|
if (this.children.length > 1) {
|
|
38
36
|
this.setBtnStyle(btn, index);
|
|
39
37
|
}
|
|
40
38
|
},
|
|
41
|
-
|
|
42
|
-
btn.
|
|
39
|
+
mouseleave: () => {
|
|
40
|
+
btn.style.setObj({
|
|
43
41
|
zIndex: 1
|
|
44
42
|
});
|
|
45
43
|
if (this.children.length > 1) {
|
|
@@ -52,7 +50,7 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
52
50
|
}
|
|
53
51
|
addBtnStyle(btn, index) {
|
|
54
52
|
if (index === 0) {
|
|
55
|
-
btn.
|
|
53
|
+
btn.style.addObj({
|
|
56
54
|
borderTopRightRadius: 0,
|
|
57
55
|
borderBottomRightRadius: 0,
|
|
58
56
|
marginRight: '-1px',
|
|
@@ -60,14 +58,14 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
60
|
else if (index === this.children.length - 1) {
|
|
63
|
-
btn.
|
|
61
|
+
btn.style.addObj({
|
|
64
62
|
borderTopLeftRadius: 0,
|
|
65
63
|
borderBottomLeftRadius: 0,
|
|
66
64
|
borderLeftColor: td_button_style_1.$borderRightColor
|
|
67
65
|
});
|
|
68
66
|
}
|
|
69
67
|
else {
|
|
70
|
-
btn.
|
|
68
|
+
btn.style.addObj({
|
|
71
69
|
borderTopRightRadius: 0,
|
|
72
70
|
borderTopLeftRadius: 0,
|
|
73
71
|
borderBottomRightRadius: 0,
|
|
@@ -79,7 +77,7 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
79
77
|
}
|
|
80
78
|
setBtnStyle(btn, index) {
|
|
81
79
|
if (index === 0) {
|
|
82
|
-
btn.
|
|
80
|
+
btn.style.setObj({
|
|
83
81
|
borderTopRightRadius: 0,
|
|
84
82
|
borderBottomRightRadius: 0,
|
|
85
83
|
marginRight: '-1px',
|
|
@@ -87,14 +85,14 @@ class TdButtonGroup extends ui_abstract_1.UI {
|
|
|
87
85
|
});
|
|
88
86
|
}
|
|
89
87
|
else if (index === this.children.length - 1) {
|
|
90
|
-
btn.
|
|
88
|
+
btn.style.setObj({
|
|
91
89
|
borderTopLeftRadius: 0,
|
|
92
90
|
borderBottomLeftRadius: 0,
|
|
93
91
|
borderLeftColor: td_button_style_1.$borderRightColor
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
else {
|
|
97
|
-
btn.
|
|
95
|
+
btn.style.setObj({
|
|
98
96
|
borderTopRightRadius: 0,
|
|
99
97
|
borderTopLeftRadius: 0,
|
|
100
98
|
borderBottomRightRadius: 0,
|
|
@@ -7,14 +7,14 @@ class TdAside extends ui_abstract_1.UI {
|
|
|
7
7
|
constructor(params = {}) {
|
|
8
8
|
super(params);
|
|
9
9
|
this.className = 'TdAside';
|
|
10
|
-
this.
|
|
10
|
+
this.style.addObj({
|
|
11
11
|
overflow: 'auto',
|
|
12
12
|
boxSizing: 'border-box',
|
|
13
13
|
flexShrink: 0,
|
|
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.
|
|
17
|
+
this.props = this.useParams(params);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.TdAside = TdAside;
|
|
@@ -6,9 +6,9 @@ class TdContainer extends ui_abstract_1.UI {
|
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
super(params, 'section');
|
|
8
8
|
this.className = 'TdContainer';
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
9
|
+
this.attr.addName('td-container');
|
|
10
|
+
this.attr.addClass('td-container');
|
|
11
|
+
this.style.addObj({
|
|
12
12
|
display: 'flex',
|
|
13
13
|
flexDirection: 'row', // vertical ===> column
|
|
14
14
|
flex: 1,
|
|
@@ -18,12 +18,12 @@ class TdContainer extends ui_abstract_1.UI {
|
|
|
18
18
|
});
|
|
19
19
|
this.childNodes = [];
|
|
20
20
|
if (params === null || params === void 0 ? void 0 : params.vertical) {
|
|
21
|
-
this.
|
|
21
|
+
this.style.addObj({
|
|
22
22
|
flexDirection: 'column'
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
this.addChild(this.getSlotNode());
|
|
26
|
-
this.props = this.
|
|
26
|
+
this.props = this.useParams(params);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.TdContainer = TdContainer;
|
|
@@ -11,7 +11,7 @@ class TdContainerComp extends HTMLElement {
|
|
|
11
11
|
// 省去了监听document加载完毕
|
|
12
12
|
const title = 'td-container';
|
|
13
13
|
const container = new td_container_class_1.TdContainer();
|
|
14
|
-
container.
|
|
14
|
+
container.attr.setName(title);
|
|
15
15
|
// 渲染
|
|
16
16
|
container.mount();
|
|
17
17
|
console.log('container is ', container);
|
|
@@ -6,7 +6,7 @@ class TdFooter extends ui_abstract_1.UI {
|
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
super(params, 'footer');
|
|
8
8
|
this.className = 'TdFooter';
|
|
9
|
-
this.
|
|
9
|
+
this.style.addObj({
|
|
10
10
|
padding: '0 20px',
|
|
11
11
|
height: (params === null || params === void 0 ? void 0 : params.height) || '60px',
|
|
12
12
|
boxSizing: 'border-box',
|
|
@@ -16,7 +16,7 @@ class TdFooter extends ui_abstract_1.UI {
|
|
|
16
16
|
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
17
17
|
this.slotChild(params.slot);
|
|
18
18
|
}
|
|
19
|
-
this.props = this.
|
|
19
|
+
this.props = this.useParams(params);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.TdFooter = TdFooter;
|
|
@@ -6,8 +6,8 @@ class TdHeader extends ui_abstract_1.UI {
|
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
super(params, 'header');
|
|
8
8
|
this.className = 'TdHeader';
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
9
|
+
this.attr.addName('td-header');
|
|
10
|
+
this.style.addObj({
|
|
11
11
|
display: 'flex',
|
|
12
12
|
alignItems: 'center',
|
|
13
13
|
padding: '0 20px',
|
|
@@ -19,7 +19,7 @@ class TdHeader extends ui_abstract_1.UI {
|
|
|
19
19
|
if (params === null || params === void 0 ? void 0 : params.slot) {
|
|
20
20
|
this.slotChild(params.slot);
|
|
21
21
|
}
|
|
22
|
-
this.props = this.
|
|
22
|
+
this.props = this.useParams(params);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.TdHeader = TdHeader;
|
|
@@ -6,7 +6,7 @@ class TdMain extends ui_abstract_1.UI {
|
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
super(params, (params === null || params === void 0 ? void 0 : params.tag) || 'main');
|
|
8
8
|
this.className = 'TdMain';
|
|
9
|
-
this.
|
|
9
|
+
this.style.addObj({
|
|
10
10
|
display: 'block',
|
|
11
11
|
flex: 1,
|
|
12
12
|
flexBasis: 'auto',
|
|
@@ -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.
|
|
19
|
+
this.props = this.useParams(params);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.TdMain = TdMain;
|
|
@@ -17,9 +17,9 @@ class TdIcon extends ui_abstract_1.UI {
|
|
|
17
17
|
constructor(params = {}) {
|
|
18
18
|
super(params, 'i');
|
|
19
19
|
this.className = 'TdIcon';
|
|
20
|
-
this.
|
|
20
|
+
this.style.addObj(td_icon_style_1.$tdIcon);
|
|
21
21
|
if (params === null || params === void 0 ? void 0 : params.loading) {
|
|
22
|
-
this.
|
|
22
|
+
this.style.addObj(td_icon_style_1.$iconLoading);
|
|
23
23
|
}
|
|
24
24
|
// 首次创建时,添加style标签;避免重复创建
|
|
25
25
|
if (!TdIcon.initCalled) {
|
|
@@ -39,9 +39,9 @@ class TdIcon extends ui_abstract_1.UI {
|
|
|
39
39
|
(0, framework_1.createStyle)(cssText);
|
|
40
40
|
// createClass('td-icon', $tdIcon);
|
|
41
41
|
}
|
|
42
|
-
this.
|
|
42
|
+
this.attr.addClass('td-icon');
|
|
43
43
|
this.addChild(this.getSlotNode());
|
|
44
|
-
this.props = this.
|
|
44
|
+
this.props = this.useParams(params);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* 根据配置更新图标的状态和样式。
|
|
@@ -54,28 +54,28 @@ class TdIcon extends ui_abstract_1.UI {
|
|
|
54
54
|
// 直接作为 childNodes的子元素更合理;
|
|
55
55
|
this.getSlotNode().resetSlot(props.svgObj);
|
|
56
56
|
this.svg = props.svgObj;
|
|
57
|
-
this.svg.
|
|
57
|
+
this.svg.attr.addObj({
|
|
58
58
|
height: '1em',
|
|
59
59
|
width: '1em',
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
if (props === null || props === void 0 ? void 0 : props.color) {
|
|
63
|
-
this.
|
|
63
|
+
this.style.addObj({
|
|
64
64
|
color: props.color,
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
if (props === null || props === void 0 ? void 0 : props.size) {
|
|
68
|
-
this.
|
|
68
|
+
this.style.addObj({
|
|
69
69
|
fontSize: (0, utils_1.addUnit)(props.size),
|
|
70
70
|
});
|
|
71
71
|
(_a = this.svg) === null || _a === void 0 ? void 0 : _a.resetSize(props.size, props.size);
|
|
72
72
|
}
|
|
73
73
|
if ((props === null || props === void 0 ? void 0 : props.position) === 'right') {
|
|
74
74
|
// 位置应该是引用的对象中设置,自身应该不需要设置。
|
|
75
|
-
this.
|
|
75
|
+
this.style.addObj(td_icon_style_1.$iconRight);
|
|
76
76
|
}
|
|
77
77
|
else if ((props === null || props === void 0 ? void 0 : props.position) === 'left') {
|
|
78
|
-
this.
|
|
78
|
+
this.style.addObj(td_icon_style_1.$iconLeft);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UI } from '../../../../ui/ui.abstract';
|
|
2
2
|
import { TdRow } from '../td-row/td-row.class';
|
|
3
3
|
import { ITdCol, ITdColConfig } from './td-col.interface';
|
|
4
|
+
import { TypeNode } from '@type-dom/framework';
|
|
4
5
|
export declare class TdCol extends UI implements ITdCol {
|
|
5
6
|
className: 'TdCol';
|
|
6
7
|
parent?: TdRow;
|
|
@@ -8,6 +9,8 @@ export declare class TdCol extends UI implements ITdCol {
|
|
|
8
9
|
constructor(params?: ITdColConfig);
|
|
9
10
|
get screenWidth(): number;
|
|
10
11
|
setup(): void;
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
mounted(): void;
|
|
13
|
+
destroy(root?: TypeNode): void;
|
|
14
|
+
debounceResize: () => void;
|
|
15
|
+
resize: () => void;
|
|
13
16
|
}
|