@type-dom/ui 0.0.8 → 0.0.9
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/package.json +1 -2
- 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 +9 -9
- 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 +7 -7
- 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 +0 -2
- package/src/components/feedback/index.js +3 -5
- 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.js +1 -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 +3 -1
- 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-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-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-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 +6 -6
- 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/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
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PropertyOptions = 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 field_select_class_1 = require("../../../form/field-select/field-select.class");
|
|
8
7
|
const field_item_abstract_1 = require("../field-item.abstract");
|
|
9
8
|
const field_item_style_1 = require("../field-item.style");
|
|
10
9
|
class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
10
|
+
// optionsConfigObservable: Observable<Event>;
|
|
11
11
|
constructor(labelText = '选项列表') {
|
|
12
12
|
super(labelText);
|
|
13
|
-
this.
|
|
13
|
+
this.attr.addName('option-property');
|
|
14
14
|
this.selectConfigDiv = new framework_1.Div();
|
|
15
|
-
this.selectConfigDiv.
|
|
16
|
-
this.selectConfigDiv.
|
|
15
|
+
this.selectConfigDiv.attr.addName('select-config');
|
|
16
|
+
this.selectConfigDiv.style.addObj({
|
|
17
17
|
height: '100%',
|
|
18
18
|
lineHeight: '32px',
|
|
19
19
|
textAlign: 'center',
|
|
@@ -31,20 +31,20 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
31
31
|
width: 'calc(100% - 100px)'
|
|
32
32
|
});
|
|
33
33
|
this.selectDiv = new framework_1.Div();
|
|
34
|
-
this.selectDiv.
|
|
34
|
+
this.selectDiv.style.addObj({
|
|
35
35
|
display: 'flex',
|
|
36
36
|
flexDirection: 'row'
|
|
37
37
|
});
|
|
38
38
|
// 单独的方法实现
|
|
39
39
|
this.selectObj = new field_select_class_1.FieldSelect();
|
|
40
|
-
this.selectObj.
|
|
41
|
-
this.selectObj.
|
|
40
|
+
this.selectObj.attr.addName('select');
|
|
41
|
+
this.selectObj.style.addObj(Object.assign({}, field_item_style_1.itemContentStyle, {
|
|
42
42
|
width: '100%',
|
|
43
43
|
borderRadius: '4px 0 0 4px',
|
|
44
44
|
borderRight: 'none'
|
|
45
45
|
}));
|
|
46
46
|
this.btn = new framework_1.Button({ parent: this.selectDiv });
|
|
47
|
-
this.btn.
|
|
47
|
+
this.btn.style.addObj({
|
|
48
48
|
// position: 'absolute',
|
|
49
49
|
// right: '10px',
|
|
50
50
|
padding: '8px 3px 4px',
|
|
@@ -59,13 +59,13 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
59
59
|
this.selectDiv.childNodes = [this.selectObj, this.btn];
|
|
60
60
|
this.firstDiv = new framework_1.Div();
|
|
61
61
|
const labelDiv = new framework_1.Div();
|
|
62
|
-
labelDiv.
|
|
62
|
+
labelDiv.style.addObj({
|
|
63
63
|
display: 'inline-block',
|
|
64
64
|
width: '50%'
|
|
65
65
|
});
|
|
66
66
|
labelDiv.addChild(new framework_1.TextNode('标签'));
|
|
67
67
|
const valueDiv = new framework_1.Div();
|
|
68
|
-
valueDiv.
|
|
68
|
+
valueDiv.style.addObj({
|
|
69
69
|
display: 'inline-block',
|
|
70
70
|
width: '50%'
|
|
71
71
|
});
|
|
@@ -77,7 +77,7 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
77
77
|
this.firstDiv,
|
|
78
78
|
this.optionsContent
|
|
79
79
|
];
|
|
80
|
-
this.button.
|
|
80
|
+
this.button.style.addObj({
|
|
81
81
|
position: 'absolute',
|
|
82
82
|
right: '10px',
|
|
83
83
|
padding: '8px 3px 4px',
|
|
@@ -90,7 +90,7 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
90
90
|
this.childNodes = [this.label, this.selectConfigDiv, this.button];
|
|
91
91
|
// 创建添加按钮
|
|
92
92
|
// this.addDiv = new Div(this.selectConfigDiv);
|
|
93
|
-
// this.addDiv.
|
|
93
|
+
// this.addDiv.style.setObj({
|
|
94
94
|
// textAlign: 'center',
|
|
95
95
|
// marginTop: '-10px',
|
|
96
96
|
// display: 'none', // 现在不需要动态添加选项。
|
|
@@ -98,7 +98,7 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
98
98
|
// const svg = new AddSvg({ parent: this.addDiv });
|
|
99
99
|
// svg.addAttribute('width', '24px');
|
|
100
100
|
// this.addDiv.addChild(svg);
|
|
101
|
-
this.optionsConfigObservable =
|
|
101
|
+
// this.optionsConfigObservable = fromEvent(this.btn.dom, 'click');
|
|
102
102
|
}
|
|
103
103
|
get optionSetting() {
|
|
104
104
|
var _a;
|
|
@@ -122,10 +122,11 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
resetOptionSettingResultValue(value) {
|
|
125
|
-
// AppRoot.selectedControl?.
|
|
125
|
+
// AppRoot.selectedControl?.attr.get('optionSetting')''
|
|
126
126
|
// this.optionSetting = Object.assign(this.optionSetting, { resultValue: value });
|
|
127
|
-
if (this.optionSetting)
|
|
127
|
+
if (this.optionSetting) {
|
|
128
128
|
this.optionSetting.resultValue = value;
|
|
129
|
+
}
|
|
129
130
|
}
|
|
130
131
|
// vue项目中返回的是选中的项目。只有一层,没有两层。
|
|
131
132
|
resetConfig(optionSetting) {
|
|
@@ -152,23 +153,23 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
152
153
|
selectedOption.options.forEach((opt, optIndex) => {
|
|
153
154
|
const optDiv = new framework_1.Div();
|
|
154
155
|
const labelDiv = new framework_1.Div();
|
|
155
|
-
labelDiv.
|
|
156
|
-
labelDiv.
|
|
156
|
+
labelDiv.style.addObj(styleObj);
|
|
157
|
+
labelDiv.attr.setObj({
|
|
157
158
|
// contenteditable: 'true', // 现在选项不需要编辑
|
|
158
159
|
optIndex,
|
|
159
160
|
optType: 'label'
|
|
160
161
|
});
|
|
161
162
|
labelDiv.addChild(new framework_1.TextNode(opt.label));
|
|
162
163
|
const valueDiv = new framework_1.Div();
|
|
163
|
-
valueDiv.
|
|
164
|
-
valueDiv.
|
|
164
|
+
valueDiv.style.addObj(styleObj);
|
|
165
|
+
valueDiv.attr.addObj({
|
|
165
166
|
// contenteditable: 'true', // 现在选项不需要编辑
|
|
166
167
|
optIndex,
|
|
167
168
|
optType: 'value'
|
|
168
169
|
});
|
|
169
170
|
valueDiv.addChild(new framework_1.TextNode(String(opt.value)));
|
|
170
171
|
// const deleteDiv = new Div(optDiv);
|
|
171
|
-
// deleteDiv.
|
|
172
|
+
// deleteDiv.style.setObj({
|
|
172
173
|
// display: 'none',
|
|
173
174
|
// // display: 'inline-block', // 现在不需要动态删除选项
|
|
174
175
|
// width: '10%',
|
|
@@ -178,7 +179,7 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
178
179
|
// // marginTop: '10px',
|
|
179
180
|
// });
|
|
180
181
|
// const svg = new DeleteSvg(deleteDiv);
|
|
181
|
-
// svg.
|
|
182
|
+
// svg.style.setObj({
|
|
182
183
|
// width: '20',
|
|
183
184
|
// });
|
|
184
185
|
// deleteDiv.appendChild(svg);
|
|
@@ -201,18 +202,18 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
201
202
|
// config.options设置
|
|
202
203
|
options.forEach((opt, optIndex) => {
|
|
203
204
|
const optDiv = new framework_1.Div();
|
|
204
|
-
optDiv.
|
|
205
|
+
optDiv.attr.setName('option');
|
|
205
206
|
const labelDiv = new framework_1.Div();
|
|
206
|
-
labelDiv.
|
|
207
|
-
labelDiv.
|
|
207
|
+
labelDiv.style.addObj(styleObj);
|
|
208
|
+
labelDiv.attr.setObj({
|
|
208
209
|
// contenteditable: 'true', // 现在选项不需要编辑
|
|
209
210
|
optIndex,
|
|
210
211
|
optType: 'label'
|
|
211
212
|
});
|
|
212
213
|
labelDiv.addChild(new framework_1.TextNode(opt.label));
|
|
213
214
|
const valueDiv = new framework_1.Div();
|
|
214
|
-
valueDiv.
|
|
215
|
-
valueDiv.
|
|
215
|
+
valueDiv.style.addObj(styleObj);
|
|
216
|
+
valueDiv.attr.addObj({
|
|
216
217
|
optIndex,
|
|
217
218
|
optType: 'value'
|
|
218
219
|
});
|
|
@@ -221,10 +222,11 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
221
222
|
this.optionsContent.appendChild(optDiv);
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
|
-
|
|
225
|
-
this.
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
setup() {
|
|
226
|
+
this.btn.addEvents({
|
|
227
|
+
click: () => {
|
|
228
|
+
console.log('this.btn click . ');
|
|
229
|
+
}
|
|
228
230
|
});
|
|
229
231
|
this.selectObj.addEvents({
|
|
230
232
|
change: () => {
|
|
@@ -27,32 +27,28 @@ class FieldRadio extends field_item_abstract_1.FieldItem {
|
|
|
27
27
|
else {
|
|
28
28
|
button = this.optionDiv.childNodes[index];
|
|
29
29
|
}
|
|
30
|
-
button.
|
|
30
|
+
button.style.addObj({
|
|
31
31
|
height: '32px',
|
|
32
32
|
borderRadius: '0',
|
|
33
33
|
border: '1px solid #000'
|
|
34
34
|
});
|
|
35
|
-
button.
|
|
35
|
+
button.attr.addObj({
|
|
36
36
|
type: 'radio',
|
|
37
37
|
value: option.value,
|
|
38
38
|
checked: option.checked
|
|
39
39
|
});
|
|
40
40
|
if (option.checked) {
|
|
41
|
-
|
|
42
|
-
// button.styleObj.color = '#fff';
|
|
43
|
-
button.ctrl.addStyleObj({
|
|
41
|
+
button.style.addObj({
|
|
44
42
|
backgroundColor: '#00f',
|
|
45
43
|
color: '#fff',
|
|
46
44
|
});
|
|
47
45
|
this.selectedOpt = button;
|
|
48
46
|
}
|
|
49
47
|
else {
|
|
50
|
-
button.
|
|
48
|
+
button.style.addObj({
|
|
51
49
|
backgroundColor: '#fff',
|
|
52
50
|
color: '#000'
|
|
53
51
|
});
|
|
54
|
-
// button.styleObj.backgroundColor = '#fff';
|
|
55
|
-
// button.styleObj.color = '#000';
|
|
56
52
|
}
|
|
57
53
|
// span.childNodes.push(label, inputRadio);
|
|
58
54
|
// this.optionDiv.childNodes.push(button);
|
|
@@ -69,37 +65,38 @@ class FieldRadio extends field_item_abstract_1.FieldItem {
|
|
|
69
65
|
this.setOptions(this.params.options);
|
|
70
66
|
this.optionDiv.mount();
|
|
71
67
|
}
|
|
72
|
-
|
|
68
|
+
mounted() {
|
|
73
69
|
this.optionDiv.childNodes.forEach((btn) => {
|
|
74
70
|
if (btn.dom === undefined) {
|
|
75
71
|
return;
|
|
76
72
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
73
|
+
if (btn instanceof framework_1.TypeElement) {
|
|
74
|
+
btn.addEvent('click', () => {
|
|
75
|
+
// if (OfdEditor.mode === 'read') {
|
|
76
|
+
// return;
|
|
77
|
+
// }
|
|
78
|
+
if (this.selectedOpt) {
|
|
79
|
+
this.selectedOpt.style.setObj({
|
|
80
|
+
backgroundColor: '#fff',
|
|
81
|
+
color: '#000'
|
|
82
|
+
});
|
|
83
|
+
this.selectedOpt.attr.set('checked', false);
|
|
84
|
+
}
|
|
85
|
+
this.selectedOpt = btn;
|
|
86
|
+
if (btn instanceof framework_1.TypeHtml) {
|
|
87
|
+
btn.style.setObj({
|
|
88
|
+
backgroundColor: '#00f',
|
|
89
|
+
color: '#fff'
|
|
90
|
+
});
|
|
91
|
+
btn.attr.set('checked', true);
|
|
92
|
+
this.resultValue = btn.attr.get('value');
|
|
93
|
+
this.reset(this.resultValue);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
103
100
|
});
|
|
104
101
|
}
|
|
105
102
|
}
|
|
@@ -9,20 +9,20 @@ class FieldSelect extends field_item_abstract_1.FieldItem {
|
|
|
9
9
|
super(labelText);
|
|
10
10
|
this.mode = 'editor';
|
|
11
11
|
this.select = new select_class_1.Select();
|
|
12
|
-
this.select.
|
|
13
|
-
this.select.
|
|
12
|
+
this.select.style.addObj(Object.assign({}, field_item_style_1.itemContentStyle));
|
|
13
|
+
this.select.attr.addObj({
|
|
14
14
|
name: 'property-select'
|
|
15
15
|
// type: 'text',
|
|
16
16
|
// placeholder: placeholder,
|
|
17
|
-
};
|
|
17
|
+
});
|
|
18
18
|
if (this.mode === 'read') {
|
|
19
|
-
this.select.
|
|
19
|
+
this.select.attr.addObj({
|
|
20
20
|
disabled: true
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
this.childNodes = [this.label, this.select, this.button];
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
setup() {
|
|
26
26
|
this.select.addEvents({
|
|
27
27
|
click: (evt) => {
|
|
28
28
|
console.log('this.select.dom click, event is ', evt);
|
|
@@ -8,7 +8,7 @@ class FieldSpan extends field_item_abstract_1.FieldItem {
|
|
|
8
8
|
constructor(labelText = '控件名称') {
|
|
9
9
|
super(labelText);
|
|
10
10
|
this.content = new framework_1.Span({ parent: this });
|
|
11
|
-
this.content.
|
|
11
|
+
this.content.style.addObj({
|
|
12
12
|
height: '28px',
|
|
13
13
|
lineHeight: '28px',
|
|
14
14
|
textAlign: 'center',
|
|
@@ -27,13 +27,13 @@ class FieldSpan extends field_item_abstract_1.FieldItem {
|
|
|
27
27
|
// -webkit-transition: border-color .2s cubic-bezier(.645,.045,.355,1);
|
|
28
28
|
transition: 'border-color .2s cubic-bezier(.645,.045,.355,1)',
|
|
29
29
|
width: 'calc(100% - 80px)'
|
|
30
|
-
};
|
|
31
|
-
this.
|
|
30
|
+
});
|
|
31
|
+
this.attr.addObj({
|
|
32
32
|
name: 'field-span'
|
|
33
|
-
};
|
|
33
|
+
});
|
|
34
34
|
this.textNode = new framework_1.TextNode('显示');
|
|
35
35
|
this.content.addChild(this.textNode);
|
|
36
|
-
this.button.
|
|
36
|
+
this.button.style.setObj({
|
|
37
37
|
// position: 'absolute',
|
|
38
38
|
// right: '10px',
|
|
39
39
|
padding: '8px 3px 4px',
|
|
@@ -8,7 +8,7 @@ class FieldTextarea extends field_item_abstract_1.FieldItem {
|
|
|
8
8
|
constructor(labelText = '控件名称', placeholder = '请输入') {
|
|
9
9
|
super(labelText);
|
|
10
10
|
this.mode = 'edit';
|
|
11
|
-
this.
|
|
11
|
+
this.style.addObj({
|
|
12
12
|
display: 'block', // 不是 flex
|
|
13
13
|
marginBottom: '20px'
|
|
14
14
|
});
|
|
@@ -40,12 +40,12 @@ class FieldTextarea extends field_item_abstract_1.FieldItem {
|
|
|
40
40
|
console.log('this.parent is ', this.parent);
|
|
41
41
|
console.log('this.mode is ', this.mode);
|
|
42
42
|
if (this.mode === 'read') {
|
|
43
|
-
this.content.
|
|
43
|
+
this.content.attr.addObj({
|
|
44
44
|
disabled: true
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
this.button.textNode.setText('确定');
|
|
48
|
-
this.button.
|
|
48
|
+
this.button.style.addObj({
|
|
49
49
|
height: '24px',
|
|
50
50
|
float: 'right',
|
|
51
51
|
display: 'block'
|
|
@@ -53,10 +53,10 @@ class FieldTextarea extends field_item_abstract_1.FieldItem {
|
|
|
53
53
|
this.childNodes = [this.label, this.content, this.button];
|
|
54
54
|
}
|
|
55
55
|
resetInputPlaceholder(placeholder) {
|
|
56
|
-
this.content.
|
|
56
|
+
this.content.attr.set('placeholder', placeholder);
|
|
57
57
|
}
|
|
58
58
|
resetInputValue(value = '') {
|
|
59
|
-
this.content.
|
|
59
|
+
this.content.attr.set('value', value);
|
|
60
60
|
this.content.dom.value = String(value);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -8,5 +8,5 @@ export declare class FieldSelect extends TypeSelect implements IFieldSelect {
|
|
|
8
8
|
constructor();
|
|
9
9
|
setOptions(options: IOptionSet[], value: string | number | boolean): void;
|
|
10
10
|
resetOptions(options: IOptionSet[], value: string | number | boolean): void;
|
|
11
|
-
|
|
11
|
+
setup(): void;
|
|
12
12
|
}
|
|
@@ -7,14 +7,14 @@ class FieldSelect extends framework_1.TypeSelect {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'FieldSelect';
|
|
10
|
-
this.
|
|
10
|
+
this.attr.addName('td-select');
|
|
11
11
|
this.childNodes = [];
|
|
12
12
|
}
|
|
13
13
|
setOptions(options, value) {
|
|
14
14
|
this.clearChildren();
|
|
15
15
|
const firstOpt = new option_class_1.SelectOption();
|
|
16
16
|
firstOpt.textNode.setText('请选择');
|
|
17
|
-
firstOpt.
|
|
17
|
+
firstOpt.attr.addObj({
|
|
18
18
|
label: '请选择',
|
|
19
19
|
value: 0
|
|
20
20
|
});
|
|
@@ -22,7 +22,7 @@ class FieldSelect extends framework_1.TypeSelect {
|
|
|
22
22
|
options.forEach((opt) => {
|
|
23
23
|
const optObj = new option_class_1.SelectOption();
|
|
24
24
|
optObj.textNode.setText(opt.label);
|
|
25
|
-
optObj.
|
|
25
|
+
optObj.attr.addObj({
|
|
26
26
|
label: opt.label,
|
|
27
27
|
value: opt.value
|
|
28
28
|
});
|
|
@@ -31,12 +31,11 @@ class FieldSelect extends framework_1.TypeSelect {
|
|
|
31
31
|
this.addChild(optObj);
|
|
32
32
|
});
|
|
33
33
|
this.childNodes.forEach((optObj) => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
optObj.ctrl.addAttribute('selected', true);
|
|
34
|
+
if (String(optObj.attr.get('value')).trim() === String(value).trim()) {
|
|
35
|
+
optObj.attr.add('selected', true);
|
|
37
36
|
}
|
|
38
37
|
else {
|
|
39
|
-
// optObj.
|
|
38
|
+
// optObj.attr.remove('selected');
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
// console.error('this.dom.value is ', this.dom.value);
|
|
@@ -46,7 +45,7 @@ class FieldSelect extends framework_1.TypeSelect {
|
|
|
46
45
|
this.mount(); // 需要单独渲染。
|
|
47
46
|
// console.error('this.dom.value is ', this.dom.value);
|
|
48
47
|
}
|
|
49
|
-
|
|
48
|
+
setup() {
|
|
50
49
|
this.addEvents({
|
|
51
50
|
click: (evt) => {
|
|
52
51
|
console.log('this.select.dom click, event is ', evt);
|
|
@@ -6,9 +6,7 @@ class SelectOption extends framework_1.TypeOption {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
this.className = 'SelectOption';
|
|
9
|
-
this.
|
|
10
|
-
name: 'option'
|
|
11
|
-
};
|
|
9
|
+
this.attr.addName('option');
|
|
12
10
|
this.textNode = new framework_1.TextNode('一个选项');
|
|
13
11
|
this.childNodes = [this.textNode];
|
|
14
12
|
}
|
|
@@ -7,10 +7,10 @@ class RadioGroup extends framework_1.TypeDiv {
|
|
|
7
7
|
constructor(params = {}) {
|
|
8
8
|
super();
|
|
9
9
|
this.className = 'RadioGroup';
|
|
10
|
-
this.
|
|
10
|
+
this.attr.addName('radio-group');
|
|
11
11
|
this.value = '';
|
|
12
12
|
this.childNodes = [];
|
|
13
|
-
this.props = this.
|
|
13
|
+
this.props = this.useParams(params);
|
|
14
14
|
}
|
|
15
15
|
setup() {
|
|
16
16
|
const props = this.props;
|
|
@@ -23,7 +23,7 @@ class RadioGroup extends framework_1.TypeDiv {
|
|
|
23
23
|
const random = Math.random();
|
|
24
24
|
options.forEach((opt) => {
|
|
25
25
|
const optObj = new radio_option_class_1.RadioOption({ parent: this });
|
|
26
|
-
optObj.input.
|
|
26
|
+
optObj.input.attr.addObj({
|
|
27
27
|
name: 'radio' + random,
|
|
28
28
|
label: opt.label,
|
|
29
29
|
value: opt.value,
|
|
@@ -40,14 +40,13 @@ class RadioGroup extends framework_1.TypeDiv {
|
|
|
40
40
|
this.value = value;
|
|
41
41
|
// console.error('value is ', value);
|
|
42
42
|
this.childNodes.forEach((opt) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
opt.input.ctrl.setAttrObj({
|
|
43
|
+
if (String(opt.input.attr.get('value')) === String(value)) {
|
|
44
|
+
opt.input.attr.setObj({
|
|
46
45
|
checked: true
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
else {
|
|
50
|
-
opt.input.
|
|
49
|
+
opt.input.attr.remove('checked');
|
|
51
50
|
}
|
|
52
51
|
});
|
|
53
52
|
}
|
|
@@ -6,11 +6,11 @@ class RadioOption extends framework_1.TypeSpan {
|
|
|
6
6
|
constructor(params = {}) {
|
|
7
7
|
super();
|
|
8
8
|
this.className = 'RadioOption';
|
|
9
|
-
this.
|
|
9
|
+
this.style.addObj({
|
|
10
10
|
padding: '0 5px'
|
|
11
11
|
});
|
|
12
12
|
this.input = new framework_1.Input({ parent: this });
|
|
13
|
-
this.input.
|
|
13
|
+
this.input.attr.addObj({
|
|
14
14
|
type: 'radio'
|
|
15
15
|
// name: optionSetting.name,
|
|
16
16
|
// label: opt.label,
|
|
@@ -19,20 +19,18 @@ class RadioOption extends framework_1.TypeSpan {
|
|
|
19
19
|
});
|
|
20
20
|
this.textNode = new framework_1.TextNode('');
|
|
21
21
|
this.childNodes = [this.input, this.textNode];
|
|
22
|
-
this.props = this.
|
|
22
|
+
this.props = this.useParams(params);
|
|
23
23
|
}
|
|
24
24
|
setup(config) {
|
|
25
25
|
if (config === null || config === void 0 ? void 0 : config.name) {
|
|
26
|
-
this.input.
|
|
26
|
+
this.input.attr.addName(config.name);
|
|
27
27
|
}
|
|
28
28
|
if (config === null || config === void 0 ? void 0 : config.value) {
|
|
29
|
-
this.input.
|
|
29
|
+
this.input.attr.addObj({ value: config.value });
|
|
30
30
|
}
|
|
31
31
|
if (config === null || config === void 0 ? void 0 : config.checked) {
|
|
32
|
-
this.input.
|
|
32
|
+
this.input.attr.addObj({ checked: config.checked || false });
|
|
33
33
|
}
|
|
34
|
-
}
|
|
35
|
-
initEvents() {
|
|
36
34
|
this.input.addEvents({
|
|
37
35
|
click: () => {
|
|
38
36
|
console.log('this.input.dom click . ');
|
|
@@ -6,7 +6,7 @@ export declare class Select extends TypeSelect implements ISelect {
|
|
|
6
6
|
value: string | number | boolean;
|
|
7
7
|
constructor();
|
|
8
8
|
setOptionSetting(optionSetting: IOptionSetting): void;
|
|
9
|
-
|
|
9
|
+
setup(): void;
|
|
10
10
|
jsSelectIsExitItem(objSelect: HTMLSelectElement, objItemValue: string): boolean;
|
|
11
11
|
jsAddItemToSelect(objSelect: HTMLSelectElement, objItemText: string | undefined, objItemValue: string): void;
|
|
12
12
|
jsRemoveItemFromSelect(objSelect: HTMLSelectElement, objItemValue: string): void;
|
|
@@ -13,7 +13,7 @@ class Select extends framework_1.TypeSelect {
|
|
|
13
13
|
this.clearChildren();
|
|
14
14
|
optionSetting.options.forEach((opt) => {
|
|
15
15
|
const optionObj = new framework_1.Option({ parent: this });
|
|
16
|
-
optionObj.
|
|
16
|
+
optionObj.attr.setObj({
|
|
17
17
|
// label: opt.label,
|
|
18
18
|
value: opt.value,
|
|
19
19
|
selected: opt.selected || false
|
|
@@ -26,7 +26,7 @@ class Select extends framework_1.TypeSelect {
|
|
|
26
26
|
this.addChild(optionObj);
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
setup() {
|
|
30
30
|
this.addEvents({
|
|
31
31
|
click: () => {
|
|
32
32
|
console.log('this.dom click . ');
|
|
@@ -34,12 +34,12 @@ class Select extends framework_1.TypeSelect {
|
|
|
34
34
|
this.value = this.dom.value; // 对应的opt.label.
|
|
35
35
|
this.childNodes.forEach((opt) => {
|
|
36
36
|
if (opt.dom.value === this.dom.value) {
|
|
37
|
-
opt.
|
|
37
|
+
opt.attr.setObj({
|
|
38
38
|
selected: true
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
|
-
opt.
|
|
42
|
+
opt.attr.remove('selected');
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -11,10 +11,10 @@ class TdCheckbox extends ui_abstract_1.UI {
|
|
|
11
11
|
const tag = !hasOwnLabel ? 'span' : 'label';
|
|
12
12
|
super(params, tag); // label | span
|
|
13
13
|
this.className = 'TdCheckbox';
|
|
14
|
-
this.
|
|
14
|
+
this.attr.addObj({
|
|
15
15
|
name: 'td-checkbox'
|
|
16
16
|
});
|
|
17
|
-
this.
|
|
17
|
+
this.style.addObj(td_checkbox_style_1.$checkboxStyle);
|
|
18
18
|
const inputSpan = new framework_1.Span({
|
|
19
19
|
attrObj: {
|
|
20
20
|
name: 'td-checkbox-input-span'
|
|
@@ -71,7 +71,7 @@ class TdCheckbox extends ui_abstract_1.UI {
|
|
|
71
71
|
}
|
|
72
72
|
this.addChild(labelSpan);
|
|
73
73
|
}
|
|
74
|
-
this.props = this.
|
|
74
|
+
this.props = this.useParams(params);
|
|
75
75
|
}
|
|
76
76
|
handleChange(ev) {
|
|
77
77
|
if (this.isLimitExceeded)
|
|
@@ -10,10 +10,10 @@ class TdCheckboxButton extends ui_abstract_1.UI {
|
|
|
10
10
|
constructor(params = {}) {
|
|
11
11
|
super(params, 'label'); // label | span
|
|
12
12
|
this.className = 'TdCheckboxButton';
|
|
13
|
-
this.
|
|
13
|
+
this.attr.addObj({
|
|
14
14
|
name: 'td-checkbox-button'
|
|
15
15
|
});
|
|
16
|
-
this.
|
|
16
|
+
this.style.addObj(td_checkbox_button_style_1.$checkboxButtonStyle);
|
|
17
17
|
const { hasOwnLabel } = (0, use_checkbox_1.useCheckbox)(params);
|
|
18
18
|
const original = new framework_1.Input({
|
|
19
19
|
name: 'original',
|
|
@@ -53,7 +53,7 @@ class TdCheckboxButton extends ui_abstract_1.UI {
|
|
|
53
53
|
}
|
|
54
54
|
this.addChild(labelSpan);
|
|
55
55
|
}
|
|
56
|
-
this.props = this.
|
|
56
|
+
this.props = this.useParams(params);
|
|
57
57
|
}
|
|
58
58
|
handleChange(ev) {
|
|
59
59
|
if (this.isLimitExceeded)
|