Package not found. Please check the package name and try again.
@type-dom/ui 0.0.1
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 +11 -0
- package/package.json +14 -0
- package/src/basic/index.d.ts +15 -0
- package/src/basic/index.js +19 -0
- package/src/basic/td-button/td-button.class.d.ts +16 -0
- package/src/basic/td-button/td-button.class.js +140 -0
- package/src/basic/td-button/td-button.interface.d.ts +38 -0
- package/src/basic/td-button/td-button.interface.js +2 -0
- package/src/basic/td-button/td-button.style.d.ts +13 -0
- package/src/basic/td-button/td-button.style.js +143 -0
- package/src/basic/td-container/td-aside/td-aside.class.d.ts +6 -0
- package/src/basic/td-container/td-aside/td-aside.class.js +17 -0
- package/src/basic/td-container/td-aside/td-aside.interface.d.ts +7 -0
- package/src/basic/td-container/td-aside/td-aside.interface.js +2 -0
- package/src/basic/td-container/td-container.class.d.ts +7 -0
- package/src/basic/td-container/td-container.class.js +27 -0
- package/src/basic/td-container/td-container.d.ts +8 -0
- package/src/basic/td-container/td-container.interface.d.ts +8 -0
- package/src/basic/td-container/td-container.interface.js +2 -0
- package/src/basic/td-container/td-container.js +21 -0
- package/src/basic/td-container/td-footer/td-footer.class.d.ts +6 -0
- package/src/basic/td-container/td-footer/td-footer.class.js +18 -0
- package/src/basic/td-container/td-footer/td-footer.interface.d.ts +7 -0
- package/src/basic/td-container/td-footer/td-footer.interface.js +2 -0
- package/src/basic/td-container/td-header/td-header.class.d.ts +8 -0
- package/src/basic/td-container/td-header/td-header.class.js +18 -0
- package/src/basic/td-container/td-header/td-header.interface.d.ts +7 -0
- package/src/basic/td-container/td-header/td-header.interface.js +2 -0
- package/src/basic/td-container/td-main/td-main.class.d.ts +6 -0
- package/src/basic/td-container/td-main/td-main.class.js +19 -0
- package/src/basic/td-container/td-main/td-main.interface.d.ts +6 -0
- package/src/basic/td-container/td-main/td-main.interface.js +2 -0
- package/src/basic/td-icon/td-icon.class.d.ts +11 -0
- package/src/basic/td-icon/td-icon.class.js +57 -0
- package/src/basic/td-icon/td-icon.interface.d.ts +11 -0
- package/src/basic/td-icon/td-icon.interface.js +2 -0
- package/src/basic/td-icon/td-icon.style.d.ts +13 -0
- package/src/basic/td-icon/td-icon.style.js +27 -0
- package/src/basic/td-select/option/option.class.d.ts +12 -0
- package/src/basic/td-select/option/option.class.js +18 -0
- package/src/basic/td-select/option/option.interface.d.ts +5 -0
- package/src/basic/td-select/option/option.interface.js +2 -0
- package/src/basic/td-select/td-select.class.d.ts +14 -0
- package/src/basic/td-select/td-select.class.js +68 -0
- package/src/basic/td-select/td-select.interface.d.ts +6 -0
- package/src/basic/td-select/td-select.interface.js +2 -0
- package/src/data/index.d.ts +0 -0
- package/src/data/index.js +1 -0
- package/src/feedback/dialog/dialog.d.ts +7 -0
- package/src/feedback/dialog/dialog.js +14 -0
- package/src/feedback/index.d.ts +2 -0
- package/src/feedback/index.js +7 -0
- package/src/feedback/message-box/message-box.d.ts +9 -0
- package/src/feedback/message-box/message-box.js +24 -0
- package/src/feedback/overlay/container/body/body.d.ts +7 -0
- package/src/feedback/overlay/container/body/body.js +21 -0
- package/src/feedback/overlay/container/container.d.ts +15 -0
- package/src/feedback/overlay/container/container.js +41 -0
- package/src/feedback/overlay/container/footer/cancel-button/cancel-button.d.ts +8 -0
- package/src/feedback/overlay/container/footer/cancel-button/cancel-button.js +31 -0
- package/src/feedback/overlay/container/footer/confirm-button/confirm-button.d.ts +9 -0
- package/src/feedback/overlay/container/footer/confirm-button/confirm-button.js +35 -0
- package/src/feedback/overlay/container/footer/footer.d.ts +11 -0
- package/src/feedback/overlay/container/footer/footer.js +49 -0
- package/src/feedback/overlay/container/header/close-button/close-button.d.ts +11 -0
- package/src/feedback/overlay/container/header/close-button/close-button.js +37 -0
- package/src/feedback/overlay/container/header/header.d.ts +12 -0
- package/src/feedback/overlay/container/header/header.js +25 -0
- package/src/feedback/overlay/container/header/title/title.d.ts +9 -0
- package/src/feedback/overlay/container/header/title/title.js +23 -0
- package/src/feedback/overlay/overlay.abstract.d.ts +16 -0
- package/src/feedback/overlay/overlay.abstract.js +65 -0
- package/src/form/checkbox-group/checkbox-group.class.d.ts +13 -0
- package/src/form/checkbox-group/checkbox-group.class.js +59 -0
- package/src/form/checkbox-group/checkbox-group.interface.d.ts +6 -0
- package/src/form/checkbox-group/checkbox-group.interface.js +2 -0
- package/src/form/checkbox-group/checkbox-option/checkbox-option.class.d.ts +12 -0
- package/src/form/checkbox-group/checkbox-option/checkbox-option.class.js +44 -0
- package/src/form/checkbox-group/checkbox-option/checkbox-option.interface.d.ts +10 -0
- package/src/form/checkbox-group/checkbox-option/checkbox-option.interface.js +2 -0
- package/src/form/field-item/cascade/field-cascade.abstract.d.ts +22 -0
- package/src/form/field-item/cascade/field-cascade.abstract.js +186 -0
- package/src/form/field-item/field-item.abstract.d.ts +11 -0
- package/src/form/field-item/field-item.abstract.js +42 -0
- package/src/form/field-item/field-item.interface.d.ts +12 -0
- package/src/form/field-item/field-item.interface.js +2 -0
- package/src/form/field-item/field-item.style.d.ts +3 -0
- package/src/form/field-item/field-item.style.js +39 -0
- package/src/form/field-item/input/field-input.abstract.d.ts +13 -0
- package/src/form/field-item/input/field-input.abstract.js +52 -0
- package/src/form/field-item/options/field-options.abstract.d.ts +22 -0
- package/src/form/field-item/options/field-options.abstract.js +246 -0
- package/src/form/field-item/radio/field-radio.abstract.d.ts +16 -0
- package/src/form/field-item/radio/field-radio.abstract.js +98 -0
- package/src/form/field-item/select/field-select.abstract.d.ts +12 -0
- package/src/form/field-item/select/field-select.abstract.js +44 -0
- package/src/form/field-item/span/field-span.abstract.d.ts +9 -0
- package/src/form/field-item/span/field-span.abstract.js +54 -0
- package/src/form/field-item/textarea/field-textarea.abstract.d.ts +11 -0
- package/src/form/field-item/textarea/field-textarea.abstract.js +63 -0
- package/src/form/index.d.ts +11 -0
- package/src/form/index.js +23 -0
- package/src/form/input-number/td-input-number.class.d.ts +9 -0
- package/src/form/input-number/td-input-number.class.js +55 -0
- package/src/form/input-number/td-input-number.interface.d.ts +9 -0
- package/src/form/input-number/td-input-number.interface.js +2 -0
- package/src/form/radio-group/radio-group.class.d.ts +13 -0
- package/src/form/radio-group/radio-group.class.js +48 -0
- package/src/form/radio-group/radio-group.interface.d.ts +6 -0
- package/src/form/radio-group/radio-group.interface.js +2 -0
- package/src/form/radio-group/radio-option/radio-option.class.d.ts +12 -0
- package/src/form/radio-group/radio-option/radio-option.class.js +33 -0
- package/src/form/radio-group/radio-option/radio-option.interface.d.ts +5 -0
- package/src/form/radio-group/radio-option/radio-option.interface.js +2 -0
- package/src/form/select/select.class.d.ts +17 -0
- package/src/form/select/select.class.js +132 -0
- package/src/form/select/select.interface.d.ts +10 -0
- package/src/form/select/select.interface.js +2 -0
- package/src/form/td-input/td-input.class.d.ts +9 -0
- package/src/form/td-input/td-input.class.js +55 -0
- package/src/form/td-input/td-input.interface.d.ts +11 -0
- package/src/form/td-input/td-input.interface.js +2 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +8 -0
- package/src/navigation/index.d.ts +0 -0
- package/src/navigation/index.js +1 -0
- package/src/others/collapsible-box/collapsible-box.d.ts +15 -0
- package/src/others/collapsible-box/collapsible-box.js +37 -0
- package/src/others/collapsible-box/contents/contents.d.ts +7 -0
- package/src/others/collapsible-box/contents/contents.js +25 -0
- package/src/others/collapsible-box/heading/expand-heading.d.ts +12 -0
- package/src/others/collapsible-box/heading/expand-heading.js +70 -0
- package/src/others/index.d.ts +3 -0
- package/src/others/index.js +9 -0
- package/src/styles/color-scheme.d.ts +1 -0
- package/src/styles/color-scheme.js +88 -0
- package/src/styles/config.d.ts +5 -0
- package/src/styles/config.js +8 -0
- package/src/styles/function.d.ts +10 -0
- package/src/styles/function.js +75 -0
- package/src/styles/var.d.ts +184 -0
- package/src/styles/var.js +250 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@type-dom/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"tslib": "^2.3.0"
|
|
6
|
+
},
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "./src/index.js",
|
|
9
|
+
"typings": "./src/index.d.ts",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public",
|
|
12
|
+
"registry": "https://registry.npmjs.org/"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { TdButton } from './td-button/td-button.class';
|
|
2
|
+
export type { ITdButton } from './td-button/td-button.interface';
|
|
3
|
+
export { TdIcon } from './td-icon/td-icon.class';
|
|
4
|
+
export type { ITdIcon } from './td-icon/td-icon.interface';
|
|
5
|
+
export { TdContainer } from './td-container/td-container.class';
|
|
6
|
+
export { TdContainerComp } from './td-container/td-container';
|
|
7
|
+
export type { ITdContainer } from './td-container/td-container.interface';
|
|
8
|
+
export { TdHeader } from './td-container/td-header/td-header.class';
|
|
9
|
+
export type { ITdHeader, ITdHeaderConfig } from './td-container/td-header/td-header.interface';
|
|
10
|
+
export { TdAside } from './td-container/td-aside/td-aside.class';
|
|
11
|
+
export type { ITdAside, ITdAsideConfig } from './td-container/td-aside/td-aside.interface';
|
|
12
|
+
export { TdMain } from './td-container/td-main/td-main.class';
|
|
13
|
+
export type { ITdMain, ITdMainConfig } from './td-container/td-main/td-main.interface';
|
|
14
|
+
export { TdFooter } from './td-container/td-footer/td-footer.class';
|
|
15
|
+
export type { ITdFooter } from './td-container/td-footer/td-footer.interface';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdFooter = exports.TdMain = exports.TdAside = exports.TdHeader = exports.TdContainerComp = exports.TdContainer = exports.TdIcon = exports.TdButton = void 0;
|
|
4
|
+
var td_button_class_1 = require("./td-button/td-button.class");
|
|
5
|
+
Object.defineProperty(exports, "TdButton", { enumerable: true, get: function () { return td_button_class_1.TdButton; } });
|
|
6
|
+
var td_icon_class_1 = require("./td-icon/td-icon.class");
|
|
7
|
+
Object.defineProperty(exports, "TdIcon", { enumerable: true, get: function () { return td_icon_class_1.TdIcon; } });
|
|
8
|
+
var td_container_class_1 = require("./td-container/td-container.class");
|
|
9
|
+
Object.defineProperty(exports, "TdContainer", { enumerable: true, get: function () { return td_container_class_1.TdContainer; } });
|
|
10
|
+
var td_container_1 = require("./td-container/td-container");
|
|
11
|
+
Object.defineProperty(exports, "TdContainerComp", { enumerable: true, get: function () { return td_container_1.TdContainerComp; } });
|
|
12
|
+
var td_header_class_1 = require("./td-container/td-header/td-header.class");
|
|
13
|
+
Object.defineProperty(exports, "TdHeader", { enumerable: true, get: function () { return td_header_class_1.TdHeader; } });
|
|
14
|
+
var td_aside_class_1 = require("./td-container/td-aside/td-aside.class");
|
|
15
|
+
Object.defineProperty(exports, "TdAside", { enumerable: true, get: function () { return td_aside_class_1.TdAside; } });
|
|
16
|
+
var td_main_class_1 = require("./td-container/td-main/td-main.class");
|
|
17
|
+
Object.defineProperty(exports, "TdMain", { enumerable: true, get: function () { return td_main_class_1.TdMain; } });
|
|
18
|
+
var td_footer_class_1 = require("./td-container/td-footer/td-footer.class");
|
|
19
|
+
Object.defineProperty(exports, "TdFooter", { enumerable: true, get: function () { return td_footer_class_1.TdFooter; } });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TypeButton, TextNode, Span, TypeHtml, XElement } from '@type-dom/framework';
|
|
2
|
+
import { TdIcon } from '../td-icon/td-icon.class';
|
|
3
|
+
import { ITdButton, ITdButtonConfig } from './td-button.interface';
|
|
4
|
+
export declare class TdButton extends TypeButton implements ITdButton {
|
|
5
|
+
className: 'TdButton';
|
|
6
|
+
parent?: TypeHtml | XElement;
|
|
7
|
+
childNodes: (Span | TdIcon)[];
|
|
8
|
+
span: Span;
|
|
9
|
+
textNode: TextNode;
|
|
10
|
+
private type?;
|
|
11
|
+
private plain?;
|
|
12
|
+
private disabled?;
|
|
13
|
+
constructor(config?: Partial<ITdButtonConfig>);
|
|
14
|
+
setConfig(config?: Partial<ITdButtonConfig>): void;
|
|
15
|
+
initEvents(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdButton = void 0;
|
|
4
|
+
const rxjs_1 = require("rxjs");
|
|
5
|
+
const framework_1 = require("@type-dom/framework");
|
|
6
|
+
const td_icon_style_1 = require("../td-icon/td-icon.style");
|
|
7
|
+
const var_1 = require("../../styles/var");
|
|
8
|
+
const td_icon_class_1 = require("../td-icon/td-icon.class");
|
|
9
|
+
const td_button_style_1 = require("./td-button.style");
|
|
10
|
+
// import '../../styles/style.css';
|
|
11
|
+
class TdButton extends framework_1.TypeButton {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
super();
|
|
14
|
+
this.className = 'TdButton';
|
|
15
|
+
// this.template = new Template(this);
|
|
16
|
+
this.span = new framework_1.Span(this);
|
|
17
|
+
this.span.addStyleObj({
|
|
18
|
+
display: 'inline-flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
});
|
|
21
|
+
this.textNode = new framework_1.TextNode();
|
|
22
|
+
this.span.addChild(this.textNode);
|
|
23
|
+
const slot = new framework_1.Slot(this.span);
|
|
24
|
+
this.span.addChild(slot);
|
|
25
|
+
this.childNodes = [this.span];
|
|
26
|
+
this.setConfig(config);
|
|
27
|
+
}
|
|
28
|
+
setConfig(config) {
|
|
29
|
+
this.addStyleObj(td_button_style_1.tdButtonBase);
|
|
30
|
+
if (config === null || config === void 0 ? void 0 : config.title) {
|
|
31
|
+
this.textNode.setText(config.title);
|
|
32
|
+
}
|
|
33
|
+
if (config === null || config === void 0 ? void 0 : config.SvgClass) {
|
|
34
|
+
const icon = new td_icon_class_1.TdIcon({
|
|
35
|
+
SvgClass: config.SvgClass,
|
|
36
|
+
});
|
|
37
|
+
if (config.iconPosition === 'right') {
|
|
38
|
+
icon.addStyleObj(td_icon_style_1.$iconRight);
|
|
39
|
+
this.addChild(icon);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (config.title) {
|
|
43
|
+
icon.addStyleObj(td_icon_style_1.$iconLeft);
|
|
44
|
+
}
|
|
45
|
+
// else {
|
|
46
|
+
// icon.addStyleObj()
|
|
47
|
+
// }
|
|
48
|
+
this.unshiftChild(icon);
|
|
49
|
+
}
|
|
50
|
+
if (config.loading) {
|
|
51
|
+
icon.addStyleObj(td_icon_style_1.$iconLoading);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
// const type = config?.type ? config.type : 'default';
|
|
55
|
+
// this.type = type;
|
|
56
|
+
if (config === null || config === void 0 ? void 0 : config.type) {
|
|
57
|
+
this.type = config.type;
|
|
58
|
+
if (config === null || config === void 0 ? void 0 : config.plain) {
|
|
59
|
+
console.log('config.plain . ');
|
|
60
|
+
this.plain = config.plain;
|
|
61
|
+
if (config.disabled) {
|
|
62
|
+
this.addStyleObj(td_button_style_1.$buttonPlainColors[config.type].disabled);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
console.log(td_button_style_1.$buttonPlainColors[config.type].default);
|
|
66
|
+
this.addStyleObj(td_button_style_1.$buttonPlainColors[config.type].default);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
if (config === null || config === void 0 ? void 0 : config.disabled) {
|
|
71
|
+
console.log('config?.disabled is true . $button.disabled is ', var_1.$button.disabled);
|
|
72
|
+
this.disabled = config.disabled;
|
|
73
|
+
this.addStyleObj(td_button_style_1.$buttonStateColors[config.type].disabled);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
this.addStyleObj(td_button_style_1.$buttonStateColors[config.type].default);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const size = (config === null || config === void 0 ? void 0 : config.size) ? config.size : 'middle';
|
|
81
|
+
this.addStyleObj(td_button_style_1.sizeOpts[size]);
|
|
82
|
+
if (config === null || config === void 0 ? void 0 : config.round) {
|
|
83
|
+
this.addStyleObj({
|
|
84
|
+
borderRadius: var_1.$borderRadius.round,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else if (config === null || config === void 0 ? void 0 : config.circle) {
|
|
88
|
+
this.addStyleObj({
|
|
89
|
+
borderRadius: var_1.$borderRadius.circle,
|
|
90
|
+
padding: var_1.$buttonPaddingVertical.default
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// 悬浮、聚焦、激活状态样式
|
|
95
|
+
initEvents() {
|
|
96
|
+
this.events.push((0, rxjs_1.fromEvent)(this.dom, 'mouseover').subscribe(() => {
|
|
97
|
+
if (this.disabled) {
|
|
98
|
+
this.setStyleObj({
|
|
99
|
+
cursor: framework_1.StyleCursor.notAllowed
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
if (this.type) {
|
|
104
|
+
this.setStyleObj(td_button_style_1.$buttonStateColors[this.type].hover);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
this.setStyleObj({
|
|
108
|
+
color: var_1.$button.hover.textColor,
|
|
109
|
+
backgroundColor: var_1.$button.hover.borderColor,
|
|
110
|
+
borderColor: var_1.$button.hover.borderColor,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}), (0, rxjs_1.fromEvent)(this.dom, 'mouseout').subscribe(() => {
|
|
115
|
+
if (this.disabled) {
|
|
116
|
+
this.setStyleObj({
|
|
117
|
+
cursor: framework_1.StyleCursor.auto,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
if (this.type) {
|
|
122
|
+
if (this.plain) {
|
|
123
|
+
this.setStyleObj(td_button_style_1.$buttonPlainColors[this.type].default);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
this.setStyleObj(td_button_style_1.$buttonStateColors[this.type].default);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.setStyleObj({
|
|
131
|
+
color: var_1.$button.textColor,
|
|
132
|
+
backgroundColor: var_1.$button.bgColor,
|
|
133
|
+
borderColor: var_1.$button.borderColor,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.TdButton = TdButton;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ITypeButton, ISpan } from '@type-dom/framework';
|
|
2
|
+
import { ITdIcon } from '../td-icon/td-icon.interface';
|
|
3
|
+
export interface ITdButton extends ITypeButton {
|
|
4
|
+
className: 'TdButton';
|
|
5
|
+
childNodes: (ISpan | ITdIcon)[];
|
|
6
|
+
}
|
|
7
|
+
export type IButtonSize = '' | 'mini' | 'small' | 'middle' | 'large';
|
|
8
|
+
export type IButtonType = 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger' | 'text' | '';
|
|
9
|
+
export type IButtonNativeType = 'button' | 'submit' | 'reset';
|
|
10
|
+
/**
|
|
11
|
+
* type、plain、round 和 circle 来定义按钮的样式。
|
|
12
|
+
* type: primary/success/warning/danger/info
|
|
13
|
+
* size: mini/small/middle/large
|
|
14
|
+
* round,
|
|
15
|
+
* circle: boolean
|
|
16
|
+
* 使用 icon 属性来为按钮添加图标。
|
|
17
|
+
* icon: 'Search'
|
|
18
|
+
* 通过设置 loading 属性为 true 来显示加载中状态。
|
|
19
|
+
* loading-icon 自定义加载中状态图标组件
|
|
20
|
+
* color 自定义按钮的颜色。
|
|
21
|
+
* disabled 按钮是否为禁用状态
|
|
22
|
+
*/
|
|
23
|
+
export interface ITdButtonConfig {
|
|
24
|
+
size: IButtonSize;
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
title: string;
|
|
27
|
+
type: IButtonType;
|
|
28
|
+
SvgClass: any;
|
|
29
|
+
iconPosition: 'left' | 'right';
|
|
30
|
+
icon: string;
|
|
31
|
+
nativeType: IButtonNativeType;
|
|
32
|
+
loading: boolean;
|
|
33
|
+
plain: boolean;
|
|
34
|
+
round: boolean;
|
|
35
|
+
circle: boolean;
|
|
36
|
+
loadingIcon: string;
|
|
37
|
+
color: string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IStyle } from '@type-dom/framework';
|
|
2
|
+
import { IType } from '../../styles/var';
|
|
3
|
+
export declare const $buttonIconSpanGap: {
|
|
4
|
+
large: string;
|
|
5
|
+
default: string;
|
|
6
|
+
small: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sizeOpts: Record<string, Partial<IStyle>>;
|
|
9
|
+
export declare const tdButtonBase: Partial<IStyle>;
|
|
10
|
+
export declare const $buttonStateColors: Record<string, Record<string, Partial<IStyle>>>;
|
|
11
|
+
export declare function buttonVariant($type: IType): void;
|
|
12
|
+
export declare const $buttonPlainColors: Record<string, Record<string, Partial<IStyle>>>;
|
|
13
|
+
export declare function buttonPlain($type: IType): void;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buttonPlain = exports.$buttonPlainColors = exports.buttonVariant = exports.$buttonStateColors = exports.tdButtonBase = exports.sizeOpts = exports.$buttonIconSpanGap = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const var_1 = require("../../styles/var");
|
|
6
|
+
exports.$buttonIconSpanGap = {
|
|
7
|
+
large: '8px',
|
|
8
|
+
default: '6px',
|
|
9
|
+
small: '4px',
|
|
10
|
+
};
|
|
11
|
+
exports.sizeOpts = {
|
|
12
|
+
mini: {
|
|
13
|
+
height: var_1.$commonComponentSize.small,
|
|
14
|
+
fontSize: var_1.$buttonFontSize.small,
|
|
15
|
+
padding: var_1.$buttonPaddingVertical.small + ' ' + var_1.$buttonPaddingHorizontal.small,
|
|
16
|
+
borderRadius: var_1.$buttonBorderRadius.small,
|
|
17
|
+
},
|
|
18
|
+
small: {
|
|
19
|
+
height: var_1.$commonComponentSize.small,
|
|
20
|
+
fontSize: var_1.$buttonFontSize.small,
|
|
21
|
+
padding: var_1.$buttonPaddingVertical.small + ' ' + var_1.$buttonPaddingHorizontal.small,
|
|
22
|
+
borderRadius: var_1.$buttonBorderRadius.small,
|
|
23
|
+
},
|
|
24
|
+
middle: {
|
|
25
|
+
height: var_1.$commonComponentSize.default,
|
|
26
|
+
fontSize: var_1.$buttonFontSize.default,
|
|
27
|
+
padding: var_1.$buttonPaddingVertical.default + ' ' + var_1.$buttonPaddingHorizontal.default,
|
|
28
|
+
borderRadius: var_1.$buttonBorderRadius.default,
|
|
29
|
+
},
|
|
30
|
+
large: {
|
|
31
|
+
height: var_1.$commonComponentSize.large,
|
|
32
|
+
fontSize: var_1.$buttonFontSize.large,
|
|
33
|
+
padding: var_1.$buttonPaddingVertical.large + ' ' + var_1.$buttonPaddingHorizontal.large,
|
|
34
|
+
borderRadius: var_1.$buttonBorderRadius.large,
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.tdButtonBase = {
|
|
38
|
+
display: framework_1.StyleDisplay.inlineFlex,
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
lineHeight: '1',
|
|
42
|
+
// min-height will expand when in flex
|
|
43
|
+
height: '32px',
|
|
44
|
+
whiteSpace: 'nowrap',
|
|
45
|
+
cursor: framework_1.StyleCursor.pointer,
|
|
46
|
+
color: var_1.$button.textColor,
|
|
47
|
+
textAlign: 'center',
|
|
48
|
+
boxSizing: 'border-box',
|
|
49
|
+
outline: 'none',
|
|
50
|
+
transition: '.1s',
|
|
51
|
+
fontWeight: var_1.$button.fontWeight,
|
|
52
|
+
userSelect: 'none',
|
|
53
|
+
verticalAlign: 'middle',
|
|
54
|
+
appearance: 'none',
|
|
55
|
+
// '-webkit-appearance': 'none',
|
|
56
|
+
backgroundColor: var_1.$button.bgColor,
|
|
57
|
+
// border: $border, // getCssVar('border'),
|
|
58
|
+
borderWidth: var_1.$borderWidth,
|
|
59
|
+
borderStyle: var_1.$borderStyle,
|
|
60
|
+
borderColor: var_1.$button.borderColor,
|
|
61
|
+
padding: '8px 15px',
|
|
62
|
+
};
|
|
63
|
+
exports.$buttonStateColors = {};
|
|
64
|
+
function buttonVariant($type) {
|
|
65
|
+
const $buttonColorTypes = {
|
|
66
|
+
default: {
|
|
67
|
+
color: var_1.$colorWhite,
|
|
68
|
+
backgroundColor: var_1.$colors[$type].base,
|
|
69
|
+
borderColor: var_1.$colors[$type].base,
|
|
70
|
+
borderWidth: var_1.$borderWidth,
|
|
71
|
+
outlineColor: var_1.$colors[$type]['light-5'],
|
|
72
|
+
// activeColor: $colors[$type]['dark-2'],
|
|
73
|
+
},
|
|
74
|
+
hover: {
|
|
75
|
+
color: var_1.$colorWhite,
|
|
76
|
+
// 'link-text-color': $colors[$type]['light-5'],
|
|
77
|
+
backgroundColor: var_1.$colors[$type]['light-3'],
|
|
78
|
+
borderColor: var_1.$colors[$type]['light-3'], // ['color', $type, 'light-3'],
|
|
79
|
+
},
|
|
80
|
+
active: {
|
|
81
|
+
backgroundColor: var_1.$colors[$type]['dark-2'],
|
|
82
|
+
borderColor: var_1.$colors[$type]['dark-2'] // ['color', $type, 'dark-2'],
|
|
83
|
+
},
|
|
84
|
+
disabled: {
|
|
85
|
+
color: var_1.$colorWhite,
|
|
86
|
+
backgroundColor: var_1.$colors[$type]['light-5'],
|
|
87
|
+
borderColor: var_1.$colors[$type]['light-5'], // ['color', $type, 'light-5'],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
exports.$buttonStateColors[$type] = $buttonColorTypes;
|
|
91
|
+
// for (const $type1 in $buttonColorTypes) {
|
|
92
|
+
// console.log('$type1 is ', $type1);
|
|
93
|
+
// const $typeMap = $buttonColorTypes[$type1];
|
|
94
|
+
// console.log('$typeMap is ', $typeMap);
|
|
95
|
+
// for (const $typeColor in $typeMap) {
|
|
96
|
+
// console.log('$typeColor is ', $typeColor);
|
|
97
|
+
// const $list = $typeMap[$typeColor];
|
|
98
|
+
// console.log('$list is ', $list);
|
|
99
|
+
// // cssVarFromGlobal(('button', $type, $typeColor), $list);
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// @each $type, $typeMap in $buttonColorTypes {
|
|
103
|
+
// @each $typeColor, $list in $typeMap {
|
|
104
|
+
// @include css-var-from-global(('button', $type, $typeColor), $list);
|
|
105
|
+
// }
|
|
106
|
+
// }
|
|
107
|
+
// &.is-plain,
|
|
108
|
+
// &.is-text,
|
|
109
|
+
// &.is-link {
|
|
110
|
+
// @include button-plain($type);
|
|
111
|
+
// }
|
|
112
|
+
}
|
|
113
|
+
exports.buttonVariant = buttonVariant;
|
|
114
|
+
for (const $type of ['default', 'primary', 'success', 'warning', 'danger', 'info']) {
|
|
115
|
+
// @include m($type) {
|
|
116
|
+
// @include button-variant($type);
|
|
117
|
+
// }
|
|
118
|
+
buttonVariant($type);
|
|
119
|
+
}
|
|
120
|
+
exports.$buttonPlainColors = {};
|
|
121
|
+
function buttonPlain($type) {
|
|
122
|
+
const $buttonColorTypes = {
|
|
123
|
+
default: {
|
|
124
|
+
color: var_1.$colors[$type].base,
|
|
125
|
+
backgroundColor: var_1.$colors[$type]['light-9'],
|
|
126
|
+
borderColor: var_1.$colors[$type]['light-5'],
|
|
127
|
+
borderWidth: var_1.$borderWidth,
|
|
128
|
+
},
|
|
129
|
+
hover: {
|
|
130
|
+
color: var_1.$colorWhite,
|
|
131
|
+
backgroundColor: var_1.$colors[$type].base,
|
|
132
|
+
borderColor: var_1.$colors[$type].base,
|
|
133
|
+
},
|
|
134
|
+
active: {
|
|
135
|
+
color: var_1.$colorWhite
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
exports.$buttonPlainColors[$type] = $buttonColorTypes;
|
|
139
|
+
}
|
|
140
|
+
exports.buttonPlain = buttonPlain;
|
|
141
|
+
for (const $type of ['default', 'primary', 'success', 'warning', 'danger', 'info']) {
|
|
142
|
+
buttonPlain($type);
|
|
143
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdAside = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
class TdAside extends framework_1.TypeAside {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super();
|
|
8
|
+
this.className = 'TdAside';
|
|
9
|
+
this.addStyleObj({
|
|
10
|
+
overflow: 'auto',
|
|
11
|
+
boxSizing: 'border-box',
|
|
12
|
+
flexShrink: 0,
|
|
13
|
+
width: (config === null || config === void 0 ? void 0 : config.width) || '300px'
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.TdAside = TdAside;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TypeHtml, TypeSection, XElement } from '@type-dom/framework';
|
|
2
|
+
import { ITdContainerConfig } from './td-container.interface';
|
|
3
|
+
export declare class TdContainer extends TypeSection {
|
|
4
|
+
className: 'TdContainer';
|
|
5
|
+
parent?: TypeHtml | XElement;
|
|
6
|
+
constructor(config?: ITdContainerConfig);
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdContainer = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
// import '../../style/scss/index.scss';
|
|
6
|
+
class TdContainer extends framework_1.TypeSection {
|
|
7
|
+
constructor(config) {
|
|
8
|
+
super();
|
|
9
|
+
this.className = 'TdContainer';
|
|
10
|
+
this.addAttrName('td-container');
|
|
11
|
+
this.addAttrClass('td-container');
|
|
12
|
+
this.addStyleObj({
|
|
13
|
+
display: 'flex',
|
|
14
|
+
flexDirection: 'row',
|
|
15
|
+
flex: 1,
|
|
16
|
+
flexBasis: 'auto',
|
|
17
|
+
boxSizing: 'border-box',
|
|
18
|
+
minWidth: 0,
|
|
19
|
+
});
|
|
20
|
+
if (config === null || config === void 0 ? void 0 : config.vertical) {
|
|
21
|
+
this.addStyleObj({
|
|
22
|
+
flexDirection: 'column'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.TdContainer = TdContainer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class TdContainerComp extends HTMLElement {
|
|
2
|
+
static observedAttributes: never[];
|
|
3
|
+
/**
|
|
4
|
+
* connectedCallback会在 custom element 首次被插入到文档 DOM 节点上时被调用,
|
|
5
|
+
* 而 attributeChangedCallback则会在 custom element 增加、删除或者修改某个属性时被调用。
|
|
6
|
+
*/
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdContainerComp = void 0;
|
|
4
|
+
const td_container_class_1 = require("./td-container.class");
|
|
5
|
+
class TdContainerComp extends HTMLElement {
|
|
6
|
+
/**
|
|
7
|
+
* connectedCallback会在 custom element 首次被插入到文档 DOM 节点上时被调用,
|
|
8
|
+
* 而 attributeChangedCallback则会在 custom element 增加、删除或者修改某个属性时被调用。
|
|
9
|
+
*/
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
const title = 'td-container';
|
|
12
|
+
const container = new td_container_class_1.TdContainer();
|
|
13
|
+
container.setAttrName(title);
|
|
14
|
+
// 渲染
|
|
15
|
+
container.render();
|
|
16
|
+
console.log('container is ', container);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.TdContainerComp = TdContainerComp;
|
|
20
|
+
TdContainerComp.observedAttributes = [];
|
|
21
|
+
customElements.define('td-container', TdContainerComp);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdFooter = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
class TdFooter extends framework_1.TypeFooter {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super();
|
|
8
|
+
this.className = 'TdFooter';
|
|
9
|
+
this.addStyleObj({
|
|
10
|
+
padding: '0 20px',
|
|
11
|
+
height: (config === null || config === void 0 ? void 0 : config.height) || '60px',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
flexShrink: 0,
|
|
14
|
+
backgroundColor: '#a0cfff',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.TdFooter = TdFooter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TypeHeader } from '@type-dom/framework';
|
|
2
|
+
import type { ITdHeader, ITdHeaderConfig } from './td-header.interface';
|
|
3
|
+
import { TdContainer } from '../td-container.class';
|
|
4
|
+
export declare class TdHeader extends TypeHeader implements ITdHeader {
|
|
5
|
+
className: 'TdHeader';
|
|
6
|
+
parent?: TdContainer;
|
|
7
|
+
constructor(config?: ITdHeaderConfig);
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdHeader = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
class TdHeader extends framework_1.TypeHeader {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super();
|
|
8
|
+
this.className = 'TdHeader';
|
|
9
|
+
this.addStyleObj({
|
|
10
|
+
padding: '0 20px',
|
|
11
|
+
height: (config === null || config === void 0 ? void 0 : config.height) || '60px',
|
|
12
|
+
boxSizing: 'border-box',
|
|
13
|
+
flexShrink: 0,
|
|
14
|
+
backgroundColor: '#a0cfff',
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.TdHeader = TdHeader;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdMain = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
class TdMain extends framework_1.TypeMain {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.className = 'TdMain';
|
|
9
|
+
this.addStyleObj({
|
|
10
|
+
display: 'block',
|
|
11
|
+
flex: 1,
|
|
12
|
+
flexBasis: 'auto',
|
|
13
|
+
overflow: 'auto',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
padding: '20px',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.TdMain = TdMain;
|