@onereach/ui-components 2.69.7-beta.2170.0 → 2.69.7-beta.2171.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 (117) hide show
  1. package/dist/bundled/v2/{OrButton-a846fa7e.js → OrButton-4b99c680.js} +1 -10
  2. package/dist/bundled/v2/{OrCardCollection-15d11d05.js → OrCardCollection-c4209a92.js} +1 -1
  3. package/dist/bundled/v2/{OrConfirm-ec3feaf5.js → OrConfirm-cab6535b.js} +1 -1
  4. package/dist/bundled/v2/{OrExpansionPanel-995caa85.js → OrExpansionPanel-d9a260e2.js} +32 -5
  5. package/dist/bundled/v2/{OrSelect-8a4d227e.js → OrSelect-9658e0f2.js} +9 -16
  6. package/dist/bundled/v2/components/index.d.ts +0 -1
  7. package/dist/bundled/v2/components/index.js +5 -6
  8. package/dist/bundled/v2/components/or-button-v3/OrButton.vue.d.ts +0 -11
  9. package/dist/bundled/v2/components/or-button-v3/index.js +1 -1
  10. package/dist/bundled/v2/components/or-card-collection-v3/index.js +2 -2
  11. package/dist/bundled/v2/components/or-confirm-v3/index.js +2 -2
  12. package/dist/bundled/v2/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +22 -3
  13. package/dist/bundled/v2/components/or-expansion-panel-v3/index.js +1 -1
  14. package/dist/bundled/v2/components/or-select-v3/OrSelect.vue.d.ts +14 -25
  15. package/dist/bundled/v2/components/or-select-v3/index.d.ts +0 -1
  16. package/dist/bundled/v2/components/or-select-v3/index.js +2 -2
  17. package/dist/bundled/v2/components/or-select-v3/types.d.ts +1 -1
  18. package/dist/bundled/v2/index.js +6 -7
  19. package/dist/bundled/v3/{OrButton-2b27c1fd.js → OrButton-a671b8a1.js} +2 -3
  20. package/dist/bundled/v3/{OrButton.vue_vue_type_script_lang-8c44986c.js → OrButton.vue_vue_type_script_lang-b0dc31ca.js} +1 -9
  21. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-bd852915.js → OrCardCollection.vue_vue_type_script_lang-9a2ae9a3.js} +2 -2
  22. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-9e4e2884.js → OrConfirm.vue_vue_type_script_lang-f57ffa1a.js} +2 -2
  23. package/dist/bundled/v3/{OrExpansionPanel.vue_vue_type_script_lang-7f9c6721.js → OrExpansionPanel.vue_vue_type_script_lang-5360f580.js} +31 -4
  24. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-94063fc4.js → OrSelect.vue_vue_type_script_lang-359d1a58.js} +4 -8
  25. package/dist/bundled/v3/components/index.d.ts +0 -1
  26. package/dist/bundled/v3/components/index.js +6 -7
  27. package/dist/bundled/v3/components/or-button-v3/OrButton.vue.d.ts +0 -11
  28. package/dist/bundled/v3/components/or-button-v3/index.js +1 -1
  29. package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -3
  30. package/dist/bundled/v3/components/or-confirm-v3/index.js +3 -3
  31. package/dist/bundled/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +22 -3
  32. package/dist/bundled/v3/components/or-expansion-panel-v3/index.js +1 -1
  33. package/dist/bundled/v3/components/or-select-v3/OrSelect.vue.d.ts +14 -25
  34. package/dist/bundled/v3/components/or-select-v3/index.d.ts +0 -1
  35. package/dist/bundled/v3/components/or-select-v3/index.js +2 -2
  36. package/dist/bundled/v3/components/or-select-v3/types.d.ts +1 -1
  37. package/dist/bundled/v3/index.js +163 -254
  38. package/dist/esm/v2/{OrButton-835d4f11.js → OrButton-357e1e2c.js} +1 -10
  39. package/dist/esm/v2/{OrCardCollection-024cfba9.js → OrCardCollection-57d11adf.js} +1 -1
  40. package/dist/esm/v2/{OrConfirm-5e8dd4b6.js → OrConfirm-ec7aef0e.js} +1 -1
  41. package/dist/esm/v2/{OrExpansionPanel-968ddc61.js → OrExpansionPanel-a123024e.js} +32 -5
  42. package/dist/esm/v2/{OrSelect-641184f0.js → OrSelect-7a2f6001.js} +9 -16
  43. package/dist/esm/v2/components/index.d.ts +0 -1
  44. package/dist/esm/v2/components/index.js +5 -6
  45. package/dist/esm/v2/components/or-button-v3/OrButton.vue.d.ts +0 -11
  46. package/dist/esm/v2/components/or-button-v3/index.js +1 -1
  47. package/dist/esm/v2/components/or-card-collection-v3/index.js +2 -2
  48. package/dist/esm/v2/components/or-confirm-v3/index.js +2 -2
  49. package/dist/esm/v2/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +22 -3
  50. package/dist/esm/v2/components/or-expansion-panel-v3/index.js +1 -1
  51. package/dist/esm/v2/components/or-select-v3/OrSelect.vue.d.ts +14 -25
  52. package/dist/esm/v2/components/or-select-v3/index.d.ts +0 -1
  53. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  54. package/dist/esm/v2/components/or-select-v3/types.d.ts +1 -1
  55. package/dist/esm/v2/index.js +5 -6
  56. package/dist/esm/v3/{OrButton-0fa67a0d.js → OrButton-bb6bf8a9.js} +2 -11
  57. package/dist/esm/v3/{OrCardCollection-286d0f3f.js → OrCardCollection-2a6514f3.js} +1 -1
  58. package/dist/esm/v3/{OrConfirm-56ae1494.js → OrConfirm-5d56cbd3.js} +1 -1
  59. package/dist/esm/v3/{OrExpansionPanel-311e64cf.js → OrExpansionPanel-f8d7ff8d.js} +32 -5
  60. package/dist/esm/v3/{OrSelect-08bd0f60.js → OrSelect-4415b8d2.js} +10 -20
  61. package/dist/esm/v3/components/index.d.ts +0 -1
  62. package/dist/esm/v3/components/index.js +5 -6
  63. package/dist/esm/v3/components/or-button-v3/OrButton.vue.d.ts +0 -11
  64. package/dist/esm/v3/components/or-button-v3/index.js +1 -1
  65. package/dist/esm/v3/components/or-card-collection-v3/index.js +2 -2
  66. package/dist/esm/v3/components/or-confirm-v3/index.js +2 -2
  67. package/dist/esm/v3/components/or-expansion-panel-v3/OrExpansionPanel.vue.d.ts +22 -3
  68. package/dist/esm/v3/components/or-expansion-panel-v3/index.js +1 -1
  69. package/dist/esm/v3/components/or-select-v3/OrSelect.vue.d.ts +14 -25
  70. package/dist/esm/v3/components/or-select-v3/index.d.ts +0 -1
  71. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  72. package/dist/esm/v3/components/or-select-v3/types.d.ts +1 -1
  73. package/dist/esm/v3/index.js +5 -6
  74. package/package.json +1 -1
  75. package/src/components/index.ts +0 -1
  76. package/src/components/or-button-v3/OrButton.stories3.ts +0 -4
  77. package/src/components/or-button-v3/OrButton.vue +0 -6
  78. package/src/components/or-button-v3/styles.ts +1 -9
  79. package/src/components/or-expansion-panel-v3/OrExpansionPanel.stories3.ts +12 -2
  80. package/src/components/or-expansion-panel-v3/OrExpansionPanel.vue +39 -3
  81. package/src/components/or-select-v3/OrSelect.vue +14 -26
  82. package/src/components/or-select-v3/index.ts +0 -1
  83. package/src/components/or-select-v3/types.ts +1 -1
  84. package/dist/bundled/v2/OrPagination-379c10b8.js +0 -308
  85. package/dist/bundled/v2/components/or-pagination-v3/OrPagination.stories3.d.ts +0 -12
  86. package/dist/bundled/v2/components/or-pagination-v3/OrPagination.vue.d.ts +0 -112
  87. package/dist/bundled/v2/components/or-pagination-v3/index.d.ts +0 -2
  88. package/dist/bundled/v2/components/or-pagination-v3/index.js +0 -20
  89. package/dist/bundled/v2/components/or-pagination-v3/styles.d.ts +0 -4
  90. package/dist/bundled/v2/components/or-pagination-v3/types.d.ts +0 -4
  91. package/dist/bundled/v3/OrPagination.vue_vue_type_script_lang-c96d7cd7.js +0 -187
  92. package/dist/bundled/v3/components/or-pagination-v3/OrPagination.stories3.d.ts +0 -12
  93. package/dist/bundled/v3/components/or-pagination-v3/OrPagination.vue.d.ts +0 -112
  94. package/dist/bundled/v3/components/or-pagination-v3/index.d.ts +0 -2
  95. package/dist/bundled/v3/components/or-pagination-v3/index.js +0 -22
  96. package/dist/bundled/v3/components/or-pagination-v3/styles.d.ts +0 -4
  97. package/dist/bundled/v3/components/or-pagination-v3/types.d.ts +0 -4
  98. package/dist/esm/v2/OrPagination-c0dbec6a.js +0 -308
  99. package/dist/esm/v2/components/or-pagination-v3/OrPagination.stories3.d.ts +0 -12
  100. package/dist/esm/v2/components/or-pagination-v3/OrPagination.vue.d.ts +0 -112
  101. package/dist/esm/v2/components/or-pagination-v3/index.d.ts +0 -2
  102. package/dist/esm/v2/components/or-pagination-v3/index.js +0 -18
  103. package/dist/esm/v2/components/or-pagination-v3/styles.d.ts +0 -4
  104. package/dist/esm/v2/components/or-pagination-v3/types.d.ts +0 -4
  105. package/dist/esm/v3/OrPagination-a703307d.js +0 -269
  106. package/dist/esm/v3/components/or-pagination-v3/OrPagination.stories3.d.ts +0 -12
  107. package/dist/esm/v3/components/or-pagination-v3/OrPagination.vue.d.ts +0 -112
  108. package/dist/esm/v3/components/or-pagination-v3/index.d.ts +0 -2
  109. package/dist/esm/v3/components/or-pagination-v3/index.js +0 -17
  110. package/dist/esm/v3/components/or-pagination-v3/styles.d.ts +0 -4
  111. package/dist/esm/v3/components/or-pagination-v3/types.d.ts +0 -4
  112. package/src/components/or-pagination-v3/OrPagination.docs.mdx +0 -7
  113. package/src/components/or-pagination-v3/OrPagination.stories3.ts +0 -87
  114. package/src/components/or-pagination-v3/OrPagination.vue +0 -270
  115. package/src/components/or-pagination-v3/index.ts +0 -2
  116. package/src/components/or-pagination-v3/styles.ts +0 -38
  117. package/src/components/or-pagination-v3/types.ts +0 -4
@@ -1,270 +0,0 @@
1
- <template>
2
- <div
3
- ref="root"
4
- v-bind="$attrs"
5
- :class="rootStyles"
6
- >
7
- <div :class="offsetControlStyles">
8
- <OrButton
9
- :class="itemStyles"
10
- :variant="'link'"
11
- :color="'inherit'"
12
- :disabled="currentPage === firstPage"
13
- @click.stop="toPreviousPage()"
14
- >
15
- <OrIcon :icon="'keyboard_arrow_left'" />
16
- </OrButton>
17
-
18
- <OrButton
19
- v-for="(page, index) in buttonGroup"
20
- :key="index"
21
- :class="itemStyles"
22
- :variant="'link'"
23
- :color="'inherit'"
24
- :activated="currentPage === page"
25
- @click.stop="typeof page === 'number' && toPage(page)"
26
- >
27
- {{ page }}
28
- </OrButton>
29
-
30
- <OrButton
31
- :class="itemStyles"
32
- :variant="'link'"
33
- :color="'inherit'"
34
- :disabled="currentPage === lastPage"
35
- @click.stop="toNextPage()"
36
- >
37
- <OrIcon :icon="'keyboard_arrow_right'" />
38
- </OrButton>
39
- </div>
40
-
41
- <div :class="limitControlStyles">
42
- Per page:
43
-
44
- <OrButton
45
- ref="limitButton"
46
- :class="itemStyles"
47
- :variant="'link'"
48
- :color="'inherit'"
49
- :activated="true"
50
- @click.stop="limitMenu.open()"
51
- >
52
- {{ currentLimit }} <OrIcon :icon="'arrow_drop_down'" />
53
- </OrButton>
54
-
55
- <OrMenu
56
- ref="limitMenu"
57
- :trigger="limitButtonRoot"
58
- :placement="'top'"
59
- >
60
- <OrMenuItem
61
- v-for="pageSize in pageSizeOptions"
62
- :key="pageSize"
63
- @click.stop="currentLimit = pageSize"
64
- >
65
- {{ pageSize }}
66
- </OrMenuItem>
67
- </OrMenu>
68
- </div>
69
- </div>
70
- </template>
71
-
72
- <script lang="ts">
73
- import { computed, defineComponent, PropType, ref } from 'vue-demi';
74
- import { useClassAttribute } from '../../hooks';
75
- import { OrButtonV3 as OrButton } from '../or-button-v3';
76
- import { OrIconV3 as OrIcon } from '../or-icon-v3';
77
- import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3';
78
- import { OrMenuV3 as OrMenu } from '../or-menu-v3';
79
- import { PaginationItem, PaginationLimitControl, PaginationOffsetControl, PaginationRoot } from './styles';
80
- import { PaginationModel } from './types';
81
-
82
- export default defineComponent({
83
- name: 'OrPagination',
84
-
85
- components: {
86
- OrButton,
87
- OrIcon,
88
- OrMenu,
89
- OrMenuItem,
90
- },
91
-
92
- inheritAttrs: false,
93
-
94
- props: {
95
- modelValue: {
96
- type: Object as PropType<PaginationModel>,
97
- default: undefined,
98
- },
99
-
100
- value: { // TODO: Remove Vue 2 fallback
101
- type: Object as PropType<PaginationModel>,
102
- default: undefined,
103
- },
104
-
105
- length: {
106
- type: Number,
107
- required: true,
108
- },
109
-
110
- pageSizeOptions: {
111
- type: Array as PropType<number[]>,
112
- default: () => [50, 20, 10, 5],
113
- },
114
- },
115
-
116
- emits: [
117
- 'update:modelValue',
118
-
119
- 'input',
120
- ],
121
-
122
- expose: [
123
- 'root',
124
- ],
125
-
126
- setup(props, context) {
127
- // Refs
128
- const root = ref<HTMLElement>();
129
-
130
- const limitButton = ref<InstanceType<typeof OrButton>>();
131
- const limitButtonRoot = computed(() => limitButton.value?.root);
132
-
133
- const limitMenu = ref<InstanceType<typeof OrMenu>>();
134
- const limitMenuRoot = computed(() => limitMenu.value?.root);
135
-
136
- // Styles
137
- const classAttribute = useClassAttribute();
138
-
139
- const rootStyles = computed(() => [
140
- 'or-pagination',
141
- ...PaginationRoot,
142
- classAttribute.value,
143
- ]);
144
-
145
- const offsetControlStyles = computed(() => [
146
- ...PaginationOffsetControl,
147
- ]);
148
-
149
- const limitControlStyles = computed(() => [
150
- ...PaginationLimitControl,
151
- ]);
152
-
153
- const itemStyles = computed(() => [
154
- ...PaginationItem,
155
- ]);
156
-
157
- // State
158
- const proxyModelValue = computed({
159
- get: () => {
160
- return props.modelValue ?? props.value; // TODO: Remove Vue 2 fallback
161
- },
162
-
163
- set: (value) => {
164
- context.emit('input', value);
165
- context.emit('update:modelValue', value);
166
- },
167
- });
168
-
169
- const currentLimit = computed<number>({
170
- get: () => {
171
- return proxyModelValue.value?.limit ?? props.pageSizeOptions[0];
172
- },
173
-
174
- set: (value) => {
175
- proxyModelValue.value = {
176
- limit: value,
177
- offset: 0,
178
- };
179
- },
180
- });
181
-
182
- const currentOffset = computed<number>({
183
- get: () => {
184
- return proxyModelValue.value?.offset ?? 0;
185
- },
186
-
187
- set: (value) => {
188
- proxyModelValue.value = {
189
- limit: currentLimit.value,
190
- offset: value,
191
- };
192
- },
193
- });
194
-
195
- const currentPage = computed<number>({
196
- get: () => {
197
- return Math.floor(currentOffset.value / currentLimit.value) + 1;
198
- },
199
-
200
- set: (value) => {
201
- currentOffset.value = (value - 1) * currentLimit.value;
202
- },
203
- });
204
-
205
- const firstPage = computed<number>(() => {
206
- return 1;
207
- });
208
-
209
- const lastPage = computed<number>(() => {
210
- return Math.ceil(props.length / currentLimit.value);
211
- });
212
-
213
- const buttonGroup = computed<(number | string)[]>(() => {
214
- return Array.from({ length: lastPage.value }, (_, index) => index + 1)
215
- .map((page) => {
216
- switch (true) {
217
- case page > firstPage.value && page < currentPage.value - 1:
218
- case page > currentPage.value + 1 && page < lastPage.value:
219
- return '…';
220
-
221
- default:
222
- return page;
223
- }
224
- })
225
- .reduce((accumulator, page) => {
226
- if (accumulator[accumulator.length - 1] === page) {
227
- return accumulator;
228
- }
229
-
230
- return [...accumulator, page];
231
- }, [] as (number | string)[]);
232
- });
233
-
234
- // Functions
235
- function toPreviousPage(): void {
236
- currentPage.value = currentPage.value - 1;
237
- }
238
-
239
- function toNextPage(): void {
240
- currentPage.value = currentPage.value + 1;
241
- }
242
-
243
- function toPage(page: number): void {
244
- currentPage.value = page;
245
- }
246
-
247
- return {
248
- root,
249
- limitButton,
250
- limitButtonRoot,
251
- limitMenu,
252
- limitMenuRoot,
253
- rootStyles,
254
- offsetControlStyles,
255
- limitControlStyles,
256
- itemStyles,
257
- proxyModelValue,
258
- currentLimit,
259
- currentOffset,
260
- currentPage,
261
- firstPage,
262
- lastPage,
263
- buttonGroup,
264
- toPreviousPage,
265
- toNextPage,
266
- toPage,
267
- };
268
- },
269
- });
270
- </script>
@@ -1,2 +0,0 @@
1
- export { default as OrPaginationV3 } from './OrPagination.vue';
2
- export * from './types';
@@ -1,38 +0,0 @@
1
- export const PaginationRoot: string[] = [
2
- // Layout
3
- 'layout-row',
4
-
5
- // Spacing
6
- 'gap-xl',
7
-
8
- // Typography
9
- 'typography-caption-regular',
10
-
11
- // Theme
12
- 'theme-foreground-outline',
13
- 'dark:theme-foreground-outline-dark',
14
- ];
15
-
16
- export const PaginationOffsetControl: string[] = [
17
- // Layout
18
- 'layout-row',
19
-
20
- // Spacing
21
- 'gap-md',
22
- ];
23
-
24
- export const PaginationLimitControl: string[] = [
25
- // Layout
26
- 'layout-row',
27
-
28
- // Spacing
29
- 'gap-sm',
30
- ];
31
-
32
- export const PaginationItem: string[] = [
33
- // Typography
34
- 'typography-caption-regular',
35
-
36
- // Typography (activated)
37
- 'activated:typography-caption-bold',
38
- ];
@@ -1,4 +0,0 @@
1
- export interface PaginationModel {
2
- limit: number;
3
- offset: number;
4
- }