goodteditor-ui 1.0.12 → 1.0.13
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/dist/js.png +0 -0
- package/index.js +51 -51
- package/jsconfig.json +13 -13
- package/package.json +57 -57
- package/src/App.vue +36 -36
- package/src/components/ui/Avatar.md +68 -68
- package/src/components/ui/Avatar.vue +177 -177
- 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 +157 -157
- 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 +341 -341
- 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 +310 -310
- 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 +258 -209
- 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 +420 -420
- package/src/components/ui/TimePicker.md +50 -50
- package/src/components/ui/TimePicker.vue +252 -252
- package/src/components/ui/Tooltip.md +114 -52
- package/src/components/ui/Tooltip.vue +113 -113
- package/src/components/ui/utils/FormComponent.js +107 -107
- package/src/components/ui/utils/Helpers.js +84 -61
- package/src/components/ui/utils/WithPopover.js +99 -81
- package/src/main.js +8 -8
- package/styleguide.config.js +37 -37
- package/vue.config.js +8 -8
- package/.idea/codeStyles/Project.xml +0 -51
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/goodt-ui.iml +0 -12
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
```vue
|
|
2
|
-
<template>
|
|
3
|
-
<div class="pad-l5">
|
|
4
|
-
<ui-paginator v-bind="props">
|
|
5
|
-
<template #default="{ page, pages, pageData, setPage }">
|
|
6
|
-
<div class="mar-bot-l3">
|
|
7
|
-
<div class="tile" v-for="item in pageData" :key="item.index">
|
|
8
|
-
<div class="tile-body">{{ item.index + 1 }}. {{ item.label }}</div>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
<ui-pagination v-bind="{ page, pages }" @change="n => setPage(n)"></ui-pagination>
|
|
12
|
-
</template>
|
|
13
|
-
</ui-paginator>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<script>
|
|
17
|
-
import UiPagination from './Pagination.vue';
|
|
18
|
-
import UiPaginator from './Paginator.vue';
|
|
19
|
-
|
|
20
|
-
export default {
|
|
21
|
-
components: { UiPagination, UiPaginator },
|
|
22
|
-
data() {
|
|
23
|
-
return {
|
|
24
|
-
props: {
|
|
25
|
-
data: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veritatis quos corporis obcaecati dolorum distinctio accusantium sapiente, earum non dignissimos quia officia voluptatum, sunt rem voluptate a commodi test'
|
|
26
|
-
.split(' ')
|
|
27
|
-
.map((label, index) => ({ label, index })),
|
|
28
|
-
perPage: 5,
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
</script>
|
|
34
|
-
```
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div class="pad-l5">
|
|
4
|
+
<ui-paginator v-bind="props">
|
|
5
|
+
<template #default="{ page, pages, pageData, setPage }">
|
|
6
|
+
<div class="mar-bot-l3">
|
|
7
|
+
<div class="tile" v-for="item in pageData" :key="item.index">
|
|
8
|
+
<div class="tile-body">{{ item.index + 1 }}. {{ item.label }}</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<ui-pagination v-bind="{ page, pages }" @change="n => setPage(n)"></ui-pagination>
|
|
12
|
+
</template>
|
|
13
|
+
</ui-paginator>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
import UiPagination from './Pagination.vue';
|
|
18
|
+
import UiPaginator from './Paginator.vue';
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
components: { UiPagination, UiPaginator },
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
props: {
|
|
25
|
+
data: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veritatis quos corporis obcaecati dolorum distinctio accusantium sapiente, earum non dignissimos quia officia voluptatum, sunt rem voluptate a commodi test'
|
|
26
|
+
.split(' ')
|
|
27
|
+
.map((label, index) => ({ label, index })),
|
|
28
|
+
perPage: 5,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
```
|
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ui-paginator">
|
|
3
|
-
<!--
|
|
4
|
-
@slot Page data slot
|
|
5
|
-
@binding {Number} page current page number
|
|
6
|
-
@binding {Number} pages total pages number
|
|
7
|
-
@binding {Array} pageData current page data
|
|
8
|
-
@binding {(n:number) => {}} setPage sets a new page
|
|
9
|
-
-->
|
|
10
|
-
<slot v-bind="{ page: currentPage, pages, pageData, setPage }"></slot>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
<script>
|
|
14
|
-
export default {
|
|
15
|
-
props: {
|
|
16
|
-
/**
|
|
17
|
-
* Data to be paginated
|
|
18
|
-
*/
|
|
19
|
-
data: {
|
|
20
|
-
type: Array,
|
|
21
|
-
default() {
|
|
22
|
-
return [];
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
/**
|
|
26
|
-
* Current page (.sync supported)
|
|
27
|
-
*/
|
|
28
|
-
page: {
|
|
29
|
-
type: Number,
|
|
30
|
-
default: 1,
|
|
31
|
-
},
|
|
32
|
-
/**
|
|
33
|
-
* Number of items displayed per page
|
|
34
|
-
*/
|
|
35
|
-
perPage: {
|
|
36
|
-
type: Number,
|
|
37
|
-
default: 10,
|
|
38
|
-
validator(val) {
|
|
39
|
-
return val > 0;
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
data() {
|
|
44
|
-
return { currentPage: 1 };
|
|
45
|
-
},
|
|
46
|
-
computed: {
|
|
47
|
-
pages() {
|
|
48
|
-
const { data, perPage } = this;
|
|
49
|
-
return Math.ceil(data.length / perPage);
|
|
50
|
-
},
|
|
51
|
-
pageData() {
|
|
52
|
-
const { data, currentPage, perPage } = this;
|
|
53
|
-
return data ? data.slice((currentPage - 1) * perPage, currentPage * perPage) : [];
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
watch: {
|
|
57
|
-
'data.length'() {
|
|
58
|
-
this.setPage(1);
|
|
59
|
-
},
|
|
60
|
-
page: {
|
|
61
|
-
handler(val) {
|
|
62
|
-
this.setPage(val);
|
|
63
|
-
},
|
|
64
|
-
immediate: true,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
methods: {
|
|
68
|
-
setPage(page) {
|
|
69
|
-
this.currentPage = page;
|
|
70
|
-
/**
|
|
71
|
-
* Page change event (page.sync compatibility)
|
|
72
|
-
* @property {number} page
|
|
73
|
-
*/
|
|
74
|
-
this.$emit('update:page', page);
|
|
75
|
-
/**
|
|
76
|
-
* Change event
|
|
77
|
-
* @property {number} page
|
|
78
|
-
*/
|
|
79
|
-
this.$emit('change', page);
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-paginator">
|
|
3
|
+
<!--
|
|
4
|
+
@slot Page data slot
|
|
5
|
+
@binding {Number} page current page number
|
|
6
|
+
@binding {Number} pages total pages number
|
|
7
|
+
@binding {Array} pageData current page data
|
|
8
|
+
@binding {(n:number) => {}} setPage sets a new page
|
|
9
|
+
-->
|
|
10
|
+
<slot v-bind="{ page: currentPage, pages, pageData, setPage }"></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* Data to be paginated
|
|
18
|
+
*/
|
|
19
|
+
data: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default() {
|
|
22
|
+
return [];
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Current page (.sync supported)
|
|
27
|
+
*/
|
|
28
|
+
page: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 1,
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* Number of items displayed per page
|
|
34
|
+
*/
|
|
35
|
+
perPage: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: 10,
|
|
38
|
+
validator(val) {
|
|
39
|
+
return val > 0;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
data() {
|
|
44
|
+
return { currentPage: 1 };
|
|
45
|
+
},
|
|
46
|
+
computed: {
|
|
47
|
+
pages() {
|
|
48
|
+
const { data, perPage } = this;
|
|
49
|
+
return Math.ceil(data.length / perPage);
|
|
50
|
+
},
|
|
51
|
+
pageData() {
|
|
52
|
+
const { data, currentPage, perPage } = this;
|
|
53
|
+
return data ? data.slice((currentPage - 1) * perPage, currentPage * perPage) : [];
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
watch: {
|
|
57
|
+
'data.length'() {
|
|
58
|
+
this.setPage(1);
|
|
59
|
+
},
|
|
60
|
+
page: {
|
|
61
|
+
handler(val) {
|
|
62
|
+
this.setPage(val);
|
|
63
|
+
},
|
|
64
|
+
immediate: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
setPage(page) {
|
|
69
|
+
this.currentPage = page;
|
|
70
|
+
/**
|
|
71
|
+
* Page change event (page.sync compatibility)
|
|
72
|
+
* @property {number} page
|
|
73
|
+
*/
|
|
74
|
+
this.$emit('update:page', page);
|
|
75
|
+
/**
|
|
76
|
+
* Change event
|
|
77
|
+
* @property {number} page
|
|
78
|
+
*/
|
|
79
|
+
this.$emit('change', page);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
```vue
|
|
2
|
-
<template>
|
|
3
|
-
<div class="pad-l5">
|
|
4
|
-
<div class="pos-rel">
|
|
5
|
-
<div id="popover-btn" class="btn btn-primary" @click="show = !show">
|
|
6
|
-
Button
|
|
7
|
-
</div>
|
|
8
|
-
<ui-popover v-bind="props" :show.sync="show">
|
|
9
|
-
<div class="panel">
|
|
10
|
-
<div class="panel-body">Lorem ipsum dolor sit amet.</div>
|
|
11
|
-
</div>
|
|
12
|
-
</ui-popover>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<script>
|
|
17
|
-
import UiPopover from './Popover.vue';
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
components: { UiPopover },
|
|
21
|
-
data() {
|
|
22
|
-
return {
|
|
23
|
-
show: false,
|
|
24
|
-
props: {
|
|
25
|
-
target: '#popover-btn',
|
|
26
|
-
appendToBody: true,
|
|
27
|
-
autoWidth: false,
|
|
28
|
-
position: 'bottom-start',
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
</script>
|
|
34
|
-
```
|
|
1
|
+
```vue
|
|
2
|
+
<template>
|
|
3
|
+
<div class="pad-l5">
|
|
4
|
+
<div class="pos-rel">
|
|
5
|
+
<div id="popover-btn" class="btn btn-primary" @click="show = !show">
|
|
6
|
+
Button
|
|
7
|
+
</div>
|
|
8
|
+
<ui-popover v-bind="props" :show.sync="show">
|
|
9
|
+
<div class="panel">
|
|
10
|
+
<div class="panel-body">Lorem ipsum dolor sit amet.</div>
|
|
11
|
+
</div>
|
|
12
|
+
</ui-popover>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
import UiPopover from './Popover.vue';
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
components: { UiPopover },
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
show: false,
|
|
24
|
+
props: {
|
|
25
|
+
target: '#popover-btn',
|
|
26
|
+
appendToBody: true,
|
|
27
|
+
autoWidth: false,
|
|
28
|
+
position: 'bottom-start',
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
```
|