@type-dom/ui 0.0.8 → 0.0.10
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 +2 -8
- 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 +20 -20
- 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 +15 -16
- 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 +2 -2
- package/src/components/feedback/index.js +5 -6
- 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.d.ts +2 -0
- package/src/components/feedback/td-loading/td-loading.class.js +7 -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 +5 -3
- 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-notification/td-notification.style.js +6 -6
- 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/td-checkbox.style.js +2 -2
- 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-input/widget/utils.js +8 -8
- 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 +10 -10
- 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/styles/var.d.ts +1 -1
- package/src/styles/var.js +2 -2
- 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
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TdTabNav = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const utils_1 = require("@type-dom/utils");
|
|
5
6
|
const framework_1 = require("@type-dom/framework");
|
|
6
7
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
|
-
const utils_1 = require("@type-dom/utils");
|
|
8
8
|
const ui_abstract_1 = require("../../../ui/ui.abstract");
|
|
9
9
|
const var_1 = require("../../../styles/var");
|
|
10
|
-
const aria_1 = require("../../../aria");
|
|
11
10
|
const td_tabs_style_1 = require("./td-tabs.style");
|
|
12
11
|
const td_tab_bar_class_1 = require("./td-tab-bar.class");
|
|
13
12
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
@@ -17,8 +16,8 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
17
16
|
super(params);
|
|
18
17
|
this.tabs = [];
|
|
19
18
|
this.className = 'TdTabNav';
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
19
|
+
this.attr.addName('td-tab-nav-wrap');
|
|
20
|
+
this.style.addObj(td_tabs_style_1.$tabsNavWrapStyle);
|
|
22
21
|
this.addChild(new framework_1.U({
|
|
23
22
|
name: 'underline',
|
|
24
23
|
styleObj: td_tabs_style_1.$tabsNavWrapAfterStyle,
|
|
@@ -134,6 +133,8 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
134
133
|
this.removeFocus();
|
|
135
134
|
// this.rootTabs.currentName = tabName;
|
|
136
135
|
(_b = (_a = params.emits) === null || _a === void 0 ? void 0 : _a.tabClick) === null || _b === void 0 ? void 0 : _b.call(_a, pane, tabName, evt);
|
|
136
|
+
// tabClick是上级 tabs 的事件监听器,不是tabNav的;
|
|
137
|
+
// this.emit('tabClick', pane, tabName, evt);
|
|
137
138
|
(0, framework_1.nextTick)(() => {
|
|
138
139
|
this.selectTab(ele);
|
|
139
140
|
});
|
|
@@ -141,21 +142,20 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
141
142
|
keydown: (ev) => {
|
|
142
143
|
var _a, _b;
|
|
143
144
|
if (closable &&
|
|
144
|
-
(ev.code ===
|
|
145
|
-
|
|
146
|
-
// emit('tabRemove', pane, ev)
|
|
145
|
+
((ev === null || ev === void 0 ? void 0 : ev.code) === utils_1.EVENT_CODE.delete || (ev === null || ev === void 0 ? void 0 : ev.code) === utils_1.EVENT_CODE.backspace)) {
|
|
146
|
+
// emit('tabRemove', pane, ev);
|
|
147
147
|
(_b = (_a = params.emits) === null || _a === void 0 ? void 0 : _a.tabRemove) === null || _b === void 0 ? void 0 : _b.call(_a, pane, ev);
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
151
|
});
|
|
152
152
|
if (tabName === ((_d = this.rootTabs) === null || _d === void 0 ? void 0 : _d.currentName)) {
|
|
153
|
-
item.
|
|
153
|
+
item.style.addObj({
|
|
154
154
|
color: var_1.$colors.primary.base,
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
|
-
item.
|
|
158
|
+
item.style.addObj({
|
|
159
159
|
color: var_1.$textColor.regular,
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -187,8 +187,8 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
187
187
|
})) || [];
|
|
188
188
|
console.log('this.tabs is ', this.tabs);
|
|
189
189
|
this.nav.addChildren(...this.tabs);
|
|
190
|
-
this.nav.
|
|
191
|
-
this.props = this.
|
|
190
|
+
this.nav.style.addObj(this.navStyle);
|
|
191
|
+
this.props = this.useParams(params);
|
|
192
192
|
}
|
|
193
193
|
mounted() {
|
|
194
194
|
setTimeout(() => this.scrollToActiveTab(), 0);
|
|
@@ -300,12 +300,12 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
300
300
|
(_a = this.tabBar) === null || _a === void 0 ? void 0 : _a.change();
|
|
301
301
|
this.tabs.forEach((tab) => {
|
|
302
302
|
if (item === tab) {
|
|
303
|
-
tab.
|
|
303
|
+
tab.style.setObj({
|
|
304
304
|
color: var_1.$colors.primary.base,
|
|
305
305
|
});
|
|
306
306
|
}
|
|
307
307
|
else {
|
|
308
|
-
tab.
|
|
308
|
+
tab.style.setObj({
|
|
309
309
|
color: var_1.$textColor.regular,
|
|
310
310
|
});
|
|
311
311
|
}
|
|
@@ -313,7 +313,7 @@ class TdTabNav extends ui_abstract_1.UI {
|
|
|
313
313
|
}
|
|
314
314
|
changeTab(e) {
|
|
315
315
|
const code = e.code;
|
|
316
|
-
const { up, down, left, right } =
|
|
316
|
+
const { up, down, left, right } = utils_1.EVENT_CODE;
|
|
317
317
|
if (![up, down, left, right].includes(code))
|
|
318
318
|
return;
|
|
319
319
|
// 左右上下键更换tab
|
|
@@ -26,15 +26,15 @@ class TdTabPane extends ui_abstract_1.UI {
|
|
|
26
26
|
}
|
|
27
27
|
this.addChild(this.panel);
|
|
28
28
|
}
|
|
29
|
-
this.props = this.
|
|
29
|
+
this.props = this.useParams(params);
|
|
30
30
|
}
|
|
31
31
|
setActive(active) {
|
|
32
32
|
var _a, _b;
|
|
33
33
|
if (active) {
|
|
34
|
-
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.
|
|
34
|
+
(_a = this.panel) === null || _a === void 0 ? void 0 : _a.style.show();
|
|
35
35
|
}
|
|
36
36
|
else {
|
|
37
|
-
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.
|
|
37
|
+
(_b = this.panel) === null || _b === void 0 ? void 0 : _b.style.hide();
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -16,8 +16,8 @@ class TdTabs extends ui_abstract_1.UI {
|
|
|
16
16
|
var _a, _b;
|
|
17
17
|
super(params);
|
|
18
18
|
this.className = 'TdTabs';
|
|
19
|
-
this.
|
|
20
|
-
// this.
|
|
19
|
+
this.attr.addName('td-tabs');
|
|
20
|
+
// this.style.addObj($tabsStyle);
|
|
21
21
|
this.currentName = (params === null || params === void 0 ? void 0 : params.modelValue) || '';
|
|
22
22
|
this.header = new framework_1.Div({
|
|
23
23
|
className: 'header',
|
|
@@ -28,7 +28,7 @@ class TdTabs extends ui_abstract_1.UI {
|
|
|
28
28
|
const tabPosition = (params === null || params === void 0 ? void 0 : params.tabPosition) || 'top';
|
|
29
29
|
const isVertical = ['left', 'right'].includes(tabPosition);
|
|
30
30
|
if (isVertical) {
|
|
31
|
-
this.header.
|
|
31
|
+
this.header.style.addObj(td_tabs_style_1.$tabsHeaderVerticalStyle);
|
|
32
32
|
}
|
|
33
33
|
if ((params === null || params === void 0 ? void 0 : params.editable) || (params === null || params === void 0 ? void 0 : params.addable)) {
|
|
34
34
|
this.newBtn = new framework_1.Span({
|
|
@@ -92,7 +92,7 @@ class TdTabs extends ui_abstract_1.UI {
|
|
|
92
92
|
else {
|
|
93
93
|
this.childNodes = [this.panel, this.header];
|
|
94
94
|
}
|
|
95
|
-
this.props = this.
|
|
95
|
+
this.props = this.useParams(params);
|
|
96
96
|
}
|
|
97
97
|
setCurrentName(value_1) {
|
|
98
98
|
return tslib_1.__awaiter(this, arguments, void 0, function* (value, trigger = false) {
|
|
@@ -11,14 +11,14 @@ class CollapsibleBox extends framework_1.TypeDiv {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super();
|
|
13
13
|
this.className = 'CollapsibleBox';
|
|
14
|
-
this.
|
|
14
|
+
this.style.addObj({
|
|
15
15
|
// borderTop: '1px solid #dddddd',
|
|
16
16
|
// borderBottom: '1px solid #dddddd',
|
|
17
17
|
listStyle: 'none',
|
|
18
18
|
padding: '3px',
|
|
19
19
|
marginBottom: '5px'
|
|
20
20
|
});
|
|
21
|
-
this.
|
|
21
|
+
this.attr.addName('collapsible-box');
|
|
22
22
|
this.heading = new expand_heading_1.ExpandHeading('标题');
|
|
23
23
|
this.heading.parent = this;
|
|
24
24
|
this.contents = new contents_1.CollapsibleBoxContents();
|
|
@@ -7,14 +7,14 @@ class CollapsibleBoxContents extends framework_1.TypeDiv {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'CollapsibleBoxContents';
|
|
10
|
-
this.
|
|
10
|
+
this.style.addObj({
|
|
11
11
|
display: 'flex',
|
|
12
12
|
flexWrap: 'wrap',
|
|
13
13
|
justifyContent: 'flex-start',
|
|
14
14
|
// width: '194px',
|
|
15
15
|
border: '1px solid #a0a0a0'
|
|
16
16
|
});
|
|
17
|
-
this.
|
|
17
|
+
this.attr.addName('collapsible-box-contents');
|
|
18
18
|
this.childNodes = [];
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -7,7 +7,7 @@ class ExpandHeading extends framework_1.TypeDiv {
|
|
|
7
7
|
constructor(title) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'ExpandHeading';
|
|
10
|
-
this.
|
|
10
|
+
this.style.addObj({
|
|
11
11
|
margin: '0',
|
|
12
12
|
paddingLeft: '10px',
|
|
13
13
|
boxSizing: 'border-box',
|
|
@@ -20,7 +20,7 @@ class ExpandHeading extends framework_1.TypeDiv {
|
|
|
20
20
|
alignItems: 'center',
|
|
21
21
|
height: '36px'
|
|
22
22
|
});
|
|
23
|
-
this.
|
|
23
|
+
this.attr.addName('expand-heading');
|
|
24
24
|
this.svg = new svgs_1.ElCaretBottomSvg({
|
|
25
25
|
attrObj: {
|
|
26
26
|
fill: '#FFF'
|
|
@@ -37,31 +37,31 @@ class ExpandHeading extends framework_1.TypeDiv {
|
|
|
37
37
|
setTitle(title) {
|
|
38
38
|
this.title.setText(title);
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
setup() {
|
|
41
41
|
this.svg.addEvents({
|
|
42
42
|
click: (e) => {
|
|
43
|
-
var _a, _b
|
|
43
|
+
var _a, _b;
|
|
44
44
|
console.log('expand-heading svg.dom clicked');
|
|
45
45
|
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
46
46
|
// const style = getComputedStyle(this.svg.dom);
|
|
47
47
|
// console.log('style.transform is ', style.transform);
|
|
48
|
-
if (
|
|
49
|
-
this.svg.
|
|
48
|
+
if (this.svg.style.get('transform') === 'rotate(-90deg)') {
|
|
49
|
+
this.svg.style.setObj({
|
|
50
50
|
transform: 'rotate(0deg)',
|
|
51
51
|
transition: 'transform 0.3s'
|
|
52
52
|
});
|
|
53
53
|
// console.log('style.transform is ', style.transform);
|
|
54
|
-
if (((
|
|
55
|
-
this.parent.lastChild.
|
|
54
|
+
if (((_a = this.parent) === null || _a === void 0 ? void 0 : _a.lastChild) instanceof framework_1.TypeHtml) {
|
|
55
|
+
this.parent.lastChild.style.set('display', 'flex'); // flex
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
|
-
this.svg.
|
|
59
|
+
this.svg.style.setObj({
|
|
60
60
|
transform: 'rotate(-90deg)',
|
|
61
61
|
transition: 'transform 0.3s'
|
|
62
62
|
});
|
|
63
|
-
if (((
|
|
64
|
-
this.parent.lastChild.
|
|
63
|
+
if (((_b = this.parent) === null || _b === void 0 ? void 0 : _b.lastChild) instanceof framework_1.TypeHtml) {
|
|
64
|
+
this.parent.lastChild.style.set('display', 'none');
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -7,10 +7,10 @@ class CustomBlock extends framework_1.TypeDiv {
|
|
|
7
7
|
constructor(params) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'CustomBlock';
|
|
10
|
-
this.
|
|
10
|
+
this.attr.addName('tip');
|
|
11
11
|
const bgColor = params.type === 'warning' ? var_1.$colorDangerRgb : var_1.$colorPrimaryRgb;
|
|
12
12
|
const borderLeftColor = params.type === 'warning' ? var_1.$colors.danger.base : var_1.$colors.primary.base;
|
|
13
|
-
this.
|
|
13
|
+
this.style.addObj({
|
|
14
14
|
padding: '8px 16px',
|
|
15
15
|
// background-color: var(--block-tip-bg-color),
|
|
16
16
|
backgroundColor: 'rgba(' + bgColor + ', 0.1)',
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ExampleFloatControl = void 0;
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
|
-
const var_1 = require("../../../styles/var");
|
|
6
5
|
const svgs_1 = require("@type-dom/svgs");
|
|
6
|
+
const var_1 = require("../../../styles/var");
|
|
7
7
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
8
|
class ExampleFloatControl extends framework_1.TypeDiv {
|
|
9
9
|
constructor(params) {
|
|
10
10
|
super();
|
|
11
11
|
this.className = 'ExampleFloatControl';
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
12
|
+
this.attr.addName('example-float-control');
|
|
13
|
+
this.attr.addObj({
|
|
14
14
|
role: 'button',
|
|
15
15
|
tabIndex: 0
|
|
16
16
|
});
|
|
17
|
-
this.
|
|
17
|
+
this.style.addObj({
|
|
18
18
|
display: 'flex',
|
|
19
19
|
alignItems: 'center',
|
|
20
20
|
justifyContent: 'center',
|
|
@@ -48,14 +48,14 @@ class ExampleFloatControl extends framework_1.TypeDiv {
|
|
|
48
48
|
marginLeft: '10px'
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
51
|
-
this.
|
|
51
|
+
this.useParams(params);
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
setup() {
|
|
54
54
|
this.addEvents({
|
|
55
55
|
click: () => {
|
|
56
56
|
// 隐藏 代码
|
|
57
|
-
this.
|
|
58
|
-
this.parent.sourceWrapper.
|
|
57
|
+
this.style.hide();
|
|
58
|
+
this.parent.sourceWrapper.style.hide();
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -7,14 +7,14 @@ class ExampleShowcase extends framework_1.TypeDiv {
|
|
|
7
7
|
constructor(params) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'ExampleShowcase';
|
|
10
|
-
this.
|
|
11
|
-
this.
|
|
10
|
+
this.attr.addName('example-showcase');
|
|
11
|
+
this.style.addObj({
|
|
12
12
|
padding: '1.5rem',
|
|
13
13
|
margin: '.5px',
|
|
14
14
|
// background-color: var(--bg-color),
|
|
15
15
|
backgroundColor: var_1.$bgColor.default
|
|
16
16
|
});
|
|
17
|
-
this.
|
|
17
|
+
this.useParams(params);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
exports.ExampleShowcase = ExampleShowcase;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { ITypeConfig, TypeDiv } from '@type-dom/framework';
|
|
1
|
+
import { IJsonData, ITypeConfig, TypeDiv, XProxy } from '@type-dom/framework';
|
|
2
|
+
export interface IExampleSourceWrapperConfig extends ITypeConfig {
|
|
3
|
+
sourceWrapper: string | XProxy<IJsonData>;
|
|
4
|
+
}
|
|
2
5
|
export declare class ExampleSourceWrapper extends TypeDiv {
|
|
3
6
|
className: 'ExampleSourceWrapper';
|
|
4
|
-
|
|
7
|
+
props: IExampleSourceWrapperConfig;
|
|
8
|
+
constructor(params: IExampleSourceWrapperConfig);
|
|
5
9
|
}
|
|
@@ -8,8 +8,8 @@ class ExampleSourceWrapper extends framework_1.TypeDiv {
|
|
|
8
8
|
var _a;
|
|
9
9
|
super();
|
|
10
10
|
this.className = 'ExampleSourceWrapper';
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
11
|
+
this.attr.addName('example-source-wrapper');
|
|
12
|
+
this.style.addObj({
|
|
13
13
|
// background-color: var(--code-bg-color),
|
|
14
14
|
backgroundColor: styles_1.$fillColor.light,
|
|
15
15
|
overflowX: 'auto'
|
|
@@ -24,7 +24,7 @@ class ExampleSourceWrapper extends framework_1.TypeDiv {
|
|
|
24
24
|
// if (params?.slot) {
|
|
25
25
|
// this.slotChild(params.slot);
|
|
26
26
|
// }
|
|
27
|
-
this.
|
|
27
|
+
this.props = this.useParams(params);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.ExampleSourceWrapper = ExampleSourceWrapper;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IJsonData, ITypeConfig, TypeDiv, TypeElement, XProxy } from '@type-dom/framework';
|
|
2
2
|
import { ExampleSourceWrapper } from './example-source-wrapper';
|
|
3
3
|
import { ExampleFloatControl } from './example-float-control';
|
|
4
|
-
interface IExampleConfig extends ITypeConfig {
|
|
4
|
+
export interface IExampleConfig extends ITypeConfig {
|
|
5
5
|
showcase: TypeElement[];
|
|
6
6
|
sourceWrapper: string | XProxy<IJsonData>;
|
|
7
7
|
}
|
|
@@ -12,4 +12,3 @@ export declare class Example extends TypeDiv {
|
|
|
12
12
|
props: IExampleConfig;
|
|
13
13
|
constructor(params: IExampleConfig);
|
|
14
14
|
}
|
|
15
|
-
export {};
|
|
@@ -3,18 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Example = void 0;
|
|
4
4
|
const framework_1 = require("@type-dom/framework");
|
|
5
5
|
const var_1 = require("../../../styles/var");
|
|
6
|
+
const td_divider_class_1 = require("../td-divider/td-divider.class");
|
|
6
7
|
const example_showcase_1 = require("./example-showcase");
|
|
7
8
|
const example_source_wrapper_1 = require("./example-source-wrapper");
|
|
8
9
|
const op_btns_1 = require("./op-btns");
|
|
9
10
|
const example_float_control_1 = require("./example-float-control");
|
|
10
|
-
const td_divider_class_1 = require("../td-divider/td-divider.class");
|
|
11
11
|
// todo slots 改造
|
|
12
12
|
class Example extends framework_1.TypeDiv {
|
|
13
13
|
constructor(params) {
|
|
14
14
|
super();
|
|
15
15
|
this.className = 'Example';
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
16
|
+
this.attr.addName('example');
|
|
17
|
+
this.style.addObj({
|
|
18
18
|
// border: '1px solid 'var(--border-color),
|
|
19
19
|
border: '1px solid ' + var_1.$borderColor.base,
|
|
20
20
|
// border-radius: var(--el-border-radius-base);
|
|
@@ -71,7 +71,7 @@ class Example extends framework_1.TypeDiv {
|
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
this.addChild(this.floatControl);
|
|
74
|
-
this.props = this.
|
|
74
|
+
this.props = this.useParams(params);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
exports.Example = Example;
|
|
@@ -3,16 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OpBtns = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const framework_1 = require("@type-dom/framework");
|
|
6
|
+
const svgs_1 = require("@type-dom/svgs");
|
|
6
7
|
const var_1 = require("../../../styles/var");
|
|
7
8
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
|
-
const svgs_1 = require("@type-dom/svgs");
|
|
9
9
|
class OpBtns extends framework_1.TypeDiv {
|
|
10
10
|
constructor(params) {
|
|
11
11
|
super();
|
|
12
12
|
this.className = 'OpBtns';
|
|
13
13
|
this.parent = params.parent;
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
14
|
+
this.attr.addName('op-btns');
|
|
15
|
+
this.style.addObj({
|
|
16
16
|
padding: '.5rem',
|
|
17
17
|
display: 'flex',
|
|
18
18
|
alignItems: 'center',
|
|
@@ -78,19 +78,18 @@ class OpBtns extends framework_1.TypeDiv {
|
|
|
78
78
|
svgObj: new svgs_1.TdViewCodeSvg(),
|
|
79
79
|
events: {
|
|
80
80
|
click: () => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.parent.
|
|
84
|
-
this.parent.floatControl.ctrl.show('flex');
|
|
81
|
+
if (this.parent.sourceWrapper.style.get('display') === 'none') {
|
|
82
|
+
this.parent.sourceWrapper.style.show();
|
|
83
|
+
this.parent.floatControl.style.show('flex');
|
|
85
84
|
}
|
|
86
85
|
else {
|
|
87
|
-
this.parent.sourceWrapper.
|
|
88
|
-
this.parent.floatControl.
|
|
86
|
+
this.parent.sourceWrapper.style.hide();
|
|
87
|
+
this.parent.floatControl.style.hide();
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
}
|
|
92
91
|
}));
|
|
93
|
-
this.
|
|
92
|
+
this.useParams(params);
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
exports.OpBtns = OpBtns;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { Div, TypeMenu, type IRoute, Router } from '@type-dom/framework';
|
|
1
|
+
import { Div, TypeMenu, type IRoute, Router, ITypeConfig } from '@type-dom/framework';
|
|
2
2
|
import { TdIcon } from '../../basic/td-icon/td-icon.class';
|
|
3
3
|
import { Menus } from './menus';
|
|
4
|
+
export interface IMenuConfig extends ITypeConfig {
|
|
5
|
+
route: IRoute;
|
|
6
|
+
router?: Router;
|
|
7
|
+
width?: string;
|
|
8
|
+
}
|
|
4
9
|
export declare class Menu extends TypeMenu {
|
|
5
10
|
className: 'Menu';
|
|
6
|
-
route
|
|
7
|
-
router
|
|
11
|
+
route?: IRoute;
|
|
12
|
+
router?: Router;
|
|
8
13
|
parent?: Menu | Menus;
|
|
9
14
|
contentItem: Div;
|
|
10
15
|
menuItems: Menu[];
|
|
11
16
|
collapsed?: boolean;
|
|
12
17
|
caret?: TdIcon;
|
|
13
|
-
constructor(
|
|
18
|
+
constructor(params: IMenuConfig);
|
|
14
19
|
get menuRoot(): Menus | undefined;
|
|
15
|
-
|
|
20
|
+
setup(): void;
|
|
16
21
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Menu = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const svgs_1 = require("@type-dom/svgs");
|
|
7
6
|
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
8
7
|
class Menu extends framework_1.TypeMenu {
|
|
9
|
-
constructor(
|
|
8
|
+
constructor(params) {
|
|
9
|
+
var _a;
|
|
10
|
+
console.log('Menu constructor . ');
|
|
10
11
|
super();
|
|
11
12
|
this.className = 'Menu';
|
|
12
|
-
this.route = route;
|
|
13
|
-
this.router = router;
|
|
14
|
-
this.
|
|
13
|
+
this.route = params.route;
|
|
14
|
+
this.router = params.router;
|
|
15
|
+
this.style.addObj({
|
|
15
16
|
paddingInlineStart: '20px'
|
|
16
17
|
// display: 'flex',
|
|
17
18
|
// flexDirection: 'column',
|
|
@@ -23,27 +24,27 @@ class Menu extends framework_1.TypeMenu {
|
|
|
23
24
|
alignItems: 'center'
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
|
-
if (route.svgObj) {
|
|
27
|
+
if (this.route.svgObj) {
|
|
27
28
|
div.addChild(new td_icon_class_1.TdIcon({
|
|
28
|
-
svgObj: route.svgObj,
|
|
29
|
+
svgObj: this.route.svgObj,
|
|
29
30
|
styleObj: {
|
|
30
31
|
paddingRight: '5px'
|
|
31
32
|
}
|
|
32
33
|
}));
|
|
33
34
|
}
|
|
34
35
|
div.addChild(new framework_1.Div({
|
|
35
|
-
text: route.name,
|
|
36
|
+
text: this.route.name,
|
|
36
37
|
attrObj: {
|
|
37
38
|
name: 'route-name'
|
|
38
39
|
},
|
|
39
40
|
styleObj: {
|
|
40
|
-
width: '160px'
|
|
41
|
+
width: (_a = params.width) !== null && _a !== void 0 ? _a : '160px'
|
|
41
42
|
}
|
|
42
43
|
}));
|
|
43
|
-
if (route.children) {
|
|
44
|
+
if (this.route.children) {
|
|
44
45
|
const caret = new td_icon_class_1.TdIcon({
|
|
45
46
|
svgObj: new svgs_1.ElCaretBottomSvg(),
|
|
46
|
-
size: '30px'
|
|
47
|
+
// size: '30px'
|
|
47
48
|
});
|
|
48
49
|
caret.appendParent(div);
|
|
49
50
|
this.caret = caret;
|
|
@@ -51,29 +52,29 @@ class Menu extends framework_1.TypeMenu {
|
|
|
51
52
|
div.appendParent(this);
|
|
52
53
|
this.contentItem = div;
|
|
53
54
|
this.menuItems = [];
|
|
55
|
+
this.useParams(params);
|
|
54
56
|
}
|
|
55
57
|
get menuRoot() {
|
|
56
58
|
var _a;
|
|
57
59
|
return (_a = this.parent) === null || _a === void 0 ? void 0 : _a.menuRoot;
|
|
58
60
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
setup() {
|
|
62
|
+
var _a;
|
|
63
|
+
if (((_a = this.route) === null || _a === void 0 ? void 0 : _a.redirect) === undefined) {
|
|
61
64
|
// todo addEvent 如何pipe ??
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
event.stopPropagation(); // 防止冒泡
|
|
76
|
-
event.preventDefault();
|
|
65
|
+
this.contentItem.addEvents({
|
|
66
|
+
click: (event) => {
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
console.log('click . ');
|
|
69
|
+
if (((_a = this.menuRoot) === null || _a === void 0 ? void 0 : _a.selectedMenu) === this) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
(_b = this.router) === null || _b === void 0 ? void 0 : _b.push(this.route.path);
|
|
73
|
+
(_c = this.menuRoot) === null || _c === void 0 ? void 0 : _c.setSelectedMenu(this);
|
|
74
|
+
document.title = 'UI - ' + ((_d = this.route) === null || _d === void 0 ? void 0 : _d.name);
|
|
75
|
+
event === null || event === void 0 ? void 0 : event.stopPropagation(); // 防止冒泡
|
|
76
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
77
|
+
}
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
else {
|
|
@@ -81,25 +82,26 @@ class Menu extends framework_1.TypeMenu {
|
|
|
81
82
|
const leftSvg = new svgs_1.ElCaretLeftSvg();
|
|
82
83
|
// console.log(' leftSvg.resetSize ');
|
|
83
84
|
// leftSvg.resetSize('1.5em', '1.5em');
|
|
84
|
-
// leftSvg.
|
|
85
|
+
// leftSvg.style.setObj({
|
|
85
86
|
// width: '1.5em',
|
|
86
87
|
// height: '1.5em'
|
|
87
88
|
// })
|
|
88
89
|
const bottomSvg = new svgs_1.ElCaretBottomSvg();
|
|
89
|
-
// bottomSvg.
|
|
90
|
+
// bottomSvg.style.setObj({
|
|
90
91
|
// width: '1.5em',
|
|
91
92
|
// height: '1.5em'
|
|
92
93
|
// })
|
|
93
94
|
// bottomSvg.resetSize('1.5em', '1.5em');
|
|
94
|
-
this.addEvent('click',
|
|
95
|
+
this.contentItem.addEvent('click', (event) => {
|
|
95
96
|
var _a, _b, _c;
|
|
97
|
+
console.log('click .');
|
|
96
98
|
if (((_a = this.menuRoot) === null || _a === void 0 ? void 0 : _a.selectedMenu) === this) {
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
101
|
if (this.collapsed === undefined || this.collapsed === false) {
|
|
100
102
|
this.collapsed = true;
|
|
101
103
|
this.menuItems.forEach((menu) => {
|
|
102
|
-
menu.
|
|
104
|
+
menu.style.setObj({
|
|
103
105
|
display: 'none'
|
|
104
106
|
});
|
|
105
107
|
});
|
|
@@ -108,7 +110,7 @@ class Menu extends framework_1.TypeMenu {
|
|
|
108
110
|
else {
|
|
109
111
|
this.collapsed = false;
|
|
110
112
|
this.menuItems.forEach((menu) => {
|
|
111
|
-
menu.
|
|
113
|
+
menu.style.setObj({
|
|
112
114
|
display: 'block'
|
|
113
115
|
});
|
|
114
116
|
});
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { IRoute, ITypeConfig, Router, TypeDiv } from '@type-dom/framework';
|
|
2
2
|
import { Menu } from './menu';
|
|
3
|
+
export interface IMenusConfig extends ITypeConfig {
|
|
4
|
+
router?: Router;
|
|
5
|
+
}
|
|
3
6
|
export declare class Menus extends TypeDiv {
|
|
4
7
|
className: 'Menus';
|
|
5
8
|
selectedMenu?: Menu;
|
|
6
|
-
|
|
9
|
+
private router?;
|
|
10
|
+
constructor(params?: IMenusConfig);
|
|
7
11
|
get menuRoot(): Menus;
|
|
12
|
+
mounted(): void;
|
|
8
13
|
createMenus(parent: Menus | Menu, routes: IRoute[], router: Router): void;
|
|
9
14
|
setSelectedMenu(menu: Menu): void;
|
|
10
15
|
}
|