@onereach/ui-components 11.3.1 → 11.3.2-beta.4417.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/bundled/v2/components/OrDataGridV3/OrDataGrid.js +1 -1
- package/dist/bundled/v2/components/OrDataGridV3/index.js +1 -1
- package/dist/bundled/v2/components/OrPaginationV3/OrPagination.js +91 -51
- package/dist/bundled/v2/components/OrPaginationV3/OrPagination.vue.d.ts +40 -9
- package/dist/bundled/v2/components/OrPaginationV3/styles.d.ts +1 -3
- package/dist/bundled/v2/components/OrPaginationV3/styles.js +2 -12
- package/dist/bundled/v2/components/OrPaginationV3/types.d.ts +4 -0
- package/dist/bundled/v2/components/index.js +1 -1
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/OrDataGrid.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrDataGridV3-ab1277d5.js → OrDataGridV3-53537045.js} +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/OrPagination.js +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/OrPagination.vue.d.ts +16 -5
- package/dist/bundled/v3/components/OrPaginationV3/index.js +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/styles.d.ts +1 -3
- package/dist/bundled/v3/components/OrPaginationV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrPaginationV3/types.d.ts +4 -0
- package/dist/bundled/v3/components/{OrPaginationV3-a460d1bb.js → OrPaginationV3-4576ee90.js} +101 -66
- package/dist/bundled/v3/components/index.js +2 -2
- package/dist/bundled/v3/index.js +2 -2
- package/dist/esm/v2/{OrDataGrid-1bdd2499.js → OrDataGrid-9e29b831.js} +1 -1
- package/dist/esm/v2/{OrPagination-1b153a54.js → OrPagination-2d6fbd4b.js} +91 -61
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-data-grid-v3/index.js +2 -2
- package/dist/esm/v2/components/or-pagination-v3/OrPagination.vue.d.ts +40 -9
- package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v2/components/or-pagination-v3/styles.d.ts +1 -3
- package/dist/esm/v2/components/or-pagination-v3/types.d.ts +4 -0
- package/dist/esm/v2/index.js +2 -2
- package/dist/esm/v3/{OrDataGrid-c7a65d77.js → OrDataGrid-c68a7070.js} +1 -1
- package/dist/esm/v3/{OrPagination-6bb85ce5.js → OrPagination-42ad7478.js} +100 -65
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-data-grid-v3/index.js +2 -2
- package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +16 -5
- package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
- package/dist/esm/v3/components/or-pagination-v3/styles.d.ts +1 -3
- package/dist/esm/v3/components/or-pagination-v3/types.d.ts +4 -0
- package/dist/esm/v3/index.js +2 -2
- package/package.json +2 -3
- package/src/components/or-pagination-v3/OrPagination.vue +109 -68
- package/src/components/or-pagination-v3/styles.ts +1 -17
- package/src/components/or-pagination-v3/types.ts +5 -0
- /package/dist/bundled/v2/{OrDataGrid-13e9299a.js → OrDataGrid-0f6770b0.js} +0 -0
package/dist/bundled/v3/components/{OrPaginationV3-a460d1bb.js → OrPaginationV3-4576ee90.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, Fragment, renderList, createBlock,
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createTextVNode, createVNode, withCtx, toDisplayString, Fragment, renderList, createBlock, createCommentVNode } from 'vue';
|
|
2
2
|
import { defineComponent, ref, computed, toRef } from 'vue-demi';
|
|
3
3
|
import { s as script$1 } from './OrButtonV3-c8e5a5de.js';
|
|
4
4
|
import { s as script$2 } from './OrIconV3-b5c97ea7.js';
|
|
@@ -7,7 +7,7 @@ import { s as script$4 } from './OrMenuItemV3-83001ba3.js';
|
|
|
7
7
|
import { useProxyModelValue } from '../hooks/useProxyModelValue.js';
|
|
8
8
|
import useResponsive from '../hooks/useResponsive/useResponsive.js';
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const Pagination = [
|
|
11
11
|
// Layout
|
|
12
12
|
'layout-row',
|
|
13
13
|
// Spacing
|
|
@@ -16,16 +16,6 @@ const PaginationRoot = [
|
|
|
16
16
|
'typography-caption-regular',
|
|
17
17
|
// Theme
|
|
18
18
|
'theme-foreground-outline', 'dark:theme-foreground-outline-dark'];
|
|
19
|
-
const PaginationOffsetControl = [
|
|
20
|
-
// Layout
|
|
21
|
-
'layout-row',
|
|
22
|
-
// Spacing
|
|
23
|
-
'gap-md'];
|
|
24
|
-
const PaginationLimitControl = [
|
|
25
|
-
// Layout
|
|
26
|
-
'layout-row',
|
|
27
|
-
// Spacing
|
|
28
|
-
'gap-sm'];
|
|
29
19
|
const PaginationItem = [
|
|
30
20
|
// Typography
|
|
31
21
|
'typography-caption-regular',
|
|
@@ -56,13 +46,21 @@ var script = defineComponent({
|
|
|
56
46
|
options: {
|
|
57
47
|
type: Array,
|
|
58
48
|
default: () => [50, 20, 10, 5]
|
|
49
|
+
},
|
|
50
|
+
features: {
|
|
51
|
+
type: Object,
|
|
52
|
+
default: () => ({
|
|
53
|
+
limit: true,
|
|
54
|
+
range: true
|
|
55
|
+
})
|
|
59
56
|
}
|
|
60
57
|
},
|
|
61
58
|
emits: ['update:modelValue'],
|
|
62
59
|
expose: ['root'],
|
|
63
60
|
setup(props, context) {
|
|
64
|
-
// Refs
|
|
61
|
+
// Refs & Styles
|
|
65
62
|
const root = ref();
|
|
63
|
+
const rootStyles = computed(() => ['or-pagination-v3', ...Pagination]);
|
|
66
64
|
const limitButton = ref();
|
|
67
65
|
const limitButtonRoot = computed(() => {
|
|
68
66
|
var _a;
|
|
@@ -73,20 +71,26 @@ var script = defineComponent({
|
|
|
73
71
|
var _a;
|
|
74
72
|
return (_a = limitMenu.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
75
73
|
});
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
const offsetButton = ref();
|
|
75
|
+
const offsetButtonRoot = computed(() => {
|
|
76
|
+
var _a;
|
|
77
|
+
return (_a = offsetButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
78
|
+
});
|
|
79
|
+
const offsetMenu = ref();
|
|
80
|
+
const offsetMenuRoot = computed(() => {
|
|
81
|
+
var _a;
|
|
82
|
+
return (_a = offsetMenu.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
83
|
+
});
|
|
80
84
|
const itemStyles = computed(() => [...PaginationItem]);
|
|
81
85
|
// State
|
|
82
|
-
const
|
|
86
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
83
87
|
const currentLimit = computed({
|
|
84
88
|
get: () => {
|
|
85
89
|
var _a, _b;
|
|
86
|
-
return (_b = (_a =
|
|
90
|
+
return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
|
|
87
91
|
},
|
|
88
92
|
set: value => {
|
|
89
|
-
|
|
93
|
+
model.value = {
|
|
90
94
|
limit: value,
|
|
91
95
|
offset: 0
|
|
92
96
|
};
|
|
@@ -95,10 +99,10 @@ var script = defineComponent({
|
|
|
95
99
|
const currentOffset = computed({
|
|
96
100
|
get: () => {
|
|
97
101
|
var _a, _b;
|
|
98
|
-
return (_b = (_a =
|
|
102
|
+
return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
|
|
99
103
|
},
|
|
100
104
|
set: value => {
|
|
101
|
-
|
|
105
|
+
model.value = {
|
|
102
106
|
limit: currentLimit.value,
|
|
103
107
|
offset: value
|
|
104
108
|
};
|
|
@@ -161,15 +165,17 @@ var script = defineComponent({
|
|
|
161
165
|
} = useResponsive();
|
|
162
166
|
return {
|
|
163
167
|
root,
|
|
168
|
+
rootStyles,
|
|
164
169
|
limitButton,
|
|
165
170
|
limitButtonRoot,
|
|
166
171
|
limitMenu,
|
|
167
172
|
limitMenuRoot,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
173
|
+
offsetButton,
|
|
174
|
+
offsetButtonRoot,
|
|
175
|
+
offsetMenu,
|
|
176
|
+
offsetMenuRoot,
|
|
171
177
|
itemStyles,
|
|
172
|
-
|
|
178
|
+
model,
|
|
173
179
|
currentLimit,
|
|
174
180
|
currentOffset,
|
|
175
181
|
currentPage,
|
|
@@ -185,6 +191,16 @@ var script = defineComponent({
|
|
|
185
191
|
}
|
|
186
192
|
});
|
|
187
193
|
|
|
194
|
+
const _hoisted_1 = {
|
|
195
|
+
class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-md', 'shrink-0'])
|
|
196
|
+
};
|
|
197
|
+
const _hoisted_2 = {
|
|
198
|
+
key: 0,
|
|
199
|
+
class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-sm'])
|
|
200
|
+
};
|
|
201
|
+
const _hoisted_3 = {
|
|
202
|
+
class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-md', 'shrink-0'])
|
|
203
|
+
};
|
|
188
204
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
189
205
|
const _component_OrIcon = resolveComponent("OrIcon");
|
|
190
206
|
const _component_OrButton = resolveComponent("OrButton");
|
|
@@ -193,22 +209,56 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
193
209
|
return openBlock(), createElementBlock("div", {
|
|
194
210
|
ref: 'root',
|
|
195
211
|
class: normalizeClass(_ctx.rootStyles)
|
|
196
|
-
}, [createElementVNode("div", {
|
|
197
|
-
|
|
198
|
-
|
|
212
|
+
}, [createElementVNode("div", _hoisted_1, [_ctx.features.limit ? (openBlock(), createElementBlock("div", _hoisted_2, [createTextVNode(" Per page: "), createVNode(_component_OrButton, {
|
|
213
|
+
ref: 'limitButton',
|
|
214
|
+
class: normalizeClass(_ctx.itemStyles),
|
|
215
|
+
variant: 'link',
|
|
216
|
+
color: 'inherit',
|
|
217
|
+
activated: true,
|
|
218
|
+
onClick: _cache[0] || (_cache[0] = $event => _ctx.limitMenu && _ctx.limitMenu.open())
|
|
219
|
+
}, {
|
|
220
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLimit) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
|
|
221
|
+
icon: _ctx.limitMenu && _ctx.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
222
|
+
}, null, 8 /* PROPS */, ["icon"])]),
|
|
223
|
+
_: 1 /* STABLE */
|
|
224
|
+
}, 8 /* PROPS */, ["class"]), createVNode(_component_OrMenu, {
|
|
225
|
+
ref: 'limitMenu',
|
|
226
|
+
"additional-styles": ['min-w-[60px]'],
|
|
227
|
+
trigger: _ctx.limitButtonRoot,
|
|
228
|
+
placement: 'top'
|
|
229
|
+
}, {
|
|
230
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, limit => {
|
|
231
|
+
return openBlock(), createBlock(_component_OrMenuItem, {
|
|
232
|
+
key: limit,
|
|
233
|
+
selected: _ctx.currentLimit === limit,
|
|
234
|
+
onClick: $event => {
|
|
235
|
+
_ctx.currentLimit = limit;
|
|
236
|
+
_ctx.limitMenu && _ctx.limitMenu.close();
|
|
237
|
+
}
|
|
238
|
+
}, {
|
|
239
|
+
default: withCtx(() => [createTextVNode(toDisplayString(limit), 1 /* TEXT */)]),
|
|
240
|
+
|
|
241
|
+
_: 2 /* DYNAMIC */
|
|
242
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
|
|
243
|
+
}), 128 /* KEYED_FRAGMENT */))]),
|
|
244
|
+
|
|
245
|
+
_: 1 /* STABLE */
|
|
246
|
+
}, 8 /* PROPS */, ["trigger"])])) : createCommentVNode("v-if", true), _ctx.features.range ? (openBlock(), createElementBlock(Fragment, {
|
|
247
|
+
key: 1
|
|
248
|
+
}, [createTextVNode(toDisplayString(_ctx.currentOffset + 1) + "-" + toDisplayString(Math.min(_ctx.currentOffset + _ctx.currentLimit, _ctx.length)) + " of " + toDisplayString(_ctx.length), 1 /* TEXT */)], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)]), createElementVNode("div", _hoisted_3, [createVNode(_component_OrButton, {
|
|
199
249
|
class: normalizeClass(_ctx.itemStyles),
|
|
200
250
|
variant: 'link',
|
|
201
251
|
color: 'inherit',
|
|
202
252
|
disabled: _ctx.currentPage === _ctx.firstPage,
|
|
203
|
-
onClick: _cache[
|
|
253
|
+
onClick: _cache[1] || (_cache[1] = $event => _ctx.toPreviousPage())
|
|
204
254
|
}, {
|
|
205
255
|
default: withCtx(() => [createVNode(_component_OrIcon, {
|
|
206
256
|
icon: 'keyboard_arrow_left'
|
|
207
257
|
})]),
|
|
208
258
|
_: 1 /* STABLE */
|
|
209
|
-
}, 8 /* PROPS */, ["class", "disabled"]), _ctx.isDesktop ? (openBlock(), createElementBlock(Fragment, {
|
|
259
|
+
}, 8 /* PROPS */, ["class", "disabled"]), _ctx.isDesktop ? (openBlock(true), createElementBlock(Fragment, {
|
|
210
260
|
key: 0
|
|
211
|
-
},
|
|
261
|
+
}, renderList(_ctx.buttonGroup, (page, index) => {
|
|
212
262
|
return openBlock(), createBlock(_component_OrButton, {
|
|
213
263
|
key: index,
|
|
214
264
|
class: normalizeClass(_ctx.itemStyles),
|
|
@@ -221,58 +271,43 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
221
271
|
|
|
222
272
|
_: 2 /* DYNAMIC */
|
|
223
273
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "activated", "onClick"]);
|
|
224
|
-
}), 128 /* KEYED_FRAGMENT */)),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
disabled: _ctx.currentPage === _ctx.lastPage,
|
|
229
|
-
onClick: _cache[1] || (_cache[1] = $event => _ctx.toNextPage())
|
|
230
|
-
}, {
|
|
231
|
-
default: withCtx(() => [createVNode(_component_OrIcon, {
|
|
232
|
-
icon: 'keyboard_arrow_right'
|
|
233
|
-
})]),
|
|
234
|
-
_: 1 /* STABLE */
|
|
235
|
-
}, 8 /* PROPS */, ["class", "disabled"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), createElementVNode("div", {
|
|
236
|
-
class: normalizeClass(_ctx.limitControlStyles)
|
|
237
|
-
}, [_ctx.isDesktop ? (openBlock(), createElementBlock(Fragment, {
|
|
238
|
-
key: 0
|
|
239
|
-
}, [createTextVNode(" Per page: ")], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true), createVNode(_component_OrButton, {
|
|
240
|
-
ref: 'limitButton',
|
|
274
|
+
}), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true), _ctx.isMobile ? (openBlock(), createElementBlock(Fragment, {
|
|
275
|
+
key: 1
|
|
276
|
+
}, [createVNode(_component_OrButton, {
|
|
277
|
+
ref: 'offsetButton',
|
|
241
278
|
class: normalizeClass(_ctx.itemStyles),
|
|
242
279
|
variant: 'link',
|
|
243
280
|
color: 'inherit',
|
|
244
281
|
activated: true,
|
|
245
|
-
onClick: _cache[2] || (_cache[2] = $event => _ctx.
|
|
282
|
+
onClick: _cache[2] || (_cache[2] = $event => _ctx.offsetMenu && _ctx.offsetMenu.open())
|
|
246
283
|
}, {
|
|
247
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.
|
|
248
|
-
icon: _ctx.
|
|
284
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentPage) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
|
|
285
|
+
icon: _ctx.offsetMenu && _ctx.offsetMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
249
286
|
}, null, 8 /* PROPS */, ["icon"])]),
|
|
250
287
|
_: 1 /* STABLE */
|
|
251
288
|
}, 8 /* PROPS */, ["class"]), createVNode(_component_OrMenu, {
|
|
252
|
-
ref: '
|
|
289
|
+
ref: 'offsetMenu',
|
|
253
290
|
"additional-styles": ['min-w-[60px]'],
|
|
254
|
-
trigger: _ctx.
|
|
291
|
+
trigger: _ctx.offsetButtonRoot,
|
|
255
292
|
placement: 'top'
|
|
256
293
|
}, {
|
|
257
|
-
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.
|
|
294
|
+
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.lastPage, page => {
|
|
258
295
|
return openBlock(), createBlock(_component_OrMenuItem, {
|
|
259
|
-
key:
|
|
296
|
+
key: page,
|
|
297
|
+
selected: _ctx.currentPage === page,
|
|
260
298
|
onClick: $event => {
|
|
261
|
-
_ctx.
|
|
262
|
-
_ctx.
|
|
299
|
+
_ctx.currentPage = page;
|
|
300
|
+
_ctx.offsetMenu && _ctx.offsetMenu.close();
|
|
263
301
|
}
|
|
264
302
|
}, {
|
|
265
|
-
default: withCtx(() => [createTextVNode(toDisplayString(
|
|
303
|
+
default: withCtx(() => [createTextVNode(toDisplayString(page), 1 /* TEXT */)]),
|
|
266
304
|
|
|
267
305
|
_: 2 /* DYNAMIC */
|
|
268
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
|
|
306
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
|
|
269
307
|
}), 128 /* KEYED_FRAGMENT */))]),
|
|
270
308
|
|
|
271
309
|
_: 1 /* STABLE */
|
|
272
|
-
}, 8 /* PROPS */, ["trigger"])],
|
|
273
|
-
key: 0,
|
|
274
|
-
class: normalizeClass(_ctx.offsetControlStyles)
|
|
275
|
-
}, [createVNode(_component_OrButton, {
|
|
310
|
+
}, 8 /* PROPS */, ["trigger"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true), createVNode(_component_OrButton, {
|
|
276
311
|
class: normalizeClass(_ctx.itemStyles),
|
|
277
312
|
variant: 'link',
|
|
278
313
|
color: 'inherit',
|
|
@@ -283,10 +318,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
283
318
|
icon: 'keyboard_arrow_right'
|
|
284
319
|
})]),
|
|
285
320
|
_: 1 /* STABLE */
|
|
286
|
-
}, 8 /* PROPS */, ["class", "disabled"])]
|
|
321
|
+
}, 8 /* PROPS */, ["class", "disabled"])])], 2 /* CLASS */);
|
|
287
322
|
}
|
|
288
323
|
|
|
289
324
|
script.render = render;
|
|
290
325
|
script.__file = "src/components/or-pagination-v3/OrPagination.vue";
|
|
291
326
|
|
|
292
|
-
export {
|
|
327
|
+
export { Pagination as P, PaginationItem as a, script as s };
|
|
@@ -24,7 +24,7 @@ export { s as OrCombinedInputV3 } from './OrCombinedInputV3-d40e62b4.js';
|
|
|
24
24
|
export { s as OrConfirm } from './OrConfirm-bd123cb5.js';
|
|
25
25
|
export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-eec76b11.js';
|
|
26
26
|
export { default as OrContextMenuV3 } from './OrContextMenuV3/OrContextMenu.js';
|
|
27
|
-
export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-
|
|
27
|
+
export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-53537045.js';
|
|
28
28
|
export { s as OrDateFormatV3 } from './OrDateFormatV3-658550ce.js';
|
|
29
29
|
export { s as OrDatePickerV3 } from './OrDatePickerV3-066be001.js';
|
|
30
30
|
export { s as OrDateRangePickerV3 } from './OrDateRangePickerV3-6811c529.js';
|
|
@@ -71,7 +71,7 @@ export { default as OrNumberInput } from './OrNumberInput/OrNumberInput.js';
|
|
|
71
71
|
export { default as OrOverflowMenu } from './OrOverflowMenu/OrOverflowMenu.js';
|
|
72
72
|
export { default as OrOverlay } from './OrOverlay/OrOverlay.js';
|
|
73
73
|
export { s as OrOverlayV3 } from './OrOverlayV3-275d0680.js';
|
|
74
|
-
export { s as OrPaginationV3 } from './OrPaginationV3-
|
|
74
|
+
export { s as OrPaginationV3 } from './OrPaginationV3-4576ee90.js';
|
|
75
75
|
export { default as OrPassword } from './OrPassword/OrPassword.js';
|
|
76
76
|
export { s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, i as isPrevented } from './OrPopoverV3-7ef8c72d.js';
|
|
77
77
|
export { s as OrProgress, O as OrProgressColors, a as OrProgressTypes } from './OrProgress-e6b79b1d.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -16,7 +16,7 @@ export { s as OrCombinedInputV3 } from './components/OrCombinedInputV3-d40e62b4.
|
|
|
16
16
|
export { s as OrConfirm } from './components/OrConfirm-bd123cb5.js';
|
|
17
17
|
export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-eec76b11.js';
|
|
18
18
|
export { default as OrContextMenuV3 } from './components/OrContextMenuV3/OrContextMenu.js';
|
|
19
|
-
export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-
|
|
19
|
+
export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-53537045.js';
|
|
20
20
|
export { s as OrDateFormatV3 } from './components/OrDateFormatV3-658550ce.js';
|
|
21
21
|
export { s as OrDatePickerV3 } from './components/OrDatePickerV3-066be001.js';
|
|
22
22
|
export { s as OrDateRangePickerV3 } from './components/OrDateRangePickerV3-6811c529.js';
|
|
@@ -107,7 +107,7 @@ export { s as OrModal, O as OrModalSizes } from './components/OrModal-101a726d.j
|
|
|
107
107
|
export { M as ModalSize, s as OrModalV3 } from './components/OrModalV3-ab4d21f5.js';
|
|
108
108
|
export { default as OrOverlay } from './components/OrOverlay/OrOverlay.js';
|
|
109
109
|
export { s as OrOverlayV3 } from './components/OrOverlayV3-275d0680.js';
|
|
110
|
-
export { s as OrPaginationV3 } from './components/OrPaginationV3-
|
|
110
|
+
export { s as OrPaginationV3 } from './components/OrPaginationV3-4576ee90.js';
|
|
111
111
|
export { s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, i as isPrevented } from './components/OrPopoverV3-7ef8c72d.js';
|
|
112
112
|
export { s as OrProgress, O as OrProgressColors, a as OrProgressTypes } from './components/OrProgress-e6b79b1d.js';
|
|
113
113
|
export { s as OrRadioV3 } from './components/OrRadioV3-813551a4.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
2
|
import { _ as __vue_component__$1 } from './OrCheckbox-2536a62d.js';
|
|
3
|
-
import { _ as __vue_component__$f } from './OrPagination-
|
|
3
|
+
import { _ as __vue_component__$f } from './OrPagination-2d6fbd4b.js';
|
|
4
4
|
import { _ as __vue_component__$g } from './OrSearch-5e325974.js';
|
|
5
5
|
import { _ as __vue_component__$2, a as __vue_component__$3, b as __vue_component__$4, c as __vue_component__$5, d as __vue_component__$6, e as __vue_component__$7, f as __vue_component__$8, g as __vue_component__$9, h as __vue_component__$a, i as __vue_component__$b, j as __vue_component__$c, k as __vue_component__$d, l as __vue_component__$e, D as DataGridVariant } from './OrDataGridToolbar-4611a09b.js';
|
|
6
6
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
@@ -12,7 +12,7 @@ import { _ as __vue_component__$4 } from './OrMenuItem-fd2b15dc.js';
|
|
|
12
12
|
import { _ as __vue_component__$3 } from './OrMenu-c44856c5.js';
|
|
13
13
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const Pagination = [
|
|
16
16
|
// Layout
|
|
17
17
|
'layout-row',
|
|
18
18
|
// Spacing
|
|
@@ -21,16 +21,6 @@ const PaginationRoot = [
|
|
|
21
21
|
'typography-caption-regular',
|
|
22
22
|
// Theme
|
|
23
23
|
'theme-foreground-outline', 'dark:theme-foreground-outline-dark'];
|
|
24
|
-
const PaginationOffsetControl = [
|
|
25
|
-
// Layout
|
|
26
|
-
'layout-row',
|
|
27
|
-
// Spacing
|
|
28
|
-
'gap-md'];
|
|
29
|
-
const PaginationLimitControl = [
|
|
30
|
-
// Layout
|
|
31
|
-
'layout-row',
|
|
32
|
-
// Spacing
|
|
33
|
-
'gap-sm'];
|
|
34
24
|
const PaginationItem = [
|
|
35
25
|
// Typography
|
|
36
26
|
'typography-caption-regular',
|
|
@@ -61,13 +51,21 @@ var script = defineComponent({
|
|
|
61
51
|
options: {
|
|
62
52
|
type: Array,
|
|
63
53
|
default: () => [50, 20, 10, 5]
|
|
54
|
+
},
|
|
55
|
+
features: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => ({
|
|
58
|
+
limit: true,
|
|
59
|
+
range: true
|
|
60
|
+
})
|
|
64
61
|
}
|
|
65
62
|
},
|
|
66
63
|
emits: ['update:modelValue'],
|
|
67
64
|
expose: ['root'],
|
|
68
65
|
setup(props, context) {
|
|
69
|
-
// Refs
|
|
66
|
+
// Refs & Styles
|
|
70
67
|
const root = ref();
|
|
68
|
+
const rootStyles = computed(() => ['or-pagination-v3', ...Pagination]);
|
|
71
69
|
const limitButton = ref();
|
|
72
70
|
const limitButtonRoot = computed(() => {
|
|
73
71
|
var _a;
|
|
@@ -78,20 +76,26 @@ var script = defineComponent({
|
|
|
78
76
|
var _a;
|
|
79
77
|
return (_a = limitMenu.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
80
78
|
});
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
const offsetButton = ref();
|
|
80
|
+
const offsetButtonRoot = computed(() => {
|
|
81
|
+
var _a;
|
|
82
|
+
return (_a = offsetButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
83
|
+
});
|
|
84
|
+
const offsetMenu = ref();
|
|
85
|
+
const offsetMenuRoot = computed(() => {
|
|
86
|
+
var _a;
|
|
87
|
+
return (_a = offsetMenu.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
88
|
+
});
|
|
85
89
|
const itemStyles = computed(() => [...PaginationItem]);
|
|
86
90
|
// State
|
|
87
|
-
const
|
|
91
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
88
92
|
const currentLimit = computed({
|
|
89
93
|
get: () => {
|
|
90
94
|
var _a, _b;
|
|
91
|
-
return (_b = (_a =
|
|
95
|
+
return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
|
|
92
96
|
},
|
|
93
97
|
set: value => {
|
|
94
|
-
|
|
98
|
+
model.value = {
|
|
95
99
|
limit: value,
|
|
96
100
|
offset: 0
|
|
97
101
|
};
|
|
@@ -100,10 +104,10 @@ var script = defineComponent({
|
|
|
100
104
|
const currentOffset = computed({
|
|
101
105
|
get: () => {
|
|
102
106
|
var _a, _b;
|
|
103
|
-
return (_b = (_a =
|
|
107
|
+
return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
|
|
104
108
|
},
|
|
105
109
|
set: value => {
|
|
106
|
-
|
|
110
|
+
model.value = {
|
|
107
111
|
limit: currentLimit.value,
|
|
108
112
|
offset: value
|
|
109
113
|
};
|
|
@@ -166,15 +170,17 @@ var script = defineComponent({
|
|
|
166
170
|
} = useResponsive();
|
|
167
171
|
return {
|
|
168
172
|
root,
|
|
173
|
+
rootStyles,
|
|
169
174
|
limitButton,
|
|
170
175
|
limitButtonRoot,
|
|
171
176
|
limitMenu,
|
|
172
177
|
limitMenuRoot,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
offsetButton,
|
|
179
|
+
offsetButtonRoot,
|
|
180
|
+
offsetMenu,
|
|
181
|
+
offsetMenuRoot,
|
|
176
182
|
itemStyles,
|
|
177
|
-
|
|
183
|
+
model,
|
|
178
184
|
currentLimit,
|
|
179
185
|
currentOffset,
|
|
180
186
|
currentPage,
|
|
@@ -202,7 +208,48 @@ var __vue_render__ = function () {
|
|
|
202
208
|
ref: 'root',
|
|
203
209
|
class: _vm.rootStyles
|
|
204
210
|
}, [_c('div', {
|
|
205
|
-
class:
|
|
211
|
+
class: ['layout-row', 'gap-md', 'shrink-0']
|
|
212
|
+
}, [_vm.features.limit ? [_c('div', {
|
|
213
|
+
class: ['layout-row', 'gap-sm']
|
|
214
|
+
}, [_vm._v("\n Per page:\n\n "), _c('OrButton', {
|
|
215
|
+
ref: 'limitButton',
|
|
216
|
+
class: _vm.itemStyles,
|
|
217
|
+
attrs: {
|
|
218
|
+
"variant": 'link',
|
|
219
|
+
"color": 'inherit',
|
|
220
|
+
"activated": true
|
|
221
|
+
},
|
|
222
|
+
on: {
|
|
223
|
+
"click": function ($event) {
|
|
224
|
+
_vm.limitMenu && _vm.limitMenu.open();
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}, [_vm._v("\n " + _vm._s(_vm.currentLimit) + " "), _c('OrIcon', {
|
|
228
|
+
attrs: {
|
|
229
|
+
"icon": _vm.limitMenu && _vm.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
230
|
+
}
|
|
231
|
+
})], 1), _vm._v(" "), _c('OrMenu', {
|
|
232
|
+
ref: 'limitMenu',
|
|
233
|
+
attrs: {
|
|
234
|
+
"additional-styles": ['min-w-[60px]'],
|
|
235
|
+
"trigger": _vm.limitButtonRoot,
|
|
236
|
+
"placement": 'top'
|
|
237
|
+
}
|
|
238
|
+
}, _vm._l(_vm.options, function (limit) {
|
|
239
|
+
return _c('OrMenuItem', {
|
|
240
|
+
key: limit,
|
|
241
|
+
attrs: {
|
|
242
|
+
"selected": _vm.currentLimit === limit
|
|
243
|
+
},
|
|
244
|
+
on: {
|
|
245
|
+
"click": function ($event) {
|
|
246
|
+
_vm.currentLimit = limit;
|
|
247
|
+
_vm.limitMenu && _vm.limitMenu.close();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}, [_vm._v("\n " + _vm._s(limit) + "\n ")]);
|
|
251
|
+
}), 1)], 1)] : _vm._e(), _vm._v(" "), _vm.features.range ? [_vm._v("\n " + _vm._s(_vm.currentOffset + 1) + "-" + _vm._s(Math.min(_vm.currentOffset + _vm.currentLimit, _vm.length)) + " of " + _vm._s(_vm.length) + "\n ")] : _vm._e()], 2), _vm._v(" "), _c('div', {
|
|
252
|
+
class: ['layout-row', 'gap-md', 'shrink-0']
|
|
206
253
|
}, [_c('OrButton', {
|
|
207
254
|
class: _vm.itemStyles,
|
|
208
255
|
attrs: {
|
|
@@ -219,7 +266,7 @@ var __vue_render__ = function () {
|
|
|
219
266
|
attrs: {
|
|
220
267
|
"icon": 'keyboard_arrow_left'
|
|
221
268
|
}
|
|
222
|
-
})], 1), _vm._v(" "), _vm.isDesktop ?
|
|
269
|
+
})], 1), _vm._v(" "), _vm.isDesktop ? _vm._l(_vm.buttonGroup, function (page, index) {
|
|
223
270
|
return _c('OrButton', {
|
|
224
271
|
key: index,
|
|
225
272
|
class: _vm.itemStyles,
|
|
@@ -234,26 +281,8 @@ var __vue_render__ = function () {
|
|
|
234
281
|
}
|
|
235
282
|
}
|
|
236
283
|
}, [_vm._v("\n " + _vm._s(page) + "\n ")]);
|
|
237
|
-
}), _vm._v(" "), _c('OrButton', {
|
|
238
|
-
|
|
239
|
-
attrs: {
|
|
240
|
-
"variant": 'link',
|
|
241
|
-
"color": 'inherit',
|
|
242
|
-
"disabled": _vm.currentPage === _vm.lastPage
|
|
243
|
-
},
|
|
244
|
-
on: {
|
|
245
|
-
"click": function ($event) {
|
|
246
|
-
return _vm.toNextPage();
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}, [_c('OrIcon', {
|
|
250
|
-
attrs: {
|
|
251
|
-
"icon": 'keyboard_arrow_right'
|
|
252
|
-
}
|
|
253
|
-
})], 1)] : _vm._e()], 2), _vm._v(" "), _c('div', {
|
|
254
|
-
class: _vm.limitControlStyles
|
|
255
|
-
}, [_vm.isDesktop ? [_vm._v("\n Per page:\n ")] : _vm._e(), _vm._v(" "), _c('OrButton', {
|
|
256
|
-
ref: 'limitButton',
|
|
284
|
+
}) : _vm._e(), _vm._v(" "), _vm.isMobile ? [_c('OrButton', {
|
|
285
|
+
ref: 'offsetButton',
|
|
257
286
|
class: _vm.itemStyles,
|
|
258
287
|
attrs: {
|
|
259
288
|
"variant": 'link',
|
|
@@ -262,33 +291,34 @@ var __vue_render__ = function () {
|
|
|
262
291
|
},
|
|
263
292
|
on: {
|
|
264
293
|
"click": function ($event) {
|
|
265
|
-
_vm.
|
|
294
|
+
_vm.offsetMenu && _vm.offsetMenu.open();
|
|
266
295
|
}
|
|
267
296
|
}
|
|
268
|
-
}, [_vm._v("\n
|
|
297
|
+
}, [_vm._v("\n " + _vm._s(_vm.currentPage) + " "), _c('OrIcon', {
|
|
269
298
|
attrs: {
|
|
270
|
-
"icon": _vm.
|
|
299
|
+
"icon": _vm.offsetMenu && _vm.offsetMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
|
|
271
300
|
}
|
|
272
301
|
})], 1), _vm._v(" "), _c('OrMenu', {
|
|
273
|
-
ref: '
|
|
302
|
+
ref: 'offsetMenu',
|
|
274
303
|
attrs: {
|
|
275
304
|
"additional-styles": ['min-w-[60px]'],
|
|
276
|
-
"trigger": _vm.
|
|
305
|
+
"trigger": _vm.offsetButtonRoot,
|
|
277
306
|
"placement": 'top'
|
|
278
307
|
}
|
|
279
|
-
}, _vm._l(_vm.
|
|
308
|
+
}, _vm._l(_vm.lastPage, function (page) {
|
|
280
309
|
return _c('OrMenuItem', {
|
|
281
|
-
key:
|
|
310
|
+
key: page,
|
|
311
|
+
attrs: {
|
|
312
|
+
"selected": _vm.currentPage === page
|
|
313
|
+
},
|
|
282
314
|
on: {
|
|
283
315
|
"click": function ($event) {
|
|
284
|
-
_vm.
|
|
285
|
-
_vm.
|
|
316
|
+
_vm.currentPage = page;
|
|
317
|
+
_vm.offsetMenu && _vm.offsetMenu.close();
|
|
286
318
|
}
|
|
287
319
|
}
|
|
288
|
-
}, [_vm._v("\n
|
|
289
|
-
}), 1)]
|
|
290
|
-
class: _vm.offsetControlStyles
|
|
291
|
-
}, [_c('OrButton', {
|
|
320
|
+
}, [_vm._v("\n " + _vm._s(page) + "\n ")]);
|
|
321
|
+
}), 1)] : _vm._e(), _vm._v(" "), _c('OrButton', {
|
|
292
322
|
class: _vm.itemStyles,
|
|
293
323
|
attrs: {
|
|
294
324
|
"variant": 'link',
|
|
@@ -304,7 +334,7 @@ var __vue_render__ = function () {
|
|
|
304
334
|
attrs: {
|
|
305
335
|
"icon": 'keyboard_arrow_right'
|
|
306
336
|
}
|
|
307
|
-
})], 1)],
|
|
337
|
+
})], 1)], 2)]);
|
|
308
338
|
};
|
|
309
339
|
var __vue_staticRenderFns__ = [];
|
|
310
340
|
|
|
@@ -34,7 +34,7 @@ export { _ as OrCombinedInputV3 } from '../OrCombinedInput-4b19d4b3.js';
|
|
|
34
34
|
export { _ as OrConfirm } from '../OrConfirm-4b5fdad4.js';
|
|
35
35
|
export { C as ConfirmType, _ as OrConfirmV3 } from '../OrConfirm-b97c00de.js';
|
|
36
36
|
export { _ as OrContextMenuV3 } from '../OrContextMenu-180a83f8.js';
|
|
37
|
-
export { _ as OrDataGridV3 } from '../OrDataGrid-
|
|
37
|
+
export { _ as OrDataGridV3 } from '../OrDataGrid-9e29b831.js';
|
|
38
38
|
export { D as DataGridVariant } from '../OrDataGridToolbar-4611a09b.js';
|
|
39
39
|
export { _ as OrDateFormatV3 } from '../OrDateFormat-5122f872.js';
|
|
40
40
|
export { _ as OrDatePickerV3 } from '../OrDatePicker-83367e4e.js';
|
|
@@ -89,7 +89,7 @@ export { _ as OrNumberInput } from '../OrNumberInput-b00163b4.js';
|
|
|
89
89
|
export { _ as OrOverflowMenu } from '../OrOverflowMenu-7be5525a.js';
|
|
90
90
|
export { _ as OrOverlay } from '../OrOverlay-ccec2218.js';
|
|
91
91
|
export { _ as OrOverlayV3 } from '../OrOverlay-23008721.js';
|
|
92
|
-
export { _ as OrPaginationV3 } from '../OrPagination-
|
|
92
|
+
export { _ as OrPaginationV3 } from '../OrPagination-2d6fbd4b.js';
|
|
93
93
|
export { _ as OrPassword } from '../OrPassword-d530c522.js';
|
|
94
94
|
export { _ as OrPopoverV3, a as PopoverPlacement, P as PopoverVariant } from '../OrPopover-8c1fdbe0.js';
|
|
95
95
|
export { i as isPrevented } from '../isPrevented-b151a948.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _ as OrDataGridV3 } from '../../OrDataGrid-
|
|
1
|
+
export { _ as OrDataGridV3 } from '../../OrDataGrid-9e29b831.js';
|
|
2
2
|
export { D as DataGridVariant } from '../../OrDataGridToolbar-4611a09b.js';
|
|
3
3
|
import 'vue-demi';
|
|
4
4
|
import '../../OrCheckbox-2536a62d.js';
|
|
@@ -17,7 +17,7 @@ import '@onereach/styles/tailwind.config.json';
|
|
|
17
17
|
import '../../OrLabel-bf7e2ea2.js';
|
|
18
18
|
import '../../normalize-component-6e8e3d80.js';
|
|
19
19
|
import '../../style-inject.es-4c6f2515.js';
|
|
20
|
-
import '../../OrPagination-
|
|
20
|
+
import '../../OrPagination-2d6fbd4b.js';
|
|
21
21
|
import '../../useResponsive-1baf3485.js';
|
|
22
22
|
import '../../OrButton-3a743a90.js';
|
|
23
23
|
import '../../OrButton.vue_rollup-plugin-vue_script-e8900483.js';
|