@type-dom/ui 0.0.6 → 0.0.7
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 +2 -2
- package/src/components/basic/td-button/td-button.class.js +1 -1
- package/src/components/basic/td-container/td-aside/td-aside.class.js +1 -1
- package/src/components/basic/td-container/td-container.class.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 +6 -5
- package/src/components/basic/td-container/td-main/td-main.class.js +1 -1
- package/src/components/basic/td-icon/td-icon.class.js +12 -12
- package/src/components/basic/td-layout/td-col/td-col.class.js +1 -1
- package/src/components/basic/td-layout/td-row/td-row.class.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +1 -1
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +1 -1
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +1 -1
- package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +1 -1
- package/src/components/basic/td-space/td-space.class.js +1 -1
- package/src/components/basic/td-text/td-text.class.js +1 -1
- package/src/components/data/td-avatar/td-avatar.class.js +1 -1
- package/src/components/data/td-badge/td-badge.class.js +1 -1
- package/src/components/data/td-card/td-card.class.js +1 -1
- package/src/components/data/td-check-tag/td-check-tag.class.js +1 -1
- package/src/components/data/td-collapse/td-collapse.class.js +2 -4
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +1 -1
- 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 +1 -3
- package/src/components/data/td-descriptions/td-descriptions-row.d.ts +1 -1
- package/src/components/data/td-descriptions/td-descriptions-row.js +1 -1
- package/src/components/data/td-descriptions/td-descritions-cell.js +1 -1
- package/src/components/data/td-descriptions-item/td-descriptions-item.class.js +2 -4
- package/src/components/data/td-empty/img-empty.class.js +1 -1
- package/src/components/data/td-empty/td-empty.class.js +1 -1
- package/src/components/data/td-image/td-image.class.js +1 -1
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +1 -1
- package/src/components/data/td-result/td-result.class.js +4 -8
- package/src/components/data/td-segmented/td-segmented.class.js +1 -1
- package/src/components/data/td-statistic/td-statistic.abstract.d.ts +1 -1
- package/src/components/data/td-statistic/td-statistic.abstract.js +1 -1
- package/src/components/data/td-tag/td-tag.class.js +1 -1
- package/src/components/feedback/dialog/dialog.class.js +1 -1
- package/src/components/feedback/message-box/message-box.js +1 -1
- package/src/components/feedback/td-alert/td-alert.class.js +1 -1
- package/src/components/feedback/td-dialog/td-dialog.class.d.ts +3 -0
- package/src/components/feedback/td-dialog/td-dialog.class.js +18 -1
- 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 +1 -1
- package/src/components/feedback/td-drawer/td-drawer.class.js +1 -1
- 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 +1 -1
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +5 -5
- package/src/components/feedback/td-loading/td-loading.class.js +1 -1
- package/src/components/feedback/td-message/td-message.class.js +2 -2
- package/src/components/feedback/td-message-box/td-message-box.class.js +2 -2
- package/src/components/feedback/td-notification/td-notification.class.js +2 -2
- package/src/components/feedback/td-overlay/td-overlay.class.js +1 -1
- package/src/components/feedback/td-popper/arrow/arrow.class.js +1 -1
- package/src/components/feedback/td-popper/content/content.class.js +1 -1
- package/src/components/feedback/td-popper/td-popper.class.js +1 -1
- package/src/components/feedback/td-popper/trigger/trigger.class.js +1 -1
- 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/radio-group/radio-group.class.js +1 -1
- 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 +1 -1
- package/src/components/form/td-checkbox/td-checkbox.class.js +1 -1
- package/src/components/form/td-checkbox/td-checkbox.style.js +2 -2
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +1 -1
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +1 -1
- package/src/components/form/td-form/td-form.class.js +1 -1
- package/src/components/form/td-form-item/td-form-item.class.js +1 -1
- package/src/components/form/td-input/td-input.class.js +1 -1
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +1 -1
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +1 -1
- package/src/components/form/td-input/widget/utils.js +8 -8
- package/src/components/form/td-option/td-option.class.js +1 -1
- 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 +1 -1
- package/src/components/form/td-radio/td-radio.class.js +1 -1
- package/src/components/form/td-radio-button/td-radio-button.class.js +1 -1
- package/src/components/form/td-radio-group/td-radio-group.class.js +1 -1
- package/src/components/form/td-select/dropdown/dropdown.class.js +1 -1
- package/src/components/form/td-select/td-select.class.js +1 -1
- package/src/components/form/td-switch/td-switch.class.js +1 -1
- package/src/components/form/td-switch/widget/td-switch-core.js +1 -1
- package/src/components/form/td-switch/widget/td-switch-left.js +1 -1
- package/src/components/form/td-switch/widget/td-switch-right.js +1 -1
- package/src/components/navigation/td-affix/td-affix.class.js +1 -1
- 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.d.ts +1 -1
- package/src/components/navigation/td-anchor/td-anchor.class.js +1 -1
- package/src/components/navigation/td-backtop/td-backtop.class.js +1 -1
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +2 -4
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.class.js +1 -1
- package/src/components/navigation/td-menu/td-menu.class.js +1 -1
- 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 +6 -6
- 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 +12 -12
- 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 +1 -1
- package/src/components/navigation/td-tabs/td-tabs.class.js +1 -1
- package/src/components/others/td-divider/td-divider.class.js +1 -1
|
@@ -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,12 +34,15 @@ 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
|
slot: this.overlay,
|
|
@@ -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';
|
|
@@ -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_overlay_class_1 = require("../td-overlay/td-overlay.class");
|
|
7
7
|
class TdDrawer extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params, 'fragment');
|
|
10
10
|
this.className = 'TdDrawer';
|
|
11
11
|
this.transition = new framework_1.Transition({
|
|
@@ -4,9 +4,9 @@ export interface ITdDrawer extends IUI {
|
|
|
4
4
|
className: 'TdDrawer';
|
|
5
5
|
}
|
|
6
6
|
export interface ITdDrawerConfig extends ITdDialogConfig {
|
|
7
|
-
direction
|
|
8
|
-
size
|
|
9
|
-
withHeader
|
|
10
|
-
modalFade
|
|
11
|
-
headerAriaLevel
|
|
7
|
+
direction?: 'ltr' | 'rtl' | 'ttb' | 'btt';
|
|
8
|
+
size?: string | number;
|
|
9
|
+
withHeader?: boolean;
|
|
10
|
+
modalFade?: boolean;
|
|
11
|
+
headerAriaLevel?: string;
|
|
12
12
|
}
|
|
@@ -5,7 +5,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
5
5
|
const aria_1 = require("../../../aria");
|
|
6
6
|
const utils_1 = require("./utils");
|
|
7
7
|
class TdFocusTrap extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params, 'fragment');
|
|
10
10
|
this.className = 'TdFocusTrap';
|
|
11
11
|
this.inheritAttrs = false;
|
|
@@ -8,12 +8,12 @@ export interface ITdFocusTrapConfig extends IUIConfig {
|
|
|
8
8
|
trapped?: boolean;
|
|
9
9
|
focusTrapEl?: HTMLElement;
|
|
10
10
|
focusStartEl?: 'container' | 'first' | HTMLElement;
|
|
11
|
-
emits
|
|
11
|
+
emits?: {
|
|
12
12
|
[ON_TRAP_FOCUS_EVT]?: () => void;
|
|
13
13
|
[ON_RELEASE_FOCUS_EVT]?: () => void;
|
|
14
|
-
focusin
|
|
15
|
-
focusout
|
|
16
|
-
focusoutPrevented
|
|
17
|
-
releaseRequested
|
|
14
|
+
focusin?: () => void;
|
|
15
|
+
focusout?: () => void;
|
|
16
|
+
focusoutPrevented?: () => void;
|
|
17
|
+
releaseRequested?: () => void;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
@@ -5,7 +5,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
5
5
|
const framework_1 = require("@type-dom/framework");
|
|
6
6
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
7
|
class TdLoading extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params, 'fragment');
|
|
10
10
|
this.className = 'TdLoading';
|
|
11
11
|
this.transition = new framework_1.Transition({
|
|
@@ -59,7 +59,7 @@ class TdMessage extends ui_abstract_1.UI {
|
|
|
59
59
|
});
|
|
60
60
|
// this.message.ctrl.hide();
|
|
61
61
|
// this.transition.setSlot(this.message);
|
|
62
|
-
this.transition.
|
|
62
|
+
this.transition.addSlot(this.message);
|
|
63
63
|
const type = (params === null || params === void 0 ? void 0 : params.type) || 'info';
|
|
64
64
|
const iconComponent = (params === null || params === void 0 ? void 0 : params.icon) || (new svgs_1.TypeComponentsMap[type]()) || '';
|
|
65
65
|
console.log('iconComponent', iconComponent);
|
|
@@ -215,7 +215,6 @@ class TdMessage extends ui_abstract_1.UI {
|
|
|
215
215
|
this.visible = false;
|
|
216
216
|
this.message.ctrl.hide();
|
|
217
217
|
this.clearTimer();
|
|
218
|
-
this.destroy();
|
|
219
218
|
TdMessage.msgId = (TdMessage.msgId || 1) - 1;
|
|
220
219
|
TdMessage.msgList = TdMessage.msgList.filter(item => item !== this);
|
|
221
220
|
console.log('TdMessage.msgList is ', TdMessage.msgList, TdMessage.msgList.length);
|
|
@@ -226,6 +225,7 @@ class TdMessage extends ui_abstract_1.UI {
|
|
|
226
225
|
};
|
|
227
226
|
msg.message.ctrl.setStyleObj(customStyle);
|
|
228
227
|
});
|
|
228
|
+
this.destroy();
|
|
229
229
|
}
|
|
230
230
|
keydown({ code }) {
|
|
231
231
|
if (code === aria_1.EVENT_CODE.esc) {
|
|
@@ -11,7 +11,7 @@ const td_input_class_1 = require("../../form/td-input/td-input.class");
|
|
|
11
11
|
const td_overlay_class_1 = require("../td-overlay/td-overlay.class");
|
|
12
12
|
const td_message_box_style_1 = require("./td-message-box.style");
|
|
13
13
|
class TdMessageBox extends ui_abstract_1.UI {
|
|
14
|
-
constructor(params) {
|
|
14
|
+
constructor(params = {}) {
|
|
15
15
|
var _a, _b;
|
|
16
16
|
super(params, 'fragment');
|
|
17
17
|
this.handleInputEnter = (e) => {
|
|
@@ -83,7 +83,7 @@ class TdMessageBox extends ui_abstract_1.UI {
|
|
|
83
83
|
// styleObj: $messageBoxStyle,
|
|
84
84
|
});
|
|
85
85
|
this.overlayEvent = (0, framework_1.useSameTarget)(this.handleWrapperClick);
|
|
86
|
-
this.transition.
|
|
86
|
+
this.transition.addSlot(this.overlay);
|
|
87
87
|
this.dialog = new framework_1.Div({
|
|
88
88
|
name: 'message-box-overlay',
|
|
89
89
|
attrObj: {
|
|
@@ -57,7 +57,7 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
|
-
this.transition.
|
|
60
|
+
this.transition.addSlot(this.notification);
|
|
61
61
|
let iconComponent;
|
|
62
62
|
if ((params === null || params === void 0 ? void 0 : params.type) && svgs_1.TypeComponentsMap[params.type]) {
|
|
63
63
|
console.log('params.type is ', params.type);
|
|
@@ -194,7 +194,6 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
194
194
|
this.visible = false;
|
|
195
195
|
this.notification.ctrl.hide();
|
|
196
196
|
const position = this.props.position || 'top-right';
|
|
197
|
-
this.destroy(); // todo 应该是 Transition 的 afterLeave 触发 destroy; 会删除props
|
|
198
197
|
TdNotification.notifications[position] = TdNotification.notifications[position].filter((notification) => notification !== this);
|
|
199
198
|
TdNotification.notifyId = TdNotification.notifyId - 1;
|
|
200
199
|
let verticalOffset = this.props.offset || 0;
|
|
@@ -206,6 +205,7 @@ class TdNotification extends ui_abstract_1.UI {
|
|
|
206
205
|
});
|
|
207
206
|
verticalOffset += item.notification.dom.offsetHeight; // + this.GAP_SIZE;
|
|
208
207
|
});
|
|
208
|
+
this.destroy(); // todo 应该是 Transition 的 afterLeave 触发 destroy; 会删除props
|
|
209
209
|
}
|
|
210
210
|
onKeydown({ code }) {
|
|
211
211
|
console.log('onKeydown ', code);
|
|
@@ -5,7 +5,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
5
5
|
const td_overlay_style_1 = require("./td-overlay.style");
|
|
6
6
|
exports.overlayZIndex = 2000;
|
|
7
7
|
class TdOverlay extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params);
|
|
10
10
|
exports.overlayZIndex = exports.overlayZIndex + 1;
|
|
11
11
|
this.className = 'TdOverlay';
|
|
@@ -4,7 +4,7 @@ exports.TdPopperArrow = void 0;
|
|
|
4
4
|
const var_1 = require("../../../../styles/var");
|
|
5
5
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
6
6
|
class TdPopperArrow extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params, 'span');
|
|
9
9
|
this.className = 'TdPopperArrow';
|
|
10
10
|
this.ctrl.addAttrName('td-popper-arrow');
|
|
@@ -4,7 +4,7 @@ exports.TdPopperContent = void 0;
|
|
|
4
4
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
5
5
|
const td_focus_trap_class_1 = require("../../td-focus-trap/td-focus-trap.class");
|
|
6
6
|
class TdPopperContent extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params);
|
|
9
9
|
this.className = 'TdPopperContent';
|
|
10
10
|
this.ctrl.addAttrName('td-popper-content');
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TdPopper = void 0;
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
class TdPopper extends ui_abstract_1.UI {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super(params, 'fragment');
|
|
8
8
|
this.className = 'TdPopper';
|
|
9
9
|
this.props = this.setParams(params);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TdPopperTrigger = void 0;
|
|
4
4
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
5
5
|
class TdPopperTrigger extends ui_abstract_1.UI {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.className = 'TdPopperTrigger';
|
|
9
9
|
this.props = this.setParams(params);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TdTooltipContent = void 0;
|
|
4
4
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
5
5
|
class TdTooltipContent extends ui_abstract_1.UI {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.className = 'TdTooltipContent';
|
|
9
9
|
this.props = this.setParams(params);
|
|
@@ -8,7 +8,7 @@ const arrow_class_1 = require("../td-popper/arrow/arrow.class");
|
|
|
8
8
|
const trigger_class_1 = require("./trigger/trigger.class");
|
|
9
9
|
const content_class_1 = require("./content/content.class");
|
|
10
10
|
class TdTooltip extends ui_abstract_1.UI {
|
|
11
|
-
constructor(params) {
|
|
11
|
+
constructor(params = {}) {
|
|
12
12
|
super(params);
|
|
13
13
|
this.className = 'TdTooltip';
|
|
14
14
|
this.trigger = new trigger_class_1.TdTooltipTrigger();
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TdTooltipTrigger = void 0;
|
|
4
4
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
5
5
|
class TdTooltipTrigger extends ui_abstract_1.UI {
|
|
6
|
-
constructor(params) {
|
|
6
|
+
constructor(params = {}) {
|
|
7
7
|
super(params);
|
|
8
8
|
this.className = 'TdTooltipTrigger';
|
|
9
9
|
this.props = this.setParams(params);
|
|
@@ -4,7 +4,7 @@ exports.RadioGroup = void 0;
|
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const radio_option_class_1 = require("./radio-option/radio-option.class");
|
|
6
6
|
class RadioGroup extends framework_1.TypeDiv {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'RadioGroup';
|
|
10
10
|
this.ctrl.addAttrName('radio-group');
|
|
@@ -4,7 +4,7 @@ exports.RadioOption = void 0;
|
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const framework_1 = require("@type-dom/framework");
|
|
6
6
|
class RadioOption extends framework_1.TypeSpan {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'RadioOption';
|
|
10
10
|
this.ctrl.addStyleObj({
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const td_checkbox_style_1 = require("./td-checkbox.style");
|
|
7
7
|
const use_checkbox_1 = require("./composables/use-checkbox");
|
|
8
8
|
class TdCheckbox extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
const { hasOwnLabel } = (0, use_checkbox_1.useCheckbox)(params);
|
|
11
11
|
const tag = !hasOwnLabel ? 'span' : 'label';
|
|
12
12
|
super(params, tag); // label | span
|
|
@@ -106,8 +106,8 @@ exports.$checkboxInnerStyle = {
|
|
|
106
106
|
backgroundColor: var_1.$bgColor.default,
|
|
107
107
|
// z-index: getCssVar('index-normal'),
|
|
108
108
|
zIndex: var_1.$zIndex.normal,
|
|
109
|
-
transition: `border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
110
|
-
background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
109
|
+
transition: `border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
110
|
+
background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
|
|
111
111
|
outline 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46)`
|
|
112
112
|
};
|
|
113
113
|
exports.$checkboxInnerAfterStyle = {
|
|
@@ -7,7 +7,7 @@ const use_checkbox_1 = require("../td-checkbox/composables/use-checkbox");
|
|
|
7
7
|
const td_checkbox_style_1 = require("../td-checkbox/td-checkbox.style");
|
|
8
8
|
const td_checkbox_button_style_1 = require("./td-checkbox-button.style");
|
|
9
9
|
class TdCheckboxButton extends ui_abstract_1.UI {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
super(params, 'label'); // label | span
|
|
12
12
|
this.className = 'TdCheckboxButton';
|
|
13
13
|
this.ctrl.addAttrObj({
|
|
@@ -4,7 +4,7 @@ exports.TdCheckboxGroup = void 0;
|
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
const td_checkbox_style_1 = require("../td-checkbox/td-checkbox.style");
|
|
6
6
|
class TdCheckboxGroup extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params);
|
|
9
9
|
this.className = 'TdCheckboxGroup';
|
|
10
10
|
this.ctrl.addAttrObj({
|
|
@@ -10,7 +10,7 @@ const var_1 = require("../../../styles/var");
|
|
|
10
10
|
const td_form_item_style_1 = require("./td-form-item.style");
|
|
11
11
|
class TdFormItem extends ui_abstract_1.UI {
|
|
12
12
|
// new TdFormItem 是 发生在 TdForm slotChild 之前的。
|
|
13
|
-
constructor(params) {
|
|
13
|
+
constructor(params = {}) {
|
|
14
14
|
super(params);
|
|
15
15
|
this.className = 'TdFormItem';
|
|
16
16
|
this.ctrl.addAttrName('td-form-item');
|
|
@@ -9,7 +9,7 @@ const td_input_wrapper_class_1 = require("./widget/td-input-wrapper.class");
|
|
|
9
9
|
const td_input_style_1 = require("./td-input.style");
|
|
10
10
|
const td_textarea_wrapper_1 = require("./widget/td-textarea-wrapper");
|
|
11
11
|
class TdInput extends ui_abstract_1.UI {
|
|
12
|
-
constructor(params) {
|
|
12
|
+
constructor(params = {}) {
|
|
13
13
|
super(params);
|
|
14
14
|
console.log('TdInput constructor . ');
|
|
15
15
|
this.className = 'TdInput';
|
|
@@ -7,7 +7,7 @@ const td_input_style_1 = require("../td-input.style");
|
|
|
7
7
|
const suffix_1 = require("./suffix");
|
|
8
8
|
const prefix_1 = require("./prefix");
|
|
9
9
|
class TdInputWrapper extends framework_1.TypeDiv {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
super();
|
|
12
12
|
this.className = 'TdInputWrapper';
|
|
13
13
|
this.parent = params === null || params === void 0 ? void 0 : params.parent;
|
|
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const var_1 = require("../../../../styles/var");
|
|
6
6
|
const td_input_style_1 = require("../td-input.style");
|
|
7
7
|
class TdTextareaWrapper extends framework_1.TypeDiv {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'TextareaWrapper';
|
|
11
11
|
this.ctrl.addStyleObj({
|
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.calcTextareaHeight = calcTextareaHeight;
|
|
4
4
|
const utils_1 = require("@type-dom/utils");
|
|
5
5
|
let hiddenTextarea = undefined;
|
|
6
|
-
const HIDDEN_STYLE = `
|
|
7
|
-
height:0 !important;
|
|
8
|
-
visibility:hidden !important;
|
|
9
|
-
${utils_1.isFireFox ? '' : 'overflow:hidden !important;'}
|
|
10
|
-
position:absolute !important;
|
|
11
|
-
z-index:-1000 !important;
|
|
12
|
-
top:0 !important;
|
|
13
|
-
right:0 !important;
|
|
6
|
+
const HIDDEN_STYLE = `
|
|
7
|
+
height:0 !important;
|
|
8
|
+
visibility:hidden !important;
|
|
9
|
+
${utils_1.isFireFox ? '' : 'overflow:hidden !important;'}
|
|
10
|
+
position:absolute !important;
|
|
11
|
+
z-index:-1000 !important;
|
|
12
|
+
top:0 !important;
|
|
13
|
+
right:0 !important;
|
|
14
14
|
`;
|
|
15
15
|
const CONTEXT_STYLE = [
|
|
16
16
|
'letter-spacing',
|
|
@@ -4,7 +4,7 @@ exports.TdOption = void 0;
|
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
const td_select_style_1 = require("../td-select/td-select.style");
|
|
6
6
|
class TdOption extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params, 'li');
|
|
9
9
|
this.className = 'TdOption';
|
|
10
10
|
this.ctrl.addAttrObj({
|
|
@@ -7,7 +7,7 @@ export interface ITdOptionConfig extends IUIConfig {
|
|
|
7
7
|
* @description value of option
|
|
8
8
|
* required: true,
|
|
9
9
|
*/
|
|
10
|
-
value
|
|
10
|
+
value?: string | number | boolean | object;
|
|
11
11
|
/**
|
|
12
12
|
* @description label of option, same as `value` if omitted
|
|
13
13
|
*/
|
|
@@ -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_select_style_1 = require("../td-select/td-select.style");
|
|
7
7
|
class TdOptionGroup extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params, 'ul');
|
|
10
10
|
this.className = 'TdOptionGroup';
|
|
11
11
|
this.ctrl.addAttrObj({
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const var_1 = require("../../../styles/var");
|
|
7
7
|
const td_radio_group_class_1 = require("../td-radio-group/td-radio-group.class");
|
|
8
8
|
class TdRadio extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params, 'label');
|
|
11
11
|
this.className = 'TdRadio';
|
|
12
12
|
this.ctrl.addStyleObj({
|
|
@@ -6,7 +6,7 @@ const var_1 = require("../../../styles/var");
|
|
|
6
6
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
7
|
const td_radio_group_class_1 = require("../td-radio-group/td-radio-group.class");
|
|
8
8
|
class TdRadioButton extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params, 'label');
|
|
11
11
|
this.className = 'TdRadioButton';
|
|
12
12
|
this.ctrl.addAttrName('radio-button');
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const td_radio_class_1 = require("../td-radio/td-radio.class");
|
|
7
7
|
const td_radio_button_class_1 = require("../td-radio-button/td-radio-button.class");
|
|
8
8
|
class TdRadioGroup extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params);
|
|
11
11
|
this.className = 'TdRadioGroup';
|
|
12
12
|
this.ctrl.addStyleObj({
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
|
6
6
|
const framework_1 = require("@type-dom/framework");
|
|
7
7
|
const td_select_style_1 = require("../td-select.style");
|
|
8
8
|
class TdSelectDropDown extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params);
|
|
11
11
|
this.className = 'TdSelectDropdown';
|
|
12
12
|
this.ctrl.addStyleObj({
|
|
@@ -7,7 +7,7 @@ const td_tooltip_class_1 = require("../../feedback/td-tooltip/td-tooltip.class")
|
|
|
7
7
|
const dropdown_class_1 = require("./dropdown/dropdown.class");
|
|
8
8
|
const td_select_style_1 = require("./td-select.style");
|
|
9
9
|
class TdSelect extends ui_abstract_1.UI {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
super(params);
|
|
12
12
|
this.className = 'TdSelect';
|
|
13
13
|
this.ctrl.addStyleObj(td_select_style_1.$select);
|
|
@@ -11,7 +11,7 @@ const td_switch_left_1 = require("./widget/td-switch-left");
|
|
|
11
11
|
const td_switch_right_1 = require("./widget/td-switch-right");
|
|
12
12
|
const td_switch_style_1 = require("./td-switch.style");
|
|
13
13
|
class TdSwitch extends ui_abstract_1.UI {
|
|
14
|
-
constructor(params) {
|
|
14
|
+
constructor(params = {}) {
|
|
15
15
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16
16
|
super(params);
|
|
17
17
|
this.className = 'TdSwitch';
|
|
@@ -7,7 +7,7 @@ const var_1 = require("../../../../styles/var");
|
|
|
7
7
|
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
8
8
|
const td_switch_style_1 = require("../td-switch.style");
|
|
9
9
|
class TdSwitchCore extends framework_1.TypeSpan {
|
|
10
|
-
constructor(params) {
|
|
10
|
+
constructor(params = {}) {
|
|
11
11
|
super();
|
|
12
12
|
this.className = 'TdSwitchCore';
|
|
13
13
|
this.ctrl.addAttrObj({
|
|
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
6
6
|
const td_switch_style_1 = require("../td-switch.style");
|
|
7
7
|
class TdSwitchLeft extends framework_1.TypeSpan {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'TdSwitchLeft';
|
|
11
11
|
this.ctrl.addAttrName('switch-label');
|
|
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const td_switch_style_1 = require("../td-switch.style");
|
|
6
6
|
const td_icon_class_1 = require("../../../basic/td-icon/td-icon.class");
|
|
7
7
|
class TdSwitchRight extends framework_1.TypeSpan {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'TdSwitchRight';
|
|
11
11
|
this.ctrl.addStyleObj(Object.assign(Object.assign({}, td_switch_style_1.$switchLabel), { marginLeft: '10px' }));
|
|
@@ -6,7 +6,7 @@ const utils_1 = require("@type-dom/utils");
|
|
|
6
6
|
const framework_1 = require("@type-dom/framework");
|
|
7
7
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
8
8
|
class TdAffix extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params);
|
|
11
11
|
console.log('TdAffix constructor . ');
|
|
12
12
|
this.className = 'TdAffix';
|
|
@@ -4,7 +4,7 @@ exports.TdAnchorLink = void 0;
|
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const ui_abstract_1 = require("../../../../ui/ui.abstract");
|
|
6
6
|
class TdAnchorLink extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params);
|
|
9
9
|
this.className = 'TdAnchorLink';
|
|
10
10
|
this.href = new framework_1.A({
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const td_anchor_style_1 = require("./td-anchor.style");
|
|
7
7
|
const td_anchor_function_1 = require("./td-anchor.function");
|
|
8
8
|
class TdAnchor extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
var _a, _b, _c, _d;
|
|
11
11
|
super(params);
|
|
12
12
|
this.className = 'TdAnchor';
|