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,168 +1,168 @@
|
|
|
1
|
-
Simple example
|
|
2
|
-
|
|
3
|
-
```vue
|
|
4
|
-
<template>
|
|
5
|
-
<div class="pad-l5">
|
|
6
|
-
<p>model: {{ model }}</p>
|
|
7
|
-
<div class="p">
|
|
8
|
-
<label>
|
|
9
|
-
<input class="checkbox checkbox-small" type="checkbox" v-model="props.range" />
|
|
10
|
-
<span class="pad-left-2 v-mid">range</span>
|
|
11
|
-
</label>
|
|
12
|
-
</div>
|
|
13
|
-
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<script>
|
|
17
|
-
export default {
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
model: null,
|
|
21
|
-
props: {
|
|
22
|
-
dayOfWeek: 1,
|
|
23
|
-
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
24
|
-
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
25
|
-
','
|
|
26
|
-
),
|
|
27
|
-
range: false,
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
</script>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Min, max, allowed etc
|
|
36
|
-
|
|
37
|
-
```vue
|
|
38
|
-
<template>
|
|
39
|
-
<div class="pad-l5">
|
|
40
|
-
<p>model: {{ model }}</p>
|
|
41
|
-
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
<script>
|
|
45
|
-
let d = new Date();
|
|
46
|
-
export default {
|
|
47
|
-
data() {
|
|
48
|
-
return {
|
|
49
|
-
model: null,
|
|
50
|
-
props: {
|
|
51
|
-
dayOfWeek: 1,
|
|
52
|
-
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
53
|
-
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
54
|
-
','
|
|
55
|
-
),
|
|
56
|
-
min: new Date(d.getFullYear(), d.getMonth(), 5),
|
|
57
|
-
max: new Date(d.getFullYear(), d.getMonth(), 25),
|
|
58
|
-
allowed: d => ![0, 6].includes(d.getDay()),
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
</script>
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Range example
|
|
67
|
-
|
|
68
|
-
```vue
|
|
69
|
-
<template>
|
|
70
|
-
<div class="pad-l5">
|
|
71
|
-
<p>model: {{ model }}</p>
|
|
72
|
-
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
<script>
|
|
76
|
-
let dayjs = window.dayjs;
|
|
77
|
-
export default {
|
|
78
|
-
data() {
|
|
79
|
-
return {
|
|
80
|
-
model: [],
|
|
81
|
-
props: {
|
|
82
|
-
range: true,
|
|
83
|
-
dayOfWeek: 1,
|
|
84
|
-
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
85
|
-
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
86
|
-
','
|
|
87
|
-
),
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
</script>
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Extended example using slots
|
|
96
|
-
|
|
97
|
-
```vue
|
|
98
|
-
<template>
|
|
99
|
-
<div class="pad-l5">
|
|
100
|
-
<p>model: {{ model }}</p>
|
|
101
|
-
<date-picker v-model="model" v-bind="props">
|
|
102
|
-
<template
|
|
103
|
-
#header="{ nextMonth, prevMonth, prevYear, nextYear, setToday, setMonth, setYear, month, monthName, year }"
|
|
104
|
-
>
|
|
105
|
-
<table class="pad-3 w-100">
|
|
106
|
-
<tr>
|
|
107
|
-
<td>
|
|
108
|
-
<div class="text-lead">{{ monthName }}</div>
|
|
109
|
-
<div class="text-small color-grey">
|
|
110
|
-
<i class="mdi mdi-arrow-up cursor-pointer" @click="nextYear"></i>
|
|
111
|
-
<input
|
|
112
|
-
class="color-inherit text-centerl"
|
|
113
|
-
type="number"
|
|
114
|
-
:value="year"
|
|
115
|
-
@input="e => setYear(e.target.value)"
|
|
116
|
-
style="border:none; width:4rem"
|
|
117
|
-
/>
|
|
118
|
-
<i class="mdi mdi-arrow-down cursor-pointer" @click="prevYear"></i>
|
|
119
|
-
</div>
|
|
120
|
-
</td>
|
|
121
|
-
<td width="1px">
|
|
122
|
-
<i class="mdi mdi-calendar cursor-pointer" @click="setToday"></i>
|
|
123
|
-
</td>
|
|
124
|
-
<td width="1px">
|
|
125
|
-
<i class="mdi mdi-arrow-up cursor-pointer" @click="nextMonth"></i>
|
|
126
|
-
<i class="mdi mdi-arrow-down cursor-pointer" @click="prevMonth"></i>
|
|
127
|
-
</td>
|
|
128
|
-
</tr>
|
|
129
|
-
</table>
|
|
130
|
-
</template>
|
|
131
|
-
<template #cell-day="{ dayIndex, dayName, isWeekend }">
|
|
132
|
-
<div class="text-bold text-small" :class="{ 'color-red': isWeekend }">
|
|
133
|
-
{{ dayName }}
|
|
134
|
-
</div>
|
|
135
|
-
</template>
|
|
136
|
-
<template #cell-date="{ date, isSelected, isToday, setDate }">
|
|
137
|
-
<div
|
|
138
|
-
class="btn btn-icon btn-small pad-none round"
|
|
139
|
-
:class="{
|
|
140
|
-
'bg-primary color-white': isToday,
|
|
141
|
-
'bg-red': isSelected,
|
|
142
|
-
}"
|
|
143
|
-
@click="setDate(date)"
|
|
144
|
-
>
|
|
145
|
-
{{ date.getDate() }}
|
|
146
|
-
</div>
|
|
147
|
-
</template>
|
|
148
|
-
</date-picker>
|
|
149
|
-
</div>
|
|
150
|
-
</template>
|
|
151
|
-
<script>
|
|
152
|
-
export default {
|
|
153
|
-
data() {
|
|
154
|
-
return {
|
|
155
|
-
rangeOffset: 0,
|
|
156
|
-
model: null,
|
|
157
|
-
props: {
|
|
158
|
-
dayOfWeek: 1,
|
|
159
|
-
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
160
|
-
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
161
|
-
','
|
|
162
|
-
),
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
</script>
|
|
168
|
-
```
|
|
1
|
+
Simple example
|
|
2
|
+
|
|
3
|
+
```vue
|
|
4
|
+
<template>
|
|
5
|
+
<div class="pad-l5">
|
|
6
|
+
<p>model: {{ model }}</p>
|
|
7
|
+
<div class="p">
|
|
8
|
+
<label>
|
|
9
|
+
<input class="checkbox checkbox-small" type="checkbox" v-model="props.range" />
|
|
10
|
+
<span class="pad-left-2 v-mid">range</span>
|
|
11
|
+
</label>
|
|
12
|
+
</div>
|
|
13
|
+
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
model: null,
|
|
21
|
+
props: {
|
|
22
|
+
dayOfWeek: 1,
|
|
23
|
+
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
24
|
+
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
25
|
+
','
|
|
26
|
+
),
|
|
27
|
+
range: false,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
</script>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Min, max, allowed etc
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<template>
|
|
39
|
+
<div class="pad-l5">
|
|
40
|
+
<p>model: {{ model }}</p>
|
|
41
|
+
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
<script>
|
|
45
|
+
let d = new Date();
|
|
46
|
+
export default {
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
model: null,
|
|
50
|
+
props: {
|
|
51
|
+
dayOfWeek: 1,
|
|
52
|
+
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
53
|
+
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
54
|
+
','
|
|
55
|
+
),
|
|
56
|
+
min: new Date(d.getFullYear(), d.getMonth(), 5),
|
|
57
|
+
max: new Date(d.getFullYear(), d.getMonth(), 25),
|
|
58
|
+
allowed: d => ![0, 6].includes(d.getDay()),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
</script>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Range example
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<div class="pad-l5">
|
|
71
|
+
<p>model: {{ model }}</p>
|
|
72
|
+
<date-picker v-model="model" v-bind="props"></date-picker>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
75
|
+
<script>
|
|
76
|
+
let dayjs = window.dayjs;
|
|
77
|
+
export default {
|
|
78
|
+
data() {
|
|
79
|
+
return {
|
|
80
|
+
model: [],
|
|
81
|
+
props: {
|
|
82
|
+
range: true,
|
|
83
|
+
dayOfWeek: 1,
|
|
84
|
+
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
85
|
+
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
86
|
+
','
|
|
87
|
+
),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Extended example using slots
|
|
96
|
+
|
|
97
|
+
```vue
|
|
98
|
+
<template>
|
|
99
|
+
<div class="pad-l5">
|
|
100
|
+
<p>model: {{ model }}</p>
|
|
101
|
+
<date-picker v-model="model" v-bind="props">
|
|
102
|
+
<template
|
|
103
|
+
#header="{ nextMonth, prevMonth, prevYear, nextYear, setToday, setMonth, setYear, month, monthName, year }"
|
|
104
|
+
>
|
|
105
|
+
<table class="pad-3 w-100">
|
|
106
|
+
<tr>
|
|
107
|
+
<td>
|
|
108
|
+
<div class="text-lead">{{ monthName }}</div>
|
|
109
|
+
<div class="text-small color-grey">
|
|
110
|
+
<i class="mdi mdi-arrow-up cursor-pointer" @click="nextYear"></i>
|
|
111
|
+
<input
|
|
112
|
+
class="color-inherit text-centerl"
|
|
113
|
+
type="number"
|
|
114
|
+
:value="year"
|
|
115
|
+
@input="e => setYear(e.target.value)"
|
|
116
|
+
style="border:none; width:4rem"
|
|
117
|
+
/>
|
|
118
|
+
<i class="mdi mdi-arrow-down cursor-pointer" @click="prevYear"></i>
|
|
119
|
+
</div>
|
|
120
|
+
</td>
|
|
121
|
+
<td width="1px">
|
|
122
|
+
<i class="mdi mdi-calendar cursor-pointer" @click="setToday"></i>
|
|
123
|
+
</td>
|
|
124
|
+
<td width="1px">
|
|
125
|
+
<i class="mdi mdi-arrow-up cursor-pointer" @click="nextMonth"></i>
|
|
126
|
+
<i class="mdi mdi-arrow-down cursor-pointer" @click="prevMonth"></i>
|
|
127
|
+
</td>
|
|
128
|
+
</tr>
|
|
129
|
+
</table>
|
|
130
|
+
</template>
|
|
131
|
+
<template #cell-day="{ dayIndex, dayName, isWeekend }">
|
|
132
|
+
<div class="text-bold text-small" :class="{ 'color-red': isWeekend }">
|
|
133
|
+
{{ dayName }}
|
|
134
|
+
</div>
|
|
135
|
+
</template>
|
|
136
|
+
<template #cell-date="{ date, isSelected, isToday, setDate }">
|
|
137
|
+
<div
|
|
138
|
+
class="btn btn-icon btn-small pad-none round"
|
|
139
|
+
:class="{
|
|
140
|
+
'bg-primary color-white': isToday,
|
|
141
|
+
'bg-red': isSelected,
|
|
142
|
+
}"
|
|
143
|
+
@click="setDate(date)"
|
|
144
|
+
>
|
|
145
|
+
{{ date.getDate() }}
|
|
146
|
+
</div>
|
|
147
|
+
</template>
|
|
148
|
+
</date-picker>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
<script>
|
|
152
|
+
export default {
|
|
153
|
+
data() {
|
|
154
|
+
return {
|
|
155
|
+
rangeOffset: 0,
|
|
156
|
+
model: null,
|
|
157
|
+
props: {
|
|
158
|
+
dayOfWeek: 1,
|
|
159
|
+
dayNames: 'Вс,Пн,Вт,Ср,Чт,Пт,Сб'.split(','),
|
|
160
|
+
monthNames: 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь'.split(
|
|
161
|
+
','
|
|
162
|
+
),
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
</script>
|
|
168
|
+
```
|