@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.
Files changed (142) hide show
  1. package/README.md +11 -0
  2. package/package.json +14 -0
  3. package/src/basic/index.d.ts +15 -0
  4. package/src/basic/index.js +19 -0
  5. package/src/basic/td-button/td-button.class.d.ts +16 -0
  6. package/src/basic/td-button/td-button.class.js +140 -0
  7. package/src/basic/td-button/td-button.interface.d.ts +38 -0
  8. package/src/basic/td-button/td-button.interface.js +2 -0
  9. package/src/basic/td-button/td-button.style.d.ts +13 -0
  10. package/src/basic/td-button/td-button.style.js +143 -0
  11. package/src/basic/td-container/td-aside/td-aside.class.d.ts +6 -0
  12. package/src/basic/td-container/td-aside/td-aside.class.js +17 -0
  13. package/src/basic/td-container/td-aside/td-aside.interface.d.ts +7 -0
  14. package/src/basic/td-container/td-aside/td-aside.interface.js +2 -0
  15. package/src/basic/td-container/td-container.class.d.ts +7 -0
  16. package/src/basic/td-container/td-container.class.js +27 -0
  17. package/src/basic/td-container/td-container.d.ts +8 -0
  18. package/src/basic/td-container/td-container.interface.d.ts +8 -0
  19. package/src/basic/td-container/td-container.interface.js +2 -0
  20. package/src/basic/td-container/td-container.js +21 -0
  21. package/src/basic/td-container/td-footer/td-footer.class.d.ts +6 -0
  22. package/src/basic/td-container/td-footer/td-footer.class.js +18 -0
  23. package/src/basic/td-container/td-footer/td-footer.interface.d.ts +7 -0
  24. package/src/basic/td-container/td-footer/td-footer.interface.js +2 -0
  25. package/src/basic/td-container/td-header/td-header.class.d.ts +8 -0
  26. package/src/basic/td-container/td-header/td-header.class.js +18 -0
  27. package/src/basic/td-container/td-header/td-header.interface.d.ts +7 -0
  28. package/src/basic/td-container/td-header/td-header.interface.js +2 -0
  29. package/src/basic/td-container/td-main/td-main.class.d.ts +6 -0
  30. package/src/basic/td-container/td-main/td-main.class.js +19 -0
  31. package/src/basic/td-container/td-main/td-main.interface.d.ts +6 -0
  32. package/src/basic/td-container/td-main/td-main.interface.js +2 -0
  33. package/src/basic/td-icon/td-icon.class.d.ts +11 -0
  34. package/src/basic/td-icon/td-icon.class.js +57 -0
  35. package/src/basic/td-icon/td-icon.interface.d.ts +11 -0
  36. package/src/basic/td-icon/td-icon.interface.js +2 -0
  37. package/src/basic/td-icon/td-icon.style.d.ts +13 -0
  38. package/src/basic/td-icon/td-icon.style.js +27 -0
  39. package/src/basic/td-select/option/option.class.d.ts +12 -0
  40. package/src/basic/td-select/option/option.class.js +18 -0
  41. package/src/basic/td-select/option/option.interface.d.ts +5 -0
  42. package/src/basic/td-select/option/option.interface.js +2 -0
  43. package/src/basic/td-select/td-select.class.d.ts +14 -0
  44. package/src/basic/td-select/td-select.class.js +68 -0
  45. package/src/basic/td-select/td-select.interface.d.ts +6 -0
  46. package/src/basic/td-select/td-select.interface.js +2 -0
  47. package/src/data/index.d.ts +0 -0
  48. package/src/data/index.js +1 -0
  49. package/src/feedback/dialog/dialog.d.ts +7 -0
  50. package/src/feedback/dialog/dialog.js +14 -0
  51. package/src/feedback/index.d.ts +2 -0
  52. package/src/feedback/index.js +7 -0
  53. package/src/feedback/message-box/message-box.d.ts +9 -0
  54. package/src/feedback/message-box/message-box.js +24 -0
  55. package/src/feedback/overlay/container/body/body.d.ts +7 -0
  56. package/src/feedback/overlay/container/body/body.js +21 -0
  57. package/src/feedback/overlay/container/container.d.ts +15 -0
  58. package/src/feedback/overlay/container/container.js +41 -0
  59. package/src/feedback/overlay/container/footer/cancel-button/cancel-button.d.ts +8 -0
  60. package/src/feedback/overlay/container/footer/cancel-button/cancel-button.js +31 -0
  61. package/src/feedback/overlay/container/footer/confirm-button/confirm-button.d.ts +9 -0
  62. package/src/feedback/overlay/container/footer/confirm-button/confirm-button.js +35 -0
  63. package/src/feedback/overlay/container/footer/footer.d.ts +11 -0
  64. package/src/feedback/overlay/container/footer/footer.js +49 -0
  65. package/src/feedback/overlay/container/header/close-button/close-button.d.ts +11 -0
  66. package/src/feedback/overlay/container/header/close-button/close-button.js +37 -0
  67. package/src/feedback/overlay/container/header/header.d.ts +12 -0
  68. package/src/feedback/overlay/container/header/header.js +25 -0
  69. package/src/feedback/overlay/container/header/title/title.d.ts +9 -0
  70. package/src/feedback/overlay/container/header/title/title.js +23 -0
  71. package/src/feedback/overlay/overlay.abstract.d.ts +16 -0
  72. package/src/feedback/overlay/overlay.abstract.js +65 -0
  73. package/src/form/checkbox-group/checkbox-group.class.d.ts +13 -0
  74. package/src/form/checkbox-group/checkbox-group.class.js +59 -0
  75. package/src/form/checkbox-group/checkbox-group.interface.d.ts +6 -0
  76. package/src/form/checkbox-group/checkbox-group.interface.js +2 -0
  77. package/src/form/checkbox-group/checkbox-option/checkbox-option.class.d.ts +12 -0
  78. package/src/form/checkbox-group/checkbox-option/checkbox-option.class.js +44 -0
  79. package/src/form/checkbox-group/checkbox-option/checkbox-option.interface.d.ts +10 -0
  80. package/src/form/checkbox-group/checkbox-option/checkbox-option.interface.js +2 -0
  81. package/src/form/field-item/cascade/field-cascade.abstract.d.ts +22 -0
  82. package/src/form/field-item/cascade/field-cascade.abstract.js +186 -0
  83. package/src/form/field-item/field-item.abstract.d.ts +11 -0
  84. package/src/form/field-item/field-item.abstract.js +42 -0
  85. package/src/form/field-item/field-item.interface.d.ts +12 -0
  86. package/src/form/field-item/field-item.interface.js +2 -0
  87. package/src/form/field-item/field-item.style.d.ts +3 -0
  88. package/src/form/field-item/field-item.style.js +39 -0
  89. package/src/form/field-item/input/field-input.abstract.d.ts +13 -0
  90. package/src/form/field-item/input/field-input.abstract.js +52 -0
  91. package/src/form/field-item/options/field-options.abstract.d.ts +22 -0
  92. package/src/form/field-item/options/field-options.abstract.js +246 -0
  93. package/src/form/field-item/radio/field-radio.abstract.d.ts +16 -0
  94. package/src/form/field-item/radio/field-radio.abstract.js +98 -0
  95. package/src/form/field-item/select/field-select.abstract.d.ts +12 -0
  96. package/src/form/field-item/select/field-select.abstract.js +44 -0
  97. package/src/form/field-item/span/field-span.abstract.d.ts +9 -0
  98. package/src/form/field-item/span/field-span.abstract.js +54 -0
  99. package/src/form/field-item/textarea/field-textarea.abstract.d.ts +11 -0
  100. package/src/form/field-item/textarea/field-textarea.abstract.js +63 -0
  101. package/src/form/index.d.ts +11 -0
  102. package/src/form/index.js +23 -0
  103. package/src/form/input-number/td-input-number.class.d.ts +9 -0
  104. package/src/form/input-number/td-input-number.class.js +55 -0
  105. package/src/form/input-number/td-input-number.interface.d.ts +9 -0
  106. package/src/form/input-number/td-input-number.interface.js +2 -0
  107. package/src/form/radio-group/radio-group.class.d.ts +13 -0
  108. package/src/form/radio-group/radio-group.class.js +48 -0
  109. package/src/form/radio-group/radio-group.interface.d.ts +6 -0
  110. package/src/form/radio-group/radio-group.interface.js +2 -0
  111. package/src/form/radio-group/radio-option/radio-option.class.d.ts +12 -0
  112. package/src/form/radio-group/radio-option/radio-option.class.js +33 -0
  113. package/src/form/radio-group/radio-option/radio-option.interface.d.ts +5 -0
  114. package/src/form/radio-group/radio-option/radio-option.interface.js +2 -0
  115. package/src/form/select/select.class.d.ts +17 -0
  116. package/src/form/select/select.class.js +132 -0
  117. package/src/form/select/select.interface.d.ts +10 -0
  118. package/src/form/select/select.interface.js +2 -0
  119. package/src/form/td-input/td-input.class.d.ts +9 -0
  120. package/src/form/td-input/td-input.class.js +55 -0
  121. package/src/form/td-input/td-input.interface.d.ts +11 -0
  122. package/src/form/td-input/td-input.interface.js +2 -0
  123. package/src/index.d.ts +4 -0
  124. package/src/index.js +8 -0
  125. package/src/navigation/index.d.ts +0 -0
  126. package/src/navigation/index.js +1 -0
  127. package/src/others/collapsible-box/collapsible-box.d.ts +15 -0
  128. package/src/others/collapsible-box/collapsible-box.js +37 -0
  129. package/src/others/collapsible-box/contents/contents.d.ts +7 -0
  130. package/src/others/collapsible-box/contents/contents.js +25 -0
  131. package/src/others/collapsible-box/heading/expand-heading.d.ts +12 -0
  132. package/src/others/collapsible-box/heading/expand-heading.js +70 -0
  133. package/src/others/index.d.ts +3 -0
  134. package/src/others/index.js +9 -0
  135. package/src/styles/color-scheme.d.ts +1 -0
  136. package/src/styles/color-scheme.js +88 -0
  137. package/src/styles/config.d.ts +5 -0
  138. package/src/styles/config.js +8 -0
  139. package/src/styles/function.d.ts +10 -0
  140. package/src/styles/function.js +75 -0
  141. package/src/styles/var.d.ts +184 -0
  142. package/src/styles/var.js +250 -0
@@ -0,0 +1,6 @@
1
+ import { ITypeMain } from '@type-dom/framework';
2
+ export interface ITdMain extends ITypeMain {
3
+ className: 'TdMain';
4
+ }
5
+ export interface ITdMainConfig {
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { TypeHtml, TypeI, TypeSvgSvg } from '@type-dom/framework';
2
+ import { ITdIcon, ITdIconConfig } from './td-icon.interface';
3
+ export declare class TdIcon extends TypeI implements ITdIcon {
4
+ className: 'TdIcon';
5
+ parent?: TypeHtml;
6
+ svg?: TypeSvgSvg;
7
+ constructor(config?: Partial<ITdIconConfig>);
8
+ createSvg(className: string): void;
9
+ setConfig(config?: Partial<ITdIconConfig>): void;
10
+ replaceSvg(svg: TypeSvgSvg): void;
11
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TdIcon = void 0;
4
+ const framework_1 = require("@type-dom/framework");
5
+ const td_icon_style_1 = require("./td-icon.style");
6
+ class TdIcon extends framework_1.TypeI {
7
+ constructor(config) {
8
+ super();
9
+ this.className = 'TdIcon';
10
+ const slot = new framework_1.Slot(this);
11
+ this.childNodes = [slot];
12
+ this.setConfig(config);
13
+ }
14
+ // todo
15
+ createSvg(className) {
16
+ return;
17
+ }
18
+ setConfig(config) {
19
+ this.addStyleObj(td_icon_style_1.$tdIcon);
20
+ if (config === null || config === void 0 ? void 0 : config.SvgClass) {
21
+ const svg = new config.SvgClass(this);
22
+ // svg.resetSize('1em', '1em');
23
+ this.addChild(svg);
24
+ this.svg = svg;
25
+ }
26
+ if (config === null || config === void 0 ? void 0 : config.color) {
27
+ this.addStyleObj({
28
+ color: config.color,
29
+ });
30
+ }
31
+ if (config === null || config === void 0 ? void 0 : config.size) {
32
+ this.addStyleObj({
33
+ fontSize: config.size,
34
+ });
35
+ }
36
+ if (config === null || config === void 0 ? void 0 : config.loading) {
37
+ this.addStyleObj(td_icon_style_1.$iconLoading);
38
+ }
39
+ if ((config === null || config === void 0 ? void 0 : config.position) === 'right') { // 位置应该是引用的对象中设置,自身应该不需要设置。
40
+ this.addStyleObj(td_icon_style_1.$iconRight);
41
+ }
42
+ else {
43
+ // this.addStyleObj($iconLeft);
44
+ }
45
+ // this.addStyleObj(sizeOpts[size]);
46
+ // this.addAttrObj({
47
+ // type: 'primary', // success warn danger primary
48
+ // size: 'middle' // small middle, large
49
+ // });
50
+ }
51
+ replaceSvg(svg) {
52
+ this.childNodes.splice(1, 1, svg);
53
+ svg.parent = this;
54
+ this.render();
55
+ }
56
+ }
57
+ exports.TdIcon = TdIcon;
@@ -0,0 +1,11 @@
1
+ import { ITypeI } from '@type-dom/framework';
2
+ export interface ITdIcon extends ITypeI {
3
+ className: 'TdIcon';
4
+ }
5
+ export interface ITdIconConfig {
6
+ SvgClass: any;
7
+ size: string;
8
+ color: string;
9
+ loading: boolean;
10
+ position: 'left' | 'right';
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { IStyle } from '@type-dom/framework';
2
+ export declare const $tdIcon: Partial<IStyle>;
3
+ export declare const $iconLoading: {
4
+ animation: string;
5
+ };
6
+ export declare const $iconRight: {
7
+ marginLeft: string;
8
+ float: string;
9
+ };
10
+ export declare const $iconLeft: {
11
+ marginRight: string;
12
+ float: string;
13
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.$iconLeft = exports.$iconRight = exports.$iconLoading = exports.$tdIcon = void 0;
4
+ const framework_1 = require("@type-dom/framework");
5
+ exports.$tdIcon = {
6
+ height: '1em',
7
+ width: '1em',
8
+ lineHeight: '1em',
9
+ display: framework_1.StyleDisplay.inlineFlex,
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ position: framework_1.StylePosition.relative,
13
+ fill: 'currentColor',
14
+ // color: var(--color),
15
+ fontSize: 'inherit',
16
+ };
17
+ exports.$iconLoading = {
18
+ animation: 'rotating 2s linear infinite'
19
+ };
20
+ exports.$iconRight = {
21
+ marginLeft: '5px',
22
+ float: 'right',
23
+ };
24
+ exports.$iconLeft = {
25
+ marginRight: '5px',
26
+ float: 'left',
27
+ };
@@ -0,0 +1,12 @@
1
+ import { TextNode, TypeNode, TypeOption } from '@type-dom/framework';
2
+ import { TdSelect } from '../td-select.class';
3
+ import { ISelectOption } from './option.interface';
4
+ export declare class SelectOption extends TypeOption implements ISelectOption {
5
+ nodeName: 'option';
6
+ className: 'SelectOption';
7
+ parent?: TdSelect;
8
+ dom: HTMLOptionElement;
9
+ childNodes: TypeNode[];
10
+ text: TextNode;
11
+ constructor();
12
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SelectOption = void 0;
4
+ const framework_1 = require("@type-dom/framework");
5
+ class SelectOption extends framework_1.TypeOption {
6
+ constructor() {
7
+ super();
8
+ this.nodeName = 'option';
9
+ this.dom = document.createElement(this.nodeName);
10
+ this.className = 'SelectOption';
11
+ this.propObj.attrObj = {
12
+ name: 'option'
13
+ };
14
+ this.text = new framework_1.TextNode('一个选项');
15
+ this.childNodes = [this.text];
16
+ }
17
+ }
18
+ exports.SelectOption = SelectOption;
@@ -0,0 +1,5 @@
1
+ import { ITypeOption } from '@type-dom/framework';
2
+ export interface ISelectOption extends ITypeOption {
3
+ nodeName: 'option';
4
+ className: 'SelectOption';
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { TypeHtml, TypeSelect } from '@type-dom/framework';
2
+ import { IOption } from '../../form/field-item/field-item.interface';
3
+ import { SelectOption } from './option/option.class';
4
+ import { ITdSelect } from './td-select.interface';
5
+ export declare class TdSelect extends TypeSelect implements ITdSelect {
6
+ className: 'TdSelect';
7
+ parent?: TypeHtml;
8
+ childNodes: SelectOption[];
9
+ value?: string | number | boolean;
10
+ constructor();
11
+ setOptions(options: IOption[], value: string | number | boolean): void;
12
+ resetOptions(options: IOption[], value: string | number | boolean): void;
13
+ initEvents(): void;
14
+ }
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TdSelect = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ const option_class_1 = require("./option/option.class");
7
+ class TdSelect extends framework_1.TypeSelect {
8
+ constructor() {
9
+ super();
10
+ this.className = 'TdSelect';
11
+ this.addAttrName('td-select');
12
+ this.childNodes = [];
13
+ }
14
+ setOptions(options, value) {
15
+ this.clearChildNodes();
16
+ this.clearChildDom();
17
+ const firstOpt = new option_class_1.SelectOption();
18
+ firstOpt.text.setText('请选择');
19
+ firstOpt.addAttrObj({
20
+ label: '请选择',
21
+ value: 0
22
+ });
23
+ this.addChild(firstOpt);
24
+ options.forEach(opt => {
25
+ const optObj = new option_class_1.SelectOption();
26
+ optObj.text.setText(opt.label);
27
+ optObj.addAttrObj({
28
+ label: opt.label,
29
+ value: opt.value
30
+ });
31
+ // console.log('opt is ', opt);
32
+ // opt.selected && optObj.addAttribute('selected', true);
33
+ this.addChild(optObj);
34
+ });
35
+ this.childNodes.forEach(optObj => {
36
+ if (String(optObj.attrObj.value).trim() === String(value).trim()) {
37
+ optObj.addAttribute('selected', true);
38
+ }
39
+ else {
40
+ // optObj.removeAttribute('selected');
41
+ }
42
+ });
43
+ // console.error('this.dom.value is ', this.dom.value);
44
+ }
45
+ resetOptions(options, value) {
46
+ this.setOptions(options, value);
47
+ this.render(); // 需要单独渲染。
48
+ // console.error('this.dom.value is ', this.dom.value);
49
+ }
50
+ initEvents() {
51
+ this.events.push(
52
+ // 如果只有一个选项时,监听change,input有问题。
53
+ (0, rxjs_1.fromEvent)(this.dom, 'click').subscribe((evt) => {
54
+ console.log('this.select.dom click, event is ', evt);
55
+ console.log('this.select.dom.value is ', this.dom.value);
56
+ // console.log(this.reset);
57
+ // this.setValue(this.dom.value);
58
+ this.value = this.dom.value;
59
+ }), (0, rxjs_1.fromEvent)(this.dom, 'change').subscribe((evt) => {
60
+ console.log('this.select.dom change, event is ', evt);
61
+ console.log('this.select.dom.value is ', this.dom.value);
62
+ // console.log(this.reset);
63
+ // this.setValue(this.dom.value);
64
+ this.value = this.dom.value;
65
+ }));
66
+ }
67
+ }
68
+ exports.TdSelect = TdSelect;
@@ -0,0 +1,6 @@
1
+ import { ITypeSelect } from '@type-dom/framework';
2
+ import { ISelectOption } from './option/option.interface';
3
+ export interface ITdSelect extends ITypeSelect {
4
+ className: 'TdSelect';
5
+ childNodes: ISelectOption[];
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,7 @@
1
+ import { TypeRoot } from '@type-dom/framework';
2
+ import { Overlay } from '../overlay/overlay.abstract';
3
+ export declare class Dialog extends Overlay {
4
+ className: 'Dialog';
5
+ parent?: TypeRoot;
6
+ constructor();
7
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dialog = void 0;
4
+ const overlay_abstract_1 = require("../overlay/overlay.abstract");
5
+ class Dialog extends overlay_abstract_1.Overlay {
6
+ constructor() {
7
+ super();
8
+ this.className = 'Dialog';
9
+ this.addAttrObj({
10
+ name: 'dialog',
11
+ });
12
+ }
13
+ }
14
+ exports.Dialog = Dialog;
@@ -0,0 +1,2 @@
1
+ export { Dialog } from './dialog/dialog';
2
+ export { MessageBox } from './message-box/message-box';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessageBox = exports.Dialog = void 0;
4
+ var dialog_1 = require("./dialog/dialog");
5
+ Object.defineProperty(exports, "Dialog", { enumerable: true, get: function () { return dialog_1.Dialog; } });
6
+ var message_box_1 = require("./message-box/message-box");
7
+ Object.defineProperty(exports, "MessageBox", { enumerable: true, get: function () { return message_box_1.MessageBox; } });
@@ -0,0 +1,9 @@
1
+ import { TypeRoot } from '@type-dom/framework';
2
+ import { Overlay } from '../overlay/overlay.abstract';
3
+ export declare class MessageBox extends Overlay {
4
+ className: 'MessageBox';
5
+ parent?: TypeRoot;
6
+ constructor();
7
+ toast(title: string, message: string): void;
8
+ confirm(title: string, message: string): void;
9
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MessageBox = void 0;
4
+ const overlay_abstract_1 = require("../overlay/overlay.abstract");
5
+ class MessageBox extends overlay_abstract_1.Overlay {
6
+ constructor() {
7
+ super();
8
+ this.className = 'MessageBox';
9
+ this.addAttrObj({
10
+ name: 'message-box',
11
+ });
12
+ }
13
+ toast(title, message) {
14
+ // this.clear();
15
+ this.setTitle(title);
16
+ this.setMsg(message);
17
+ this.show();
18
+ }
19
+ confirm(title, message) {
20
+ this.setTitle(title);
21
+ this.setMsg(message);
22
+ }
23
+ }
24
+ exports.MessageBox = MessageBox;
@@ -0,0 +1,7 @@
1
+ import { TypeDiv } from '@type-dom/framework';
2
+ import { OverlayContainer } from '../container';
3
+ export declare class OverlayBody extends TypeDiv {
4
+ className: 'OverlayBody';
5
+ parent?: OverlayContainer;
6
+ constructor();
7
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OverlayBody = void 0;
4
+ const framework_1 = require("@type-dom/framework");
5
+ class OverlayBody extends framework_1.TypeDiv {
6
+ constructor() {
7
+ super();
8
+ this.className = 'OverlayBody';
9
+ this.propObj = {
10
+ styleObj: {
11
+ padding: '30px 20px',
12
+ fontSize: '14px',
13
+ wordBreak: 'break-all',
14
+ },
15
+ attrObj: {
16
+ name: 'overlay-body',
17
+ }
18
+ };
19
+ }
20
+ }
21
+ exports.OverlayBody = OverlayBody;
@@ -0,0 +1,15 @@
1
+ import { TypeDiv } from '@type-dom/framework';
2
+ import { Overlay } from '../overlay.abstract';
3
+ import { OverlayHeader } from './header/header';
4
+ import { OverlayBody } from './body/body';
5
+ import { OverlayFooter } from './footer/footer';
6
+ export declare class OverlayContainer extends TypeDiv {
7
+ className: 'OverlayContainer';
8
+ parent?: Overlay;
9
+ childNodes: [OverlayHeader, OverlayBody, OverlayFooter];
10
+ header: OverlayHeader;
11
+ body: OverlayBody;
12
+ footer: OverlayFooter;
13
+ constructor();
14
+ initEvents(): void;
15
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OverlayContainer = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ const header_1 = require("./header/header");
7
+ const body_1 = require("./body/body");
8
+ const footer_1 = require("./footer/footer");
9
+ class OverlayContainer extends framework_1.TypeDiv {
10
+ constructor() {
11
+ super();
12
+ this.className = 'OverlayContainer';
13
+ this.propObj = {
14
+ styleObj: {
15
+ position: framework_1.StylePosition.relative,
16
+ margin: '15vh auto 50px',
17
+ width: '50%',
18
+ boxShadow: '0 1px 3px rgba(0, 0, 0, 0.3)',
19
+ borderRadius: '4px',
20
+ backgroundColor: '#FFF',
21
+ padding: '20px',
22
+ },
23
+ attrObj: {
24
+ name: 'overlay-container'
25
+ }
26
+ };
27
+ this.header = new header_1.OverlayHeader();
28
+ this.header.parent = this;
29
+ this.body = new body_1.OverlayBody();
30
+ this.body.parent = this;
31
+ this.footer = new footer_1.OverlayFooter();
32
+ this.footer.parent = this;
33
+ this.childNodes = [this.header, this.body, this.footer];
34
+ }
35
+ initEvents() {
36
+ this.events.push((0, rxjs_1.fromEvent)(this.dom, 'click').subscribe((e) => {
37
+ e.stopPropagation();
38
+ }));
39
+ }
40
+ }
41
+ exports.OverlayContainer = OverlayContainer;
@@ -0,0 +1,8 @@
1
+ import { TypeButton } from '@type-dom/framework';
2
+ import { OverlayFooter } from '../footer';
3
+ export declare class CancelButton extends TypeButton {
4
+ className: 'CancelButton';
5
+ parent?: OverlayFooter;
6
+ constructor();
7
+ initEvents(): void;
8
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CancelButton = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ class CancelButton extends framework_1.TypeButton {
7
+ constructor() {
8
+ super();
9
+ this.className = 'CancelButton';
10
+ this.addStyleObj({
11
+ // backgroundColor: '#f00',
12
+ // color: '#FFF',
13
+ margin: 'auto 10px',
14
+ // outline: 'none',
15
+ // border: '1px solid #f00',
16
+ });
17
+ this.addAttrName('cancel-button');
18
+ this.setTitle('取消');
19
+ }
20
+ initEvents() {
21
+ var _a, _b;
22
+ if (!((_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent)) {
23
+ console.error('this.parent?.parent?.parent is undefined . ');
24
+ }
25
+ this.events.push((0, rxjs_1.fromEvent)(this.dom, 'click').subscribe(() => {
26
+ var _a, _b, _c;
27
+ (_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.hide();
28
+ }));
29
+ }
30
+ }
31
+ exports.CancelButton = CancelButton;
@@ -0,0 +1,9 @@
1
+ import { TextNode, TypeButton } from '@type-dom/framework';
2
+ import { OverlayFooter } from '../footer';
3
+ export declare class ConfirmButton extends TypeButton {
4
+ className: 'ConfirmButton';
5
+ parent?: OverlayFooter;
6
+ childNodes: [TextNode];
7
+ constructor();
8
+ initEvents(): void;
9
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConfirmButton = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ class ConfirmButton extends framework_1.TypeButton {
7
+ constructor() {
8
+ super();
9
+ this.className = 'ConfirmButton';
10
+ this.propObj = {
11
+ styleObj: {
12
+ backgroundColor: '#1890ff',
13
+ color: '#fff',
14
+ borderColor: '#1890ff',
15
+ margin: 'auto 10px',
16
+ },
17
+ attrObj: {
18
+ name: 'confirm-button',
19
+ }
20
+ };
21
+ this.setTitle('确认');
22
+ this.childNodes = [this.textNode];
23
+ }
24
+ initEvents() {
25
+ var _a, _b;
26
+ if (!((_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent)) {
27
+ console.error('this.parent?.parent?.parent is undefined . ');
28
+ }
29
+ this.events.push((0, rxjs_1.fromEvent)(this.dom, 'click').subscribe(() => {
30
+ var _a, _b, _c;
31
+ (_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.hide();
32
+ }));
33
+ }
34
+ }
35
+ exports.ConfirmButton = ConfirmButton;
@@ -0,0 +1,11 @@
1
+ import { TypeDiv } from '@type-dom/framework';
2
+ import { OverlayContainer } from '../container';
3
+ import { TdButton } from '../../../../basic/td-button/td-button.class';
4
+ export declare class OverlayFooter extends TypeDiv {
5
+ className: 'OverlayFooter';
6
+ parent?: OverlayContainer;
7
+ cancelBtn: TdButton;
8
+ confirmBtn: TdButton;
9
+ constructor();
10
+ initEvents(): void;
11
+ }
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OverlayFooter = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ const td_button_class_1 = require("../../../../basic/td-button/td-button.class");
7
+ // import { CancelButton } from './cancel-button/cancel-button';
8
+ // import { ConfirmButton } from './confirm-button/confirm-button';
9
+ class OverlayFooter extends framework_1.TypeDiv {
10
+ constructor() {
11
+ super();
12
+ this.className = 'OverlayFooter';
13
+ this.addStyleObj({
14
+ padding: '20px',
15
+ paddingTop: '10px',
16
+ textAlign: 'right',
17
+ boxSizing: 'border-box',
18
+ });
19
+ this.addAttrName('overlay-foot');
20
+ // this.cancelBtn = new CancelButton(this);
21
+ this.cancelBtn = new td_button_class_1.TdButton({
22
+ title: '取消',
23
+ });
24
+ // cancelBtn.hide();
25
+ // this.cancelBtn.setTitle('取消');
26
+ this.confirmBtn = new td_button_class_1.TdButton({
27
+ title: '确定',
28
+ type: 'primary'
29
+ });
30
+ this.confirmBtn.parent = this;
31
+ this.confirmBtn.addStyleObj({
32
+ marginLeft: '10px',
33
+ });
34
+ // this.confirmBtn.setTitle('确定');
35
+ this.childNodes = [this.cancelBtn, this.confirmBtn];
36
+ }
37
+ initEvents() {
38
+ this.events.push((0, rxjs_1.fromEvent)(this.cancelBtn.dom, 'click').subscribe(() => {
39
+ var _a, _b;
40
+ console.log('cancelBtn click . ');
41
+ (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.hide();
42
+ }), (0, rxjs_1.fromEvent)(this.confirmBtn.dom, 'click').subscribe(() => {
43
+ var _a, _b;
44
+ console.log('confirmBtn click . ');
45
+ (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.hide();
46
+ }));
47
+ }
48
+ }
49
+ exports.OverlayFooter = OverlayFooter;
@@ -0,0 +1,11 @@
1
+ import { TypeButton } from '@type-dom/framework';
2
+ import { TdCloseSvg } from '@type-dom/svgs';
3
+ import { OverlayHeader } from '../header';
4
+ export declare class CloseButton extends TypeButton {
5
+ className: 'CloseButton';
6
+ parent?: OverlayHeader;
7
+ childNodes: [TdCloseSvg];
8
+ private readonly svg;
9
+ constructor();
10
+ initEvents(): void;
11
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloseButton = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const framework_1 = require("@type-dom/framework");
6
+ const svgs_1 = require("@type-dom/svgs");
7
+ class CloseButton extends framework_1.TypeButton {
8
+ constructor() {
9
+ super();
10
+ this.className = 'CloseButton';
11
+ this.propObj = {
12
+ styleObj: {
13
+ cursor: framework_1.StyleCursor.pointer,
14
+ position: framework_1.StylePosition.absolute,
15
+ top: '20px',
16
+ right: '20px',
17
+ padding: '0',
18
+ background: 'transparent',
19
+ border: 'none',
20
+ outline: 'none',
21
+ fontSize: '16px',
22
+ },
23
+ attrObj: {
24
+ name: 'close-button',
25
+ }
26
+ };
27
+ this.svg = new svgs_1.TdCloseSvg(this);
28
+ this.childNodes = [this.svg];
29
+ }
30
+ initEvents() {
31
+ this.events.push((0, rxjs_1.fromEvent)(this.dom, 'click').subscribe(() => {
32
+ var _a, _b, _c;
33
+ (_c = (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent) === null || _c === void 0 ? void 0 : _c.hide();
34
+ }));
35
+ }
36
+ }
37
+ exports.CloseButton = CloseButton;