quasar-ui-sellmate-ui-kit 3.3.0 → 3.3.2
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/dist/index.common.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.min.css +1 -1
- package/dist/index.rtl.css +1 -1
- package/dist/index.rtl.min.css +1 -1
- package/dist/index.umd.js +90 -78
- package/dist/index.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/components/SEditor.vue +53 -49
package/package.json
CHANGED
|
@@ -14,46 +14,54 @@
|
|
|
14
14
|
v-model="model"
|
|
15
15
|
class="s-editor"
|
|
16
16
|
v-on="usePlaintextPasting ? { paste: onPaste } : {}"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<q-
|
|
22
|
-
class="bg-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
17
|
+
>
|
|
18
|
+
<template #upload>
|
|
19
|
+
<q-btn flat dense :ripple="false" size="sm">
|
|
20
|
+
<q-icon name="image" />
|
|
21
|
+
<q-menu>
|
|
22
|
+
<q-card class="q-pa-sm bg-Grey_Lighten-5">
|
|
23
|
+
<q-card-section class="q-pa-none">
|
|
24
|
+
<q-input
|
|
25
|
+
class="bg-white font-12-400"
|
|
26
|
+
style="width: 348px"
|
|
27
|
+
v-model="value"
|
|
28
|
+
dense
|
|
29
|
+
outlined
|
|
30
|
+
type="textarea"
|
|
31
|
+
:placeholder="imgInputPlaceholder"
|
|
32
|
+
autofocus
|
|
33
|
+
/>
|
|
34
|
+
<div class="row reverse q-mt-sm">
|
|
35
|
+
<s-button
|
|
36
|
+
outline
|
|
37
|
+
:label="imgUploadBtnLabel"
|
|
38
|
+
@click="onOkClick"
|
|
39
|
+
v-close-popup
|
|
40
|
+
color="Blue_B_Default"
|
|
41
|
+
class="bg-white"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</q-card-section>
|
|
45
|
+
</q-card>
|
|
46
|
+
</q-menu>
|
|
47
|
+
</q-btn>
|
|
48
|
+
</template>
|
|
49
|
+
</q-editor>
|
|
43
50
|
</template>
|
|
44
51
|
|
|
45
52
|
<script>
|
|
46
|
-
import { defineComponent, ref, watch } from 'vue';
|
|
47
|
-
import { extend, QCard, QCardSection,
|
|
53
|
+
import { defineComponent, ref, watch, computed } from 'vue';
|
|
54
|
+
import { extend, QCard, QCardSection, QMenu, QEditor, QInput, QBtn, useQuasar } from 'quasar';
|
|
48
55
|
|
|
49
56
|
export default defineComponent({
|
|
50
57
|
name: 'SEditor',
|
|
51
58
|
components: {
|
|
52
59
|
QEditor,
|
|
53
|
-
|
|
60
|
+
QMenu,
|
|
54
61
|
QCard,
|
|
55
62
|
QCardSection,
|
|
56
63
|
QInput,
|
|
64
|
+
QBtn,
|
|
57
65
|
},
|
|
58
66
|
props: {
|
|
59
67
|
definitions: Object,
|
|
@@ -98,6 +106,10 @@
|
|
|
98
106
|
type: Boolean,
|
|
99
107
|
default: false,
|
|
100
108
|
},
|
|
109
|
+
imgUploadBtnLabel: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: '삽입',
|
|
112
|
+
},
|
|
101
113
|
imgInputPlaceholder: {
|
|
102
114
|
type: String,
|
|
103
115
|
default:
|
|
@@ -113,13 +125,9 @@
|
|
|
113
125
|
const $q = useQuasar();
|
|
114
126
|
|
|
115
127
|
// Toolbar Begin
|
|
116
|
-
const isOpened = ref(false);
|
|
128
|
+
// const isOpened = ref(false);
|
|
117
129
|
const value = ref('');
|
|
118
130
|
|
|
119
|
-
function uploadImage() {
|
|
120
|
-
isOpened.value = true;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
131
|
function setFontSize(fontSize) {
|
|
124
132
|
function isRootNode(node) {
|
|
125
133
|
return (
|
|
@@ -333,11 +341,10 @@
|
|
|
333
341
|
);
|
|
334
342
|
|
|
335
343
|
const toolDefinitions = extend(true, {}, props.definitions || {}, {
|
|
336
|
-
upload: {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
},
|
|
344
|
+
// upload: {
|
|
345
|
+
// icon: 'image',
|
|
346
|
+
// handler: () => isOpened.value = true,
|
|
347
|
+
// },
|
|
341
348
|
size1: {
|
|
342
349
|
tip: sizeDefinitions.size1.label,
|
|
343
350
|
htmlTip: sizeDefinitions.adjustLabelSize
|
|
@@ -391,18 +398,13 @@
|
|
|
391
398
|
options: ['size1', 'size2', 'size3', 'size4', 'size5', 'size6'],
|
|
392
399
|
};
|
|
393
400
|
|
|
394
|
-
const toolbarDefinitions = props.useImgUpload
|
|
395
|
-
? [...props.toolbar, ['upload']]
|
|
396
|
-
: [...props.toolbar].map(group =>
|
|
397
|
-
group.map(item => (item === 'fontSizes' ? fontSizes : item)),
|
|
398
|
-
);
|
|
399
|
-
|
|
400
401
|
function onOkClick() {
|
|
401
402
|
value.value.split('\n').forEach((el, idx) => {
|
|
402
403
|
if (el === '') return;
|
|
403
404
|
model.value += `<p><img style="max-width:100%;" src=${el} :alt="image${idx}"/></p>`;
|
|
404
405
|
});
|
|
405
|
-
|
|
406
|
+
|
|
407
|
+
// isOpened.value = false;
|
|
406
408
|
value.value = '';
|
|
407
409
|
}
|
|
408
410
|
// Toolbar End
|
|
@@ -446,12 +448,14 @@
|
|
|
446
448
|
}
|
|
447
449
|
|
|
448
450
|
return {
|
|
449
|
-
toolbarDefinitions
|
|
451
|
+
toolbarDefinitions: computed(() => {
|
|
452
|
+
const bar = props.useImgUpload ? [...props.toolbar, ['upload']] : props.toolbar;
|
|
453
|
+
return bar.map(group => group.map(item => (item === 'fontSizes' ? fontSizes : item)));
|
|
454
|
+
}),
|
|
450
455
|
toolDefinitions,
|
|
451
|
-
isOpened,
|
|
456
|
+
// isOpened,
|
|
452
457
|
model,
|
|
453
458
|
value,
|
|
454
|
-
uploadImage,
|
|
455
459
|
onOkClick,
|
|
456
460
|
onPaste,
|
|
457
461
|
editorRef,
|