goodteditor-ui 1.0.76 → 2.0.0
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 +10 -8
- package/index.html +20 -0
- package/package.json +13 -33
- package/postcss.config.js +1 -0
- package/src/components/ui/Badge.vue +3 -2
- package/src/components/ui/ColorPicker/Alpha.vue +1 -0
- package/src/components/ui/ColorPicker/Colors.vue +2 -1
- package/src/components/ui/ColorPicker/Hue.vue +1 -0
- package/src/components/ui/ColorPicker/Saturation.vue +1 -0
- package/src/components/ui/ColorPicker.vue +5 -4
- package/src/components/ui/Datalist.vue +8 -7
- package/src/components/ui/DatePicker.vue +11 -10
- package/src/components/ui/FileSelector.vue +2 -1
- package/src/components/ui/Grid.vue +14 -9
- package/src/components/ui/Image.vue +4 -2
- package/src/components/ui/InputAutocomplete.vue +23 -22
- package/src/components/ui/InputColorPicker.vue +10 -9
- package/src/components/ui/InputDatePicker.vue +11 -10
- package/src/components/ui/InputTags.vue +14 -13
- package/src/components/ui/InputTimePicker.vue +10 -9
- package/src/components/ui/InputUnits.vue +5 -5
- package/src/components/ui/Lazy.vue +5 -4
- package/src/components/ui/Pagination.vue +5 -4
- package/src/components/ui/Paginator.vue +5 -4
- package/src/components/ui/Popover.vue +14 -9
- package/src/components/ui/Popup.vue +5 -4
- package/src/components/ui/ResponsiveContainer.vue +17 -10
- package/src/components/ui/Select.vue +16 -14
- package/src/components/ui/TimePicker.vue +6 -7
- package/src/components/ui/Tooltip.vue +4 -3
- package/src/components/ui/WysiwygEditor/WysiwygEditor.vue +11 -10
- package/src/components/ui/WysiwygEditor/extensions/font-size.js +1 -1
- package/src/components/ui/WysiwygEditor/extensions/formatting.js +1 -1
- package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +3 -3
- package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +3 -3
- package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +2 -2
- package/src/components/ui/WysiwygEditor/renders/Select.vue +2 -2
- package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +2 -2
- package/src/components/ui/WysiwygEditor/renders/components/Tooltip.vue +2 -1
- package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +1 -0
- package/src/components/ui/utils/FormComponent.js +36 -37
- package/src/main.js +2 -6
- package/vite.config.js +6 -0
- package/babel.config.js +0 -5
- package/vue.config.js +0 -8
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
size="small"
|
|
32
32
|
:key="index"
|
|
33
33
|
removable
|
|
34
|
-
@click.
|
|
34
|
+
@click.stop
|
|
35
35
|
@remove="deselectOption(option)">
|
|
36
36
|
<span>{{ getOptionLabel(option) }}</span>
|
|
37
37
|
</ui-badge>
|
|
@@ -92,13 +92,13 @@
|
|
|
92
92
|
</div>
|
|
93
93
|
</slot>
|
|
94
94
|
|
|
95
|
-
<ui-popover :show
|
|
95
|
+
<ui-popover v-model:show="popoverShow" v-bind="popoverOptions">
|
|
96
96
|
<ui-datalist
|
|
97
|
+
v-model:cursorIndex="dataListCursorIndex"
|
|
97
98
|
class="w-100 pull-left"
|
|
98
|
-
@click.
|
|
99
|
+
@click.stop
|
|
99
100
|
@select-option="onDatalistSelectOption"
|
|
100
101
|
v-bind="{ size, options, class: datalistCssClass }"
|
|
101
|
-
:cursorIndex.sync="dataListCursorIndex"
|
|
102
102
|
ref="datalist">
|
|
103
103
|
<template #header>
|
|
104
104
|
<!--
|
|
@@ -238,10 +238,8 @@ export default {
|
|
|
238
238
|
/**
|
|
239
239
|
* @model
|
|
240
240
|
*/
|
|
241
|
-
|
|
242
|
-
default
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
241
|
+
modelValue: {
|
|
242
|
+
default: null
|
|
245
243
|
},
|
|
246
244
|
/**
|
|
247
245
|
* Options. Array of Objects (option objects)
|
|
@@ -300,6 +298,7 @@ export default {
|
|
|
300
298
|
default: null
|
|
301
299
|
}
|
|
302
300
|
},
|
|
301
|
+
emits: ['change'],
|
|
303
302
|
data() {
|
|
304
303
|
return {
|
|
305
304
|
optionsSelected: [],
|
|
@@ -308,22 +307,25 @@ export default {
|
|
|
308
307
|
},
|
|
309
308
|
computed: {
|
|
310
309
|
/**
|
|
311
|
-
* @return {
|
|
310
|
+
* @return {string[]}
|
|
312
311
|
*/
|
|
313
312
|
cssClassExt() {
|
|
314
|
-
|
|
315
|
-
|
|
313
|
+
const cssClass = [...this.cssClass];
|
|
314
|
+
if (this.readonly) {
|
|
315
|
+
cssClass.push('u-select-none');
|
|
316
|
+
}
|
|
317
|
+
return cssClass;
|
|
316
318
|
}
|
|
317
319
|
},
|
|
318
320
|
watch: {
|
|
319
|
-
|
|
321
|
+
modelValue: {
|
|
320
322
|
handler(model) {
|
|
321
323
|
this.importModel(model);
|
|
322
324
|
},
|
|
323
325
|
immediate: true
|
|
324
326
|
},
|
|
325
327
|
options() {
|
|
326
|
-
this.importModel(this.
|
|
328
|
+
this.importModel(this.modelValue);
|
|
327
329
|
}
|
|
328
330
|
},
|
|
329
331
|
methods: {
|
|
@@ -373,7 +375,7 @@ export default {
|
|
|
373
375
|
* Input event
|
|
374
376
|
* @property {any} value
|
|
375
377
|
*/
|
|
376
|
-
this.$emit('
|
|
378
|
+
this.$emit('update:modelValue', value, { cancel: rollback });
|
|
377
379
|
/**
|
|
378
380
|
* Change event
|
|
379
381
|
* @property {any} model
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
&-datalist {
|
|
87
87
|
z-index: auto;
|
|
88
88
|
min-width: 3em;
|
|
89
|
-
|
|
89
|
+
:deep(> ul) {
|
|
90
90
|
min-height: calc(
|
|
91
91
|
var(--ui-time-picker-item-size) * var(--ui-time-picker-datalist-min-items)
|
|
92
92
|
);
|
|
@@ -107,11 +107,9 @@ export default {
|
|
|
107
107
|
/**
|
|
108
108
|
* @model Object { h:Number, m:Number } where h stands for 'hour'; m stands for 'minute'
|
|
109
109
|
*/
|
|
110
|
-
|
|
110
|
+
modelValue: {
|
|
111
111
|
type: Object,
|
|
112
|
-
default
|
|
113
|
-
return null;
|
|
114
|
-
},
|
|
112
|
+
default: null
|
|
115
113
|
},
|
|
116
114
|
/**
|
|
117
115
|
* Hour/minute step size Object (works similar to how input step attribute works)
|
|
@@ -154,6 +152,7 @@ export default {
|
|
|
154
152
|
},
|
|
155
153
|
},
|
|
156
154
|
},
|
|
155
|
+
emits: ['update:modelValue', 'change'],
|
|
157
156
|
data() {
|
|
158
157
|
return {
|
|
159
158
|
h: -1,
|
|
@@ -166,7 +165,7 @@ export default {
|
|
|
166
165
|
};
|
|
167
166
|
},
|
|
168
167
|
watch: {
|
|
169
|
-
|
|
168
|
+
modelValue: {
|
|
170
169
|
handler(val) {
|
|
171
170
|
this.$nextTick(() => {
|
|
172
171
|
this.m = val ? val.m : -1;
|
|
@@ -239,7 +238,7 @@ export default {
|
|
|
239
238
|
* Input event
|
|
240
239
|
* @property {Object} option
|
|
241
240
|
*/
|
|
242
|
-
this.$emit('
|
|
241
|
+
this.$emit('update:modelValue', obj);
|
|
243
242
|
/**
|
|
244
243
|
* Change event
|
|
245
244
|
* @property {Object} option
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
-->
|
|
9
9
|
<slot name="target" v-bind="{ events: targetEvents, binds: targetBinds, visible }"></slot>
|
|
10
10
|
<ui-popover
|
|
11
|
+
v-model:show="popoverShow"
|
|
11
12
|
v-bind="popoverOptions"
|
|
12
|
-
:show.sync="popoverShow"
|
|
13
13
|
ref="popover"
|
|
14
|
-
@mouseenter
|
|
15
|
-
@mouseleave
|
|
14
|
+
@mouseenter="onPopoverMouseEnter"
|
|
15
|
+
@mouseleave="onPopoverMouseLeave"
|
|
16
16
|
>
|
|
17
17
|
<!--
|
|
18
18
|
@slot Tooltip slot
|
|
@@ -78,6 +78,7 @@ export default {
|
|
|
78
78
|
default: TriggerOn.MOUSE_MOVE
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
+
emits: ['hidden'],
|
|
81
82
|
data() {
|
|
82
83
|
return {
|
|
83
84
|
timeout: null,
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
48
|
<script>
|
|
49
|
-
import { Editor, EditorContent } from '@tiptap/vue-
|
|
49
|
+
import { Editor, EditorContent } from '@tiptap/vue-3';
|
|
50
50
|
|
|
51
51
|
import { debounce } from '../utils/Helpers';
|
|
52
52
|
import { resolveExtensions } from './extensions';
|
|
@@ -68,7 +68,7 @@ export default {
|
|
|
68
68
|
/**
|
|
69
69
|
* @model
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
modelValue: {
|
|
72
72
|
type: String,
|
|
73
73
|
default: '',
|
|
74
74
|
},
|
|
@@ -122,6 +122,7 @@ export default {
|
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
},
|
|
125
|
+
emits: ['update:modelValue', 'change'],
|
|
125
126
|
data: () => ({
|
|
126
127
|
/** @type {Editor} */
|
|
127
128
|
editor: null,
|
|
@@ -158,7 +159,7 @@ export default {
|
|
|
158
159
|
/**
|
|
159
160
|
* @param {string} value
|
|
160
161
|
*/
|
|
161
|
-
|
|
162
|
+
modelValue(value) {
|
|
162
163
|
const isSame = this.content === value;
|
|
163
164
|
|
|
164
165
|
if (isSame) {
|
|
@@ -182,10 +183,10 @@ export default {
|
|
|
182
183
|
this.onSelectionUpdateDebounced = debounce(this.onSelectionUpdate, 300);
|
|
183
184
|
},
|
|
184
185
|
mounted() {
|
|
185
|
-
const { $refs,
|
|
186
|
+
const { $refs, modelValue, bubbleMenu, autofocus, editorContent, editorClass, onSelectionUpdateDebounced } = this;
|
|
186
187
|
|
|
187
188
|
this.editor = new Editor({
|
|
188
|
-
content:
|
|
189
|
+
content: modelValue,
|
|
189
190
|
extensions: resolveExtensions({
|
|
190
191
|
...(bubbleMenu && {
|
|
191
192
|
bubbleMenu: {
|
|
@@ -210,7 +211,7 @@ export default {
|
|
|
210
211
|
}
|
|
211
212
|
},
|
|
212
213
|
onBlur: () => {
|
|
213
|
-
const isSame = this.content === this.
|
|
214
|
+
const isSame = this.content === this.modelValue;
|
|
214
215
|
|
|
215
216
|
if (isSame) {
|
|
216
217
|
return;
|
|
@@ -223,7 +224,7 @@ export default {
|
|
|
223
224
|
activated() {
|
|
224
225
|
this.editor.commands.focus(this.caretPosition);
|
|
225
226
|
},
|
|
226
|
-
|
|
227
|
+
beforeUnmount() {
|
|
227
228
|
this.editor?.destroy();
|
|
228
229
|
},
|
|
229
230
|
methods: {
|
|
@@ -232,7 +233,7 @@ export default {
|
|
|
232
233
|
* Input event
|
|
233
234
|
* @property {string} value
|
|
234
235
|
*/
|
|
235
|
-
this.$emit('
|
|
236
|
+
this.$emit('update:modelValue', this.content);
|
|
236
237
|
},
|
|
237
238
|
onChange() {
|
|
238
239
|
/**
|
|
@@ -265,7 +266,7 @@ export default {
|
|
|
265
266
|
get tools() {
|
|
266
267
|
return toolGroups.flatMap(({ group }) => group);
|
|
267
268
|
},
|
|
268
|
-
|
|
269
|
+
onChange: this.onChange,
|
|
269
270
|
getImageUrl: this.getImageUrl,
|
|
270
271
|
});
|
|
271
272
|
|
|
@@ -304,7 +305,7 @@ export default {
|
|
|
304
305
|
}
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
|
|
308
|
+
:deep(.ProseMirror) {
|
|
308
309
|
&.focus-outline-none:focus-visible {
|
|
309
310
|
outline: none;
|
|
310
311
|
}
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<i class="mdi" :class="icon"></i>
|
|
9
9
|
</div>
|
|
10
10
|
</button>
|
|
11
|
-
<popover :show
|
|
12
|
-
<color-picker class="pull-left" v-bind="{
|
|
11
|
+
<popover v-model:show="popoverShow" v-bind="popoverOptions">
|
|
12
|
+
<color-picker class="pull-left" v-bind="{ modelValue, showSubmit: true }" @submit="onSubmit" />
|
|
13
13
|
</popover>
|
|
14
14
|
</div>
|
|
15
15
|
</template>
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
computed: {
|
|
33
|
-
|
|
33
|
+
modelValue() {
|
|
34
34
|
return this.tool.getValue();
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
<div :title="title" class="autocomplete-tool">
|
|
3
3
|
<input-autocomplete
|
|
4
4
|
v-bind="{
|
|
5
|
-
|
|
5
|
+
modelValue,
|
|
6
6
|
options: tool.options,
|
|
7
7
|
disabled: !isEnabled,
|
|
8
8
|
size: 'small',
|
|
9
9
|
appendToBody: false
|
|
10
10
|
}"
|
|
11
|
-
@
|
|
11
|
+
@update:modelValue="onInput" />
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
components: { InputAutocomplete },
|
|
21
21
|
mixins: [useRender()],
|
|
22
22
|
computed: {
|
|
23
|
-
|
|
23
|
+
modelValue() {
|
|
24
24
|
return this.tool.getValue() ?? '';
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :title="title" class="input-units-tool">
|
|
3
3
|
<input-units
|
|
4
|
-
v-bind="{
|
|
4
|
+
v-bind="{ modelValue, units, size: 'small', disabled: !isEnabled, appendToBody: false }"
|
|
5
5
|
@change="onChange" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
@@ -14,7 +14,7 @@ export default {
|
|
|
14
14
|
components: { InputUnits },
|
|
15
15
|
mixins: [useRender()],
|
|
16
16
|
computed: {
|
|
17
|
-
|
|
17
|
+
modelValue() {
|
|
18
18
|
return this.tool.getValue();
|
|
19
19
|
},
|
|
20
20
|
units() {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div :title="title" class="select-tool">
|
|
3
3
|
<ui-select
|
|
4
4
|
v-bind="{
|
|
5
|
-
|
|
5
|
+
modelValue,
|
|
6
6
|
options,
|
|
7
7
|
valueObjects,
|
|
8
8
|
disabled: !isEnabled,
|
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
components: { UiSelect },
|
|
23
23
|
mixins: [useRender()],
|
|
24
24
|
computed: {
|
|
25
|
-
|
|
25
|
+
modelValue() {
|
|
26
26
|
return this.tool.getValue(this.options);
|
|
27
27
|
},
|
|
28
28
|
options() {
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<i class="mdi" :class="icon"></i>
|
|
9
9
|
</div>
|
|
10
10
|
</button>
|
|
11
|
-
<popover :show
|
|
11
|
+
<popover v-model:show="popoverShow" v-bind="popoverOptions" position="bottom-end">
|
|
12
12
|
<ui-datalist
|
|
13
13
|
class="w-100 pull-left"
|
|
14
14
|
v-bind="{ size: 'small', options: tool.options }"
|
|
15
|
-
@click.
|
|
15
|
+
@click.stop>
|
|
16
16
|
<template #option="{ option, index }">
|
|
17
17
|
<li :key="index" class="list-item" >
|
|
18
18
|
<component :is="option.render" :tool="option" @command-executed="onCommandExecuted" />
|
|
@@ -5,12 +5,18 @@ const r = () =>
|
|
|
5
5
|
.toString(36)
|
|
6
6
|
.substr(2);
|
|
7
7
|
|
|
8
|
+
const Size = {
|
|
9
|
+
LARGE: { name: 'large', class: ['form-elem-large'] },
|
|
10
|
+
SMALL: { name: 'small', class: ['form-elem-small'] },
|
|
11
|
+
NORMAL: { name: 'normal', class: [] }
|
|
12
|
+
};
|
|
13
|
+
|
|
8
14
|
export default {
|
|
9
15
|
props: {
|
|
10
16
|
/**
|
|
11
17
|
* @model
|
|
12
18
|
*/
|
|
13
|
-
|
|
19
|
+
modelValue: {
|
|
14
20
|
default: '',
|
|
15
21
|
},
|
|
16
22
|
/**
|
|
@@ -19,10 +25,11 @@ export default {
|
|
|
19
25
|
*/
|
|
20
26
|
size: {
|
|
21
27
|
type: String,
|
|
22
|
-
default:
|
|
23
|
-
validator:
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
default: Size.NORMAL.name,
|
|
29
|
+
validator: (val) =>
|
|
30
|
+
Object.values(Size)
|
|
31
|
+
.map(({ name }) => name)
|
|
32
|
+
.includes(val)
|
|
26
33
|
},
|
|
27
34
|
/**
|
|
28
35
|
* Placeholder
|
|
@@ -46,48 +53,40 @@ export default {
|
|
|
46
53
|
default: false,
|
|
47
54
|
},
|
|
48
55
|
},
|
|
56
|
+
emits: ['update:modelValue'],
|
|
49
57
|
data() {
|
|
50
58
|
return {
|
|
51
59
|
inputId: this.uid(),
|
|
52
|
-
cssClass: {},
|
|
53
60
|
rootHasFocus: false,
|
|
54
61
|
};
|
|
55
62
|
},
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
immediate: true,
|
|
73
|
-
},
|
|
74
|
-
disabled: {
|
|
75
|
-
handler(val) {
|
|
76
|
-
this.$set(this.cssClass, 'disabled', val);
|
|
77
|
-
},
|
|
78
|
-
immediate: true,
|
|
79
|
-
},
|
|
80
|
-
rootHasFocus(val) {
|
|
81
|
-
this.$set(this.cssClass, 'focus', val);
|
|
63
|
+
computed: {
|
|
64
|
+
cssClass() {
|
|
65
|
+
const { size, readonly, disabled, rootHasFocus } = this;
|
|
66
|
+
const sizeDef = Object.values(Size).find((def) => def.name === size);
|
|
67
|
+
const classes = [...sizeDef.class];
|
|
68
|
+
|
|
69
|
+
if (readonly) {
|
|
70
|
+
classes.push('events-none')
|
|
71
|
+
}
|
|
72
|
+
if (disabled) {
|
|
73
|
+
classes.push('disabled');
|
|
74
|
+
}
|
|
75
|
+
if (rootHasFocus) {
|
|
76
|
+
classes.push('focus');
|
|
77
|
+
}
|
|
78
|
+
return classes;
|
|
82
79
|
},
|
|
83
80
|
},
|
|
84
81
|
created() {
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
this.controller = new AbortController();
|
|
83
|
+
const { signal } = this.controller;
|
|
84
|
+
window.addEventListener('blur', this.onWinBlur, { signal });
|
|
85
|
+
document.addEventListener('mousedown', this.onDocMouseDown, { signal });
|
|
87
86
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
beforeUnmount() {
|
|
88
|
+
this.controller.abort();
|
|
89
|
+
this.controller = null;
|
|
91
90
|
},
|
|
92
91
|
methods: {
|
|
93
92
|
uid() {
|
package/src/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createApp } from 'vue';
|
|
2
2
|
import App from './App.vue';
|
|
3
3
|
|
|
4
4
|
// css
|
|
@@ -6,8 +6,4 @@ import 'goodt-framework-css/dist/all.css';
|
|
|
6
6
|
import '@mdi/font/css/materialdesignicons.min.css';
|
|
7
7
|
import '@mdi/light-font/css/materialdesignicons-light.min.css';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
new Vue({
|
|
12
|
-
render: h => h(App)
|
|
13
|
-
}).$mount('#app');
|
|
9
|
+
createApp(App).mount('#app');
|
package/vite.config.js
ADDED
package/babel.config.js
DELETED