@onereach/ui-components 2.68.1-beta.2065.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.
- package/dist/bundled/v2/{OrCardCollection-0eaf7489.js → OrCardCollection-94a30a19.js} +67 -37
- package/dist/bundled/v2/{OrSearch-e34afaee.js → OrSearch-3ece0ef6.js} +2 -2
- package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
- package/dist/bundled/v2/components/index.js +3 -3
- package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +6 -2
- package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
- package/dist/bundled/v2/index.js +4 -4
- package/dist/bundled/v3/OrButton-8ab33d9d.js +33 -0
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-26d9a7c8.js → OrCardCollection.vue_vue_type_script_lang-0e029303.js} +63 -35
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-2e7fa659.js → OrConfirm.vue_vue_type_script_lang-18997376.js} +6 -36
- package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-1d2a20e0.js → OrSearch.vue_vue_type_script_lang-147a1fb9.js} +1 -1
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
- package/dist/bundled/v3/components/index.js +9 -7
- package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +10 -2
- package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
- package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
- package/dist/bundled/v3/index.js +188 -173
- package/dist/esm/v2/{OrCardCollection-7bf35252.js → OrCardCollection-54648673.js} +69 -37
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
- package/dist/esm/v2/components/or-card-collection-v3/index.js +6 -2
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrCardCollection-9682c6ef.js → OrCardCollection-9d0036fa.js} +76 -36
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
- package/dist/esm/v3/components/or-card-collection-v3/index.js +6 -2
- package/dist/esm/v3/index.js +1 -1
- package/package.json +1 -1
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +57 -52
- package/src/components/or-card-collection-v3/OrCardCollection.vue +72 -34
- package/src/components/or-card-collection-v3/styles.ts +1 -1
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import { SortHeaderModel } from '../or-sort-header-v3';
|
|
3
2
|
import { CardCollectionView } from './props';
|
|
4
|
-
import { CardCollectionItem
|
|
3
|
+
import { CardCollectionItem } from './types';
|
|
5
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
6
5
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
6
|
+
sortMenu: import("@vue/composition-api").Ref<(import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
7
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
8
|
+
} | string[], {} & {}, {
|
|
9
|
+
[x: number]: string;
|
|
10
|
+
} | {}, true>)) | undefined>;
|
|
11
|
+
sortButton: import("@vue/composition-api").Ref<(import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
12
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
13
|
+
} | string[], {} & {}, {
|
|
14
|
+
[x: number]: string;
|
|
15
|
+
} | {}, true>)) | undefined>;
|
|
7
16
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
8
17
|
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
9
18
|
toolbarPanelStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
10
19
|
proxyView: import("@vue/composition-api").Ref<CardCollectionView>;
|
|
11
|
-
proxySort: import("@vue/composition-api").Ref<
|
|
12
|
-
column: string;
|
|
13
|
-
direction: "asc" | "desc";
|
|
14
|
-
}>;
|
|
20
|
+
proxySort: import("@vue/composition-api").Ref<string>;
|
|
15
21
|
proxySearch: import("@vue/composition-api").Ref<string>;
|
|
16
22
|
switchToGridView: () => void;
|
|
17
23
|
switchToListView: () => void;
|
|
24
|
+
handleSort: (sort: string) => void;
|
|
25
|
+
handleSearch: (search: string) => void;
|
|
18
26
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
19
27
|
items: {
|
|
20
28
|
type: PropType<CardCollectionItem[]>;
|
|
@@ -25,12 +33,12 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
25
33
|
default: CardCollectionView;
|
|
26
34
|
};
|
|
27
35
|
sort: {
|
|
28
|
-
type:
|
|
29
|
-
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
30
38
|
};
|
|
31
|
-
|
|
32
|
-
type: PropType<
|
|
33
|
-
default:
|
|
39
|
+
sortOptions: {
|
|
40
|
+
type: PropType<string[]>;
|
|
41
|
+
default: () => never[];
|
|
34
42
|
};
|
|
35
43
|
search: {
|
|
36
44
|
type: StringConstructor;
|
|
@@ -46,12 +54,12 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
46
54
|
default: CardCollectionView;
|
|
47
55
|
};
|
|
48
56
|
sort: {
|
|
49
|
-
type:
|
|
50
|
-
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
required: true;
|
|
51
59
|
};
|
|
52
|
-
|
|
53
|
-
type: PropType<
|
|
54
|
-
default:
|
|
60
|
+
sortOptions: {
|
|
61
|
+
type: PropType<string[]>;
|
|
62
|
+
default: () => never[];
|
|
55
63
|
};
|
|
56
64
|
search: {
|
|
57
65
|
type: StringConstructor;
|
|
@@ -59,38 +67,46 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
59
67
|
};
|
|
60
68
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
61
69
|
search: string;
|
|
62
|
-
sort:
|
|
70
|
+
sort: string;
|
|
63
71
|
items: CardCollectionItem[];
|
|
64
72
|
view: CardCollectionView;
|
|
65
|
-
|
|
73
|
+
sortOptions: string[];
|
|
66
74
|
} & {} & {
|
|
67
75
|
[x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
|
|
68
76
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
69
77
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
78
|
+
sortMenu: import("@vue/composition-api").Ref<(import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
79
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
80
|
+
} | string[], {} & {}, {
|
|
81
|
+
[x: number]: string;
|
|
82
|
+
} | {}, true>)) | undefined>;
|
|
83
|
+
sortButton: import("@vue/composition-api").Ref<(import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<unknown>, import("@vue/composition-api").MethodOptions, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>, import("@vue/composition-api").ExtractPropTypes<import("@vue/composition-api").ComponentPropsOptions<import("@vue/composition-api").Data>>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
84
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
85
|
+
} | string[], {} & {}, {
|
|
86
|
+
[x: number]: string;
|
|
87
|
+
} | {}, true>)) | undefined>;
|
|
70
88
|
rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
|
|
71
89
|
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
72
90
|
toolbarPanelStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
73
91
|
proxyView: import("@vue/composition-api").Ref<CardCollectionView>;
|
|
74
|
-
proxySort: import("@vue/composition-api").Ref<
|
|
75
|
-
column: string;
|
|
76
|
-
direction: "asc" | "desc";
|
|
77
|
-
}>;
|
|
92
|
+
proxySort: import("@vue/composition-api").Ref<string>;
|
|
78
93
|
proxySearch: import("@vue/composition-api").Ref<string>;
|
|
79
94
|
switchToGridView: () => void;
|
|
80
95
|
switchToListView: () => void;
|
|
96
|
+
handleSort: (sort: string) => void;
|
|
97
|
+
handleSearch: (search: string) => void;
|
|
81
98
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
82
99
|
search: string;
|
|
83
|
-
sort:
|
|
100
|
+
sort: string;
|
|
84
101
|
items: CardCollectionItem[];
|
|
85
102
|
view: CardCollectionView;
|
|
86
|
-
|
|
103
|
+
sortOptions: string[];
|
|
87
104
|
} & {} & {
|
|
88
105
|
[x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
|
|
89
106
|
}, {
|
|
90
107
|
search: string;
|
|
91
|
-
sort: SortHeaderModel;
|
|
92
108
|
items: CardCollectionItem[];
|
|
93
109
|
view: CardCollectionView;
|
|
94
|
-
|
|
110
|
+
sortOptions: string[];
|
|
95
111
|
}, true>);
|
|
96
112
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CardCollectionView, s as OrCardCollectionV3 } from '../../OrCardCollection-
|
|
1
|
+
export { C as CardCollectionView, s as OrCardCollectionV3 } from '../../OrCardCollection-9d0036fa.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../useClassAttribute-47fdb016.js';
|
|
4
4
|
import '@vueuse/core';
|
|
@@ -13,10 +13,14 @@ import '../../useResponsive-a02e95b7.js';
|
|
|
13
13
|
import '../../OrBottomSheet-62817aec.js';
|
|
14
14
|
import '../../OrOverlay-738a44d5.js';
|
|
15
15
|
import '../../OrTeleport.vue3-8099178c.js';
|
|
16
|
+
import '../../OrMenu-840038cd.js';
|
|
17
|
+
import '../../OrMenuItem-9da279f6.js';
|
|
18
|
+
import '../../OrButton-f4b9ee51.js';
|
|
19
|
+
import '../../OrLoader-b3cf4231.js';
|
|
20
|
+
import '../../OrSearch-01225d82.js';
|
|
16
21
|
import '../../OrInput-e2ac1182.js';
|
|
17
22
|
import '../../OrError-ec8c709d.js';
|
|
18
23
|
import '../../OrHint-74bb732d.js';
|
|
19
24
|
import '../../OrInputBox-5247ab25.js';
|
|
20
25
|
import '../../OrLabel-bdaec602.js';
|
|
21
26
|
import '../../style-inject.es-4c6f2515.js';
|
|
22
|
-
import '../../OrSortHeader-fe1a9cf8.js';
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -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-
|
|
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';
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
|
|
|
5
5
|
import OrCardCollection from './OrCardCollection.vue';
|
|
6
6
|
import { OrCardV3 as OrCard } from '../or-card-v3';
|
|
7
7
|
import { CardCollectionView } from './props';
|
|
8
|
-
import { CardCollectionItem
|
|
8
|
+
import { CardCollectionItem } from './types';
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
11
|
title: 'Components/Card Collection',
|
|
@@ -71,6 +71,7 @@ export default {
|
|
|
71
71
|
docs: {
|
|
72
72
|
page: OrCardCollectionDocs,
|
|
73
73
|
},
|
|
74
|
+
layout: 'fullscreen',
|
|
74
75
|
},
|
|
75
76
|
} as Meta<typeof OrCardCollection>;
|
|
76
77
|
|
|
@@ -91,17 +92,19 @@ const Template: StoryFn<typeof OrCardCollection> = (args) => ({
|
|
|
91
92
|
},
|
|
92
93
|
|
|
93
94
|
template: `
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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>
|
|
105
108
|
`,
|
|
106
109
|
});
|
|
107
110
|
|
|
@@ -152,15 +155,13 @@ WithSorting.args = {
|
|
|
152
155
|
...Default.args,
|
|
153
156
|
|
|
154
157
|
// Props
|
|
155
|
-
|
|
158
|
+
sort: 'Bar',
|
|
159
|
+
sortOptions: [
|
|
156
160
|
'Foo',
|
|
157
161
|
'Bar',
|
|
158
162
|
'Baz',
|
|
159
163
|
'Qux',
|
|
160
|
-
],
|
|
161
|
-
value: item.toLowerCase(),
|
|
162
|
-
label: item,
|
|
163
|
-
})),
|
|
164
|
+
],
|
|
164
165
|
};
|
|
165
166
|
|
|
166
167
|
|
|
@@ -181,35 +182,37 @@ export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) =>
|
|
|
181
182
|
},
|
|
182
183
|
|
|
183
184
|
template: `
|
|
184
|
-
<
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
<
|
|
192
|
-
|
|
193
|
-
<
|
|
194
|
-
|
|
195
|
-
:key="item.id"
|
|
196
|
-
>
|
|
197
|
-
{{ item.label }}
|
|
198
|
-
</OrCard>
|
|
199
|
-
</div>
|
|
200
|
-
</template>
|
|
201
|
-
<template #list="{items}">
|
|
202
|
-
<div class="typography-headline-3">Custom list</div>
|
|
203
|
-
<ul>
|
|
204
|
-
<li
|
|
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
|
|
205
196
|
v-for="item in items"
|
|
206
197
|
:key="item.id"
|
|
207
198
|
>
|
|
208
|
-
|
|
209
|
-
</
|
|
210
|
-
</
|
|
199
|
+
{{ item.label }}
|
|
200
|
+
</OrCard>
|
|
201
|
+
</div>
|
|
211
202
|
</template>
|
|
212
|
-
|
|
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>
|
|
213
216
|
`,
|
|
214
217
|
});
|
|
215
218
|
|
|
@@ -235,16 +238,18 @@ export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
|
|
|
235
238
|
},
|
|
236
239
|
|
|
237
240
|
template: `
|
|
238
|
-
<
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
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>
|
|
248
253
|
`,
|
|
249
254
|
});
|
|
250
255
|
|
|
@@ -6,37 +6,55 @@
|
|
|
6
6
|
>
|
|
7
7
|
<div :class="toolbarStyles">
|
|
8
8
|
<div :class="toolbarPanelStyles">
|
|
9
|
-
<template v-if="
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
<template v-if="sortOptions.length">
|
|
10
|
+
<OrButton
|
|
11
|
+
ref="sortButton"
|
|
12
|
+
variant="link"
|
|
13
|
+
color="inherit"
|
|
14
|
+
@click="sortMenu.toggle()"
|
|
15
15
|
>
|
|
16
|
-
{{
|
|
17
|
-
|
|
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
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
<OrIconButton
|
|
52
|
+
:icon="'view_agenda'"
|
|
53
|
+
@click="switchToListView()"
|
|
54
|
+
/>
|
|
38
55
|
|
|
39
|
-
|
|
56
|
+
<slot name="addon" />
|
|
57
|
+
</div>
|
|
40
58
|
</div>
|
|
41
59
|
</div>
|
|
42
60
|
|
|
@@ -63,16 +81,19 @@
|
|
|
63
81
|
import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
|
|
64
82
|
import { useClassAttribute } from '../../hooks';
|
|
65
83
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
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';
|
|
68
87
|
import { CardCollectionView } from './props';
|
|
69
88
|
import {
|
|
70
89
|
CardCollectionRoot,
|
|
71
90
|
CardCollectionToolbar,
|
|
72
91
|
CardCollectionToolbarPanel,
|
|
73
92
|
} from './styles';
|
|
74
|
-
import { CardCollectionItem
|
|
93
|
+
import { CardCollectionItem } from './types';
|
|
75
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';
|
|
76
97
|
|
|
77
98
|
export default defineComponent({
|
|
78
99
|
name: 'OrCardCollection',
|
|
@@ -80,8 +101,11 @@ export default defineComponent({
|
|
|
80
101
|
components: {
|
|
81
102
|
OrCardCollectionView,
|
|
82
103
|
OrIconButton,
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
OrButton,
|
|
105
|
+
OrMenu,
|
|
106
|
+
OrMenuItem,
|
|
107
|
+
OrIcon,
|
|
108
|
+
OrSearch,
|
|
85
109
|
},
|
|
86
110
|
|
|
87
111
|
inheritAttrs: false,
|
|
@@ -97,13 +121,13 @@ export default defineComponent({
|
|
|
97
121
|
},
|
|
98
122
|
|
|
99
123
|
sort: {
|
|
100
|
-
type:
|
|
101
|
-
|
|
124
|
+
type: String,
|
|
125
|
+
required: true,
|
|
102
126
|
},
|
|
103
127
|
|
|
104
|
-
|
|
105
|
-
type: Array as PropType<
|
|
106
|
-
default:
|
|
128
|
+
sortOptions: {
|
|
129
|
+
type: Array as PropType<string[]>,
|
|
130
|
+
default: () => [],
|
|
107
131
|
},
|
|
108
132
|
|
|
109
133
|
search: {
|
|
@@ -125,6 +149,8 @@ export default defineComponent({
|
|
|
125
149
|
setup(props, context) {
|
|
126
150
|
// Refs
|
|
127
151
|
const root = ref<HTMLElement>();
|
|
152
|
+
const sortMenu = ref<typeof OrMenu>();
|
|
153
|
+
const sortButton = ref<typeof OrButton>();
|
|
128
154
|
|
|
129
155
|
// Styles
|
|
130
156
|
const classAttribute = useClassAttribute();
|
|
@@ -157,6 +183,14 @@ export default defineComponent({
|
|
|
157
183
|
proxyView.value = CardCollectionView.List;
|
|
158
184
|
}
|
|
159
185
|
|
|
186
|
+
function handleSort(sort: string) {
|
|
187
|
+
proxySort.value = sort;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function handleSearch(search: string) {
|
|
191
|
+
proxySearch.value = search;
|
|
192
|
+
}
|
|
193
|
+
|
|
160
194
|
// Effects
|
|
161
195
|
watch(() => props.view, (value) => {
|
|
162
196
|
proxyView.value = value;
|
|
@@ -184,6 +218,8 @@ export default defineComponent({
|
|
|
184
218
|
|
|
185
219
|
return {
|
|
186
220
|
root,
|
|
221
|
+
sortMenu,
|
|
222
|
+
sortButton,
|
|
187
223
|
rootStyles,
|
|
188
224
|
toolbarStyles,
|
|
189
225
|
toolbarPanelStyles,
|
|
@@ -192,6 +228,8 @@ export default defineComponent({
|
|
|
192
228
|
proxySearch,
|
|
193
229
|
switchToGridView,
|
|
194
230
|
switchToListView,
|
|
231
|
+
handleSort,
|
|
232
|
+
handleSearch,
|
|
195
233
|
};
|
|
196
234
|
},
|
|
197
235
|
});
|