@onereach/ui-components 2.68.1-beta.2061.0 → 2.68.1-beta.2067.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 (81) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/{OrCardCollection-a9a779ea.js → OrCardCollection-94a30a19.js} +144 -53
  3. package/dist/bundled/v2/{OrConfirm-18c534df.js → OrConfirm-ff57274f.js} +1 -1
  4. package/dist/bundled/v2/{OrInput-8b90e08f.js → OrInput-4b82eb59.js} +4 -4
  5. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-3ece0ef6.js} +3 -3
  6. package/dist/bundled/v2/{OrSelect-f37e751b.js → OrSelect-68aacb62.js} +2 -2
  7. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  8. package/dist/bundled/v2/components/index.js +7 -7
  9. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  10. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -28
  11. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  12. package/dist/bundled/v2/components/or-card-collection-v3/index.js +8 -5
  13. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +1 -1
  14. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  15. package/dist/bundled/v2/components/or-confirm-v3/index.js +2 -2
  16. package/dist/bundled/v2/components/or-input-v3/index.js +1 -1
  17. package/dist/bundled/v2/components/or-search-v3/index.js +2 -2
  18. package/dist/bundled/v2/components/or-select-v3/index.js +2 -2
  19. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  20. package/dist/bundled/v2/index.js +8 -8
  21. package/dist/bundled/v3/OrButton-8ab33d9d.js +33 -0
  22. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-3993a015.js → OrCardCollection.vue_vue_type_script_lang-0e029303.js} +98 -48
  23. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-289b5600.js → OrConfirm.vue_vue_type_script_lang-18997376.js} +7 -37
  24. package/dist/bundled/v3/{OrInput-fa782fc1.js → OrInput-e97211bb.js} +1 -1
  25. package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
  26. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-147a1fb9.js} +2 -2
  27. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-c74a63e1.js → OrSelect.vue_vue_type_script_lang-58b92fb0.js} +1 -1
  28. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
  29. package/dist/bundled/v3/components/index.js +10 -8
  30. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  31. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -28
  32. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  33. package/dist/bundled/v3/components/or-card-collection-v3/index.js +12 -5
  34. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +1 -1
  35. package/dist/bundled/v3/components/or-confirm-v3/index.js +3 -2
  36. package/dist/bundled/v3/components/or-search-v3/index.js +2 -2
  37. package/dist/bundled/v3/components/or-select-v3/index.js +2 -2
  38. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  39. package/dist/bundled/v3/index.js +316 -301
  40. package/dist/esm/v2/{OrCardCollection-4f001551.js → OrCardCollection-54648673.js} +144 -52
  41. package/dist/esm/v2/{OrConfirm-b0b2e43c.js → OrConfirm-74e21c56.js} +1 -1
  42. package/dist/esm/v2/{OrInput-2f16a7ac.js → OrInput-b8a1627f.js} +4 -4
  43. package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-0c0d1773.js} +1 -1
  44. package/dist/esm/v2/{OrSelect-528c7480.js → OrSelect-0e6e7868.js} +2 -2
  45. package/dist/esm/v2/components/index.js +5 -5
  46. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  47. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -28
  48. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  49. package/dist/esm/v2/components/or-card-collection-v3/index.js +8 -5
  50. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +1 -1
  51. package/dist/esm/v2/components/or-confirm-v3/index.js +2 -2
  52. package/dist/esm/v2/components/or-input-v3/index.js +1 -1
  53. package/dist/esm/v2/components/or-search-v3/index.js +2 -2
  54. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  55. package/dist/esm/v2/index.js +5 -5
  56. package/dist/esm/v3/OrCardCollection-9d0036fa.js +259 -0
  57. package/dist/esm/v3/{OrConfirm-906427ef.js → OrConfirm-a3f312a6.js} +1 -1
  58. package/dist/esm/v3/{OrInput-41691fb3.js → OrInput-e2ac1182.js} +1 -1
  59. package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-01225d82.js} +1 -1
  60. package/dist/esm/v3/{OrSelect-d9c76482.js → OrSelect-2e00d4c8.js} +2 -2
  61. package/dist/esm/v3/components/index.js +5 -5
  62. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  63. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -28
  64. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  65. package/dist/esm/v3/components/or-card-collection-v3/index.js +8 -5
  66. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +1 -1
  67. package/dist/esm/v3/components/or-confirm-v3/index.js +2 -2
  68. package/dist/esm/v3/components/or-input-v3/index.js +1 -1
  69. package/dist/esm/v3/components/or-search-v3/index.js +2 -2
  70. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  71. package/dist/esm/v3/index.js +5 -5
  72. package/package.json +1 -1
  73. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +115 -19
  74. package/src/components/or-card-collection-v3/OrCardCollection.vue +93 -67
  75. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +39 -0
  76. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +40 -0
  77. package/src/components/or-card-collection-v3/styles.ts +1 -1
  78. package/src/components/or-card-collection-v3/types.ts +1 -1
  79. package/src/components/or-input-v3/OrInput.vue +1 -1
  80. package/src/components/or-select-v3/OrSelect.vue +1 -1
  81. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -1,9 +1,9 @@
1
- export { s as OrSearchV3 } from '../../OrSearch-cdde55ce.js';
1
+ export { s as OrSearchV3 } from '../../OrSearch-01225d82.js';
2
2
  export { a as SearchSize } from '../../OrInputBox-5247ab25.js';
3
3
  import 'vue-demi';
4
4
  import '@vueuse/core';
5
5
  import '../../useClassAttribute-47fdb016.js';
6
- import '../../OrInput-41691fb3.js';
6
+ import '../../OrInput-e2ac1182.js';
7
7
  import '../../OrError-ec8c709d.js';
8
8
  import 'vue';
9
9
  import '../../OrHint-74bb732d.js';
@@ -1,4 +1,4 @@
1
- export { s as OrSelectV3 } from '../../OrSelect-d9c76482.js';
1
+ export { s as OrSelectV3 } from '../../OrSelect-2e00d4c8.js';
2
2
  export { a as SelectSize } from '../../OrInputBox-5247ab25.js';
3
3
  import 'vue-demi';
4
4
  import '../../dropdown-open-0d314aa4.js';
@@ -13,7 +13,7 @@ import '../../OrError-ec8c709d.js';
13
13
  import '../../OrExpansionPanel-311e64cf.js';
14
14
  import '../../OrIcon-b195169c.js';
15
15
  import '../../OrHint-74bb732d.js';
16
- import '../../OrInput-41691fb3.js';
16
+ import '../../OrInput-e2ac1182.js';
17
17
  import '../../OrIconButton-1eebcafc.js';
18
18
  import '../../OrTooltip-50d27b4f.js';
19
19
  import '../../OrPopover-1075dd38.js';
@@ -6,7 +6,7 @@ export { b as BUTTON_COLOR, d as BUTTON_LOADER_TYPE, c as BUTTON_SIZE, B as BUTT
6
6
  export { a as ButtonColor, b as ButtonType, B as ButtonVariant, s as OrButtonV3 } from './OrButton-f4b9ee51.js';
7
7
  export { s as OrCard } from './OrCard-e3a5aea4.js';
8
8
  export { C as CARD_COLLECTION_LAYOUT, s as OrCardCollection } from './OrCardCollection-a5e326ef.js';
9
- export { C as CardCollectionView, s as OrCardCollectionV3 } from './OrCardCollection-5a0febaf.js';
9
+ export { C as CardCollectionView, s as OrCardCollectionV3 } from './OrCardCollection-9d0036fa.js';
10
10
  export { s as OrCardV3 } from './OrCard-fd92f7c8.js';
11
11
  export { a as OrCarousel, s as OrCarouselItem } from './OrCarouselItem-636d99a1.js';
12
12
  export { s as OrCheckbox } from './OrCheckbox-ed4a19cf.js';
@@ -16,7 +16,7 @@ export { s as OrCode, O as OrCodeLanguages } from './OrCode-ee19a5e6.js';
16
16
  export { s as OrCollapse } from './OrCollapse-445141ab.js';
17
17
  export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k as brown, c as cyan, j as deepOrange, d as deepPurple, g as green, i as indigo, l as lightBlue, e as lightGreen, f as lime, o as orange, p as pink, a as purple, r as red, t as teal, w as white, y as yellow } from './OrColorPicker-189cb097.js';
18
18
  export { s as OrConfirm } from './OrConfirm-f39bd784.js';
19
- export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-906427ef.js';
19
+ export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-a3f312a6.js';
20
20
  export { D as DEFAULT_TEXT, s as OrDateTimePicker, a as OrDateTimePickerItemTypes, O as OrDateTimePickerTypes } from './OrDateTimePicker-f2e08564.js';
21
21
  export { s as OrError } from './OrError-f90296db.js';
22
22
  export { s as OrErrorTagV3 } from './OrErrorTag-98252eef.js';
@@ -34,7 +34,7 @@ export { I as InlineInputType, s as OrInlineInputV3 } from './OrInlineInput-3102
34
34
  export { a as InlineTextEditTrimmingTypes, I as InlineTextEditTypes, s as OrInlineTextEdit } from './OrInlineTextEdit-1aa477b5.js';
35
35
  export { s as OrInlineTextareaV3 } from './OrInlineTextarea-b28c3d8c.js';
36
36
  export { a as InputBoxSize, I as InputBoxVariant, a as InputSize, s as OrInputBoxV3, a as SearchSize, a as SelectSize, a as TextareaSize } from './OrInputBox-5247ab25.js';
37
- export { I as InputType, s as OrInputV3 } from './OrInput-41691fb3.js';
37
+ export { I as InputType, s as OrInputV3 } from './OrInput-e2ac1182.js';
38
38
  export { a as OrInput, b as OrNumberInput, c as OrPassword, d as OrSearch, s as OrTextarea } from './OrSearch-7cb2c91c.js';
39
39
  export { s as OrLabel } from './OrLabel-876f8729.js';
40
40
  export { L as LabelVariant, s as OrLabelV3 } from './OrLabel-bdaec602.js';
@@ -58,10 +58,10 @@ export { s as OrProgressV3, P as ProgressColor, a as ProgressType } from './OrPr
58
58
  export { s as OrRadio } from './OrRadio-c3ab11f2.js';
59
59
  export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
60
60
  export { s as OrRadioV3 } from './OrRadio-54b6d0de.js';
61
- export { s as OrSearchV3 } from './OrSearch-cdde55ce.js';
61
+ export { s as OrSearchV3 } from './OrSearch-01225d82.js';
62
62
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-171cad78.js';
63
63
  export { s as OrSelect } from './OrSelect-0821b907.js';
64
- export { s as OrSelectV3 } from './OrSelect-d9c76482.js';
64
+ export { s as OrSelectV3 } from './OrSelect-2e00d4c8.js';
65
65
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
66
66
  export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-a62972f5.js';
67
67
  export { s as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeletonText-2b1610ce.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "2.68.1-beta.2061.0",
3
+ "version": "2.68.1-beta.2067.0",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -3,8 +3,9 @@ import { Meta, StoryFn } from '@storybook/vue3';
3
3
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
4
4
  import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
5
5
  import OrCardCollection from './OrCardCollection.vue';
6
+ import { OrCardV3 as OrCard } from '../or-card-v3';
6
7
  import { CardCollectionView } from './props';
7
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
8
+ import { CardCollectionItem } from './types';
8
9
 
9
10
  export default {
10
11
  title: 'Components/Card Collection',
@@ -70,12 +71,14 @@ export default {
70
71
  docs: {
71
72
  page: OrCardCollectionDocs,
72
73
  },
74
+ layout: 'fullscreen',
73
75
  },
74
76
  } as Meta<typeof OrCardCollection>;
75
77
 
76
78
  const Template: StoryFn<typeof OrCardCollection> = (args) => ({
77
79
  components: {
78
80
  OrCardCollection,
81
+ OrCard,
79
82
  OrIcon,
80
83
  },
81
84
 
@@ -89,16 +92,19 @@ const Template: StoryFn<typeof OrCardCollection> = (args) => ({
89
92
  },
90
93
 
91
94
  template: `
92
- <OrCardCollection
93
- v-bind="args"
94
- @viewChange="onViewChange"
95
- @sortChange="onSortChange"
96
- @searchChange="onSearchChange"
97
- >
98
- <template #gridItem="item">${args.gridItem}</template>
99
- <template #listItem="item">${args.listItem}</template>
100
- <template #addon>${args.addon}</template>
101
- </OrCardCollection>
95
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
96
+ <OrCardCollection
97
+ v-bind="args"
98
+ @viewChange="onViewChange"
99
+ @sortChange="onSortChange"
100
+ @searchChange="onSearchChange"
101
+ >
102
+ <template #item="{item, mode}">
103
+ <OrCard>${args.item} ({{mode}}}</OrCard>
104
+ </template>
105
+ <template #addon>${args.addon}</template>
106
+ </OrCardCollection>
107
+ </div>
102
108
  `,
103
109
  });
104
110
 
@@ -106,8 +112,7 @@ export const Default = Template.bind({});
106
112
 
107
113
  Default.args = {
108
114
  // Slots
109
- gridItem: '{{ item.label }} (grid)',
110
- listItem: '{{ item.label }} (list)',
115
+ item: '{{ item.label }}',
111
116
  addon: '<OrIcon icon="info" />',
112
117
 
113
118
  // Props
@@ -139,7 +144,7 @@ Default.args = {
139
144
  'Yankee',
140
145
  'Zulu',
141
146
  ], (item) => ({
142
- id: item.toLowerCase(),
147
+ key: item.toLowerCase(),
143
148
  label: item,
144
149
  })),
145
150
  };
@@ -150,13 +155,104 @@ WithSorting.args = {
150
155
  ...Default.args,
151
156
 
152
157
  // Props
153
- sortHeaders: Array.from<string, CardCollectionSortHeader>([
158
+ sort: 'Bar',
159
+ sortOptions: [
154
160
  'Foo',
155
161
  'Bar',
156
162
  'Baz',
157
163
  'Qux',
158
- ], (item) => ({
159
- value: item.toLowerCase(),
160
- label: item,
161
- })),
164
+ ],
165
+ };
166
+
167
+
168
+ export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) => ({
169
+ components: {
170
+ OrCardCollection,
171
+ OrCard,
172
+ OrIcon,
173
+ },
174
+
175
+ setup() {
176
+ return {
177
+ args,
178
+ onViewChange: action('viewChange'),
179
+ onSortChange: action('sortChange'),
180
+ onSearchChange: action('searchChange'),
181
+ };
182
+ },
183
+
184
+ template: `
185
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
186
+ <OrCardCollection
187
+ v-bind="args"
188
+ @viewChange="onViewChange"
189
+ @sortChange="onSortChange"
190
+ @searchChange="onSearchChange"
191
+ >
192
+ <template #grid="{items}">
193
+ <div class="typography-headline-3">Custom grid</div>
194
+ <div class="grid grid-cols-3">
195
+ <OrCard
196
+ v-for="item in items"
197
+ :key="item.id"
198
+ >
199
+ {{ item.label }}
200
+ </OrCard>
201
+ </div>
202
+ </template>
203
+ <template #list="{items}">
204
+ <div class="typography-headline-3">Custom list</div>
205
+ <ul>
206
+ <li
207
+ v-for="item in items"
208
+ :key="item.id"
209
+ >
210
+ - {{ item.label }}
211
+ </li>
212
+ </ul>
213
+ </template>
214
+ </OrCardCollection>
215
+ </div>
216
+ `,
217
+ });
218
+
219
+ OverrideViewContainer.args = {
220
+ ...Default.args,
221
+ };
222
+
223
+
224
+ export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
225
+ components: {
226
+ OrCardCollection,
227
+ OrCard,
228
+ OrIcon,
229
+ },
230
+
231
+ setup() {
232
+ return {
233
+ args,
234
+ onViewChange: action('viewChange'),
235
+ onSortChange: action('sortChange'),
236
+ onSearchChange: action('searchChange'),
237
+ };
238
+ },
239
+
240
+ template: `
241
+ <div class="p-md bg-surface-1 dark:bg-surface-1-dark">
242
+ <OrCardCollection
243
+ v-bind="args"
244
+ @viewChange="onViewChange"
245
+ @sortChange="onSortChange"
246
+ @searchChange="onSearchChange"
247
+ >
248
+ <template #item="{item}">
249
+ <a href="#" @click.prevent><OrCard>${args.item}</OrCard></a>
250
+ </template>
251
+ </OrCardCollection>
252
+ </div>
253
+ `,
254
+ });
255
+
256
+ WithLink.args = {
257
+ ...Default.args,
162
258
  };
@@ -6,87 +6,106 @@
6
6
  >
7
7
  <div :class="toolbarStyles">
8
8
  <div :class="toolbarPanelStyles">
9
- <template v-if="sortHeaders">
10
- <OrSortHeader
11
- v-for="header in sortHeaders"
12
- :key="header.value"
13
- v-model="proxySort"
14
- :input-value="header.value"
9
+ <template v-if="sortOptions.length">
10
+ <OrButton
11
+ ref="sortButton"
12
+ variant="link"
13
+ color="inherit"
14
+ @click="sortMenu.toggle()"
15
15
  >
16
- {{ header.label }}
17
- </OrSortHeader>
16
+ {{ proxySort }}
17
+ <OrIcon
18
+ v-if="sortMenu"
19
+ :icon="sortMenu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'"
20
+ />
21
+ </OrButton>
22
+ <OrMenu
23
+ ref="sortMenu"
24
+ :trigger="sortButton && sortButton.root"
25
+ >
26
+ <OrMenuItem
27
+ v-for="sortItem in sortOptions"
28
+ :key="sortItem"
29
+ @click="handleSort(sortItem)"
30
+ >
31
+ {{ sortItem }}
32
+ </OrMenuItem>
33
+ </OrMenu>
18
34
  </template>
19
35
  </div>
20
36
 
21
- <div :class="toolbarPanelStyles">
22
- <OrInput
23
- v-model="proxySearch"
24
- :type="'search'"
25
- :placeholder="'Search'"
26
- :size="'s'"
27
- />
28
-
29
- <OrIconButton
30
- :icon="'grid_view'"
31
- @click="switchToGridView()"
37
+ <div
38
+ :class="toolbarPanelStyles"
39
+ >
40
+ <OrSearch
41
+ class="md:w-[350px]"
42
+ size="s"
43
+ @search="handleSearch"
32
44
  />
45
+ <div class="layout-row gap-sm">
46
+ <OrIconButton
47
+ :icon="'grid_view'"
48
+ @click="switchToGridView()"
49
+ />
33
50
 
34
- <OrIconButton
35
- :icon="'view_list'"
36
- @click="switchToListView()"
37
- />
51
+ <OrIconButton
52
+ :icon="'view_agenda'"
53
+ @click="switchToListView()"
54
+ />
38
55
 
39
- <slot name="addon" />
56
+ <slot name="addon" />
57
+ </div>
40
58
  </div>
41
59
  </div>
42
60
 
43
- <div :class="contentStyles">
44
- <template v-if="proxyView === 'grid'">
45
- <OrCard
46
- v-for="item in items"
47
- :key="item.id"
48
- >
49
- <slot
50
- name="gridItem"
51
- v-bind="item"
52
- />
53
- </OrCard>
54
- </template>
55
-
56
- <template v-if="proxyView === 'list'">
57
- <OrCard
58
- v-for="item in items"
59
- :key="item.id"
60
- >
61
+ <slot
62
+ :name="proxyView"
63
+ v-bind="{items}"
64
+ >
65
+ <OrCardCollectionView
66
+ :items="items"
67
+ :mode="proxyView"
68
+ >
69
+ <template v-slot:item="props">
61
70
  <slot
62
- name="listItem"
63
- v-bind="item"
71
+ name="item"
72
+ v-bind="props"
64
73
  />
65
- </OrCard>
66
- </template>
67
- </div>
74
+ </template>
75
+ </OrCardCollectionView>
76
+ </slot>
68
77
  </div>
69
78
  </template>
70
79
 
71
80
  <script lang="ts">
72
81
  import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
73
82
  import { useClassAttribute } from '../../hooks';
74
- import { OrCardV3 as OrCard } from '../or-card-v3';
75
83
  import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
76
- import { OrInputV3 as OrInput } from '../or-input-v3';
77
- import { OrSortHeaderV3 as OrSortHeader, SortHeaderModel } from '../or-sort-header-v3';
84
+ import { OrMenuV3 as OrMenu } from '../or-menu-v3';
85
+ import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3';
86
+ import { OrIconV3 as OrIcon } from '../or-icon-v3';
78
87
  import { CardCollectionView } from './props';
79
- import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
80
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
88
+ import {
89
+ CardCollectionRoot,
90
+ CardCollectionToolbar,
91
+ CardCollectionToolbarPanel,
92
+ } from './styles';
93
+ import { CardCollectionItem } from './types';
94
+ import OrCardCollectionView from './OrCardCollectionView.vue3.vue';
95
+ import { OrButtonV3 as OrButton } from '../or-button-v3';
96
+ import { OrSearchV3 as OrSearch } from '../or-search-v3';
81
97
 
82
98
  export default defineComponent({
83
99
  name: 'OrCardCollection',
84
100
 
85
101
  components: {
86
- OrCard,
102
+ OrCardCollectionView,
87
103
  OrIconButton,
88
- OrInput,
89
- OrSortHeader,
104
+ OrButton,
105
+ OrMenu,
106
+ OrMenuItem,
107
+ OrIcon,
108
+ OrSearch,
90
109
  },
91
110
 
92
111
  inheritAttrs: false,
@@ -96,20 +115,19 @@ export default defineComponent({
96
115
  type: Array as PropType<CardCollectionItem[]>,
97
116
  default: [] as CardCollectionItem[],
98
117
  },
99
-
100
118
  view: {
101
119
  type: String as PropType<CardCollectionView>,
102
120
  default: CardCollectionView.Grid,
103
121
  },
104
122
 
105
123
  sort: {
106
- type: Object as PropType<SortHeaderModel>,
107
- default: undefined,
124
+ type: String,
125
+ required: true,
108
126
  },
109
127
 
110
- sortHeaders: {
111
- type: Array as PropType<CardCollectionSortHeader[]>,
112
- default: undefined,
128
+ sortOptions: {
129
+ type: Array as PropType<string[]>,
130
+ default: () => [],
113
131
  },
114
132
 
115
133
  search: {
@@ -131,6 +149,8 @@ export default defineComponent({
131
149
  setup(props, context) {
132
150
  // Refs
133
151
  const root = ref<HTMLElement>();
152
+ const sortMenu = ref<typeof OrMenu>();
153
+ const sortButton = ref<typeof OrButton>();
134
154
 
135
155
  // Styles
136
156
  const classAttribute = useClassAttribute();
@@ -149,11 +169,6 @@ export default defineComponent({
149
169
  ...CardCollectionToolbarPanel,
150
170
  ]);
151
171
 
152
- const contentStyles = computed(() => [
153
- ...CardCollectionContent,
154
- ...CardCollectionContentViews[proxyView.value],
155
- ]);
156
-
157
172
  // State
158
173
  const proxyView = ref(props.view);
159
174
  const proxySort = ref(props.sort);
@@ -168,6 +183,14 @@ export default defineComponent({
168
183
  proxyView.value = CardCollectionView.List;
169
184
  }
170
185
 
186
+ function handleSort(sort: string) {
187
+ proxySort.value = sort;
188
+ }
189
+
190
+ function handleSearch(search: string) {
191
+ proxySearch.value = search;
192
+ }
193
+
171
194
  // Effects
172
195
  watch(() => props.view, (value) => {
173
196
  proxyView.value = value;
@@ -195,15 +218,18 @@ export default defineComponent({
195
218
 
196
219
  return {
197
220
  root,
221
+ sortMenu,
222
+ sortButton,
198
223
  rootStyles,
199
224
  toolbarStyles,
200
225
  toolbarPanelStyles,
201
- contentStyles,
202
226
  proxyView,
203
227
  proxySort,
204
228
  proxySearch,
205
229
  switchToGridView,
206
230
  switchToListView,
231
+ handleSort,
232
+ handleSearch,
207
233
  };
208
234
  },
209
235
  });
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div :class="contentStyles">
3
+ <slot
4
+ v-for="(item) in items"
5
+ name="item"
6
+ v-bind="{
7
+ item,
8
+ mode,
9
+ }"
10
+ />
11
+ </div>
12
+ </template>
13
+ <script lang="ts">
14
+ import { defineComponent, computed, PropType } from 'vue-demi';
15
+ import { CardCollectionContent, CardCollectionContentViews } from './styles';
16
+ import { CardCollectionItem } from './types';
17
+ import { CardCollectionView } from './props';
18
+
19
+ export default defineComponent({
20
+ name: 'OrCardCollectionView',
21
+ props: {
22
+ items: {
23
+ type: Array as PropType<CardCollectionItem[]>,
24
+ default: [] as CardCollectionItem[],
25
+ },
26
+ mode: {
27
+ type: String as PropType<CardCollectionView>,
28
+ required: true,
29
+ },
30
+ },
31
+ setup(props) {
32
+ const contentStyles = computed(() => [
33
+ ...CardCollectionContent,
34
+ ...CardCollectionContentViews[props.mode],
35
+ ]);
36
+ return { contentStyles };
37
+ },
38
+ });
39
+ </script>
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <div :class="contentStyles">
3
+ <slot
4
+ v-for="(item, index) in items"
5
+ :key="item.key || index"
6
+ name="item"
7
+ v-bind="{
8
+ item,
9
+ mode,
10
+ }"
11
+ />
12
+ </div>
13
+ </template>
14
+ <script lang="ts">
15
+ import { defineComponent, computed, PropType } from 'vue-demi';
16
+ import { CardCollectionContent, CardCollectionContentViews } from './styles';
17
+ import { CardCollectionItem } from './types';
18
+ import { CardCollectionView } from './props';
19
+
20
+ export default defineComponent({
21
+ name: 'OrCardCollectionView',
22
+ props: {
23
+ items: {
24
+ type: Array as PropType<CardCollectionItem[]>,
25
+ default: [] as CardCollectionItem[],
26
+ },
27
+ mode: {
28
+ type: String as PropType<CardCollectionView>,
29
+ required: true,
30
+ },
31
+ },
32
+ setup(props) {
33
+ const contentStyles = computed(() => [
34
+ ...CardCollectionContent,
35
+ ...CardCollectionContentViews[props.mode],
36
+ ]);
37
+ return { contentStyles };
38
+ },
39
+ });
40
+ </script>
@@ -25,7 +25,7 @@ export const CardCollectionToolbarPanel: string[] = [
25
25
  'layout-row',
26
26
 
27
27
  // Spacing
28
- 'gap-sm+',
28
+ 'gap-lg+',
29
29
  ];
30
30
 
31
31
  export const CardCollectionContent: string[] = [
@@ -1,5 +1,5 @@
1
1
  export interface CardCollectionItem {
2
- id: string;
2
+ key?: string;
3
3
  }
4
4
 
5
5
  export interface CardCollectionSortHeader {
@@ -41,7 +41,7 @@
41
41
  @blur="$emit('blur', $event)"
42
42
  >
43
43
 
44
- <div :class="['layout-row']">
44
+ <div :class="['layout-row', 'm-[-4px] md:m-[-2px]']">
45
45
  <template v-if="type === 'password'">
46
46
  <OrIconButton
47
47
  :icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
@@ -74,7 +74,7 @@
74
74
  +{{ outerItems.length }}
75
75
  </template>
76
76
 
77
- <div :class="['layout-row']">
77
+ <div :class="['layout-row', 'm-[-4px] md:m-[-2px]']">
78
78
  <OrIcon
79
79
  :icon="popoverState === 'open' ? 'arrow_drop_up' : 'arrow_drop_down'"
80
80
  :variant="'outlined'"