@everchron/ec-shards 3.1.5 → 3.2.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/dist/ec-shards.common.js +795 -837
- package/dist/ec-shards.common.js.map +1 -1
- package/dist/ec-shards.css +1 -1
- package/dist/ec-shards.umd.js +795 -837
- package/dist/ec-shards.umd.js.map +1 -1
- package/dist/ec-shards.umd.min.js +1 -1
- package/dist/ec-shards.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/pagination/pagination.vue +133 -140
- package/src/stories/Changelog.stories.mdx +6 -0
- package/src/stories/pagination/pagination.stories.js +0 -30
package/package.json
CHANGED
|
@@ -1,65 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="ecs-pagination" :class="[ floating ? 'ecs-pagination-floating' : '' ]">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<ecs-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</ecs-
|
|
20
|
-
</
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
3
|
+
<div class="ecs-pagination-nav">
|
|
4
|
+
<ecs-button-toolbar-group>
|
|
5
|
+
<ecs-button-toolbar
|
|
6
|
+
@click="$emit('prevPage', $event)"
|
|
7
|
+
:disabled="loading || currentPage === 1"
|
|
8
|
+
icon="back"
|
|
9
|
+
data-test="pagination-previous-button">
|
|
10
|
+
Previous Page
|
|
11
|
+
</ecs-button-toolbar>
|
|
12
|
+
<ecs-button-toolbar
|
|
13
|
+
@click="$emit('nextPage', $event)"
|
|
14
|
+
:disabled="loading || currentPage === totalPages"
|
|
15
|
+
icon="next"
|
|
16
|
+
icon-position="right"
|
|
17
|
+
data-test="pagination-next-button">
|
|
18
|
+
Next Page
|
|
19
|
+
</ecs-button-toolbar>
|
|
20
|
+
</ecs-button-toolbar-group>
|
|
21
|
+
|
|
22
|
+
<div class="ecs-pagination-dropdown">
|
|
23
|
+
<span>Page</span>
|
|
24
|
+
<div @click="toggleDropdown" class="ecs-pagination-dropdown-button" :class="[dropdownShown ? 'active' : '', totalPages ? '' : 'disabled']">
|
|
25
|
+
<template v-if="currentPage">{{ currentPage }}</template>
|
|
26
|
+
<template v-else>-</template>
|
|
27
|
+
|
|
28
|
+
<transition name="dropdown">
|
|
29
|
+
<div v-if="dropdownShown && totalPages" class="ecs-pagination-select scrollbar scrollbar-sml">
|
|
30
|
+
<ecs-popover-list>
|
|
31
|
+
<ecs-popover-list-item
|
|
32
|
+
@click="$emit('update:page', n), hideDropdown"
|
|
33
|
+
v-for="n in totalPages"
|
|
34
|
+
:key="n"
|
|
35
|
+
:selected="n === currentPage">
|
|
36
|
+
{{ n }}
|
|
37
|
+
</ecs-popover-list-item>
|
|
38
|
+
</ecs-popover-list>
|
|
39
|
+
</div>
|
|
40
|
+
</transition>
|
|
41
|
+
</div>
|
|
42
|
+
<span v-if="totalPages" class="total">of {{ totalPages }}</span>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div>
|
|
33
46
|
<!-- @slot Slot for a sheet tab bar. -->
|
|
34
47
|
<slot name="tabs"></slot>
|
|
35
48
|
</div>
|
|
36
|
-
|
|
37
|
-
<ecs-flex-row v-if="showItemsPerPage && type == 'paginated'" :gap="4" class="ecs-pagination-items">
|
|
38
|
-
<span>Items per page</span>
|
|
39
|
-
<ecs-select @change="$emit('itemsPerPage', $event.target.value)" :disabled="loading" size="sml">
|
|
40
|
-
<option v-for="n in itemsPerPage" :key="n" :value="n" :selected="n === itemsPerPageSelected">{{ n }}</option>
|
|
41
|
-
</ecs-select>
|
|
42
|
-
</ecs-flex-row>
|
|
43
|
-
|
|
44
|
-
<ecs-flex-row v-if="$slots.controls" :gap="4" class="ecs-pagination-controls">
|
|
45
|
-
<!-- @slot Slot for a additional controls, such as a settings button. -->
|
|
46
|
-
<slot name="controls"></slot>
|
|
47
|
-
</ecs-flex-row>
|
|
48
49
|
</div>
|
|
49
50
|
</template>
|
|
50
51
|
|
|
51
52
|
<script>
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
53
|
+
import EcsButtonToolbarGroup from '../button-toolbar-group/button-toolbar-group'
|
|
54
|
+
import EcsButtonToolbar from '../button-toolbar/button-toolbar'
|
|
55
|
+
import EcsPopoverList from '../popover-list/popover-list'
|
|
56
|
+
import EcsPopoverListItem from '../popover-list-item/popover-list-item'
|
|
56
57
|
|
|
57
58
|
export default {
|
|
58
59
|
components: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
EcsButtonToolbarGroup,
|
|
61
|
+
EcsButtonToolbar,
|
|
62
|
+
EcsPopoverList,
|
|
63
|
+
EcsPopoverListItem
|
|
63
64
|
},
|
|
64
65
|
|
|
65
66
|
props: {
|
|
@@ -68,12 +69,6 @@
|
|
|
68
69
|
type: Boolean,
|
|
69
70
|
default: false
|
|
70
71
|
},
|
|
71
|
-
/** Determines which elements are visible in the pagination component. */
|
|
72
|
-
type: {
|
|
73
|
-
type: String,
|
|
74
|
-
validator: v => ['paginated', 'infinite'].includes(v),
|
|
75
|
-
default: 'paginated'
|
|
76
|
-
},
|
|
77
72
|
/** Briefly disables all controls while ongoing navigation. */
|
|
78
73
|
loading: {
|
|
79
74
|
type: Boolean,
|
|
@@ -86,53 +81,23 @@
|
|
|
86
81
|
/** The total pages of the index. */
|
|
87
82
|
totalPages: {
|
|
88
83
|
type: Number,
|
|
89
|
-
},
|
|
90
|
-
/** The width of the area left to the tab area in pixels. This is used to align the tab bar with a column in the table. Not needed when tabs aren't in use. */
|
|
91
|
-
tabsSpacing: {
|
|
92
|
-
type: Number,
|
|
93
|
-
default: 400
|
|
94
|
-
},
|
|
95
|
-
/** Determines if the selector for items per page should be shown. */
|
|
96
|
-
showItemsPerPage: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: true
|
|
99
|
-
},
|
|
100
|
-
/** The options to be show as selectable in the items per page dropdown. Requires an array with Numbers. Default: `[25, 50, 100]` */
|
|
101
|
-
itemsPerPage: {
|
|
102
|
-
type: Array,
|
|
103
|
-
default() {
|
|
104
|
-
return [25, 50, 100]
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
/** The selected option in the items per page dropdown. */
|
|
108
|
-
itemsPerPageSelected: {
|
|
109
|
-
type: Number,
|
|
110
|
-
default: 100
|
|
111
|
-
},
|
|
112
|
-
/** Number of the visible item range (starting). */
|
|
113
|
-
itemRangeFrom: {
|
|
114
|
-
type: [Number, String]
|
|
115
|
-
},
|
|
116
|
-
/** Number of the visible item range (ending). */
|
|
117
|
-
itemRangeTo: {
|
|
118
|
-
type: [Number, String]
|
|
119
|
-
},
|
|
120
|
-
/** Number of the total items in the index. */
|
|
121
|
-
itemRangeTotal: {
|
|
122
|
-
type: [Number, String]
|
|
123
84
|
}
|
|
124
85
|
},
|
|
125
86
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
dropdownShown: false
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
methods: {
|
|
94
|
+
toggleDropdown(){
|
|
95
|
+
if(this.totalPages)
|
|
96
|
+
this.dropdownShown = !this.dropdownShown
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
hideDropdown(){
|
|
100
|
+
this.dropdownShown = false
|
|
136
101
|
}
|
|
137
102
|
}
|
|
138
103
|
}
|
|
@@ -151,9 +116,6 @@
|
|
|
151
116
|
box-shadow: 0 -1px 0 $color-gray-4;
|
|
152
117
|
position: relative;
|
|
153
118
|
z-index: 2;
|
|
154
|
-
font-size: $type-scale-2-font-size;
|
|
155
|
-
line-height: $type-scale-2-line-height;
|
|
156
|
-
color: $color-gray-15;
|
|
157
119
|
|
|
158
120
|
&-floating{
|
|
159
121
|
border-radius: $border-radius-small;
|
|
@@ -161,63 +123,94 @@
|
|
|
161
123
|
}
|
|
162
124
|
|
|
163
125
|
&-nav{
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
164
128
|
height: 40px;
|
|
165
|
-
|
|
166
|
-
.ecs-form-select{
|
|
167
|
-
width: 52px;
|
|
168
|
-
}
|
|
129
|
+
margin-right: 24px;
|
|
169
130
|
}
|
|
170
131
|
|
|
171
|
-
|
|
172
|
-
|
|
132
|
+
.ecs-toolbar-button-group{
|
|
133
|
+
margin-right: 32px;
|
|
173
134
|
}
|
|
174
135
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
.ecs-form-select{
|
|
179
|
-
width: 52px;
|
|
180
|
-
}
|
|
136
|
+
.ecs-toolbar-button-icon{
|
|
137
|
+
font-size: $type-scale-2-font-size;
|
|
181
138
|
}
|
|
182
139
|
|
|
183
|
-
&-
|
|
184
|
-
|
|
140
|
+
&-dropdown{
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
185
143
|
font-size: $type-scale-2-font-size;
|
|
186
|
-
|
|
187
|
-
color: $color-gray-10;
|
|
144
|
+
color: $color-gray-9;
|
|
188
145
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
color: $color-gray-14;
|
|
146
|
+
.total{
|
|
147
|
+
color: $color-gray-15;
|
|
192
148
|
}
|
|
193
|
-
}
|
|
194
149
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
150
|
+
&-button{
|
|
151
|
+
background: #FFF;
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
border: 1px solid $color-gray-3;
|
|
155
|
+
padding: 0 8px;
|
|
156
|
+
height: 32px;
|
|
157
|
+
transition: .2s;
|
|
158
|
+
border-radius: $border-radius-small;
|
|
159
|
+
margin: 0 6px;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
position: relative;
|
|
162
|
+
color: $color-gray-15;
|
|
163
|
+
|
|
164
|
+
&:after{
|
|
165
|
+
content: "";
|
|
166
|
+
background: svg-uri('<svg xmlns="http://www.w3.org/2000/svg" width="8" height="5" viewBox="0 0 8 5"><polyline fill="none" stroke="#858E9E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" points="0 0 3 3 6 0" transform="translate(1 .8)"/></svg>');
|
|
167
|
+
width: 8px;
|
|
168
|
+
height: 5px;
|
|
169
|
+
margin-left: 6px;
|
|
170
|
+
}
|
|
198
171
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
172
|
+
&:hover{
|
|
173
|
+
border: 1px solid $color-gray-4;
|
|
174
|
+
box-shadow: 0 1px 1px rgba($color-gray-4, .25);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.active{
|
|
178
|
+
border: 1px solid $color-gray-5;
|
|
179
|
+
box-shadow: 0 1px 0 rgba($color-gray-2, .1) inset;
|
|
180
|
+
background: rgba($color-gray-5, .1);
|
|
181
|
+
}
|
|
204
182
|
|
|
205
|
-
|
|
206
|
-
|
|
183
|
+
&.disabled{
|
|
184
|
+
border: 1px solid $color-gray-3;
|
|
185
|
+
box-shadow: none;
|
|
186
|
+
cursor: not-allowed;
|
|
187
|
+
color: $color-gray-7;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
207
190
|
}
|
|
208
191
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
192
|
+
&-select{
|
|
193
|
+
position: absolute;
|
|
194
|
+
left: 0;
|
|
195
|
+
right: auto;
|
|
196
|
+
bottom: 34px;
|
|
197
|
+
z-index: 1000;
|
|
198
|
+
background-color: #fff;
|
|
199
|
+
box-shadow: 0 0 0 1px rgba($color-gray-15, .08), 0 1px 3px 0 rgba($color-gray-15, 0.15);
|
|
200
|
+
border-radius: $border-radius-small;
|
|
201
|
+
max-height: 30vh;
|
|
202
|
+
overflow: auto;
|
|
212
203
|
}
|
|
213
204
|
}
|
|
214
205
|
|
|
215
|
-
.
|
|
216
|
-
|
|
206
|
+
.dropdown-enter-active,
|
|
207
|
+
.dropdown-leave-active {
|
|
208
|
+
transition: all .3s;
|
|
217
209
|
}
|
|
218
210
|
|
|
219
|
-
.
|
|
211
|
+
.dropdown-enter,
|
|
212
|
+
.dropdown-leave-to {
|
|
220
213
|
opacity: 0;
|
|
221
|
-
transform:
|
|
214
|
+
transform: translateY(10px);
|
|
222
215
|
}
|
|
223
216
|
</style>
|
|
@@ -6,6 +6,12 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
6
6
|
Changelog
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
+
## Version 3.2.0 (11 January 2023)
|
|
10
|
+
|
|
11
|
+
### Fixes
|
|
12
|
+
|
|
13
|
+
Reverted all EcsPagination updates and moved these changes to the @next branch, until infinite scroll feature can be implemented. This means 3.2.0 can be used again as a stable release for current application development.
|
|
14
|
+
|
|
9
15
|
## Version 3.1.5 (undefined)
|
|
10
16
|
|
|
11
17
|
### Features
|
|
@@ -35,33 +35,3 @@ export const tabPagination = () => ({
|
|
|
35
35
|
</ecs-pagination>
|
|
36
36
|
</div>`,
|
|
37
37
|
});
|
|
38
|
-
|
|
39
|
-
export const infiniteScroll = () => ({
|
|
40
|
-
components: { EcsPagination, EcsTabBar, EcsTabButton },
|
|
41
|
-
template: `<div style="display:flex;flex-direction:column;height: 200px;justify-content: flex-end;">
|
|
42
|
-
<ecs-pagination type="infinite" :current-page="2" :total-pages="10">
|
|
43
|
-
<template slot="tabs">
|
|
44
|
-
<ecs-tab-bar type="sheet">
|
|
45
|
-
<ecs-tab-button show>Settings</ecs-tab-button>
|
|
46
|
-
<ecs-tab-button>Calendar</ecs-tab-button>
|
|
47
|
-
<ecs-tab-button>Versions</ecs-tab-button>
|
|
48
|
-
</ecs-tab-bar>
|
|
49
|
-
</template>
|
|
50
|
-
</ecs-pagination>
|
|
51
|
-
</div>`,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export const infiniteScrollRange = () => ({
|
|
55
|
-
components: { EcsPagination, EcsTabBar, EcsTabButton },
|
|
56
|
-
template: `<div style="display:flex;flex-direction:column;height: 200px;justify-content: flex-end;">
|
|
57
|
-
<ecs-pagination type="infinite" :current-page="2" :total-pages="10" :itemRangeFrom="1" :itemRangeTo="10" :itemRangeTotal="90">
|
|
58
|
-
<template slot="tabs">
|
|
59
|
-
<ecs-tab-bar type="sheet">
|
|
60
|
-
<ecs-tab-button>Settings</ecs-tab-button>
|
|
61
|
-
<ecs-tab-button show>Calendar</ecs-tab-button>
|
|
62
|
-
<ecs-tab-button>Versions</ecs-tab-button>
|
|
63
|
-
</ecs-tab-bar>
|
|
64
|
-
</template>
|
|
65
|
-
</ecs-pagination>
|
|
66
|
-
</div>`,
|
|
67
|
-
});
|