@onereach/ui-components 11.2.1 → 11.2.2-beta.4404.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.
Files changed (40) hide show
  1. package/dist/bundled/v2/components/OrDataGridV3/OrDataGrid.js +1 -1
  2. package/dist/bundled/v2/components/OrDataGridV3/index.js +1 -1
  3. package/dist/bundled/v2/components/OrPaginationV3/OrPagination.js +84 -51
  4. package/dist/bundled/v2/components/OrPaginationV3/OrPagination.vue.d.ts +28 -8
  5. package/dist/bundled/v2/components/OrPaginationV3/styles.d.ts +1 -3
  6. package/dist/bundled/v2/components/OrPaginationV3/styles.js +2 -12
  7. package/dist/bundled/v2/components/index.js +1 -1
  8. package/dist/bundled/v2/index.js +1 -1
  9. package/dist/bundled/v3/components/OrDataGridV3/OrDataGrid.js +1 -1
  10. package/dist/bundled/v3/components/OrDataGridV3/index.js +1 -1
  11. package/dist/bundled/v3/components/OrDataGridV3/styles.js +1 -1
  12. package/dist/bundled/v3/components/{OrDataGridV3-355e1035.js → OrDataGridV3-7fd8849b.js} +1 -1
  13. package/dist/bundled/v3/components/OrPaginationV3/OrPagination.js +1 -1
  14. package/dist/bundled/v3/components/OrPaginationV3/OrPagination.vue.d.ts +6 -4
  15. package/dist/bundled/v3/components/OrPaginationV3/index.js +1 -1
  16. package/dist/bundled/v3/components/OrPaginationV3/styles.d.ts +1 -3
  17. package/dist/bundled/v3/components/OrPaginationV3/styles.js +1 -1
  18. package/dist/bundled/v3/components/{OrPaginationV3-48298a86.js → OrPaginationV3-56fef1c8.js} +91 -66
  19. package/dist/bundled/v3/components/index.js +2 -2
  20. package/dist/bundled/v3/index.js +2 -2
  21. package/dist/esm/v2/{OrDataGrid-5bd153f2.js → OrDataGrid-4b340a70.js} +1 -1
  22. package/dist/esm/v2/{OrPagination-fb249225.js → OrPagination-65905270.js} +84 -61
  23. package/dist/esm/v2/components/index.js +2 -2
  24. package/dist/esm/v2/components/or-data-grid-v3/index.js +2 -2
  25. package/dist/esm/v2/components/or-pagination-v3/OrPagination.vue.d.ts +28 -8
  26. package/dist/esm/v2/components/or-pagination-v3/index.js +1 -1
  27. package/dist/esm/v2/components/or-pagination-v3/styles.d.ts +1 -3
  28. package/dist/esm/v2/index.js +2 -2
  29. package/dist/esm/v3/{OrDataGrid-cb75d875.js → OrDataGrid-edbbcc99.js} +1 -1
  30. package/dist/esm/v3/{OrPagination-c3611352.js → OrPagination-8c87faeb.js} +90 -65
  31. package/dist/esm/v3/components/index.js +2 -2
  32. package/dist/esm/v3/components/or-data-grid-v3/index.js +2 -2
  33. package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +6 -4
  34. package/dist/esm/v3/components/or-pagination-v3/index.js +1 -1
  35. package/dist/esm/v3/components/or-pagination-v3/styles.d.ts +1 -3
  36. package/dist/esm/v3/index.js +2 -2
  37. package/package.json +2 -3
  38. package/src/components/or-pagination-v3/OrPagination.vue +95 -67
  39. package/src/components/or-pagination-v3/styles.ts +1 -17
  40. /package/dist/bundled/v2/{OrDataGrid-59e12d35.js → OrDataGrid-e20adf12.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, withCtx, Fragment, renderList, createBlock, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
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-aafbb72d.js';
4
4
  import { s as script$2 } from './OrIconV3-34670800.js';
@@ -7,7 +7,7 @@ import { s as script$4 } from './OrMenuItemV3-5f2de195.js';
7
7
  import { useProxyModelValue } from '../hooks/useProxyModelValue.js';
8
8
  import useResponsive from '../hooks/useResponsive/useResponsive.js';
9
9
 
10
- const PaginationRoot = [
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',
@@ -61,8 +51,9 @@ var script = defineComponent({
61
51
  emits: ['update:modelValue'],
62
52
  expose: ['root'],
63
53
  setup(props, context) {
64
- // Refs
54
+ // Refs & Styles
65
55
  const root = ref();
56
+ const rootStyles = computed(() => ['or-pagination-v3', ...Pagination]);
66
57
  const limitButton = ref();
67
58
  const limitButtonRoot = computed(() => {
68
59
  var _a;
@@ -73,20 +64,26 @@ var script = defineComponent({
73
64
  var _a;
74
65
  return (_a = limitMenu.value) === null || _a === void 0 ? void 0 : _a.root;
75
66
  });
76
- // Styles
77
- const rootStyles = computed(() => ['or-pagination-v3', ...PaginationRoot]);
78
- const offsetControlStyles = computed(() => [...PaginationOffsetControl]);
79
- const limitControlStyles = computed(() => [...PaginationLimitControl]);
67
+ const offsetButton = ref();
68
+ const offsetButtonRoot = computed(() => {
69
+ var _a;
70
+ return (_a = offsetButton.value) === null || _a === void 0 ? void 0 : _a.root;
71
+ });
72
+ const offsetMenu = ref();
73
+ const offsetMenuRoot = computed(() => {
74
+ var _a;
75
+ return (_a = offsetMenu.value) === null || _a === void 0 ? void 0 : _a.root;
76
+ });
80
77
  const itemStyles = computed(() => [...PaginationItem]);
81
78
  // State
82
- const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
79
+ const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
83
80
  const currentLimit = computed({
84
81
  get: () => {
85
82
  var _a, _b;
86
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
83
+ return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
87
84
  },
88
85
  set: value => {
89
- proxyModelValue.value = {
86
+ model.value = {
90
87
  limit: value,
91
88
  offset: 0
92
89
  };
@@ -95,10 +92,10 @@ var script = defineComponent({
95
92
  const currentOffset = computed({
96
93
  get: () => {
97
94
  var _a, _b;
98
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
95
+ return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
99
96
  },
100
97
  set: value => {
101
- proxyModelValue.value = {
98
+ model.value = {
102
99
  limit: currentLimit.value,
103
100
  offset: value
104
101
  };
@@ -161,15 +158,17 @@ var script = defineComponent({
161
158
  } = useResponsive();
162
159
  return {
163
160
  root,
161
+ rootStyles,
164
162
  limitButton,
165
163
  limitButtonRoot,
166
164
  limitMenu,
167
165
  limitMenuRoot,
168
- rootStyles,
169
- offsetControlStyles,
170
- limitControlStyles,
166
+ offsetButton,
167
+ offsetButtonRoot,
168
+ offsetMenu,
169
+ offsetMenuRoot,
171
170
  itemStyles,
172
- proxyModelValue,
171
+ model,
173
172
  currentLimit,
174
173
  currentOffset,
175
174
  currentPage,
@@ -185,6 +184,15 @@ var script = defineComponent({
185
184
  }
186
185
  });
187
186
 
187
+ const _hoisted_1 = {
188
+ class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-md', 'shrink-0'])
189
+ };
190
+ const _hoisted_2 = {
191
+ class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-sm'])
192
+ };
193
+ const _hoisted_3 = {
194
+ class: /*#__PURE__*/normalizeClass(['layout-row', 'gap-md', 'shrink-0'])
195
+ };
188
196
  function render(_ctx, _cache, $props, $setup, $data, $options) {
189
197
  const _component_OrIcon = resolveComponent("OrIcon");
190
198
  const _component_OrButton = resolveComponent("OrButton");
@@ -193,22 +201,54 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
193
201
  return openBlock(), createElementBlock("div", {
194
202
  ref: 'root',
195
203
  class: normalizeClass(_ctx.rootStyles)
196
- }, [createElementVNode("div", {
197
- class: normalizeClass(_ctx.offsetControlStyles)
198
- }, [createVNode(_component_OrButton, {
204
+ }, [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [createTextVNode(" Per page: "), createVNode(_component_OrButton, {
205
+ ref: 'limitButton',
206
+ class: normalizeClass(_ctx.itemStyles),
207
+ variant: 'link',
208
+ color: 'inherit',
209
+ activated: true,
210
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.limitMenu && _ctx.limitMenu.open())
211
+ }, {
212
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLimit) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
213
+ icon: _ctx.limitMenu && _ctx.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
214
+ }, null, 8 /* PROPS */, ["icon"])]),
215
+ _: 1 /* STABLE */
216
+ }, 8 /* PROPS */, ["class"]), createVNode(_component_OrMenu, {
217
+ ref: 'limitMenu',
218
+ "additional-styles": ['min-w-[60px]'],
219
+ trigger: _ctx.limitButtonRoot,
220
+ placement: 'top'
221
+ }, {
222
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, limit => {
223
+ return openBlock(), createBlock(_component_OrMenuItem, {
224
+ key: limit,
225
+ selected: _ctx.currentLimit === limit,
226
+ onClick: $event => {
227
+ _ctx.currentLimit = limit;
228
+ _ctx.limitMenu && _ctx.limitMenu.close();
229
+ }
230
+ }, {
231
+ default: withCtx(() => [createTextVNode(toDisplayString(limit), 1 /* TEXT */)]),
232
+
233
+ _: 2 /* DYNAMIC */
234
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
235
+ }), 128 /* KEYED_FRAGMENT */))]),
236
+
237
+ _: 1 /* STABLE */
238
+ }, 8 /* PROPS */, ["trigger"])]), createTextVNode(" " + toDisplayString(_ctx.currentOffset + 1) + "-" + toDisplayString(Math.min(_ctx.currentOffset + _ctx.currentLimit, _ctx.length)) + " of " + toDisplayString(_ctx.length), 1 /* TEXT */)]), createElementVNode("div", _hoisted_3, [createVNode(_component_OrButton, {
199
239
  class: normalizeClass(_ctx.itemStyles),
200
240
  variant: 'link',
201
241
  color: 'inherit',
202
242
  disabled: _ctx.currentPage === _ctx.firstPage,
203
- onClick: _cache[0] || (_cache[0] = $event => _ctx.toPreviousPage())
243
+ onClick: _cache[1] || (_cache[1] = $event => _ctx.toPreviousPage())
204
244
  }, {
205
245
  default: withCtx(() => [createVNode(_component_OrIcon, {
206
246
  icon: 'keyboard_arrow_left'
207
247
  })]),
208
248
  _: 1 /* STABLE */
209
- }, 8 /* PROPS */, ["class", "disabled"]), _ctx.isDesktop ? (openBlock(), createElementBlock(Fragment, {
249
+ }, 8 /* PROPS */, ["class", "disabled"]), _ctx.isDesktop ? (openBlock(true), createElementBlock(Fragment, {
210
250
  key: 0
211
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttonGroup, (page, index) => {
251
+ }, renderList(_ctx.buttonGroup, (page, index) => {
212
252
  return openBlock(), createBlock(_component_OrButton, {
213
253
  key: index,
214
254
  class: normalizeClass(_ctx.itemStyles),
@@ -221,58 +261,43 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
221
261
 
222
262
  _: 2 /* DYNAMIC */
223
263
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "activated", "onClick"]);
224
- }), 128 /* KEYED_FRAGMENT */)), createVNode(_component_OrButton, {
225
- class: normalizeClass(_ctx.itemStyles),
226
- variant: 'link',
227
- color: 'inherit',
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',
264
+ }), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true), _ctx.isMobile ? (openBlock(), createElementBlock(Fragment, {
265
+ key: 1
266
+ }, [createVNode(_component_OrButton, {
267
+ ref: 'offsetButton',
241
268
  class: normalizeClass(_ctx.itemStyles),
242
269
  variant: 'link',
243
270
  color: 'inherit',
244
271
  activated: true,
245
- onClick: _cache[2] || (_cache[2] = $event => _ctx.limitMenu && _ctx.limitMenu.open())
272
+ onClick: _cache[2] || (_cache[2] = $event => _ctx.offsetMenu && _ctx.offsetMenu.open())
246
273
  }, {
247
- default: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentLimit) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
248
- icon: _ctx.limitMenu && _ctx.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
274
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.currentPage) + " ", 1 /* TEXT */), createVNode(_component_OrIcon, {
275
+ icon: _ctx.offsetMenu && _ctx.offsetMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
249
276
  }, null, 8 /* PROPS */, ["icon"])]),
250
277
  _: 1 /* STABLE */
251
278
  }, 8 /* PROPS */, ["class"]), createVNode(_component_OrMenu, {
252
- ref: 'limitMenu',
279
+ ref: 'offsetMenu',
253
280
  "additional-styles": ['min-w-[60px]'],
254
- trigger: _ctx.limitButtonRoot,
281
+ trigger: _ctx.offsetButtonRoot,
255
282
  placement: 'top'
256
283
  }, {
257
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, pageSize => {
284
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.lastPage, page => {
258
285
  return openBlock(), createBlock(_component_OrMenuItem, {
259
- key: pageSize,
286
+ key: page,
287
+ selected: _ctx.currentPage === page,
260
288
  onClick: $event => {
261
- _ctx.currentLimit = pageSize;
262
- _ctx.limitMenu && _ctx.limitMenu.close();
289
+ _ctx.currentPage = page;
290
+ _ctx.offsetMenu && _ctx.offsetMenu.close();
263
291
  }
264
292
  }, {
265
- default: withCtx(() => [createTextVNode(toDisplayString(pageSize), 1 /* TEXT */)]),
293
+ default: withCtx(() => [createTextVNode(toDisplayString(page), 1 /* TEXT */)]),
266
294
 
267
295
  _: 2 /* DYNAMIC */
268
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
296
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["selected", "onClick"]);
269
297
  }), 128 /* KEYED_FRAGMENT */))]),
270
298
 
271
299
  _: 1 /* STABLE */
272
- }, 8 /* PROPS */, ["trigger"])], 2 /* CLASS */), _ctx.isMobile ? (openBlock(), createElementBlock("div", {
273
- key: 0,
274
- class: normalizeClass(_ctx.offsetControlStyles)
275
- }, [createVNode(_component_OrButton, {
300
+ }, 8 /* PROPS */, ["trigger"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true), createVNode(_component_OrButton, {
276
301
  class: normalizeClass(_ctx.itemStyles),
277
302
  variant: 'link',
278
303
  color: 'inherit',
@@ -283,10 +308,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
283
308
  icon: 'keyboard_arrow_right'
284
309
  })]),
285
310
  _: 1 /* STABLE */
286
- }, 8 /* PROPS */, ["class", "disabled"])], 2 /* CLASS */)) : createCommentVNode("v-if", true)], 2 /* CLASS */);
311
+ }, 8 /* PROPS */, ["class", "disabled"])])], 2 /* CLASS */);
287
312
  }
288
313
 
289
314
  script.render = render;
290
315
  script.__file = "src/components/or-pagination-v3/OrPagination.vue";
291
316
 
292
- export { PaginationRoot as P, PaginationOffsetControl as a, PaginationLimitControl as b, PaginationItem as c, script as s };
317
+ 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-79d6aa9d.js';
25
25
  export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-d9009637.js';
26
26
  export { default as OrContextMenuV3 } from './OrContextMenuV3/OrContextMenu.js';
27
- export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-355e1035.js';
27
+ export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-7fd8849b.js';
28
28
  export { s as OrDateFormatV3 } from './OrDateFormatV3-6c1550b8.js';
29
29
  export { s as OrDatePickerV3 } from './OrDatePickerV3-2d1e069f.js';
30
30
  export { s as OrDateRangePickerV3 } from './OrDateRangePickerV3-4d9da4ff.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-3b86ceef.js';
74
- export { s as OrPaginationV3 } from './OrPaginationV3-48298a86.js';
74
+ export { s as OrPaginationV3 } from './OrPaginationV3-56fef1c8.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-f875bf63.js';
77
77
  export { s as OrProgress, O as OrProgressColors, a as OrProgressTypes } from './OrProgress-e13c60a5.js';
@@ -16,7 +16,7 @@ export { s as OrCombinedInputV3 } from './components/OrCombinedInputV3-d40e62b4.
16
16
  export { s as OrConfirm } from './components/OrConfirm-79d6aa9d.js';
17
17
  export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-d9009637.js';
18
18
  export { default as OrContextMenuV3 } from './components/OrContextMenuV3/OrContextMenu.js';
19
- export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-355e1035.js';
19
+ export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-7fd8849b.js';
20
20
  export { s as OrDateFormatV3 } from './components/OrDateFormatV3-6c1550b8.js';
21
21
  export { s as OrDatePickerV3 } from './components/OrDatePickerV3-2d1e069f.js';
22
22
  export { s as OrDateRangePickerV3 } from './components/OrDateRangePickerV3-4d9da4ff.js';
@@ -107,7 +107,7 @@ export { s as OrModal, O as OrModalSizes } from './components/OrModal-dd0677b2.j
107
107
  export { M as ModalSize, s as OrModalV3 } from './components/OrModalV3-246c9217.js';
108
108
  export { default as OrOverlay } from './components/OrOverlay/OrOverlay.js';
109
109
  export { s as OrOverlayV3 } from './components/OrOverlayV3-3b86ceef.js';
110
- export { s as OrPaginationV3 } from './components/OrPaginationV3-48298a86.js';
110
+ export { s as OrPaginationV3 } from './components/OrPaginationV3-56fef1c8.js';
111
111
  export { s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, i as isPrevented } from './components/OrPopoverV3-f875bf63.js';
112
112
  export { s as OrProgress, O as OrProgressColors, a as OrProgressTypes } from './components/OrProgress-e13c60a5.js';
113
113
  export { s as OrRadioV3 } from './components/OrRadioV3-1ee2699d.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-fb249225.js';
3
+ import { _ as __vue_component__$f } from './OrPagination-65905270.js';
4
4
  import { _ as __vue_component__$g } from './OrSearch-b862696f.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-931ff193.js';
6
6
  import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
@@ -12,7 +12,7 @@ import { _ as __vue_component__$4 } from './OrMenuItem-c3a1e218.js';
12
12
  import { _ as __vue_component__$3 } from './OrMenu-5edc99d2.js';
13
13
  import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
14
14
 
15
- const PaginationRoot = [
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',
@@ -66,8 +56,9 @@ var script = defineComponent({
66
56
  emits: ['update:modelValue'],
67
57
  expose: ['root'],
68
58
  setup(props, context) {
69
- // Refs
59
+ // Refs & Styles
70
60
  const root = ref();
61
+ const rootStyles = computed(() => ['or-pagination-v3', ...Pagination]);
71
62
  const limitButton = ref();
72
63
  const limitButtonRoot = computed(() => {
73
64
  var _a;
@@ -78,20 +69,26 @@ var script = defineComponent({
78
69
  var _a;
79
70
  return (_a = limitMenu.value) === null || _a === void 0 ? void 0 : _a.root;
80
71
  });
81
- // Styles
82
- const rootStyles = computed(() => ['or-pagination-v3', ...PaginationRoot]);
83
- const offsetControlStyles = computed(() => [...PaginationOffsetControl]);
84
- const limitControlStyles = computed(() => [...PaginationLimitControl]);
72
+ const offsetButton = ref();
73
+ const offsetButtonRoot = computed(() => {
74
+ var _a;
75
+ return (_a = offsetButton.value) === null || _a === void 0 ? void 0 : _a.root;
76
+ });
77
+ const offsetMenu = ref();
78
+ const offsetMenuRoot = computed(() => {
79
+ var _a;
80
+ return (_a = offsetMenu.value) === null || _a === void 0 ? void 0 : _a.root;
81
+ });
85
82
  const itemStyles = computed(() => [...PaginationItem]);
86
83
  // State
87
- const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
84
+ const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
88
85
  const currentLimit = computed({
89
86
  get: () => {
90
87
  var _a, _b;
91
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
88
+ return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.limit) !== null && _b !== void 0 ? _b : props.options[0];
92
89
  },
93
90
  set: value => {
94
- proxyModelValue.value = {
91
+ model.value = {
95
92
  limit: value,
96
93
  offset: 0
97
94
  };
@@ -100,10 +97,10 @@ var script = defineComponent({
100
97
  const currentOffset = computed({
101
98
  get: () => {
102
99
  var _a, _b;
103
- return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
100
+ return (_b = (_a = model.value) === null || _a === void 0 ? void 0 : _a.offset) !== null && _b !== void 0 ? _b : 0;
104
101
  },
105
102
  set: value => {
106
- proxyModelValue.value = {
103
+ model.value = {
107
104
  limit: currentLimit.value,
108
105
  offset: value
109
106
  };
@@ -166,15 +163,17 @@ var script = defineComponent({
166
163
  } = useResponsive();
167
164
  return {
168
165
  root,
166
+ rootStyles,
169
167
  limitButton,
170
168
  limitButtonRoot,
171
169
  limitMenu,
172
170
  limitMenuRoot,
173
- rootStyles,
174
- offsetControlStyles,
175
- limitControlStyles,
171
+ offsetButton,
172
+ offsetButtonRoot,
173
+ offsetMenu,
174
+ offsetMenuRoot,
176
175
  itemStyles,
177
- proxyModelValue,
176
+ model,
178
177
  currentLimit,
179
178
  currentOffset,
180
179
  currentPage,
@@ -202,7 +201,48 @@ var __vue_render__ = function () {
202
201
  ref: 'root',
203
202
  class: _vm.rootStyles
204
203
  }, [_c('div', {
205
- class: _vm.offsetControlStyles
204
+ class: ['layout-row', 'gap-md', 'shrink-0']
205
+ }, [_c('div', {
206
+ class: ['layout-row', 'gap-sm']
207
+ }, [_vm._v("\n Per page:\n\n "), _c('OrButton', {
208
+ ref: 'limitButton',
209
+ class: _vm.itemStyles,
210
+ attrs: {
211
+ "variant": 'link',
212
+ "color": 'inherit',
213
+ "activated": true
214
+ },
215
+ on: {
216
+ "click": function ($event) {
217
+ _vm.limitMenu && _vm.limitMenu.open();
218
+ }
219
+ }
220
+ }, [_vm._v("\n " + _vm._s(_vm.currentLimit) + " "), _c('OrIcon', {
221
+ attrs: {
222
+ "icon": _vm.limitMenu && _vm.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
223
+ }
224
+ })], 1), _vm._v(" "), _c('OrMenu', {
225
+ ref: 'limitMenu',
226
+ attrs: {
227
+ "additional-styles": ['min-w-[60px]'],
228
+ "trigger": _vm.limitButtonRoot,
229
+ "placement": 'top'
230
+ }
231
+ }, _vm._l(_vm.options, function (limit) {
232
+ return _c('OrMenuItem', {
233
+ key: limit,
234
+ attrs: {
235
+ "selected": _vm.currentLimit === limit
236
+ },
237
+ on: {
238
+ "click": function ($event) {
239
+ _vm.currentLimit = limit;
240
+ _vm.limitMenu && _vm.limitMenu.close();
241
+ }
242
+ }
243
+ }, [_vm._v("\n " + _vm._s(limit) + "\n ")]);
244
+ }), 1)], 1), _vm._v("\n\n " + _vm._s(_vm.currentOffset + 1) + "-" + _vm._s(Math.min(_vm.currentOffset + _vm.currentLimit, _vm.length)) + " of " + _vm._s(_vm.length) + "\n ")]), _vm._v(" "), _c('div', {
245
+ class: ['layout-row', 'gap-md', 'shrink-0']
206
246
  }, [_c('OrButton', {
207
247
  class: _vm.itemStyles,
208
248
  attrs: {
@@ -219,7 +259,7 @@ var __vue_render__ = function () {
219
259
  attrs: {
220
260
  "icon": 'keyboard_arrow_left'
221
261
  }
222
- })], 1), _vm._v(" "), _vm.isDesktop ? [_vm._l(_vm.buttonGroup, function (page, index) {
262
+ })], 1), _vm._v(" "), _vm.isDesktop ? _vm._l(_vm.buttonGroup, function (page, index) {
223
263
  return _c('OrButton', {
224
264
  key: index,
225
265
  class: _vm.itemStyles,
@@ -234,26 +274,8 @@ var __vue_render__ = function () {
234
274
  }
235
275
  }
236
276
  }, [_vm._v("\n " + _vm._s(page) + "\n ")]);
237
- }), _vm._v(" "), _c('OrButton', {
238
- class: _vm.itemStyles,
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',
277
+ }) : _vm._e(), _vm._v(" "), _vm.isMobile ? [_c('OrButton', {
278
+ ref: 'offsetButton',
257
279
  class: _vm.itemStyles,
258
280
  attrs: {
259
281
  "variant": 'link',
@@ -262,33 +284,34 @@ var __vue_render__ = function () {
262
284
  },
263
285
  on: {
264
286
  "click": function ($event) {
265
- _vm.limitMenu && _vm.limitMenu.open();
287
+ _vm.offsetMenu && _vm.offsetMenu.open();
266
288
  }
267
289
  }
268
- }, [_vm._v("\n " + _vm._s(_vm.currentLimit) + " "), _c('OrIcon', {
290
+ }, [_vm._v("\n " + _vm._s(_vm.currentPage) + " "), _c('OrIcon', {
269
291
  attrs: {
270
- "icon": _vm.limitMenu && _vm.limitMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
292
+ "icon": _vm.offsetMenu && _vm.offsetMenu.state === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'
271
293
  }
272
294
  })], 1), _vm._v(" "), _c('OrMenu', {
273
- ref: 'limitMenu',
295
+ ref: 'offsetMenu',
274
296
  attrs: {
275
297
  "additional-styles": ['min-w-[60px]'],
276
- "trigger": _vm.limitButtonRoot,
298
+ "trigger": _vm.offsetButtonRoot,
277
299
  "placement": 'top'
278
300
  }
279
- }, _vm._l(_vm.options, function (pageSize) {
301
+ }, _vm._l(_vm.lastPage, function (page) {
280
302
  return _c('OrMenuItem', {
281
- key: pageSize,
303
+ key: page,
304
+ attrs: {
305
+ "selected": _vm.currentPage === page
306
+ },
282
307
  on: {
283
308
  "click": function ($event) {
284
- _vm.currentLimit = pageSize;
285
- _vm.limitMenu && _vm.limitMenu.close();
309
+ _vm.currentPage = page;
310
+ _vm.offsetMenu && _vm.offsetMenu.close();
286
311
  }
287
312
  }
288
- }, [_vm._v("\n " + _vm._s(pageSize) + "\n ")]);
289
- }), 1)], 2), _vm._v(" "), _vm.isMobile ? [_c('div', {
290
- class: _vm.offsetControlStyles
291
- }, [_c('OrButton', {
313
+ }, [_vm._v("\n " + _vm._s(page) + "\n ")]);
314
+ }), 1)] : _vm._e(), _vm._v(" "), _c('OrButton', {
292
315
  class: _vm.itemStyles,
293
316
  attrs: {
294
317
  "variant": 'link',
@@ -304,7 +327,7 @@ var __vue_render__ = function () {
304
327
  attrs: {
305
328
  "icon": 'keyboard_arrow_right'
306
329
  }
307
- })], 1)], 1)] : _vm._e()], 2);
330
+ })], 1)], 2)]);
308
331
  };
309
332
  var __vue_staticRenderFns__ = [];
310
333
 
@@ -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-73b5b49b.js';
36
36
  export { _ as OrContextMenuV3 } from '../OrContextMenu-f919b3fc.js';
37
- export { _ as OrDataGridV3 } from '../OrDataGrid-5bd153f2.js';
37
+ export { _ as OrDataGridV3 } from '../OrDataGrid-4b340a70.js';
38
38
  export { D as DataGridVariant } from '../OrDataGridToolbar-931ff193.js';
39
39
  export { _ as OrDateFormatV3 } from '../OrDateFormat-13de8599.js';
40
40
  export { _ as OrDatePickerV3 } from '../OrDatePicker-e2138a7a.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-fb249225.js';
92
+ export { _ as OrPaginationV3 } from '../OrPagination-65905270.js';
93
93
  export { _ as OrPassword } from '../OrPassword-d530c522.js';
94
94
  export { _ as OrPopoverV3, a as PopoverPlacement, P as PopoverVariant } from '../OrPopover-bb2b3368.js';
95
95
  export { i as isPrevented } from '../isPrevented-b151a948.js';
@@ -1,4 +1,4 @@
1
- export { _ as OrDataGridV3 } from '../../OrDataGrid-5bd153f2.js';
1
+ export { _ as OrDataGridV3 } from '../../OrDataGrid-4b340a70.js';
2
2
  export { D as DataGridVariant } from '../../OrDataGridToolbar-931ff193.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-fb249225.js';
20
+ import '../../OrPagination-65905270.js';
21
21
  import '../../useResponsive-1baf3485.js';
22
22
  import '../../OrButton-3a743a90.js';
23
23
  import '../../OrButton.vue_rollup-plugin-vue_script-e8900483.js';