@fishawack/lab-velocity 1.11.1 → 2.0.0-beta.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/README.md +13 -7
- package/_Build/vue/components/Icon.vue +33 -0
- package/_Build/vue/components/Svg.vue +45 -0
- package/{basic → _Build/vue/components/basic}/Button.vue +16 -18
- package/{basic → _Build/vue/components/basic}/link.vue +8 -7
- package/{form → _Build/vue/components/form}/Cascader.vue +13 -13
- package/{form → _Build/vue/components/form}/CheckboxGroup.vue +28 -6
- package/{form → _Build/vue/components/form}/DatePicker.vue +23 -7
- package/{form → _Build/vue/components/form}/InputNumber.vue +1 -2
- package/{form → _Build/vue/components/form}/Select.vue +8 -9
- package/{form → _Build/vue/components/form}/Switch.vue +2 -2
- package/{form → _Build/vue/components/form}/Upload.vue +4 -6
- package/{form → _Build/vue/components/form}/Wysiwyg.vue +14 -14
- package/_Build/vue/components/form/Wysiwyg2.vue +577 -0
- package/{form → _Build/vue/components/form}/basic.vue +25 -7
- package/{form → _Build/vue/components/form}/file.vue +1 -1
- package/{form → _Build/vue/components/form}/input.js +2 -2
- package/{form → _Build/vue/components/form}/input.vue +31 -11
- package/{layout → _Build/vue/components/layout}/Alert.vue +10 -10
- package/_Build/vue/components/layout/Footer.vue +50 -0
- package/{layout → _Build/vue/components/layout}/Header.vue +5 -7
- package/_Build/vue/components/layout/Loader.vue +59 -0
- package/{layout → _Build/vue/components/layout}/Tooltip.vue +12 -12
- package/{layout → _Build/vue/components/layout}/pageTitle.vue +4 -4
- package/{layout → _Build/vue/components/layout}/sideBar.vue +4 -6
- package/{navigation → _Build/vue/components/navigation}/Breadcrumbs.vue +15 -10
- package/{navigation → _Build/vue/components/navigation}/BreadcrumbsItem.vue +6 -6
- package/_Build/vue/components/navigation/Menu.vue +14 -0
- package/_Build/vue/components/navigation/MenuItem.vue +20 -0
- package/_Build/vue/components/navigation/MenuItemGroup.vue +20 -0
- package/_Build/vue/components/navigation/SubMenu.vue +20 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/Upload/upload.vue +251 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/create.vue +62 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/edit.vue +98 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/index.vue +90 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/partials/form.vue +173 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/Children/show.vue +262 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PCompanies/parent.vue +36 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/create.vue +112 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/edit.vue +103 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/index.vue +112 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/partials/form.vue +169 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/Children/show.vue +120 -0
- package/_Build/vue/modules/AuthModule/adminRoutes/PUsers/parent.vue +36 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/components/AuthModal.vue +30 -35
- package/_Build/vue/modules/AuthModule/components/Chip.vue +70 -0
- package/_Build/vue/modules/AuthModule/components/Chips.vue +26 -0
- package/_Build/vue/modules/AuthModule/components/FormRole.vue +115 -0
- package/_Build/vue/modules/AuthModule/components/VBreadcrumbs.vue +32 -0
- package/_Build/vue/modules/AuthModule/components/VFormFooter.vue +46 -0
- package/_Build/vue/modules/AuthModule/components/VPageHeader.vue +38 -0
- package/_Build/vue/modules/AuthModule/components/VPasswordValidation.vue +106 -0
- package/_Build/vue/modules/AuthModule/components/VRoleLegend.vue +43 -0
- package/_Build/vue/modules/AuthModule/components/VTable.vue +127 -0
- package/_Build/vue/modules/AuthModule/components/VTableSorter.vue +240 -0
- package/_Build/vue/modules/AuthModule/js/FakeAPI.js +78 -0
- package/_Build/vue/modules/AuthModule/js/axios.js +62 -0
- package/_Build/vue/modules/AuthModule/js/router.js +295 -0
- package/_Build/vue/modules/AuthModule/js/store.js +62 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/account-exists.vue +5 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/change-password.vue +28 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/container.vue +4 -8
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-reset.vue +13 -11
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/expired-verification.vue +12 -12
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/force-reset.vue +36 -26
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/forgot.vue +11 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/login.vue +20 -15
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logincallback.vue +5 -10
- package/_Build/vue/modules/AuthModule/routes/loginheadless.vue +21 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/loginsso.vue +32 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/logout.vue +6 -6
- package/_Build/vue/modules/AuthModule/routes/logoutheadless.vue +27 -0
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/register.vue +43 -25
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/reset.vue +24 -14
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-forgot.vue +14 -12
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-reset.vue +4 -4
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/success-verify.vue +10 -7
- package/{AuthModule → _Build/vue/modules/AuthModule}/routes/verify.vue +15 -12
- package/_base.scss +1 -1
- package/_defaults.scss +2 -3
- package/_variables.scss +16 -18
- package/general.scss +1 -2
- package/index.js +38 -30
- package/package.json +103 -102
- package/vendor.scss +2 -2
- package/AuthModule/components/VPasswordValidation.vue +0 -66
- package/AuthModule/js/AuthAxios.js +0 -59
- package/AuthModule/js/AuthRoutes.js +0 -186
- package/AuthModule/js/AuthStore.js +0 -99
- package/AuthModule/js/FakeAPI.js +0 -84
- package/AuthModule/routes/loginheadless.vue +0 -16
- package/Icon.vue +0 -33
- package/Svg.vue +0 -40
- package/components/_alert.scss +0 -5
- package/components/_basic.scss +0 -54
- package/components/_breadcrumbs.scss +0 -40
- package/components/_button.scss +0 -305
- package/components/_cascader.scss +0 -12
- package/components/_checkbox.scss +0 -40
- package/components/_collapse.scss +0 -25
- package/components/_datepicker.scss +0 -51
- package/components/_footer.scss +0 -46
- package/components/_form.scss +0 -22
- package/components/_header.scss +0 -55
- package/components/_icon.scss +0 -24
- package/components/_input.scss +0 -0
- package/components/_inputNumber.scss +0 -21
- package/components/_link.scss +0 -44
- package/components/_loader.scss +0 -44
- package/components/_menu.scss +0 -112
- package/components/_pageTitle.scss +0 -8
- package/components/_select.scss +0 -28
- package/components/_sidebar.scss +0 -57
- package/components/_switch.scss +0 -14
- package/components/_table.scss +0 -20
- package/components/_tooltip.scss +0 -4
- package/components/_typography.scss +0 -153
- package/components/_upload.scss +0 -15
- package/components/_wysiwyg.scss +0 -6
- package/components/_wysiwyg2.scss +0 -136
- package/form/Wysiwyg2.vue +0 -278
- package/layout/Footer.vue +0 -35
- package/layout/Loader.vue +0 -39
- package/modules/_AuthModule.scss +0 -209
- package/modules/_AuthVariables.scss +0 -7
- package/modules/_modal.scss +0 -24
- package/navigation/Menu.vue +0 -16
- package/navigation/MenuItem.vue +0 -20
- package/navigation/MenuItemGroup.vue +0 -20
- package/navigation/SubMenu.vue +0 -20
- /package/{form → _Build/vue/components/form}/Checkbox.vue +0 -0
- /package/{form → _Build/vue/components/form}/color.vue +0 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<XInput v-bind="$props" class="vel-wysiwyg">
|
|
3
|
+
<template #label>
|
|
4
|
+
<slot name="label" />
|
|
5
|
+
</template>
|
|
6
|
+
<div class="control-group vel-wysiwyg__controls" v-if="editor">
|
|
7
|
+
<el-dropdown>
|
|
8
|
+
Heading
|
|
9
|
+
<template #dropdown>
|
|
10
|
+
<el-dropdown-menu>
|
|
11
|
+
<el-dropdown-item
|
|
12
|
+
@click="
|
|
13
|
+
editor
|
|
14
|
+
.chain()
|
|
15
|
+
.focus()
|
|
16
|
+
.toggleHeading({ level: 1 })
|
|
17
|
+
.run()
|
|
18
|
+
"
|
|
19
|
+
:class="{
|
|
20
|
+
'is-active': editor.isActive('heading', {
|
|
21
|
+
level: 1,
|
|
22
|
+
}),
|
|
23
|
+
}"
|
|
24
|
+
>
|
|
25
|
+
H1
|
|
26
|
+
</el-dropdown-item>
|
|
27
|
+
<el-dropdown-item
|
|
28
|
+
@click="
|
|
29
|
+
editor
|
|
30
|
+
.chain()
|
|
31
|
+
.focus()
|
|
32
|
+
.toggleHeading({ level: 2 })
|
|
33
|
+
.run()
|
|
34
|
+
"
|
|
35
|
+
:class="{
|
|
36
|
+
'is-active': editor.isActive('heading', {
|
|
37
|
+
level: 2,
|
|
38
|
+
}),
|
|
39
|
+
}"
|
|
40
|
+
>
|
|
41
|
+
H2
|
|
42
|
+
</el-dropdown-item>
|
|
43
|
+
<el-dropdown-item
|
|
44
|
+
@click="
|
|
45
|
+
editor
|
|
46
|
+
.chain()
|
|
47
|
+
.focus()
|
|
48
|
+
.toggleHeading({ level: 3 })
|
|
49
|
+
.run()
|
|
50
|
+
"
|
|
51
|
+
:class="{
|
|
52
|
+
'is-active': editor.isActive('heading', {
|
|
53
|
+
level: 3,
|
|
54
|
+
}),
|
|
55
|
+
}"
|
|
56
|
+
>
|
|
57
|
+
H3
|
|
58
|
+
</el-dropdown-item>
|
|
59
|
+
<el-dropdown-item
|
|
60
|
+
@click="
|
|
61
|
+
editor
|
|
62
|
+
.chain()
|
|
63
|
+
.focus()
|
|
64
|
+
.toggleHeading({ level: 4 })
|
|
65
|
+
.run()
|
|
66
|
+
"
|
|
67
|
+
:class="{
|
|
68
|
+
'is-active': editor.isActive('heading', {
|
|
69
|
+
level: 4,
|
|
70
|
+
}),
|
|
71
|
+
}"
|
|
72
|
+
>
|
|
73
|
+
H4
|
|
74
|
+
</el-dropdown-item>
|
|
75
|
+
<el-dropdown-item
|
|
76
|
+
@click="
|
|
77
|
+
editor
|
|
78
|
+
.chain()
|
|
79
|
+
.focus()
|
|
80
|
+
.toggleHeading({ level: 5 })
|
|
81
|
+
.run()
|
|
82
|
+
"
|
|
83
|
+
:class="{
|
|
84
|
+
'is-active': editor.isActive('heading', {
|
|
85
|
+
level: 5,
|
|
86
|
+
}),
|
|
87
|
+
}"
|
|
88
|
+
>
|
|
89
|
+
H5
|
|
90
|
+
</el-dropdown-item>
|
|
91
|
+
<el-dropdown-item
|
|
92
|
+
@click="
|
|
93
|
+
editor
|
|
94
|
+
.chain()
|
|
95
|
+
.focus()
|
|
96
|
+
.toggleHeading({ level: 6 })
|
|
97
|
+
.run()
|
|
98
|
+
"
|
|
99
|
+
:class="{
|
|
100
|
+
'is-active': editor.isActive('heading', {
|
|
101
|
+
level: 6,
|
|
102
|
+
}),
|
|
103
|
+
}"
|
|
104
|
+
>
|
|
105
|
+
H6
|
|
106
|
+
</el-dropdown-item>
|
|
107
|
+
<el-dropdown-item
|
|
108
|
+
@click="editor.chain().focus().setParagraph().run()"
|
|
109
|
+
:class="{
|
|
110
|
+
'is-active': editor.isActive('paragraph'),
|
|
111
|
+
}"
|
|
112
|
+
>
|
|
113
|
+
Paragraph
|
|
114
|
+
</el-dropdown-item>
|
|
115
|
+
</el-dropdown-menu>
|
|
116
|
+
</template>
|
|
117
|
+
</el-dropdown>
|
|
118
|
+
<el-dropdown>
|
|
119
|
+
Style
|
|
120
|
+
<template #dropdown>
|
|
121
|
+
<el-dropdown-menu>
|
|
122
|
+
<el-dropdown-item
|
|
123
|
+
class="vel-wysiwyg__button"
|
|
124
|
+
@click="editor.chain().focus().toggleBold().run()"
|
|
125
|
+
:disabled="
|
|
126
|
+
!editor.can().chain().focus().toggleBold().run()
|
|
127
|
+
"
|
|
128
|
+
:class="{ 'is-active': editor.isActive('bold') }"
|
|
129
|
+
>Bold</el-dropdown-item
|
|
130
|
+
>
|
|
131
|
+
<el-dropdown-item
|
|
132
|
+
class="vel-wysiwyg__button"
|
|
133
|
+
@click="editor.chain().focus().toggleItalic().run()"
|
|
134
|
+
:disabled="
|
|
135
|
+
!editor
|
|
136
|
+
.can()
|
|
137
|
+
.chain()
|
|
138
|
+
.focus()
|
|
139
|
+
.toggleItalic()
|
|
140
|
+
.run()
|
|
141
|
+
"
|
|
142
|
+
:class="{ 'is-active': editor.isActive('italic') }"
|
|
143
|
+
>Italic</el-dropdown-item
|
|
144
|
+
>
|
|
145
|
+
<el-dropdown-item
|
|
146
|
+
class="vel-wysiwyg__button"
|
|
147
|
+
@click="
|
|
148
|
+
editor.chain().focus().toggleUnderline().run()
|
|
149
|
+
"
|
|
150
|
+
:disabled="
|
|
151
|
+
!editor
|
|
152
|
+
.can()
|
|
153
|
+
.chain()
|
|
154
|
+
.focus()
|
|
155
|
+
.toggleUnderline()
|
|
156
|
+
.run()
|
|
157
|
+
"
|
|
158
|
+
:class="{
|
|
159
|
+
'is-active': editor.isActive('underline'),
|
|
160
|
+
}"
|
|
161
|
+
>Underline</el-dropdown-item
|
|
162
|
+
>
|
|
163
|
+
</el-dropdown-menu>
|
|
164
|
+
</template>
|
|
165
|
+
</el-dropdown>
|
|
166
|
+
<el-dropdown v-if="table">
|
|
167
|
+
Table
|
|
168
|
+
<template #dropdown>
|
|
169
|
+
<el-dropdown-menu>
|
|
170
|
+
<el-dropdown-item
|
|
171
|
+
@click="
|
|
172
|
+
editor
|
|
173
|
+
.chain()
|
|
174
|
+
.focus()
|
|
175
|
+
.insertTable({
|
|
176
|
+
rows: 3,
|
|
177
|
+
cols: 3,
|
|
178
|
+
withHeaderRow: true,
|
|
179
|
+
})
|
|
180
|
+
.run()
|
|
181
|
+
"
|
|
182
|
+
>
|
|
183
|
+
Insert table
|
|
184
|
+
</el-dropdown-item>
|
|
185
|
+
<el-dropdown-item
|
|
186
|
+
@click="
|
|
187
|
+
editor.chain().focus().addColumnBefore().run()
|
|
188
|
+
"
|
|
189
|
+
>
|
|
190
|
+
Add column before
|
|
191
|
+
</el-dropdown-item>
|
|
192
|
+
<el-dropdown-item
|
|
193
|
+
@click="
|
|
194
|
+
editor.chain().focus().addColumnAfter().run()
|
|
195
|
+
"
|
|
196
|
+
>
|
|
197
|
+
Add column after
|
|
198
|
+
</el-dropdown-item>
|
|
199
|
+
<el-dropdown-item
|
|
200
|
+
@click="editor.chain().focus().deleteColumn().run()"
|
|
201
|
+
>
|
|
202
|
+
Delete column
|
|
203
|
+
</el-dropdown-item>
|
|
204
|
+
<el-dropdown-item
|
|
205
|
+
@click="editor.chain().focus().addRowBefore().run()"
|
|
206
|
+
>
|
|
207
|
+
Add row before
|
|
208
|
+
</el-dropdown-item>
|
|
209
|
+
<el-dropdown-item
|
|
210
|
+
@click="editor.chain().focus().addRowAfter().run()"
|
|
211
|
+
>
|
|
212
|
+
Add row after
|
|
213
|
+
</el-dropdown-item>
|
|
214
|
+
<el-dropdown-item
|
|
215
|
+
@click="editor.chain().focus().deleteRow().run()"
|
|
216
|
+
>
|
|
217
|
+
Delete row
|
|
218
|
+
</el-dropdown-item>
|
|
219
|
+
<el-dropdown-item
|
|
220
|
+
@click="editor.chain().focus().deleteTable().run()"
|
|
221
|
+
>
|
|
222
|
+
Delete table
|
|
223
|
+
</el-dropdown-item>
|
|
224
|
+
<el-dropdown-item
|
|
225
|
+
@click="editor.chain().focus().mergeCells().run()"
|
|
226
|
+
>
|
|
227
|
+
Merge cells
|
|
228
|
+
</el-dropdown-item>
|
|
229
|
+
<el-dropdown-item
|
|
230
|
+
@click="editor.chain().focus().splitCell().run()"
|
|
231
|
+
>
|
|
232
|
+
Split cell
|
|
233
|
+
</el-dropdown-item>
|
|
234
|
+
<el-dropdown-item
|
|
235
|
+
@click="
|
|
236
|
+
editor
|
|
237
|
+
.chain()
|
|
238
|
+
.focus()
|
|
239
|
+
.toggleHeaderColumn()
|
|
240
|
+
.run()
|
|
241
|
+
"
|
|
242
|
+
>
|
|
243
|
+
Toggle header column
|
|
244
|
+
</el-dropdown-item>
|
|
245
|
+
<el-dropdown-item
|
|
246
|
+
@click="
|
|
247
|
+
editor.chain().focus().toggleHeaderRow().run()
|
|
248
|
+
"
|
|
249
|
+
>
|
|
250
|
+
Toggle header row
|
|
251
|
+
</el-dropdown-item>
|
|
252
|
+
<el-dropdown-item
|
|
253
|
+
@click="
|
|
254
|
+
editor.chain().focus().toggleHeaderCell().run()
|
|
255
|
+
"
|
|
256
|
+
>
|
|
257
|
+
Toggle header cell
|
|
258
|
+
</el-dropdown-item>
|
|
259
|
+
<el-dropdown-item
|
|
260
|
+
@click="editor.chain().focus().mergeOrSplit().run()"
|
|
261
|
+
>
|
|
262
|
+
Merge or split
|
|
263
|
+
</el-dropdown-item>
|
|
264
|
+
<el-dropdown-item
|
|
265
|
+
@click="
|
|
266
|
+
editor
|
|
267
|
+
.chain()
|
|
268
|
+
.focus()
|
|
269
|
+
.setCellAttribute('colspan', 2)
|
|
270
|
+
.run()
|
|
271
|
+
"
|
|
272
|
+
>
|
|
273
|
+
Set cell attribute
|
|
274
|
+
</el-dropdown-item>
|
|
275
|
+
<el-dropdown-item
|
|
276
|
+
@click="editor.chain().focus().fixTables().run()"
|
|
277
|
+
>
|
|
278
|
+
Fix tables
|
|
279
|
+
</el-dropdown-item>
|
|
280
|
+
</el-dropdown-menu>
|
|
281
|
+
</template>
|
|
282
|
+
</el-dropdown>
|
|
283
|
+
<button
|
|
284
|
+
type="button"
|
|
285
|
+
@click="editor.chain().focus().toggleBulletList().run()"
|
|
286
|
+
:class="{ 'is-active': editor.isActive('bulletList') }"
|
|
287
|
+
>
|
|
288
|
+
<svg viewBox="0 0 18 18">
|
|
289
|
+
<line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"></line>
|
|
290
|
+
<line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"></line>
|
|
291
|
+
<line
|
|
292
|
+
class="ql-stroke"
|
|
293
|
+
x1="6"
|
|
294
|
+
x2="15"
|
|
295
|
+
y1="14"
|
|
296
|
+
y2="14"
|
|
297
|
+
></line>
|
|
298
|
+
<line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"></line>
|
|
299
|
+
<line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"></line>
|
|
300
|
+
<line
|
|
301
|
+
class="ql-stroke"
|
|
302
|
+
x1="3"
|
|
303
|
+
x2="3"
|
|
304
|
+
y1="14"
|
|
305
|
+
y2="14"
|
|
306
|
+
></line>
|
|
307
|
+
</svg>
|
|
308
|
+
</button>
|
|
309
|
+
<button
|
|
310
|
+
type="button"
|
|
311
|
+
@click="editor.chain().focus().toggleOrderedList().run()"
|
|
312
|
+
:class="{ 'is-active': editor.isActive('orderedList') }"
|
|
313
|
+
>
|
|
314
|
+
<svg viewBox="0 0 18 18">
|
|
315
|
+
<line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"></line>
|
|
316
|
+
<line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"></line>
|
|
317
|
+
<line
|
|
318
|
+
class="ql-stroke"
|
|
319
|
+
x1="7"
|
|
320
|
+
x2="15"
|
|
321
|
+
y1="14"
|
|
322
|
+
y2="14"
|
|
323
|
+
></line>
|
|
324
|
+
<line
|
|
325
|
+
class="ql-stroke ql-thin"
|
|
326
|
+
x1="2.5"
|
|
327
|
+
x2="4.5"
|
|
328
|
+
y1="5.5"
|
|
329
|
+
y2="5.5"
|
|
330
|
+
></line>
|
|
331
|
+
<path
|
|
332
|
+
class="ql-fill"
|
|
333
|
+
d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"
|
|
334
|
+
></path>
|
|
335
|
+
<path
|
|
336
|
+
class="ql-stroke ql-thin"
|
|
337
|
+
d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"
|
|
338
|
+
></path>
|
|
339
|
+
<path
|
|
340
|
+
class="ql-stroke ql-thin"
|
|
341
|
+
d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"
|
|
342
|
+
></path>
|
|
343
|
+
</svg>
|
|
344
|
+
</button>
|
|
345
|
+
<button
|
|
346
|
+
type="button"
|
|
347
|
+
@click="editor.chain().focus().toggleCodeBlock().run()"
|
|
348
|
+
:class="{ 'is-active': editor.isActive('codeBlock') }"
|
|
349
|
+
>
|
|
350
|
+
Code block
|
|
351
|
+
</button>
|
|
352
|
+
<button
|
|
353
|
+
type="button"
|
|
354
|
+
@click="editor.chain().focus().toggleBlockquote().run()"
|
|
355
|
+
:class="{ 'is-active': editor.isActive('blockquote') }"
|
|
356
|
+
>
|
|
357
|
+
Blockquote
|
|
358
|
+
</button>
|
|
359
|
+
<button
|
|
360
|
+
type="button"
|
|
361
|
+
@click="editor.chain().focus().setHorizontalRule().run()"
|
|
362
|
+
>
|
|
363
|
+
Horizontal rule
|
|
364
|
+
</button>
|
|
365
|
+
<button
|
|
366
|
+
type="button"
|
|
367
|
+
@click="editor.chain().focus().toggleSuperscript().run()"
|
|
368
|
+
:class="{ 'is-active': editor.isActive('superscript') }"
|
|
369
|
+
>
|
|
370
|
+
<svg viewBox="0 0 18 18">
|
|
371
|
+
<path
|
|
372
|
+
class="ql-fill"
|
|
373
|
+
d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"
|
|
374
|
+
></path>
|
|
375
|
+
<path
|
|
376
|
+
class="ql-fill"
|
|
377
|
+
d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"
|
|
378
|
+
></path>
|
|
379
|
+
</svg>
|
|
380
|
+
</button>
|
|
381
|
+
<button
|
|
382
|
+
type="button"
|
|
383
|
+
@click="editor.chain().focus().toggleSubscript().run()"
|
|
384
|
+
:class="{ 'is-active': editor.isActive('subscript') }"
|
|
385
|
+
>
|
|
386
|
+
<svg viewBox="0 0 18 18">
|
|
387
|
+
<path
|
|
388
|
+
class="ql-fill"
|
|
389
|
+
d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"
|
|
390
|
+
></path>
|
|
391
|
+
<path
|
|
392
|
+
class="ql-fill"
|
|
393
|
+
d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"
|
|
394
|
+
></path>
|
|
395
|
+
</svg>
|
|
396
|
+
</button>
|
|
397
|
+
<button
|
|
398
|
+
type="button"
|
|
399
|
+
@click="setLink"
|
|
400
|
+
:class="{ 'is-active': editor.isActive('link') }"
|
|
401
|
+
>
|
|
402
|
+
<svg viewBox="0 0 18 18">
|
|
403
|
+
<line
|
|
404
|
+
class="ql-stroke"
|
|
405
|
+
x1="7"
|
|
406
|
+
x2="11"
|
|
407
|
+
y1="7"
|
|
408
|
+
y2="11"
|
|
409
|
+
></line>
|
|
410
|
+
<path
|
|
411
|
+
class="ql-even ql-stroke"
|
|
412
|
+
d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"
|
|
413
|
+
></path>
|
|
414
|
+
<path
|
|
415
|
+
class="ql-even ql-stroke"
|
|
416
|
+
d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"
|
|
417
|
+
></path>
|
|
418
|
+
</svg>
|
|
419
|
+
</button>
|
|
420
|
+
</div>
|
|
421
|
+
<editor-content :editor="editor" />
|
|
422
|
+
<el-dialog v-model="dialogVisible" title="URL" width="500">
|
|
423
|
+
<label>Enter URL</label>
|
|
424
|
+
<el-input v-model="newUrl" type="url" />
|
|
425
|
+
<template #footer>
|
|
426
|
+
<div class="dialog-footer">
|
|
427
|
+
<el-button @click="dialogVisible = false">Cancel</el-button>
|
|
428
|
+
<el-button type="primary" @click="updateURL">
|
|
429
|
+
Confirm
|
|
430
|
+
</el-button>
|
|
431
|
+
</div>
|
|
432
|
+
</template>
|
|
433
|
+
</el-dialog>
|
|
434
|
+
</XInput>
|
|
435
|
+
</template>
|
|
436
|
+
|
|
437
|
+
<script>
|
|
438
|
+
import input from "./input.js";
|
|
439
|
+
import XInput from "./input.vue";
|
|
440
|
+
import sanitizeHtml from "sanitize-html";
|
|
441
|
+
import {
|
|
442
|
+
ElDropdown,
|
|
443
|
+
ElDropdownItem,
|
|
444
|
+
ElDropdownMenu,
|
|
445
|
+
ElDialog,
|
|
446
|
+
ElButton,
|
|
447
|
+
ElInput,
|
|
448
|
+
} from "element-plus";
|
|
449
|
+
import { Editor, EditorContent } from "@tiptap/vue-3";
|
|
450
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
451
|
+
import Underline from "@tiptap/extension-underline";
|
|
452
|
+
import Table from "@tiptap/extension-table";
|
|
453
|
+
import TableCell from "@tiptap/extension-table-cell";
|
|
454
|
+
import TableHeader from "@tiptap/extension-table-header";
|
|
455
|
+
import TableRow from "@tiptap/extension-table-row";
|
|
456
|
+
import Superscript from "@tiptap/extension-superscript";
|
|
457
|
+
import Subscript from "@tiptap/extension-subscript";
|
|
458
|
+
import Link from "@tiptap/extension-link";
|
|
459
|
+
|
|
460
|
+
export default {
|
|
461
|
+
mixins: [input],
|
|
462
|
+
|
|
463
|
+
components: {
|
|
464
|
+
XInput,
|
|
465
|
+
EditorContent,
|
|
466
|
+
ElDropdown,
|
|
467
|
+
ElDropdownItem,
|
|
468
|
+
ElDropdownMenu,
|
|
469
|
+
ElDialog,
|
|
470
|
+
ElButton,
|
|
471
|
+
ElInput,
|
|
472
|
+
},
|
|
473
|
+
|
|
474
|
+
props: {
|
|
475
|
+
table: {
|
|
476
|
+
type: Boolean,
|
|
477
|
+
default: false,
|
|
478
|
+
},
|
|
479
|
+
baseClass: {
|
|
480
|
+
type: String,
|
|
481
|
+
default: "vel-wysiwyg",
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
data: () => ({
|
|
486
|
+
editor: null,
|
|
487
|
+
hold: null,
|
|
488
|
+
previousUrl: null,
|
|
489
|
+
newUrl: null,
|
|
490
|
+
dialogVisible: false,
|
|
491
|
+
}),
|
|
492
|
+
|
|
493
|
+
watch: {
|
|
494
|
+
modelValue: {
|
|
495
|
+
handler(val) {
|
|
496
|
+
if (this.hold !== val) {
|
|
497
|
+
this.setValue();
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
|
|
503
|
+
methods: {
|
|
504
|
+
setValue() {
|
|
505
|
+
this.editor.commands.setContent(this.modelValue);
|
|
506
|
+
},
|
|
507
|
+
setLink() {
|
|
508
|
+
this.previousUrl = this.editor.getAttributes("link").href;
|
|
509
|
+
this.newUrl = this.previousUrl;
|
|
510
|
+
this.dialogVisible = true;
|
|
511
|
+
},
|
|
512
|
+
updateURL() {
|
|
513
|
+
// cancelled
|
|
514
|
+
this.dialogVisible = false;
|
|
515
|
+
let url = this.newUrl;
|
|
516
|
+
if (url === this.previousUrl) {
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// empty
|
|
521
|
+
if (url === "") {
|
|
522
|
+
this.editor
|
|
523
|
+
.chain()
|
|
524
|
+
.focus()
|
|
525
|
+
.extendMarkRange("link")
|
|
526
|
+
.unsetLink()
|
|
527
|
+
.run();
|
|
528
|
+
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
// update link
|
|
532
|
+
this.editor
|
|
533
|
+
.chain()
|
|
534
|
+
.focus()
|
|
535
|
+
.extendMarkRange("link")
|
|
536
|
+
.setLink({ href: url })
|
|
537
|
+
.run();
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
|
|
541
|
+
mounted() {
|
|
542
|
+
let extensions = [
|
|
543
|
+
StarterKit,
|
|
544
|
+
Underline,
|
|
545
|
+
Superscript,
|
|
546
|
+
Subscript,
|
|
547
|
+
Link.configure({
|
|
548
|
+
openOnClick: false,
|
|
549
|
+
defaultProtocol: "https",
|
|
550
|
+
}),
|
|
551
|
+
];
|
|
552
|
+
if (this.$props.table) {
|
|
553
|
+
extensions.push(
|
|
554
|
+
Table.configure({
|
|
555
|
+
resizable: true,
|
|
556
|
+
}),
|
|
557
|
+
TableRow,
|
|
558
|
+
TableHeader,
|
|
559
|
+
TableCell,
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
this.editor = new Editor({
|
|
564
|
+
extensions: extensions,
|
|
565
|
+
});
|
|
566
|
+
this.setValue();
|
|
567
|
+
|
|
568
|
+
this.editor.on("blur", ({ editor, event }) => {
|
|
569
|
+
const value = editor.isEmpty ? "" : event.srcElement.innerHTML;
|
|
570
|
+
if (this.hold !== value) {
|
|
571
|
+
this.hold = value;
|
|
572
|
+
this.$emit("update:modelValue", this.hold);
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
</script>
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
<el-input
|
|
8
8
|
v-bind="{ ...$attrs, class: undefined }"
|
|
9
|
-
:class="[
|
|
9
|
+
:class="[
|
|
10
|
+
`${baseClass}__textbox`,
|
|
11
|
+
type === 'password' ? 'input--password' : '',
|
|
12
|
+
]"
|
|
10
13
|
:name="name"
|
|
11
14
|
:id="name"
|
|
12
15
|
:disabled="disabled"
|
|
@@ -20,7 +23,6 @@
|
|
|
20
23
|
:parser="parser"
|
|
21
24
|
:formatter="formatter"
|
|
22
25
|
>
|
|
23
|
-
|
|
24
26
|
<template v-if="prepend" #prepend>
|
|
25
27
|
<slot name="prepend" />
|
|
26
28
|
</template>
|
|
@@ -28,8 +30,24 @@
|
|
|
28
30
|
<slot name="append" />
|
|
29
31
|
|
|
30
32
|
<div v-if="type === 'password'" class="form__icon-container">
|
|
31
|
-
<GSvg
|
|
32
|
-
|
|
33
|
+
<GSvg
|
|
34
|
+
name="icon-error"
|
|
35
|
+
class="form__error-icon icon"
|
|
36
|
+
embed
|
|
37
|
+
artboard
|
|
38
|
+
v-if="error && error.first(name)"
|
|
39
|
+
/>
|
|
40
|
+
<GSvg
|
|
41
|
+
:name="
|
|
42
|
+
visibility
|
|
43
|
+
? 'icon-visibility'
|
|
44
|
+
: 'icon-visibility-off'
|
|
45
|
+
"
|
|
46
|
+
class="form__action-icon icon pointer"
|
|
47
|
+
embed
|
|
48
|
+
artboard
|
|
49
|
+
@click="visibility = !visibility"
|
|
50
|
+
/>
|
|
33
51
|
</div>
|
|
34
52
|
</template>
|
|
35
53
|
</el-input>
|
|
@@ -72,12 +90,12 @@ export default {
|
|
|
72
90
|
formatter: {
|
|
73
91
|
type: Function,
|
|
74
92
|
default: null,
|
|
75
|
-
}
|
|
93
|
+
},
|
|
76
94
|
},
|
|
77
95
|
data() {
|
|
78
96
|
return {
|
|
79
|
-
visibility: false
|
|
80
|
-
}
|
|
97
|
+
visibility: false,
|
|
98
|
+
};
|
|
81
99
|
},
|
|
82
100
|
|
|
83
101
|
components: {
|
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
default: false,
|
|
22
22
|
},
|
|
23
23
|
modelValue: {
|
|
24
|
-
type: [String,Number,Array],
|
|
24
|
+
type: [String, Number, Array],
|
|
25
25
|
default: null,
|
|
26
26
|
},
|
|
27
27
|
label: {
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
default: null,
|
|
42
42
|
},
|
|
43
43
|
error: {
|
|
44
|
-
type: [String,Object],
|
|
44
|
+
type: [String, Object],
|
|
45
45
|
default: null,
|
|
46
46
|
},
|
|
47
47
|
baseClass: {
|