@type-dom/ui 0.0.7 → 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 -4
- 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.d.ts +1 -0
- package/src/components/data/td-badge/td-badge.class.js +15 -11
- 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 -3
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +1 -0
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +8 -8
- 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 +14 -10
- package/src/components/data/td-result/td-result.class.js +3 -3
- package/src/components/data/td-segmented/td-segmented.class.js +26 -30
- package/src/components/data/td-statistic/td-statistic.abstract.js +2 -2
- package/src/components/data/td-tag/td-tag.class.js +10 -10
- 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 +4 -4
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +4 -4
- package/src/components/feedback/td-drawer/td-drawer.class.js +1 -1
- 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 +4 -2
- package/src/components/feedback/td-message/td-message.class.js +34 -27
- 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 -75
- 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 +29 -29
- 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 +21 -20
- 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 +48 -43
- 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 +15 -14
- 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 +49 -46
- 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 -36
- 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 +19 -19
- 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 +23 -24
- 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 +14 -15
- package/src/components/form/select/select.class.d.ts +1 -1
- package/src/components/form/select/select.class.js +19 -18
- 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 -54
- 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 -50
- 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 +27 -28
- 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 +42 -34
- 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 +22 -25
- 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 +27 -26
- package/src/components/others/custom-block/custom-block.d.ts +11 -0
- package/src/components/others/custom-block/custom-block.js +58 -0
- package/src/components/others/example/example-float-control.d.ts +8 -0
- package/src/components/others/example/example-float-control.js +63 -0
- package/src/components/others/example/example-showcase.d.ts +7 -0
- package/src/components/others/example/example-showcase.js +20 -0
- package/src/components/others/example/example-source-wrapper.d.ts +9 -0
- package/src/components/others/example/example-source-wrapper.js +30 -0
- package/src/components/others/example/example.d.ts +14 -0
- package/src/components/others/example/example.js +77 -0
- package/src/components/others/example/index.d.ts +5 -0
- package/src/components/others/example/index.js +13 -0
- package/src/components/others/example/op-btns.d.ts +7 -0
- package/src/components/others/example/op-btns.js +95 -0
- package/src/components/others/index.d.ts +4 -0
- package/src/components/others/index.js +9 -1
- package/src/components/others/menus/menu.d.ts +21 -0
- package/src/components/others/menus/menu.js +125 -0
- package/src/components/others/menus/menus.d.ts +15 -0
- package/src/components/others/menus/menus.js +101 -0
- 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 +3 -3
- package/src/ui/ui.interface.d.ts +3 -3
- 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 -37
- 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 -31
- 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 -31
- 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 -33
- 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 -59
|
@@ -6,7 +6,7 @@ const field_item_style_1 = require("./field-item.style");
|
|
|
6
6
|
class FieldItem extends framework_1.TypeDiv {
|
|
7
7
|
constructor(labelText) {
|
|
8
8
|
super();
|
|
9
|
-
this.
|
|
9
|
+
this.style.addObj({
|
|
10
10
|
// border: '1px solid #1890ff',
|
|
11
11
|
// background: '#f3f9ff',
|
|
12
12
|
display: 'flex',
|
|
@@ -23,9 +23,9 @@ class FieldItem extends framework_1.TypeDiv {
|
|
|
23
23
|
// this.label.textNode.setText(labelText);
|
|
24
24
|
// this.label.childNodes.push(this.label.textNode);
|
|
25
25
|
// }
|
|
26
|
-
this.label.
|
|
26
|
+
this.label.style.addObj(Object.assign({}, field_item_style_1.labelStyle));
|
|
27
27
|
this.button = new framework_1.Button({ parent: this });
|
|
28
|
-
this.button.
|
|
28
|
+
this.button.style.addObj({
|
|
29
29
|
height: '28px',
|
|
30
30
|
background: '#ffffff',
|
|
31
31
|
borderWidth: '1px',
|
|
@@ -8,5 +8,5 @@ export declare abstract class FieldInput extends FieldItem {
|
|
|
8
8
|
protected constructor(labelText?: string, placeholder?: string);
|
|
9
9
|
resetInputPlaceholder(placeholder: string): void;
|
|
10
10
|
resetInputValue(value?: string | number): void;
|
|
11
|
-
|
|
11
|
+
setup(): void;
|
|
12
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FieldInput = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const field_item_abstract_1 = require("../field-item.abstract");
|
|
7
6
|
const field_item_style_1 = require("../field-item.style");
|
|
@@ -9,17 +8,17 @@ class FieldInput extends field_item_abstract_1.FieldItem {
|
|
|
9
8
|
constructor(labelText = '控件名称', placeholder = '请输入') {
|
|
10
9
|
super(labelText);
|
|
11
10
|
this.content = new framework_1.Input({ parent: this });
|
|
12
|
-
this.content.
|
|
13
|
-
this.content.
|
|
11
|
+
this.content.style.addObj(field_item_style_1.itemContentStyle);
|
|
12
|
+
this.content.attr.addObj({
|
|
14
13
|
type: 'text',
|
|
15
14
|
placeholder: placeholder
|
|
16
|
-
};
|
|
15
|
+
});
|
|
17
16
|
if (this.mode === 'read') {
|
|
18
|
-
this.content.
|
|
17
|
+
this.content.attr.addObj({
|
|
19
18
|
disabled: true
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
// this.button.
|
|
21
|
+
// this.button.style.addObj({
|
|
23
22
|
// // position: 'absolute',
|
|
24
23
|
// // right: '10px',
|
|
25
24
|
// padding: '8px 3px 4px',
|
|
@@ -33,18 +32,20 @@ class FieldInput extends field_item_abstract_1.FieldItem {
|
|
|
33
32
|
this.childNodes = [this.label, this.content, this.button];
|
|
34
33
|
}
|
|
35
34
|
resetInputPlaceholder(placeholder) {
|
|
36
|
-
this.content.
|
|
35
|
+
this.content.attr.set('placeholder', placeholder);
|
|
37
36
|
}
|
|
38
37
|
resetInputValue(value = '') {
|
|
39
|
-
this.content.
|
|
38
|
+
this.content.attr.set('value', value);
|
|
40
39
|
this.content.dom.value = String(value);
|
|
41
40
|
}
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
setup() {
|
|
42
|
+
this.content.addEvents({
|
|
43
|
+
input: () => {
|
|
44
|
+
// console.log('this.input input, event is ', evt);
|
|
45
|
+
// console.log('this.input.dom.value is ', this.input.dom.value);
|
|
46
|
+
this.reset(this.content.dom.value);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
exports.FieldInput = FieldInput;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
1
|
import { Button, Div, Label, IOptionSetting, IOptionSet } from '@type-dom/framework';
|
|
3
2
|
import { FieldItem } from '../field-item.abstract';
|
|
4
3
|
export declare abstract class PropertyOptions extends FieldItem {
|
|
@@ -10,12 +9,11 @@ export declare abstract class PropertyOptions extends FieldItem {
|
|
|
10
9
|
optionsContent: Div;
|
|
11
10
|
protected btn: Button;
|
|
12
11
|
private readonly dotsSvg;
|
|
13
|
-
optionsConfigObservable: Observable<Event>;
|
|
14
12
|
protected constructor(labelText?: string);
|
|
15
13
|
get optionSetting(): IOptionSetting | undefined;
|
|
16
14
|
set optionSetting(optConfig: IOptionSetting | undefined);
|
|
17
15
|
resetOptionSettingResultValue(value: string | number | boolean): void;
|
|
18
16
|
resetConfig(optionSetting: IOptionSetting): void;
|
|
19
17
|
resetOptions(options: IOptionSet[]): void;
|
|
20
|
-
|
|
18
|
+
setup(): void;
|
|
21
19
|
}
|
|
@@ -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,28 +222,30 @@ class PropertyOptions extends field_item_abstract_1.FieldItem {
|
|
|
221
222
|
this.optionsContent.appendChild(optDiv);
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
|
-
|
|
225
|
-
this.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}),
|
|
229
|
-
// todo 没有改变值 ????? 是否要加click监听
|
|
230
|
-
(0, rxjs_1.fromEvent)(this.selectObj.dom, 'change').subscribe(() => {
|
|
231
|
-
var _a, _b;
|
|
232
|
-
console.log('this.selectObj.dom change . ');
|
|
233
|
-
console.log('this.selectObj.dom.value is ', this.selectObj.dom.value);
|
|
234
|
-
const selectedOption = (_b = (_a = this.optionSetting) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.find((opt) => String(opt.value) === this.selectObj.dom.value);
|
|
235
|
-
if (!this.optionSetting) {
|
|
236
|
-
throw Error('无法获取optionSetting');
|
|
225
|
+
setup() {
|
|
226
|
+
this.btn.addEvents({
|
|
227
|
+
click: () => {
|
|
228
|
+
console.log('this.btn click . ');
|
|
237
229
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
230
|
+
});
|
|
231
|
+
this.selectObj.addEvents({
|
|
232
|
+
change: () => {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
console.log('this.selectObj.dom change . ');
|
|
235
|
+
console.log('this.selectObj.dom.value is ', this.selectObj.dom.value);
|
|
236
|
+
const selectedOption = ((_a = this.optionSetting) === null || _a === void 0 ? void 0 : _a.options) && ((_b = this.optionSetting) === null || _b === void 0 ? void 0 : _b.options.find((opt) => String(opt.value) === this.selectObj.dom.value));
|
|
237
|
+
if (!this.optionSetting) {
|
|
238
|
+
throw Error('无法获取optionSetting');
|
|
239
|
+
}
|
|
240
|
+
if (selectedOption && selectedOption.options) {
|
|
241
|
+
this.resetOptionSettingResultValue(selectedOption.value);
|
|
242
|
+
console.log('this.optionSetting is ', this.optionSetting);
|
|
243
|
+
console.log('selectOption is ', selectedOption);
|
|
244
|
+
this.resetOptions(selectedOption.options);
|
|
245
|
+
// this.resetControl();
|
|
246
|
+
}
|
|
244
247
|
}
|
|
245
|
-
})
|
|
248
|
+
});
|
|
246
249
|
}
|
|
247
250
|
}
|
|
248
251
|
exports.PropertyOptions = PropertyOptions;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FieldRadio = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const framework_1 = require("@type-dom/framework");
|
|
6
5
|
const field_item_abstract_1 = require("../field-item.abstract");
|
|
7
6
|
class FieldRadio extends field_item_abstract_1.FieldItem {
|
|
@@ -28,32 +27,28 @@ class FieldRadio extends field_item_abstract_1.FieldItem {
|
|
|
28
27
|
else {
|
|
29
28
|
button = this.optionDiv.childNodes[index];
|
|
30
29
|
}
|
|
31
|
-
button.
|
|
30
|
+
button.style.addObj({
|
|
32
31
|
height: '32px',
|
|
33
32
|
borderRadius: '0',
|
|
34
33
|
border: '1px solid #000'
|
|
35
34
|
});
|
|
36
|
-
button.
|
|
35
|
+
button.attr.addObj({
|
|
37
36
|
type: 'radio',
|
|
38
37
|
value: option.value,
|
|
39
38
|
checked: option.checked
|
|
40
39
|
});
|
|
41
40
|
if (option.checked) {
|
|
42
|
-
|
|
43
|
-
// button.styleObj.color = '#fff';
|
|
44
|
-
button.ctrl.addStyleObj({
|
|
41
|
+
button.style.addObj({
|
|
45
42
|
backgroundColor: '#00f',
|
|
46
43
|
color: '#fff',
|
|
47
44
|
});
|
|
48
45
|
this.selectedOpt = button;
|
|
49
46
|
}
|
|
50
47
|
else {
|
|
51
|
-
button.
|
|
48
|
+
button.style.addObj({
|
|
52
49
|
backgroundColor: '#fff',
|
|
53
50
|
color: '#000'
|
|
54
51
|
});
|
|
55
|
-
// button.styleObj.backgroundColor = '#fff';
|
|
56
|
-
// button.styleObj.color = '#000';
|
|
57
52
|
}
|
|
58
53
|
// span.childNodes.push(label, inputRadio);
|
|
59
54
|
// this.optionDiv.childNodes.push(button);
|
|
@@ -70,37 +65,38 @@ class FieldRadio extends field_item_abstract_1.FieldItem {
|
|
|
70
65
|
this.setOptions(this.params.options);
|
|
71
66
|
this.optionDiv.mount();
|
|
72
67
|
}
|
|
73
|
-
|
|
68
|
+
mounted() {
|
|
74
69
|
this.optionDiv.childNodes.forEach((btn) => {
|
|
75
70
|
if (btn.dom === undefined) {
|
|
76
71
|
return;
|
|
77
72
|
}
|
|
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
|
-
|
|
103
|
-
|
|
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
|
+
}
|
|
104
100
|
});
|
|
105
101
|
}
|
|
106
102
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FieldSelect = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
4
|
const select_class_1 = require("../../select/select.class");
|
|
6
5
|
const field_item_abstract_1 = require("../field-item.abstract");
|
|
7
6
|
const field_item_style_1 = require("../field-item.style");
|
|
@@ -10,33 +9,34 @@ class FieldSelect extends field_item_abstract_1.FieldItem {
|
|
|
10
9
|
super(labelText);
|
|
11
10
|
this.mode = 'editor';
|
|
12
11
|
this.select = new select_class_1.Select();
|
|
13
|
-
this.select.
|
|
14
|
-
this.select.
|
|
12
|
+
this.select.style.addObj(Object.assign({}, field_item_style_1.itemContentStyle));
|
|
13
|
+
this.select.attr.addObj({
|
|
15
14
|
name: 'property-select'
|
|
16
15
|
// type: 'text',
|
|
17
16
|
// placeholder: placeholder,
|
|
18
|
-
};
|
|
17
|
+
});
|
|
19
18
|
if (this.mode === 'read') {
|
|
20
|
-
this.select.
|
|
19
|
+
this.select.attr.addObj({
|
|
21
20
|
disabled: true
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
this.childNodes = [this.label, this.select, this.button];
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
this.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
setup() {
|
|
26
|
+
this.select.addEvents({
|
|
27
|
+
click: (evt) => {
|
|
28
|
+
console.log('this.select.dom click, event is ', evt);
|
|
29
|
+
console.log('this.select.dom.value is ', this.select.dom.value);
|
|
30
|
+
// console.log(this.reset);
|
|
31
|
+
this.reset(this.select.dom.value);
|
|
32
|
+
},
|
|
33
|
+
change: (evt) => {
|
|
34
|
+
console.log('this.select.dom change, event is ', evt);
|
|
35
|
+
console.log('this.select.dom.value is ', this.select.dom.value);
|
|
36
|
+
// console.log(this.reset);
|
|
37
|
+
this.reset(this.select.dom.value);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
exports.FieldSelect = FieldSelect;
|
|
@@ -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
|
}
|