@type-dom/ui 0.0.5 → 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 +4 -3
- 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-button/td-button.style.js +3 -3
- 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-link/td-link.style.d.ts +1 -1
- package/src/components/basic/td-link/td-link.style.js +3 -3
- 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/basic/td-text/td-text.style.js +2 -2
- 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-check-tag/td-check-tag.style.d.ts +1 -1
- package/src/components/data/td-check-tag/td-check-tag.style.js +2 -2
- 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-descriptions.style.js +3 -3
- 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/util.js +1 -2
- 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-result/td-result.style.d.ts +1 -1
- package/src/components/data/td-segmented/td-segmented.class.js +1 -1
- package/src/components/data/td-segmented/td-segmented.style.js +3 -3
- 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/data/td-tag/td-tag.style.d.ts +1 -1
- package/src/components/data/td-tag/td-tag.style.js +3 -3
- 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-alert/td-alert.style.js +3 -3
- 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-focus-trap/utils.d.ts +1 -1
- 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/td-message.style.js +3 -3
- package/src/components/feedback/td-message-box/td-message-box.class.js +2 -2
- package/src/components/feedback/td-message-box/td-message-box.style.js +3 -3
- package/src/components/feedback/td-notification/td-notification.class.js +2 -2
- package/src/components/feedback/td-notification/td-notification.style.js +3 -3
- 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 +9 -10
- 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.d.ts +2 -2
- 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/navigation/td-tabs/td-tabs.style.js +2 -2
- package/src/components/others/td-divider/td-divider.class.js +1 -1
- package/src/styles/function.js +10 -11
- package/src/styles/var.js +2 -2
|
@@ -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({
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calcTextareaHeight =
|
|
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',
|
|
@@ -78,4 +78,3 @@ function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
|
|
|
78
78
|
hiddenTextarea = undefined;
|
|
79
79
|
return result;
|
|
80
80
|
}
|
|
81
|
-
exports.calcTextareaHeight = calcTextareaHeight;
|
|
@@ -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' }));
|
|
@@ -18,8 +18,8 @@ export declare class TdAffix extends UI implements ITdAffix {
|
|
|
18
18
|
private scrollContainer?;
|
|
19
19
|
private windowHeight?;
|
|
20
20
|
constructor(params?: ITdAffixConfig);
|
|
21
|
-
get rootStyle(): IStyle
|
|
22
|
-
get affixStyle(): IStyle
|
|
21
|
+
get rootStyle(): IStyle;
|
|
22
|
+
get affixStyle(): IStyle;
|
|
23
23
|
mounted(): void;
|
|
24
24
|
change(): void;
|
|
25
25
|
}
|
|
@@ -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';
|
|
@@ -10,7 +10,7 @@ const var_1 = require("../../../styles/var");
|
|
|
10
10
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
11
11
|
const td_backtop_style_1 = require("./td-backtop.style");
|
|
12
12
|
class TdBackTop extends ui_abstract_1.UI {
|
|
13
|
-
constructor(params) {
|
|
13
|
+
constructor(params = {}) {
|
|
14
14
|
super(params, 'fragment');
|
|
15
15
|
this.visible = false;
|
|
16
16
|
this.className = 'TdBackTop';
|
|
@@ -4,7 +4,7 @@ exports.TdBreadcrumb = void 0;
|
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
// todo link 样式没有添加
|
|
6
6
|
class TdBreadcrumb extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params);
|
|
9
9
|
this.className = 'TdBreadcrumb';
|
|
10
10
|
this.ctrl.addAttrName('td-breadcrumb');
|
|
@@ -13,9 +13,7 @@ class TdBreadcrumb extends ui_abstract_1.UI {
|
|
|
13
13
|
lineHeight: 1
|
|
14
14
|
});
|
|
15
15
|
this.childNodes = [];
|
|
16
|
-
|
|
17
|
-
this.slotChild(params === null || params === void 0 ? void 0 : params.slot);
|
|
18
|
-
}
|
|
16
|
+
this.addChild(this.getSlotNode());
|
|
19
17
|
this.props = this.setParams(params);
|
|
20
18
|
}
|
|
21
19
|
created() {
|
|
@@ -6,7 +6,7 @@ const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
|
6
6
|
const var_1 = require("../../../styles/var");
|
|
7
7
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
8
|
class TdBreadcrumbItem extends ui_abstract_1.UI {
|
|
9
|
-
constructor(params) {
|
|
9
|
+
constructor(params = {}) {
|
|
10
10
|
super(params, 'span');
|
|
11
11
|
this.className = 'TdBreadcrumbItem';
|
|
12
12
|
this.ctrl.addStyleObj({
|
|
@@ -4,7 +4,7 @@ exports.TdMenu = void 0;
|
|
|
4
4
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
5
5
|
const var_1 = require("../../../styles/var");
|
|
6
6
|
class TdMenu extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params, 'ul');
|
|
9
9
|
this.className = 'TdMenu';
|
|
10
10
|
this.ctrl.addAttrObj({
|
|
@@ -10,7 +10,7 @@ class TdTabBar extends ui_abstract_1.UI {
|
|
|
10
10
|
this.className = 'TdTabBar';
|
|
11
11
|
this.ctrl.addAttrName('td-tab-bar');
|
|
12
12
|
this.ctrl.addStyleObj(td_tabs_style_1.$tabsActiveBarStyle);
|
|
13
|
-
this.rootTabs = params.rootTabs;
|
|
13
|
+
this.rootTabs = params === null || params === void 0 ? void 0 : params.rootTabs;
|
|
14
14
|
this.props = this.setParams(params);
|
|
15
15
|
}
|
|
16
16
|
getBarStyle() {
|
|
@@ -23,15 +23,15 @@ class TdTabBar extends ui_abstract_1.UI {
|
|
|
23
23
|
: 'height';
|
|
24
24
|
const sizeDir = sizeName === 'width' ? 'x' : 'y';
|
|
25
25
|
const position = sizeDir === 'x' ? 'left' : 'top';
|
|
26
|
-
this.props.tabs.every((tab, index) => {
|
|
27
|
-
var _a, _b;
|
|
26
|
+
this.props.tabs && this.props.tabs.every((tab, index) => {
|
|
27
|
+
var _a, _b, _c, _d, _e;
|
|
28
28
|
// const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement
|
|
29
|
-
const $el = (_a = this.rootTabs.tabNav.tabs.find((node) => { var _a, _b; return ((_a = node.props.attrObj) === null || _a === void 0 ? void 0 : _a.tabName) === ((_b = tab.name) !== null && _b !== void 0 ? _b : (index + 1)); })) === null ||
|
|
29
|
+
const $el = ((_a = this.rootTabs) === null || _a === void 0 ? void 0 : _a.tabNav.tabs) && ((_c = (_b = this.rootTabs) === null || _b === void 0 ? void 0 : _b.tabNav.tabs.find((node) => { var _a, _b; return ((_a = node.props.attrObj) === null || _a === void 0 ? void 0 : _a.tabName) === ((_b = tab.name) !== null && _b !== void 0 ? _b : (index + 1)); })) === null || _c === void 0 ? void 0 : _c.dom);
|
|
30
30
|
console.log('$el is ', $el);
|
|
31
31
|
if (!$el)
|
|
32
32
|
return false;
|
|
33
|
-
const tabName = (
|
|
34
|
-
if (tabName !== this.rootTabs.currentName) {
|
|
33
|
+
const tabName = (_d = tab.name) !== null && _d !== void 0 ? _d : (index + 1);
|
|
34
|
+
if (tabName !== ((_e = this.rootTabs) === null || _e === void 0 ? void 0 : _e.currentName)) {
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
offset =
|
|
@@ -10,12 +10,12 @@ export declare class TdTabNav extends UI implements ITdTabNav {
|
|
|
10
10
|
private navScroll?;
|
|
11
11
|
private navOffset?;
|
|
12
12
|
private sizeName;
|
|
13
|
-
private rootTabs
|
|
13
|
+
private rootTabs?;
|
|
14
14
|
private focusable?;
|
|
15
15
|
private isFocus;
|
|
16
16
|
private tabBar?;
|
|
17
17
|
tabs: Div[];
|
|
18
|
-
constructor(params
|
|
18
|
+
constructor(params?: ITdTabNavConfig);
|
|
19
19
|
mounted(): void;
|
|
20
20
|
get navStyle(): {
|
|
21
21
|
transform: string;
|
|
@@ -12,8 +12,8 @@ const td_tabs_style_1 = require("./td-tabs.style");
|
|
|
12
12
|
const td_tab_bar_class_1 = require("./td-tab-bar.class");
|
|
13
13
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
14
14
|
class TdTabNav extends ui_abstract_1.UI {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
var _a;
|
|
15
|
+
constructor(params = {}) {
|
|
16
|
+
var _a, _b;
|
|
17
17
|
super(params);
|
|
18
18
|
this.tabs = [];
|
|
19
19
|
this.className = 'TdTabNav';
|
|
@@ -27,8 +27,8 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
27
27
|
this.navOffset = 0;
|
|
28
28
|
this.isFocus = false;
|
|
29
29
|
this.focusable = true;
|
|
30
|
-
this.rootTabs = params.rootTabs;
|
|
31
|
-
this.sizeName = ['top', 'bottom'].includes(this.rootTabs.props.tabPosition || 'top')
|
|
30
|
+
this.rootTabs = params === null || params === void 0 ? void 0 : params.rootTabs;
|
|
31
|
+
this.sizeName = ['top', 'bottom'].includes(((_a = this.rootTabs) === null || _a === void 0 ? void 0 : _a.props.tabPosition) || 'top')
|
|
32
32
|
? 'width'
|
|
33
33
|
: 'height';
|
|
34
34
|
if (this.scrollable) {
|
|
@@ -92,19 +92,19 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
92
92
|
this.navScroll.addChild(this.nav);
|
|
93
93
|
if (!params.type) {
|
|
94
94
|
this.tabBar = new td_tab_bar_class_1.TdTabBar({
|
|
95
|
-
rootTabs: params.rootTabs,
|
|
95
|
+
rootTabs: params === null || params === void 0 ? void 0 : params.rootTabs,
|
|
96
96
|
tabs: (params === null || params === void 0 ? void 0 : params.panes) || [],
|
|
97
97
|
});
|
|
98
98
|
this.nav.addChild(this.tabBar);
|
|
99
99
|
}
|
|
100
100
|
this.tabs =
|
|
101
|
-
((
|
|
101
|
+
((_b = params.panes) === null || _b === void 0 ? void 0 : _b.map((pane, index) => {
|
|
102
102
|
var _a, _b, _c, _d, _e, _f;
|
|
103
103
|
// const uid = pane.uid
|
|
104
104
|
const disabled = pane.disabled;
|
|
105
|
-
const active = this.rootTabs.currentName === ((
|
|
105
|
+
const active = ((_a = this.rootTabs) === null || _a === void 0 ? void 0 : _a.currentName) === ((_b = pane.name) !== null && _b !== void 0 ? _b : index);
|
|
106
106
|
const tabindex = !disabled && active ? 0 : -1;
|
|
107
|
-
const tabName = (
|
|
107
|
+
const tabName = (_c = pane.name) !== null && _c !== void 0 ? _c : (index + 1);
|
|
108
108
|
console.log('tabName is ', tabName);
|
|
109
109
|
const item = new framework_1.Div({
|
|
110
110
|
name: 'tab-nav-item',
|
|
@@ -149,7 +149,7 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
|
-
if (tabName === ((
|
|
152
|
+
if (tabName === ((_d = this.rootTabs) === null || _d === void 0 ? void 0 : _d.currentName)) {
|
|
153
153
|
item.ctrl.addStyleObj({
|
|
154
154
|
color: var_1.$colors.primary.base,
|
|
155
155
|
});
|
|
@@ -160,8 +160,8 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
// const tabLabelContent = pane.slots?.label || pane?.label;
|
|
163
|
-
if ((
|
|
164
|
-
item.slotChild(
|
|
163
|
+
if ((_e = pane.slots) === null || _e === void 0 ? void 0 : _e.label) {
|
|
164
|
+
item.slotChild(pane.slots.label);
|
|
165
165
|
}
|
|
166
166
|
else if (pane.label) {
|
|
167
167
|
item.addChild(new framework_1.TextNode(pane.label));
|
|
@@ -241,7 +241,7 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
241
241
|
const navScroll = (_b = this.navScroll) === null || _b === void 0 ? void 0 : _b.dom;
|
|
242
242
|
const isHorizontal = ['top', 'bottom'].includes(((_c = this.rootTabs) === null || _c === void 0 ? void 0 : _c.props.tabPosition) || 'top');
|
|
243
243
|
const activeTabBounding = activeTab.getBoundingClientRect();
|
|
244
|
-
const navScrollBounding = navScroll.getBoundingClientRect();
|
|
244
|
+
const navScrollBounding = navScroll === null || navScroll === void 0 ? void 0 : navScroll.getBoundingClientRect();
|
|
245
245
|
const maxOffset = isHorizontal
|
|
246
246
|
? nav.offsetWidth - navScrollBounding.width
|
|
247
247
|
: nav.offsetHeight - navScrollBounding.height;
|
|
@@ -4,7 +4,7 @@ exports.TdTabPane = void 0;
|
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
6
6
|
class TdTabPane extends ui_abstract_1.UI {
|
|
7
|
-
constructor(params) {
|
|
7
|
+
constructor(params = {}) {
|
|
8
8
|
super(params, 'fragment');
|
|
9
9
|
this.className = 'TdTabPane';
|
|
10
10
|
this.isClosable = params === null || params === void 0 ? void 0 : params.closable;
|
|
@@ -12,7 +12,7 @@ const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
|
12
12
|
const td_tab_nav_class_1 = require("./td-tab-nav.class");
|
|
13
13
|
const td_tabs_style_1 = require("./td-tabs.style");
|
|
14
14
|
class TdTabs extends ui_abstract_1.UI {
|
|
15
|
-
constructor(params) {
|
|
15
|
+
constructor(params = {}) {
|
|
16
16
|
var _a, _b;
|
|
17
17
|
super(params);
|
|
18
18
|
this.className = 'TdTabs';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports
|
|
3
|
+
exports.$tabsContentStyle = exports.$tabsItemStyle = exports.$tabsNavStyle = exports.$tabsNavPrevStyle = exports.$tabNavNextStyle = exports.$tabsNavWrapAfterStyle = exports.$tabsNavScrollStyle = exports.$tabsNavWrapStyle = exports.$tabsNewTabStyle = exports.$tabsActiveBarStyle = exports.$tabsHeaderVerticalStyle = exports.$tabsHeaderStyle = exports.$tabsStyle = exports.$tabs = void 0;
|
|
4
|
+
exports.useStyle = useStyle;
|
|
4
5
|
const var_1 = require("../../../styles/var");
|
|
5
6
|
const transition_1 = require("../../../styles/transition");
|
|
6
7
|
const utils_1 = require("@type-dom/utils");
|
|
@@ -125,4 +126,3 @@ exports.$tabsContentStyle = {
|
|
|
125
126
|
};
|
|
126
127
|
function useStyle(config) {
|
|
127
128
|
}
|
|
128
|
-
exports.useStyle = useStyle;
|
|
@@ -5,7 +5,7 @@ const framework_1 = require("@type-dom/framework");
|
|
|
5
5
|
const var_1 = require("../../../styles/var");
|
|
6
6
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
7
7
|
class TdDivider extends ui_abstract_1.UI {
|
|
8
|
-
constructor(params) {
|
|
8
|
+
constructor(params = {}) {
|
|
9
9
|
super(params);
|
|
10
10
|
this.className = 'TdDivider';
|
|
11
11
|
this.ctrl.addStyleObj({
|