@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.
Files changed (36) hide show
  1. package/dist/bundled/v2/{OrCardCollection-0eaf7489.js → OrCardCollection-94a30a19.js} +67 -37
  2. package/dist/bundled/v2/{OrSearch-e34afaee.js → OrSearch-3ece0ef6.js} +2 -2
  3. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  4. package/dist/bundled/v2/components/index.js +3 -3
  5. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
  6. package/dist/bundled/v2/components/or-card-collection-v3/index.js +6 -2
  7. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  8. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  9. package/dist/bundled/v2/index.js +4 -4
  10. package/dist/bundled/v3/OrButton-8ab33d9d.js +33 -0
  11. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-26d9a7c8.js → OrCardCollection.vue_vue_type_script_lang-0e029303.js} +63 -35
  12. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-2e7fa659.js → OrConfirm.vue_vue_type_script_lang-18997376.js} +6 -36
  13. package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
  14. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-1d2a20e0.js → OrSearch.vue_vue_type_script_lang-147a1fb9.js} +1 -1
  15. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
  16. package/dist/bundled/v3/components/index.js +9 -7
  17. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
  18. package/dist/bundled/v3/components/or-card-collection-v3/index.js +10 -2
  19. package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
  20. package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
  21. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  22. package/dist/bundled/v3/index.js +188 -173
  23. package/dist/esm/v2/{OrCardCollection-7bf35252.js → OrCardCollection-54648673.js} +69 -37
  24. package/dist/esm/v2/components/index.js +1 -1
  25. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
  26. package/dist/esm/v2/components/or-card-collection-v3/index.js +6 -2
  27. package/dist/esm/v2/index.js +1 -1
  28. package/dist/esm/v3/{OrCardCollection-9682c6ef.js → OrCardCollection-9d0036fa.js} +76 -36
  29. package/dist/esm/v3/components/index.js +1 -1
  30. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +42 -26
  31. package/dist/esm/v3/components/or-card-collection-v3/index.js +6 -2
  32. package/dist/esm/v3/index.js +1 -1
  33. package/package.json +1 -1
  34. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +57 -52
  35. package/src/components/or-card-collection-v3/OrCardCollection.vue +72 -34
  36. package/src/components/or-card-collection-v3/styles.ts +1 -1
@@ -2,9 +2,14 @@ import { defineComponent, computed, ref, watch } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
3
  import '@vueuse/core';
4
4
  import { _ as __vue_component__$2 } from './OrIconButton-e17e4944.js';
5
- import { _ as __vue_component__$3 } from './OrInput-b8a1627f.js';
6
- import { _ as __vue_component__$4 } from './OrSortHeader-19bf94ca.js';
5
+ import { _ as __vue_component__$4 } from './OrMenu-df27d0ef.js';
6
+ import './OrPopover-9bafbdb4.js';
7
+ import { _ as __vue_component__$5 } from './OrMenuItem-c7f28480.js';
8
+ import { _ as __vue_component__$6 } from './OrIcon-5e394c62.js';
7
9
  import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
10
+ import { _ as __vue_component__$3 } from './OrButton-357a5756.js';
11
+ import { _ as __vue_component__$7 } from './OrSearch-0c0d1773.js';
12
+ import './OrInputBox-4d5a318d.js';
8
13
 
9
14
  var CardCollectionView;
10
15
  (function (CardCollectionView) {
@@ -28,7 +33,7 @@ const CardCollectionToolbarPanel = [
28
33
  // Layout
29
34
  'layout-row',
30
35
  // Spacing
31
- 'gap-sm+'];
36
+ 'gap-lg+'];
32
37
  const CardCollectionContent = [
33
38
  // Layout
34
39
  'grid',
@@ -104,8 +109,11 @@ var script = defineComponent({
104
109
  components: {
105
110
  OrCardCollectionView: __vue_component__$1,
106
111
  OrIconButton: __vue_component__$2,
107
- OrInput: __vue_component__$3,
108
- OrSortHeader: __vue_component__$4
112
+ OrButton: __vue_component__$3,
113
+ OrMenu: __vue_component__$4,
114
+ OrMenuItem: __vue_component__$5,
115
+ OrIcon: __vue_component__$6,
116
+ OrSearch: __vue_component__$7
109
117
  },
110
118
  inheritAttrs: false,
111
119
  props: {
@@ -118,12 +126,12 @@ var script = defineComponent({
118
126
  default: CardCollectionView.Grid
119
127
  },
120
128
  sort: {
121
- type: Object,
122
- default: undefined
129
+ type: String,
130
+ required: true
123
131
  },
124
- sortHeaders: {
132
+ sortOptions: {
125
133
  type: Array,
126
- default: undefined
134
+ default: () => []
127
135
  },
128
136
  search: {
129
137
  type: String,
@@ -135,6 +143,8 @@ var script = defineComponent({
135
143
  setup(props, context) {
136
144
  // Refs
137
145
  const root = ref();
146
+ const sortMenu = ref();
147
+ const sortButton = ref();
138
148
  // Styles
139
149
  const classAttribute = useClassAttribute();
140
150
  const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
@@ -151,6 +161,12 @@ var script = defineComponent({
151
161
  function switchToListView() {
152
162
  proxyView.value = CardCollectionView.List;
153
163
  }
164
+ function handleSort(sort) {
165
+ proxySort.value = sort;
166
+ }
167
+ function handleSearch(search) {
168
+ proxySearch.value = search;
169
+ }
154
170
  // Effects
155
171
  watch(() => props.view, value => {
156
172
  proxyView.value = value;
@@ -172,6 +188,8 @@ var script = defineComponent({
172
188
  });
173
189
  return {
174
190
  root,
191
+ sortMenu,
192
+ sortButton,
175
193
  rootStyles,
176
194
  toolbarStyles,
177
195
  toolbarPanelStyles,
@@ -179,7 +197,9 @@ var script = defineComponent({
179
197
  proxySort,
180
198
  proxySearch,
181
199
  switchToGridView,
182
- switchToListView
200
+ switchToListView,
201
+ handleSort,
202
+ handleSearch
183
203
  };
184
204
  }
185
205
  });
@@ -199,36 +219,48 @@ var __vue_render__ = function () {
199
219
  class: _vm.toolbarStyles
200
220
  }, [_c('div', {
201
221
  class: _vm.toolbarPanelStyles
202
- }, [_vm.sortHeaders ? _vm._l(_vm.sortHeaders, function (header) {
203
- return _c('OrSortHeader', {
204
- key: header.value,
205
- attrs: {
206
- "input-value": header.value
207
- },
208
- model: {
209
- value: _vm.proxySort,
210
- callback: function ($$v) {
211
- _vm.proxySort = $$v;
212
- },
213
- expression: "proxySort"
222
+ }, [_vm.sortOptions.length ? [_c('OrButton', {
223
+ ref: "sortButton",
224
+ attrs: {
225
+ "variant": "link",
226
+ "color": "inherit"
227
+ },
228
+ on: {
229
+ "click": function ($event) {
230
+ return _vm.sortMenu.toggle();
214
231
  }
215
- }, [_vm._v("\n " + _vm._s(header.label) + "\n ")]);
216
- }) : _vm._e()], 2), _vm._v(" "), _c('div', {
232
+ }
233
+ }, [_vm._v("\n " + _vm._s(_vm.proxySort) + "\n "), _vm.sortMenu ? _c('OrIcon', {
234
+ attrs: {
235
+ "icon": _vm.sortMenu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'
236
+ }
237
+ }) : _vm._e()], 1), _vm._v(" "), _c('OrMenu', {
238
+ ref: "sortMenu",
239
+ attrs: {
240
+ "trigger": _vm.sortButton && _vm.sortButton.root
241
+ }
242
+ }, _vm._l(_vm.sortOptions, function (sortItem) {
243
+ return _c('OrMenuItem', {
244
+ key: sortItem,
245
+ on: {
246
+ "click": function ($event) {
247
+ return _vm.handleSort(sortItem);
248
+ }
249
+ }
250
+ }, [_vm._v("\n " + _vm._s(sortItem) + "\n ")]);
251
+ }), 1)] : _vm._e()], 2), _vm._v(" "), _c('div', {
217
252
  class: _vm.toolbarPanelStyles
218
- }, [_c('OrInput', {
253
+ }, [_c('OrSearch', {
254
+ staticClass: "md:w-[350px]",
219
255
  attrs: {
220
- "type": 'search',
221
- "placeholder": 'Search',
222
- "size": 's'
256
+ "size": "s"
223
257
  },
224
- model: {
225
- value: _vm.proxySearch,
226
- callback: function ($$v) {
227
- _vm.proxySearch = $$v;
228
- },
229
- expression: "proxySearch"
258
+ on: {
259
+ "search": _vm.handleSearch
230
260
  }
231
- }), _vm._v(" "), _c('OrIconButton', {
261
+ }), _vm._v(" "), _c('div', {
262
+ staticClass: "layout-row gap-sm"
263
+ }, [_c('OrIconButton', {
232
264
  attrs: {
233
265
  "icon": 'grid_view'
234
266
  },
@@ -239,14 +271,14 @@ var __vue_render__ = function () {
239
271
  }
240
272
  }), _vm._v(" "), _c('OrIconButton', {
241
273
  attrs: {
242
- "icon": 'view_list'
274
+ "icon": 'view_agenda'
243
275
  },
244
276
  on: {
245
277
  "click": function ($event) {
246
278
  return _vm.switchToListView();
247
279
  }
248
280
  }
249
- }), _vm._v(" "), _vm._t("addon")], 2)]), _vm._v(" "), _vm._t(_vm.proxyView, function () {
281
+ }), _vm._v(" "), _vm._t("addon")], 2)], 1)]), _vm._v(" "), _vm._t(_vm.proxyView, function () {
250
282
  return [_c('OrCardCollectionView', {
251
283
  attrs: {
252
284
  "items": _vm.items,
@@ -8,7 +8,7 @@ export { a as BUTTON_COLOR, c as BUTTON_LOADER_TYPE, b as BUTTON_SIZE, B as BUTT
8
8
  export { a as ButtonColor, b as ButtonType, B as ButtonVariant, _ as OrButtonV3 } from '../OrButton-357a5756.js';
9
9
  export { _ as OrCard } from '../OrCard-b7268256.js';
10
10
  export { C as CARD_COLLECTION_LAYOUT, _ as OrCardCollection } from '../OrCardCollection-f6b07557.js';
11
- export { C as CardCollectionView, _ as OrCardCollectionV3 } from '../OrCardCollection-7bf35252.js';
11
+ export { C as CardCollectionView, _ as OrCardCollectionV3 } from '../OrCardCollection-54648673.js';
12
12
  export { _ as OrCardV3 } from '../OrCard-de799db0.js';
13
13
  export { a as OrCarousel, _ as OrCarouselItem } from '../OrCarouselItem-4e2cf3d8.js';
14
14
  export { _ as OrCheckbox } from '../OrCheckbox-915f1f0a.js';
@@ -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, CardCollectionSortHeader } from './types';
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: PropType<SortHeaderModel>;
29
- default: undefined;
36
+ type: StringConstructor;
37
+ required: true;
30
38
  };
31
- sortHeaders: {
32
- type: PropType<CardCollectionSortHeader[]>;
33
- default: undefined;
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: PropType<SortHeaderModel>;
50
- default: undefined;
57
+ type: StringConstructor;
58
+ required: true;
51
59
  };
52
- sortHeaders: {
53
- type: PropType<CardCollectionSortHeader[]>;
54
- default: undefined;
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: SortHeaderModel;
70
+ sort: string;
63
71
  items: CardCollectionItem[];
64
72
  view: CardCollectionView;
65
- sortHeaders: CardCollectionSortHeader[];
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: SortHeaderModel;
100
+ sort: string;
84
101
  items: CardCollectionItem[];
85
102
  view: CardCollectionView;
86
- sortHeaders: CardCollectionSortHeader[];
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
- sortHeaders: CardCollectionSortHeader[];
110
+ sortOptions: string[];
95
111
  }, true>);
96
112
  export default _default;
@@ -1,4 +1,4 @@
1
- export { C as CardCollectionView, _ as OrCardCollectionV3 } from '../../OrCardCollection-7bf35252.js';
1
+ export { C as CardCollectionView, _ as OrCardCollectionV3 } from '../../OrCardCollection-54648673.js';
2
2
  import 'vue-demi';
3
3
  import '../../useClassAttribute-47fdb016.js';
4
4
  import '@vueuse/core';
@@ -14,10 +14,14 @@ import '../../OrBottomSheet-16c2e610.js';
14
14
  import '../../OrOverlay-18ba2dc6.js';
15
15
  import '../../OrTeleport.vue2-fb92f29f.js';
16
16
  import 'portal-vue';
17
+ import '../../OrMenu-df27d0ef.js';
18
+ import '../../OrMenuItem-c7f28480.js';
19
+ import '../../OrButton-357a5756.js';
20
+ import '../../OrLoader-f857d55b.js';
21
+ import '../../OrSearch-0c0d1773.js';
17
22
  import '../../OrInput-b8a1627f.js';
18
23
  import '../../OrError-d267ee9a.js';
19
24
  import '../../OrHint-42dc9ebb.js';
20
25
  import '../../OrInputBox-4d5a318d.js';
21
26
  import '../../OrLabel-2a9f1477.js';
22
27
  import '../../browser-82dea9ed.js';
23
- import '../../OrSortHeader-19bf94ca.js';
@@ -8,7 +8,7 @@ export { a as BUTTON_COLOR, c as BUTTON_LOADER_TYPE, b as BUTTON_SIZE, B as BUTT
8
8
  export { a as ButtonColor, b as ButtonType, B as ButtonVariant, _ as OrButtonV3 } from './OrButton-357a5756.js';
9
9
  export { _ as OrCard } from './OrCard-b7268256.js';
10
10
  export { C as CARD_COLLECTION_LAYOUT, _ as OrCardCollection } from './OrCardCollection-f6b07557.js';
11
- export { C as CardCollectionView, _ as OrCardCollectionV3 } from './OrCardCollection-7bf35252.js';
11
+ export { C as CardCollectionView, _ as OrCardCollectionV3 } from './OrCardCollection-54648673.js';
12
12
  export { _ as OrCardV3 } from './OrCard-de799db0.js';
13
13
  export { a as OrCarousel, _ as OrCarouselItem } from './OrCarouselItem-4e2cf3d8.js';
14
14
  export { _ as OrCheckbox } from './OrCheckbox-915f1f0a.js';
@@ -2,9 +2,14 @@ import { defineComponent, computed, ref, watch } from 'vue-demi';
2
2
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
3
  import '@vueuse/core';
4
4
  import { s as script$2 } from './OrIconButton-1eebcafc.js';
5
- import { s as script$3 } from './OrInput-e2ac1182.js';
6
- import { s as script$4 } from './OrSortHeader-fe1a9cf8.js';
7
- import { openBlock, createElementBlock, normalizeClass, Fragment, renderList, renderSlot, mergeProps, resolveComponent, createElementVNode, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, createVNode, normalizeProps, guardReactiveProps } from 'vue';
5
+ import { s as script$4 } from './OrMenu-840038cd.js';
6
+ import './OrPopover-1075dd38.js';
7
+ import { s as script$5 } from './OrMenuItem-9da279f6.js';
8
+ import { s as script$6 } from './OrIcon-b195169c.js';
9
+ import { openBlock, createElementBlock, normalizeClass, Fragment, renderList, renderSlot, mergeProps, resolveComponent, createElementVNode, createVNode, withCtx, createTextVNode, toDisplayString, createBlock, createCommentVNode, normalizeProps, guardReactiveProps } from 'vue';
10
+ import { s as script$3 } from './OrButton-f4b9ee51.js';
11
+ import { s as script$7 } from './OrSearch-01225d82.js';
12
+ import './OrInputBox-5247ab25.js';
8
13
 
9
14
  var CardCollectionView;
10
15
  (function (CardCollectionView) {
@@ -28,7 +33,7 @@ const CardCollectionToolbarPanel = [
28
33
  // Layout
29
34
  'layout-row',
30
35
  // Spacing
31
- 'gap-sm+'];
36
+ 'gap-lg+'];
32
37
  const CardCollectionContent = [
33
38
  // Layout
34
39
  'grid',
@@ -82,8 +87,11 @@ var script = defineComponent({
82
87
  components: {
83
88
  OrCardCollectionView: script$1,
84
89
  OrIconButton: script$2,
85
- OrInput: script$3,
86
- OrSortHeader: script$4
90
+ OrButton: script$3,
91
+ OrMenu: script$4,
92
+ OrMenuItem: script$5,
93
+ OrIcon: script$6,
94
+ OrSearch: script$7
87
95
  },
88
96
  inheritAttrs: false,
89
97
  props: {
@@ -96,12 +104,12 @@ var script = defineComponent({
96
104
  default: CardCollectionView.Grid
97
105
  },
98
106
  sort: {
99
- type: Object,
100
- default: undefined
107
+ type: String,
108
+ required: true
101
109
  },
102
- sortHeaders: {
110
+ sortOptions: {
103
111
  type: Array,
104
- default: undefined
112
+ default: () => []
105
113
  },
106
114
  search: {
107
115
  type: String,
@@ -113,6 +121,8 @@ var script = defineComponent({
113
121
  setup(props, context) {
114
122
  // Refs
115
123
  const root = ref();
124
+ const sortMenu = ref();
125
+ const sortButton = ref();
116
126
  // Styles
117
127
  const classAttribute = useClassAttribute();
118
128
  const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
@@ -129,6 +139,12 @@ var script = defineComponent({
129
139
  function switchToListView() {
130
140
  proxyView.value = CardCollectionView.List;
131
141
  }
142
+ function handleSort(sort) {
143
+ proxySort.value = sort;
144
+ }
145
+ function handleSearch(search) {
146
+ proxySearch.value = search;
147
+ }
132
148
  // Effects
133
149
  watch(() => props.view, value => {
134
150
  proxyView.value = value;
@@ -150,6 +166,8 @@ var script = defineComponent({
150
166
  });
151
167
  return {
152
168
  root,
169
+ sortMenu,
170
+ sortButton,
153
171
  rootStyles,
154
172
  toolbarStyles,
155
173
  toolbarPanelStyles,
@@ -157,14 +175,22 @@ var script = defineComponent({
157
175
  proxySort,
158
176
  proxySearch,
159
177
  switchToGridView,
160
- switchToListView
178
+ switchToListView,
179
+ handleSort,
180
+ handleSearch
161
181
  };
162
182
  }
163
183
  });
164
184
 
185
+ const _hoisted_1 = {
186
+ class: "layout-row gap-sm"
187
+ };
165
188
  function render(_ctx, _cache, $props, $setup, $data, $options) {
166
- const _component_OrSortHeader = resolveComponent("OrSortHeader");
167
- const _component_OrInput = resolveComponent("OrInput");
189
+ const _component_OrIcon = resolveComponent("OrIcon");
190
+ const _component_OrButton = resolveComponent("OrButton");
191
+ const _component_OrMenuItem = resolveComponent("OrMenuItem");
192
+ const _component_OrMenu = resolveComponent("OrMenu");
193
+ const _component_OrSearch = resolveComponent("OrSearch");
168
194
  const _component_OrIconButton = resolveComponent("OrIconButton");
169
195
  const _component_OrCardCollectionView = resolveComponent("OrCardCollectionView");
170
196
  return openBlock(), createElementBlock("div", mergeProps({
@@ -175,34 +201,48 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
175
201
  class: normalizeClass(_ctx.toolbarStyles)
176
202
  }, [createElementVNode("div", {
177
203
  class: normalizeClass(_ctx.toolbarPanelStyles)
178
- }, [_ctx.sortHeaders ? (openBlock(true), createElementBlock(Fragment, {
204
+ }, [_ctx.sortOptions.length ? (openBlock(), createElementBlock(Fragment, {
179
205
  key: 0
180
- }, renderList(_ctx.sortHeaders, header => {
181
- return openBlock(), createBlock(_component_OrSortHeader, {
182
- key: header.value,
183
- modelValue: _ctx.proxySort,
184
- "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxySort = $event),
185
- "input-value": header.value
186
- }, {
187
- default: withCtx(() => [createTextVNode(toDisplayString(header.label), 1 /* TEXT */)]),
206
+ }, [createVNode(_component_OrButton, {
207
+ ref: "sortButton",
208
+ variant: "link",
209
+ color: "inherit",
210
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.sortMenu.toggle())
211
+ }, {
212
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.proxySort) + " ", 1 /* TEXT */), _ctx.sortMenu ? (openBlock(), createBlock(_component_OrIcon, {
213
+ key: 0,
214
+ icon: _ctx.sortMenu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'
215
+ }, null, 8 /* PROPS */, ["icon"])) : createCommentVNode("v-if", true)]),
216
+ _: 1 /* STABLE */
217
+ }, 512 /* NEED_PATCH */), createVNode(_component_OrMenu, {
218
+ ref: "sortMenu",
219
+ trigger: _ctx.sortButton && _ctx.sortButton.root
220
+ }, {
221
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sortOptions, sortItem => {
222
+ return openBlock(), createBlock(_component_OrMenuItem, {
223
+ key: sortItem,
224
+ onClick: $event => _ctx.handleSort(sortItem)
225
+ }, {
226
+ default: withCtx(() => [createTextVNode(toDisplayString(sortItem), 1 /* TEXT */)]),
227
+
228
+ _: 2 /* DYNAMIC */
229
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
230
+ }), 128 /* KEYED_FRAGMENT */))]),
188
231
 
189
- _: 2 /* DYNAMIC */
190
- }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "input-value"]);
191
- }), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), createElementVNode("div", {
232
+ _: 1 /* STABLE */
233
+ }, 8 /* PROPS */, ["trigger"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), createElementVNode("div", {
192
234
  class: normalizeClass(_ctx.toolbarPanelStyles)
193
- }, [createVNode(_component_OrInput, {
194
- modelValue: _ctx.proxySearch,
195
- "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.proxySearch = $event),
196
- type: 'search',
197
- placeholder: 'Search',
198
- size: 's'
199
- }, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrIconButton, {
235
+ }, [createVNode(_component_OrSearch, {
236
+ class: "md:w-[350px]",
237
+ size: "s",
238
+ onSearch: _ctx.handleSearch
239
+ }, null, 8 /* PROPS */, ["onSearch"]), createElementVNode("div", _hoisted_1, [createVNode(_component_OrIconButton, {
200
240
  icon: 'grid_view',
201
- onClick: _cache[2] || (_cache[2] = $event => _ctx.switchToGridView())
241
+ onClick: _cache[1] || (_cache[1] = $event => _ctx.switchToGridView())
202
242
  }), createVNode(_component_OrIconButton, {
203
- icon: 'view_list',
204
- onClick: _cache[3] || (_cache[3] = $event => _ctx.switchToListView())
205
- }), renderSlot(_ctx.$slots, "addon")], 2 /* CLASS */)], 2 /* CLASS */), renderSlot(_ctx.$slots, _ctx.proxyView, normalizeProps(guardReactiveProps({
243
+ icon: 'view_agenda',
244
+ onClick: _cache[2] || (_cache[2] = $event => _ctx.switchToListView())
245
+ }), renderSlot(_ctx.$slots, "addon")])], 2 /* CLASS */)], 2 /* CLASS */), renderSlot(_ctx.$slots, _ctx.proxyView, normalizeProps(guardReactiveProps({
206
246
  items: _ctx.items
207
247
  })), () => [createVNode(_component_OrCardCollectionView, {
208
248
  items: _ctx.items,
@@ -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-9682c6ef.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';