goodteditor-ui 1.0.26 → 1.0.28
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/.eslintrc.js +7 -7
- package/.prettierrc +14 -14
- package/README.md +35 -35
- package/babel.config.js +5 -5
- package/index.js +53 -53
- package/jsconfig.json +13 -13
- package/package.json +67 -67
- package/src/App.vue +36 -36
- package/src/components/ui/Avatar.md +68 -68
- package/src/components/ui/Avatar.vue +180 -180
- package/src/components/ui/Badge.md +20 -20
- package/src/components/ui/Badge.vue +75 -75
- package/src/components/ui/Collapse.md +90 -90
- package/src/components/ui/Collapse.vue +86 -86
- package/src/components/ui/ColorPicker/Alpha.vue +114 -114
- package/src/components/ui/ColorPicker/Colors.vue +117 -117
- package/src/components/ui/ColorPicker/Hue.vue +113 -113
- package/src/components/ui/ColorPicker/Preview.vue +55 -55
- package/src/components/ui/ColorPicker/Saturation.vue +123 -123
- package/src/components/ui/ColorPicker/mixin.js +105 -105
- package/src/components/ui/ColorPicker.md +17 -17
- package/src/components/ui/ColorPicker.vue +314 -314
- package/src/components/ui/Datalist.md +41 -41
- package/src/components/ui/Datalist.vue +164 -164
- package/src/components/ui/DatePicker.md +168 -168
- package/src/components/ui/DatePicker.vue +527 -527
- package/src/components/ui/FileSelector.md +105 -105
- package/src/components/ui/FileSelector.vue +82 -82
- package/src/components/ui/Grid.md +130 -130
- package/src/components/ui/Grid.vue +92 -92
- package/src/components/ui/Image.md +59 -59
- package/src/components/ui/Image.vue +57 -57
- package/src/components/ui/InputAutocomplete.md +115 -115
- package/src/components/ui/InputAutocomplete.vue +374 -349
- package/src/components/ui/InputColorPicker.md +51 -51
- package/src/components/ui/InputColorPicker.vue +151 -151
- package/src/components/ui/InputDatePicker.md +121 -121
- package/src/components/ui/InputDatePicker.vue +326 -326
- package/src/components/ui/InputTags.md +51 -51
- package/src/components/ui/InputTags.vue +184 -184
- package/src/components/ui/InputTimePicker.md +25 -25
- package/src/components/ui/InputTimePicker.vue +253 -253
- package/src/components/ui/InputUnits.md +20 -20
- package/src/components/ui/InputUnits.vue +257 -257
- package/src/components/ui/Lazy.md +37 -37
- package/src/components/ui/Lazy.vue +92 -92
- package/src/components/ui/Pagination.md +74 -74
- package/src/components/ui/Pagination.vue +138 -138
- package/src/components/ui/Paginator.md +34 -34
- package/src/components/ui/Paginator.vue +83 -83
- package/src/components/ui/Popover.md +34 -34
- package/src/components/ui/Popover.vue +274 -274
- package/src/components/ui/Popup.md +59 -59
- package/src/components/ui/Popup.vue +150 -150
- package/src/components/ui/ResponsiveContainer.md +58 -58
- package/src/components/ui/ResponsiveContainer.vue +99 -99
- package/src/components/ui/Select.md +187 -187
- package/src/components/ui/Select.vue +421 -421
- package/src/components/ui/TimePicker.md +50 -50
- package/src/components/ui/TimePicker.vue +252 -252
- package/src/components/ui/Tooltip.md +54 -54
- package/src/components/ui/Tooltip.vue +113 -113
- package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +128 -128
- package/src/components/ui/WysiwygEditor/constants.js +273 -273
- package/src/components/ui/WysiwygEditor/extensions/blockquote.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/bold.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/bullet-list.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/code-block.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/code.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/font-size.js +34 -34
- package/src/components/ui/WysiwygEditor/extensions/formatting.js +14 -14
- package/src/components/ui/WysiwygEditor/extensions/heading.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/horizontal-rule.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/image.js +37 -33
- package/src/components/ui/WysiwygEditor/extensions/index.d.ts +32 -32
- package/src/components/ui/WysiwygEditor/extensions/index.js +32 -32
- package/src/components/ui/WysiwygEditor/extensions/italic.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/link.js +16 -16
- package/src/components/ui/WysiwygEditor/extensions/list-item.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/ordered-list.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/paragraph.js +23 -23
- package/src/components/ui/WysiwygEditor/extensions/strike.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table-cell.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/table-header.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table-row.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table.js +29 -29
- package/src/components/ui/WysiwygEditor/extensions/text-align.js +6 -6
- package/src/components/ui/WysiwygEditor/extensions/text-style.js +12 -12
- package/src/components/ui/WysiwygEditor/extensions/underline.js +15 -15
- package/src/components/ui/WysiwygEditor/index.d.ts +4 -4
- package/src/components/ui/WysiwygEditor/index.js +4 -4
- package/src/components/ui/WysiwygEditor/renders/Button.vue +28 -28
- package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +41 -41
- package/src/components/ui/WysiwygEditor/renders/Image.vue +200 -162
- package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
- package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +37 -37
- package/src/components/ui/WysiwygEditor/renders/Link.vue +82 -82
- package/src/components/ui/WysiwygEditor/renders/Select.vue +47 -47
- package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +49 -49
- package/src/components/ui/WysiwygEditor/renders/components/Popover.vue +15 -0
- package/src/components/ui/WysiwygEditor/renders/components/WithPopover.vue +35 -35
- package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
- package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
- package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
- package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
- package/src/components/ui/WysiwygEditor/tools-and-commands.js +709 -702
- package/src/components/ui/WysiwygEditor/utils.js +72 -72
- package/src/components/ui/WysiwygEditor.md +18 -18
- package/src/components/ui/WysiwygEditor.vue +266 -266
- package/src/components/ui/utils/FormComponent.js +107 -107
- package/src/components/ui/utils/Helpers.js +84 -84
- package/src/components/ui/utils/WithPopover.js +81 -81
- package/src/main.js +8 -8
- package/styleguide.config.js +37 -37
- package/vue.config.js +8 -8
- package/dist/js.png +0 -0
|
@@ -1,162 +1,200 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<with-popover :show.sync="isPopoverShown" auto-width>
|
|
3
|
-
<template #button="{ togglePopover }">
|
|
4
|
-
<button :title="title" class="btn btn-small btn-outline btn-icon" @click="togglePopover">
|
|
5
|
-
<div class="icon">
|
|
6
|
-
<i class="mdi" :class="icon"></i>
|
|
7
|
-
</div>
|
|
8
|
-
</button>
|
|
9
|
-
</template>
|
|
10
|
-
<
|
|
11
|
-
<div class="
|
|
12
|
-
<div class="
|
|
13
|
-
<div class="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<div class="
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<with-popover :show.sync="isPopoverShown" auto-width>
|
|
3
|
+
<template #button="{ togglePopover }">
|
|
4
|
+
<button :title="title" class="btn btn-small btn-outline btn-icon" @click="togglePopover">
|
|
5
|
+
<div class="icon">
|
|
6
|
+
<i class="mdi" :class="icon"></i>
|
|
7
|
+
</div>
|
|
8
|
+
</button>
|
|
9
|
+
</template>
|
|
10
|
+
<template #default="{ togglePopover }">
|
|
11
|
+
<div class="w-f2">
|
|
12
|
+
<div class="row row-hgap-3 mar-bot-l1">
|
|
13
|
+
<div class="col col-vmid text-truncate">
|
|
14
|
+
<div class="form-label form-label-xsmall text-truncate">Url</div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="col col-vmid col-12-12">
|
|
17
|
+
<div class="form-control form-control-icon-right w-12-12">
|
|
18
|
+
<input-autocomplete
|
|
19
|
+
v-model.trim.lazy="image.url"
|
|
20
|
+
size="small"
|
|
21
|
+
@change="onChange" />
|
|
22
|
+
<div class="icon" @click="($event) => browse(togglePopover)">
|
|
23
|
+
<i class="mdi mdi-folder cursor-pointer color-grey" />
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="row row-hgap-3 mar-bot-l1">
|
|
30
|
+
<div class="col col-vmid text-truncate">
|
|
31
|
+
<label for="resp" class="form-label form-label-small text-truncate">
|
|
32
|
+
Отзывчивое изображение
|
|
33
|
+
</label>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="col col-vmid col-auto">
|
|
36
|
+
<input
|
|
37
|
+
id="resp"
|
|
38
|
+
v-model="image.isResponsive"
|
|
39
|
+
type="checkbox"
|
|
40
|
+
class="switch switch-small pull-right"
|
|
41
|
+
@change="onChange">
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div class="row row-hgap-3 mar-bot-l1">
|
|
46
|
+
<div class="col col-vmid text-truncate">
|
|
47
|
+
<label class="form-label form-label-xsmall text-truncate">
|
|
48
|
+
Выровнять изображение
|
|
49
|
+
</label>
|
|
50
|
+
</div>
|
|
51
|
+
<div class="col col-vmid col-12-12">
|
|
52
|
+
<ui-select
|
|
53
|
+
v-model="image.align"
|
|
54
|
+
:options="$options.static.AlignOptions"
|
|
55
|
+
size="small"
|
|
56
|
+
class="w-100"
|
|
57
|
+
@change="onChange" />
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div class="row row-hgap-l1 mar-bot-l1">
|
|
62
|
+
<div class="col">
|
|
63
|
+
<div class="row row-hgap-3">
|
|
64
|
+
<div class="col col-vmid text-truncate">
|
|
65
|
+
<div class="form-label form-label-xsmall text-truncate">Ширина</div>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="col col-vmid col-12-12">
|
|
68
|
+
<input-units
|
|
69
|
+
v-model="image.width"
|
|
70
|
+
:units="$options.static.SizeUnits"
|
|
71
|
+
:disabled="image.isResponsive"
|
|
72
|
+
size="small"
|
|
73
|
+
@change="onChange">
|
|
74
|
+
</input-units>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="col">
|
|
79
|
+
<div class="row row-hgap-3">
|
|
80
|
+
<div class="col col-vmid text-truncate">
|
|
81
|
+
<div class="form-label form-label-xsmall text-truncate">Высота</div>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="col col-vmid col-12-12">
|
|
84
|
+
<input-units
|
|
85
|
+
v-model="image.height"
|
|
86
|
+
:units="$options.static.SizeUnits"
|
|
87
|
+
:disabled="image.isResponsive"
|
|
88
|
+
size="small"
|
|
89
|
+
@change="onChange">
|
|
90
|
+
</input-units>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</template>
|
|
97
|
+
</with-popover>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script>
|
|
101
|
+
import InputAutocomplete from '../../InputAutocomplete.vue';
|
|
102
|
+
import InputUnits from '../../InputUnits.vue';
|
|
103
|
+
import UiSelect from '../../Select.vue';
|
|
104
|
+
import WithPopover from './components/WithPopover.vue';
|
|
105
|
+
import { useRender } from './mixins';
|
|
106
|
+
|
|
107
|
+
const SizeUnits = ["rem", "em", "%", "px", "vh", "vw"];
|
|
108
|
+
const AlignOptions = [
|
|
109
|
+
{ value: null, label: 'По левому краю' },
|
|
110
|
+
{ value: 'mar-h-auto', label: 'По центру' },
|
|
111
|
+
{ value: 'mar-left-auto', label: 'По правому краю' }
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
const defaultImgSettings = {
|
|
115
|
+
url: '',
|
|
116
|
+
isResponsive: true,
|
|
117
|
+
align: null,
|
|
118
|
+
height: '100%',
|
|
119
|
+
width: '100%',
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const cssStrToObj = (str) => {
|
|
123
|
+
if (str == null) {
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
return str.split(';').reduce((obj, style) => {
|
|
127
|
+
const [name, val] = style.split(':').map((el) => el.trim());
|
|
128
|
+
if (name != null && val != null) {
|
|
129
|
+
obj[name] = val;
|
|
130
|
+
}
|
|
131
|
+
return obj;
|
|
132
|
+
}, {});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export default {
|
|
136
|
+
components: {
|
|
137
|
+
InputAutocomplete,
|
|
138
|
+
InputUnits,
|
|
139
|
+
UiSelect,
|
|
140
|
+
WithPopover
|
|
141
|
+
},
|
|
142
|
+
mixins: [useRender()],
|
|
143
|
+
data: () => ({
|
|
144
|
+
isPopoverShown: false,
|
|
145
|
+
image: { ...defaultImgSettings }
|
|
146
|
+
}),
|
|
147
|
+
watch: {
|
|
148
|
+
isPopoverShown(isShown) {
|
|
149
|
+
if (isShown === false) {
|
|
150
|
+
this.image = { ...defaultImgSettings };
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
this.setImageSettings();
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
static: {
|
|
158
|
+
SizeUnits,
|
|
159
|
+
AlignOptions
|
|
160
|
+
},
|
|
161
|
+
methods: {
|
|
162
|
+
setImageSettings() {
|
|
163
|
+
const attrs = this.tool.getValue();
|
|
164
|
+
|
|
165
|
+
if (JSON.stringify(attrs) === '{}') {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const { src: url, class: className, style } = attrs;
|
|
170
|
+
const { width, height } = cssStrToObj(style);
|
|
171
|
+
const align = className.match(/mar-\w+-\w+/);
|
|
172
|
+
|
|
173
|
+
this.image = {
|
|
174
|
+
...defaultImgSettings,
|
|
175
|
+
url,
|
|
176
|
+
isResponsive: className?.includes('responsive') ?? false,
|
|
177
|
+
align: align?.[0] ?? null,
|
|
178
|
+
...(width && { width }),
|
|
179
|
+
...(height && { height })
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
async browse(togglePopover) {
|
|
183
|
+
/* to avoid overlap with FileManager's popup */
|
|
184
|
+
togglePopover();
|
|
185
|
+
|
|
186
|
+
await this.tool.exec(this.image);
|
|
187
|
+
const { src: url } = this.tool.getValue();
|
|
188
|
+
|
|
189
|
+
this.image = { ...this.image, url };
|
|
190
|
+
this.emitExecuted();
|
|
191
|
+
|
|
192
|
+
togglePopover();
|
|
193
|
+
},
|
|
194
|
+
onChange() {
|
|
195
|
+
this.tool.exec(this.image);
|
|
196
|
+
this.emitExecuted();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
</script>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :title="title" class="autocomplete-tool">
|
|
3
|
-
<input-autocomplete
|
|
4
|
-
v-bind="{ value, options: tool.options, disabled: !isEnabled, size: 'small' }"
|
|
5
|
-
@input="onInput" />
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import InputAutocomplete from '../../InputAutocomplete.vue';
|
|
11
|
-
import { useRender } from './mixins';
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
components: { InputAutocomplete },
|
|
15
|
-
mixins: [useRender()],
|
|
16
|
-
computed: {
|
|
17
|
-
value() {
|
|
18
|
-
return this.tool.getValue() ?? '';
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
methods: {
|
|
22
|
-
onInput(value) {
|
|
23
|
-
this.tool.exec(value);
|
|
24
|
-
this.emitExecuted();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<style scoped>
|
|
31
|
-
.autocomplete-tool {
|
|
32
|
-
width: 10rem;
|
|
33
|
-
}
|
|
34
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :title="title" class="autocomplete-tool">
|
|
3
|
+
<input-autocomplete
|
|
4
|
+
v-bind="{ value, options: tool.options, disabled: !isEnabled, size: 'small' }"
|
|
5
|
+
@input="onInput" />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import InputAutocomplete from '../../InputAutocomplete.vue';
|
|
11
|
+
import { useRender } from './mixins';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
components: { InputAutocomplete },
|
|
15
|
+
mixins: [useRender()],
|
|
16
|
+
computed: {
|
|
17
|
+
value() {
|
|
18
|
+
return this.tool.getValue() ?? '';
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
onInput(value) {
|
|
23
|
+
this.tool.exec(value);
|
|
24
|
+
this.emitExecuted();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.autocomplete-tool {
|
|
32
|
+
width: 10rem;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :title="title" class="input-units-tool">
|
|
3
|
-
<input-units
|
|
4
|
-
v-bind="{ value, units, size: 'small', disabled: !isEnabled }"
|
|
5
|
-
@change="onChange" />
|
|
6
|
-
</div>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import InputUnits from '../../InputUnits.vue';
|
|
11
|
-
import { useRender } from './mixins';
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
components: { InputUnits },
|
|
15
|
-
mixins: [useRender()],
|
|
16
|
-
computed: {
|
|
17
|
-
value() {
|
|
18
|
-
return this.tool.getValue();
|
|
19
|
-
},
|
|
20
|
-
units() {
|
|
21
|
-
return this.tool?.units ?? [];
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
onChange(value) {
|
|
26
|
-
this.tool.exec(value);
|
|
27
|
-
this.emitExecuted();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<style scoped>
|
|
34
|
-
.input-units-tool {
|
|
35
|
-
width: 4rem;
|
|
36
|
-
}
|
|
37
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div :title="title" class="input-units-tool">
|
|
3
|
+
<input-units
|
|
4
|
+
v-bind="{ value, units, size: 'small', disabled: !isEnabled }"
|
|
5
|
+
@change="onChange" />
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
import InputUnits from '../../InputUnits.vue';
|
|
11
|
+
import { useRender } from './mixins';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
components: { InputUnits },
|
|
15
|
+
mixins: [useRender()],
|
|
16
|
+
computed: {
|
|
17
|
+
value() {
|
|
18
|
+
return this.tool.getValue();
|
|
19
|
+
},
|
|
20
|
+
units() {
|
|
21
|
+
return this.tool?.units ?? [];
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
methods: {
|
|
25
|
+
onChange(value) {
|
|
26
|
+
this.tool.exec(value);
|
|
27
|
+
this.emitExecuted();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.input-units-tool {
|
|
35
|
+
width: 4rem;
|
|
36
|
+
}
|
|
37
|
+
</style>
|