@onereach/ui-components 2.69.3 → 2.69.4

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 (76) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/OrCardCollection-f622df47.js +346 -0
  3. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-a11b3621.js} +9 -3
  4. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  5. package/dist/bundled/v2/components/index.js +4 -4
  6. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  7. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  8. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  9. package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
  10. package/dist/bundled/v2/components/or-card-collection-v3/props.d.ts +5 -1
  11. package/dist/bundled/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  12. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +8 -3
  13. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  14. package/dist/bundled/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  15. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  16. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  17. package/dist/bundled/v2/index.js +5 -5
  18. package/dist/bundled/v3/OrButton-a671b8a1.js +33 -0
  19. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-15645a65.js +228 -0
  20. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-49a3a9bd.js → OrConfirm.vue_vue_type_script_lang-f57ffa1a.js} +6 -36
  21. package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
  22. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-0ae8a6dd.js} +8 -2
  23. package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
  24. package/dist/bundled/v3/components/index.js +8 -6
  25. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  26. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  27. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  28. package/dist/bundled/v3/components/or-card-collection-v3/index.js +11 -4
  29. package/dist/bundled/v3/components/or-card-collection-v3/props.d.ts +5 -1
  30. package/dist/bundled/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  31. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +8 -3
  32. package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
  33. package/dist/bundled/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  34. package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
  35. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  36. package/dist/bundled/v3/index.js +326 -295
  37. package/dist/esm/v2/OrCardCollection-43aa4a3c.js +346 -0
  38. package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-62d91301.js} +7 -1
  39. package/dist/esm/v2/components/index.js +2 -2
  40. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  41. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  42. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  43. package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
  44. package/dist/esm/v2/components/or-card-collection-v3/props.d.ts +5 -1
  45. package/dist/esm/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  46. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +8 -3
  47. package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  48. package/dist/esm/v2/components/or-search-v3/index.js +1 -1
  49. package/dist/esm/v2/index.js +2 -2
  50. package/dist/esm/v3/OrCardCollection-6b5e6b76.js +289 -0
  51. package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-aafb93b4.js} +7 -1
  52. package/dist/esm/v3/components/index.js +2 -2
  53. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  54. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  55. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  56. package/dist/esm/v3/components/or-card-collection-v3/index.js +7 -4
  57. package/dist/esm/v3/components/or-card-collection-v3/props.d.ts +5 -1
  58. package/dist/esm/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  59. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +8 -3
  60. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  61. package/dist/esm/v3/components/or-search-v3/index.js +1 -1
  62. package/dist/esm/v3/index.js +2 -2
  63. package/package.json +2 -2
  64. package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +4 -0
  65. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +230 -30
  66. package/src/components/or-card-collection-v3/OrCardCollection.vue +120 -77
  67. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
  68. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
  69. package/src/components/or-card-collection-v3/props.ts +14 -1
  70. package/src/components/or-card-collection-v3/styles.ts +3 -3
  71. package/src/components/or-card-collection-v3/types.ts +9 -3
  72. package/src/components/or-search-v3/OrSearch.vue +7 -1
  73. package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
  74. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-861158b5.js +0 -164
  75. package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
  76. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -1,7 +1,12 @@
1
1
  export interface CardCollectionItem {
2
- id: string;
2
+ key?: string;
3
+ [key: string | number]: any;
3
4
  }
4
- export interface CardCollectionSortHeader {
5
- value: string;
5
+ export interface ViewMode {
6
+ view: string;
7
+ icon: string;
8
+ }
9
+ export interface SortOption {
6
10
  label: string;
11
+ value: string;
7
12
  }
@@ -11,6 +11,11 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
11
11
  focus: () => void;
12
12
  clear: () => void;
13
13
  }> & import("@vue/composition-api").Data, {}, {}, {
14
+ modelValue: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ required: false;
18
+ };
14
19
  size: {
15
20
  type: PropType<SearchSize>;
16
21
  default: SearchSize;
@@ -32,6 +37,11 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
32
37
  default: boolean;
33
38
  };
34
39
  }, import("@vue/composition-api").ExtractPropTypes<{
40
+ modelValue: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ required: false;
44
+ };
35
45
  size: {
36
46
  type: PropType<SearchSize>;
37
47
  default: SearchSize;
@@ -53,6 +63,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
53
63
  default: boolean;
54
64
  };
55
65
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
66
+ modelValue: string;
56
67
  size: SearchSize;
57
68
  placeholder: string;
58
69
  debounce: number;
@@ -71,6 +82,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
71
82
  focus: () => void;
72
83
  clear: () => void;
73
84
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
85
+ modelValue: string;
74
86
  size: SearchSize;
75
87
  placeholder: string;
76
88
  debounce: number;
@@ -79,6 +91,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
79
91
  } & {} & {
80
92
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
81
93
  }, {
94
+ modelValue: string;
82
95
  size: SearchSize;
83
96
  placeholder: string;
84
97
  debounce: number;
@@ -1,4 +1,4 @@
1
- export { _ as OrSearchV3 } from '../../OrSearch-ddb7c1fe.js';
1
+ export { _ as OrSearchV3 } from '../../OrSearch-62d91301.js';
2
2
  export { a as SearchSize } from '../../OrInputBox-4d5a318d.js';
3
3
  import 'vue-demi';
4
4
  import '@vueuse/core';
@@ -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-357e1e2c.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-4f001551.js';
11
+ export { D as DefaultCardCollectionViews, _ as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from './OrCardCollection-43aa4a3c.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';
@@ -63,7 +63,7 @@ export { _ as OrProgressV3, P as ProgressColor, a as ProgressType } from './OrPr
63
63
  export { _ as OrRadio } from './OrRadio-e4198532.js';
64
64
  export { _ as OrRadioGroup } from './OrRadioGroup-d9d32cba.js';
65
65
  export { _ as OrRadioV3 } from './OrRadio-848ce55d.js';
66
- export { _ as OrSearchV3 } from './OrSearch-ddb7c1fe.js';
66
+ export { _ as OrSearchV3 } from './OrSearch-62d91301.js';
67
67
  export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-e8dce8f9.js';
68
68
  export { _ as OrSelect } from './OrSelect-dae2b069.js';
69
69
  export { _ as OrSelectV3 } from './OrSelect-f0ff5a85.js';
@@ -0,0 +1,289 @@
1
+ import { defineComponent, computed, ref, watch } from 'vue-demi';
2
+ import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
3
+ import '@vueuse/core';
4
+ import { s as script$2 } from './OrIconButton-1eebcafc.js';
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, createTextVNode, toDisplayString, resolveComponent, createElementVNode, createVNode, withCtx, createBlock, createCommentVNode, normalizeProps, guardReactiveProps } from 'vue';
10
+ import { s as script$3 } from './OrButton-bb6bf8a9.js';
11
+ import { s as script$7 } from './OrSearch-aafb93b4.js';
12
+ import './OrInputBox-5247ab25.js';
13
+
14
+ const CardCollectionRoot = [
15
+ // Layout
16
+ 'layout-column',
17
+ // Spacing
18
+ 'gap-md'];
19
+ const CardCollectionToolbar = [
20
+ // Layout
21
+ 'layout-row justify-between',
22
+ // Typography
23
+ 'typography-body-2-regular',
24
+ // Theme
25
+ 'theme-foreground-default', 'dark:theme-foreground-default-dark'];
26
+ const CardCollectionToolbarPanel = [
27
+ // Layout
28
+ 'layout-row',
29
+ // Spacing
30
+ 'gap-lg+'];
31
+ const CardCollectionContent = [
32
+ // Layout
33
+ 'grid',
34
+ // Spacing
35
+ 'gap-sm md:gap-md'];
36
+ const CardCollectionContentViews = {
37
+ 'grid': [
38
+ // Layout
39
+ 'sm:grid-cols-1', 'md:grid-cols-2', 'lg:grid-cols-4', 'xl:grid-cols-6'],
40
+ 'list': []
41
+ };
42
+
43
+ var script$1 = defineComponent({
44
+ name: 'OrCardCollectionView',
45
+ props: {
46
+ items: {
47
+ type: Array,
48
+ default: []
49
+ },
50
+ mode: {
51
+ type: String,
52
+ required: true
53
+ }
54
+ },
55
+ setup(props) {
56
+ const contentStyles = computed(() => [...CardCollectionContent, ...CardCollectionContentViews[props.mode]]);
57
+ return {
58
+ contentStyles
59
+ };
60
+ }
61
+ });
62
+
63
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
64
+ return openBlock(), createElementBlock("div", {
65
+ class: normalizeClass(_ctx.contentStyles)
66
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index) => {
67
+ return renderSlot(_ctx.$slots, "item", mergeProps({
68
+ key: item.key || index
69
+ }, {
70
+ item,
71
+ mode: _ctx.mode
72
+ }), () => [createTextVNode(toDisplayString(item.key), 1 /* TEXT */)]);
73
+ }), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */);
74
+ }
75
+
76
+ script$1.render = render$1;
77
+ script$1.__file = "src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue";
78
+
79
+ var DefaultCardCollectionViews;
80
+ (function (DefaultCardCollectionViews) {
81
+ DefaultCardCollectionViews["Grid"] = "grid";
82
+ DefaultCardCollectionViews["List"] = "list";
83
+ })(DefaultCardCollectionViews || (DefaultCardCollectionViews = {}));
84
+ const gridView = {
85
+ view: DefaultCardCollectionViews.Grid,
86
+ icon: 'grid_view'
87
+ };
88
+ const listView = {
89
+ view: DefaultCardCollectionViews.List,
90
+ icon: 'view_agenda'
91
+ };
92
+ const defaultViewModes = [gridView, listView];
93
+
94
+ var script = defineComponent({
95
+ name: 'OrCardCollection',
96
+ components: {
97
+ OrCardCollectionView: script$1,
98
+ OrIconButton: script$2,
99
+ OrButton: script$3,
100
+ OrMenu: script$4,
101
+ OrMenuItem: script$5,
102
+ OrIcon: script$6,
103
+ OrSearch: script$7
104
+ },
105
+ inheritAttrs: false,
106
+ props: {
107
+ items: {
108
+ type: Array,
109
+ default: []
110
+ },
111
+ view: {
112
+ type: String,
113
+ default: gridView.view
114
+ },
115
+ viewModes: {
116
+ type: Array,
117
+ default: () => defaultViewModes
118
+ },
119
+ sort: {
120
+ type: String,
121
+ default: undefined
122
+ },
123
+ sortOptions: {
124
+ type: Array,
125
+ default: () => []
126
+ },
127
+ search: {
128
+ type: String,
129
+ default: ''
130
+ }
131
+ },
132
+ emits: ['viewChange', 'sortChange', 'searchChange'],
133
+ expose: ['root'],
134
+ setup(props, context) {
135
+ // Refs
136
+ const root = ref();
137
+ const sortMenu = ref();
138
+ const sortButton = ref();
139
+ // Styles
140
+ const classAttribute = useClassAttribute();
141
+ const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
142
+ const toolbarStyles = computed(() => [...CardCollectionToolbar]);
143
+ const toolbarPanelStyles = computed(() => [...CardCollectionToolbarPanel]);
144
+ const sortLabel = computed(() => {
145
+ var _a;
146
+ return (_a = props.sortOptions.find(item => item.value === props.sort)) === null || _a === void 0 ? void 0 : _a.label;
147
+ });
148
+ // State
149
+ const proxyView = ref(props.view);
150
+ const proxySort = ref(props.sort);
151
+ const proxySearch = ref(props.search);
152
+ // Methods
153
+ function switchView(view) {
154
+ proxyView.value = view;
155
+ }
156
+ function handleSort(sort) {
157
+ proxySort.value = sort;
158
+ }
159
+ function handleSearch(search) {
160
+ proxySearch.value = search;
161
+ }
162
+ // Effects
163
+ watch(() => props.view, value => {
164
+ proxyView.value = value;
165
+ });
166
+ watch(proxyView, value => {
167
+ context.emit('viewChange', value);
168
+ });
169
+ watch(() => props.sort, value => {
170
+ proxySort.value = value;
171
+ });
172
+ watch(proxySort, value => {
173
+ context.emit('sortChange', value);
174
+ });
175
+ watch(() => props.search, value => {
176
+ proxySearch.value = value;
177
+ });
178
+ watch(proxySearch, value => {
179
+ context.emit('searchChange', value);
180
+ });
181
+ return {
182
+ root,
183
+ sortMenu,
184
+ sortButton,
185
+ rootStyles,
186
+ toolbarStyles,
187
+ toolbarPanelStyles,
188
+ proxyView,
189
+ proxySort,
190
+ proxySearch,
191
+ sortLabel,
192
+ switchView,
193
+ handleSort,
194
+ handleSearch
195
+ };
196
+ }
197
+ });
198
+
199
+ const _hoisted_1 = {
200
+ class: "layout-row gap-sm"
201
+ };
202
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
203
+ const _component_OrIcon = resolveComponent("OrIcon");
204
+ const _component_OrButton = resolveComponent("OrButton");
205
+ const _component_OrMenuItem = resolveComponent("OrMenuItem");
206
+ const _component_OrMenu = resolveComponent("OrMenu");
207
+ const _component_OrSearch = resolveComponent("OrSearch");
208
+ const _component_OrIconButton = resolveComponent("OrIconButton");
209
+ const _component_OrCardCollectionView = resolveComponent("OrCardCollectionView");
210
+ return openBlock(), createElementBlock("div", mergeProps({
211
+ ref: "root"
212
+ }, _ctx.$attrs, {
213
+ class: _ctx.rootStyles
214
+ }), [createElementVNode("div", {
215
+ class: normalizeClass(_ctx.toolbarStyles)
216
+ }, [createElementVNode("div", {
217
+ class: normalizeClass(_ctx.toolbarPanelStyles)
218
+ }, [_ctx.sortOptions.length ? (openBlock(), createElementBlock(Fragment, {
219
+ key: 0
220
+ }, [createVNode(_component_OrButton, {
221
+ ref: "sortButton",
222
+ variant: "link",
223
+ color: "inherit",
224
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.sortMenu.toggle())
225
+ }, {
226
+ default: withCtx(() => [createTextVNode(toDisplayString(_ctx.sortLabel) + " ", 1 /* TEXT */), _ctx.sortMenu ? (openBlock(), createBlock(_component_OrIcon, {
227
+ key: 0,
228
+ icon: _ctx.sortMenu.isOpen ? 'arrow_drop_up' : 'arrow_drop_down'
229
+ }, null, 8 /* PROPS */, ["icon"])) : createCommentVNode("v-if", true)]),
230
+ _: 1 /* STABLE */
231
+ }, 512 /* NEED_PATCH */), createVNode(_component_OrMenu, {
232
+ ref: "sortMenu",
233
+ trigger: _ctx.sortButton && _ctx.sortButton.root
234
+ }, {
235
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sortOptions, sortItem => {
236
+ return openBlock(), createBlock(_component_OrMenuItem, {
237
+ key: sortItem,
238
+ onClick: $event => _ctx.handleSort(sortItem.value)
239
+ }, {
240
+ default: withCtx(() => [createTextVNode(toDisplayString(sortItem.label), 1 /* TEXT */)]),
241
+
242
+ _: 2 /* DYNAMIC */
243
+ }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]);
244
+ }), 128 /* KEYED_FRAGMENT */))]),
245
+
246
+ _: 1 /* STABLE */
247
+ }, 8 /* PROPS */, ["trigger"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), createElementVNode("div", {
248
+ class: normalizeClass(_ctx.toolbarPanelStyles)
249
+ }, [createVNode(_component_OrSearch, {
250
+ modelValue: _ctx.proxySearch,
251
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.proxySearch = $event),
252
+ class: "md:w-[350px]",
253
+ size: "s",
254
+ onSearch: _ctx.handleSearch
255
+ }, null, 8 /* PROPS */, ["modelValue", "onSearch"]), createElementVNode("div", _hoisted_1, [_ctx.viewModes.length > 1 ? (openBlock(true), createElementBlock(Fragment, {
256
+ key: 0
257
+ }, renderList(_ctx.viewModes, viewOption => {
258
+ return openBlock(), createBlock(_component_OrIconButton, {
259
+ key: viewOption.view,
260
+ icon: {
261
+ icon: viewOption.icon,
262
+ variant: viewOption.view === _ctx.proxyView ? 'filled' : 'outlined'
263
+ },
264
+ onClick: $event => _ctx.switchView(viewOption.view)
265
+ }, null, 8 /* PROPS */, ["icon", "onClick"]);
266
+ }), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "addon")])], 2 /* CLASS */)], 2 /* CLASS */), renderSlot(_ctx.$slots, "header", normalizeProps(guardReactiveProps({
267
+ items: _ctx.items,
268
+ mode: _ctx.proxyView
269
+ }))), _ctx.items.length ? renderSlot(_ctx.$slots, _ctx.proxyView, normalizeProps(mergeProps({
270
+ key: 0
271
+ }, {
272
+ items: _ctx.items
273
+ })), () => [createVNode(_component_OrCardCollectionView, {
274
+ items: _ctx.items,
275
+ mode: _ctx.proxyView
276
+ }, {
277
+ item: withCtx(props => [renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(props)))]),
278
+ _: 3 /* FORWARDED */
279
+ }, 8 /* PROPS */, ["items", "mode"])]) : _ctx.items.length === 0 && _ctx.proxySearch.length > 0 ? renderSlot(_ctx.$slots, "noSearchResults", normalizeProps(mergeProps({
280
+ key: 1
281
+ }, {
282
+ search: _ctx.proxySearch
283
+ })), () => [createTextVNode(" No results ")]) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */);
284
+ }
285
+
286
+ script.render = render;
287
+ script.__file = "src/components/or-card-collection-v3/OrCardCollection.vue";
288
+
289
+ export { DefaultCardCollectionViews as D, defaultViewModes as d, gridView as g, listView as l, script as s };
@@ -12,6 +12,11 @@ var script = defineComponent({
12
12
  },
13
13
  inheritAttrs: false,
14
14
  props: {
15
+ modelValue: {
16
+ type: String,
17
+ default: '',
18
+ required: false
19
+ },
15
20
  size: {
16
21
  type: String,
17
22
  default: InputBoxSize.M
@@ -36,13 +41,14 @@ var script = defineComponent({
36
41
  emits: ['search', 'input', 'keydown', 'keyup', 'focus', 'blur', 'clear'],
37
42
  expose: ['root', 'focus', 'clear'],
38
43
  setup(props, context) {
44
+ var _a;
39
45
  // Refs
40
46
  const root = ref();
41
47
  // Styles
42
48
  const classAttribute = useClassAttribute();
43
49
  const rootStyles = computed(() => ['or-search', classAttribute.value]);
44
50
  // State
45
- const localModelValue = ref('');
51
+ const localModelValue = ref((_a = props.modelValue) !== null && _a !== void 0 ? _a : '');
46
52
  // Events
47
53
  debouncedWatch(localModelValue, () => context.emit('search', localModelValue.value), {
48
54
  debounce: props.debounce
@@ -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-bb6bf8a9.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 { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from '../OrCardCollection-6b5e6b76.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';
@@ -58,7 +58,7 @@ export { s as OrProgressV3, P as ProgressColor, a as ProgressType } from '../OrP
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-aafb93b4.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
64
  export { s as OrSelectV3 } from '../OrSelect-7e813982.js';
@@ -1,4 +1,5 @@
1
1
  import { Meta, StoryFn } from '@storybook/vue3';
2
+ import OrCardCollection from './OrCardCollection.vue';
2
3
  declare const _default: Meta<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, {
3
4
  [x: string]: ((...args: any[]) => any) | null;
4
5
  } | string[], {} & {}, {
@@ -15,3 +16,7 @@ export declare const WithSorting: StoryFn<import("vue").ComponentOptions<import(
15
16
  } | string[], {} & {}, {
16
17
  [x: number]: string;
17
18
  } | {}, true>)>;
19
+ export declare const OverrideViewContainer: StoryFn<typeof OrCardCollection>;
20
+ export declare const ExtraViewMode: StoryFn<typeof OrCardCollection>;
21
+ export declare const WithLink: StoryFn<typeof OrCardCollection>;
22
+ export declare const EmptySearchResults: StoryFn<typeof OrCardCollection>;
@@ -1,41 +1,51 @@
1
1
  import { PropType } from 'vue-demi';
2
- import { SortHeaderModel } from '../or-sort-header-v3';
3
- import { CardCollectionView } from './props';
4
- import { CardCollectionItem, CardCollectionSortHeader } from './types';
2
+ import { CardCollectionItem, SortOption, ViewMode } from './types';
5
3
  declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
6
4
  root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
5
+ 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, {
6
+ [x: string]: ((...args: any[]) => any) | null;
7
+ } | string[], {} & {}, {
8
+ [x: number]: string;
9
+ } | {}, true>)) | undefined>;
10
+ 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, {
11
+ [x: string]: ((...args: any[]) => any) | null;
12
+ } | string[], {} & {}, {
13
+ [x: number]: string;
14
+ } | {}, true>)) | undefined>;
7
15
  rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
8
16
  toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
9
17
  toolbarPanelStyles: import("@vue/composition-api").ComputedRef<string[]>;
10
- contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
11
- proxyView: import("@vue/composition-api").Ref<CardCollectionView>;
12
- proxySort: import("@vue/composition-api").Ref<{
13
- column: string;
14
- direction: "asc" | "desc";
15
- }>;
18
+ proxyView: import("@vue/composition-api").Ref<string>;
19
+ proxySort: import("@vue/composition-api").Ref<string>;
16
20
  proxySearch: import("@vue/composition-api").Ref<string>;
17
- switchToGridView: () => void;
18
- switchToListView: () => void;
21
+ sortLabel: import("@vue/composition-api").ComputedRef<string | undefined>;
22
+ switchView: (view: string) => void;
23
+ handleSort: (sort: string) => void;
24
+ handleSearch: (search: string) => void;
19
25
  }> & import("@vue/composition-api").Data, {}, {}, {
20
26
  items: {
21
27
  type: PropType<CardCollectionItem[]>;
22
28
  default: CardCollectionItem[];
23
29
  };
24
30
  view: {
25
- type: PropType<CardCollectionView>;
26
- default: CardCollectionView;
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ viewModes: {
35
+ type: PropType<ViewMode[]>;
36
+ default: () => ViewMode[];
27
37
  };
28
38
  sort: {
29
- type: PropType<SortHeaderModel>;
39
+ type: StringConstructor;
30
40
  default: undefined;
31
41
  };
32
- sortHeaders: {
33
- type: PropType<CardCollectionSortHeader[]>;
34
- default: undefined;
42
+ sortOptions: {
43
+ type: PropType<SortOption[]>;
44
+ default: () => never[];
35
45
  };
36
46
  search: {
37
47
  type: StringConstructor;
38
- default: undefined;
48
+ default: string;
39
49
  };
40
50
  }, import("@vue/composition-api").ExtractPropTypes<{
41
51
  items: {
@@ -43,56 +53,71 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
43
53
  default: CardCollectionItem[];
44
54
  };
45
55
  view: {
46
- type: PropType<CardCollectionView>;
47
- default: CardCollectionView;
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ viewModes: {
60
+ type: PropType<ViewMode[]>;
61
+ default: () => ViewMode[];
48
62
  };
49
63
  sort: {
50
- type: PropType<SortHeaderModel>;
64
+ type: StringConstructor;
51
65
  default: undefined;
52
66
  };
53
- sortHeaders: {
54
- type: PropType<CardCollectionSortHeader[]>;
55
- default: undefined;
67
+ sortOptions: {
68
+ type: PropType<SortOption[]>;
69
+ default: () => never[];
56
70
  };
57
71
  search: {
58
72
  type: StringConstructor;
59
- default: undefined;
73
+ default: string;
60
74
  };
61
75
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
62
76
  search: string;
63
- sort: SortHeaderModel;
77
+ sort: string;
64
78
  items: CardCollectionItem[];
65
- view: CardCollectionView;
66
- sortHeaders: CardCollectionSortHeader[];
79
+ view: string;
80
+ viewModes: ViewMode[];
81
+ sortOptions: SortOption[];
67
82
  } & {} & {
68
83
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
69
84
  }, import("@vue/composition-api").ShallowUnwrapRef<{
70
85
  root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
86
+ 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, {
87
+ [x: string]: ((...args: any[]) => any) | null;
88
+ } | string[], {} & {}, {
89
+ [x: number]: string;
90
+ } | {}, true>)) | undefined>;
91
+ 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, {
92
+ [x: string]: ((...args: any[]) => any) | null;
93
+ } | string[], {} & {}, {
94
+ [x: number]: string;
95
+ } | {}, true>)) | undefined>;
71
96
  rootStyles: import("@vue/composition-api").ComputedRef<(string | undefined)[]>;
72
97
  toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
73
98
  toolbarPanelStyles: import("@vue/composition-api").ComputedRef<string[]>;
74
- contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
75
- proxyView: import("@vue/composition-api").Ref<CardCollectionView>;
76
- proxySort: import("@vue/composition-api").Ref<{
77
- column: string;
78
- direction: "asc" | "desc";
79
- }>;
99
+ proxyView: import("@vue/composition-api").Ref<string>;
100
+ proxySort: import("@vue/composition-api").Ref<string>;
80
101
  proxySearch: import("@vue/composition-api").Ref<string>;
81
- switchToGridView: () => void;
82
- switchToListView: () => void;
102
+ sortLabel: import("@vue/composition-api").ComputedRef<string | undefined>;
103
+ switchView: (view: string) => void;
104
+ handleSort: (sort: string) => void;
105
+ handleSearch: (search: string) => void;
83
106
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
84
107
  search: string;
85
- sort: SortHeaderModel;
108
+ sort: string;
86
109
  items: CardCollectionItem[];
87
- view: CardCollectionView;
88
- sortHeaders: CardCollectionSortHeader[];
110
+ view: string;
111
+ viewModes: ViewMode[];
112
+ sortOptions: SortOption[];
89
113
  } & {} & {
90
114
  [x: string & `on${string}`]: ((...args: any[]) => any) | undefined;
91
115
  }, {
92
116
  search: string;
93
- sort: SortHeaderModel;
117
+ sort: string;
94
118
  items: CardCollectionItem[];
95
- view: CardCollectionView;
96
- sortHeaders: CardCollectionSortHeader[];
119
+ view: string;
120
+ viewModes: ViewMode[];
121
+ sortOptions: SortOption[];
97
122
  }, true>);
98
123
  export default _default;
@@ -0,0 +1,35 @@
1
+ import { PropType } from 'vue-demi';
2
+ import { CardCollectionItem } from './types';
3
+ import { DefaultCardCollectionViews } from './props';
4
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
5
+ contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
6
+ }> & import("@vue/composition-api").Data, {}, {}, {
7
+ items: {
8
+ type: PropType<CardCollectionItem[]>;
9
+ default: CardCollectionItem[];
10
+ };
11
+ mode: {
12
+ type: PropType<DefaultCardCollectionViews>;
13
+ required: true;
14
+ };
15
+ }, import("@vue/composition-api").ExtractPropTypes<{
16
+ items: {
17
+ type: PropType<CardCollectionItem[]>;
18
+ default: CardCollectionItem[];
19
+ };
20
+ mode: {
21
+ type: PropType<DefaultCardCollectionViews>;
22
+ required: true;
23
+ };
24
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
25
+ items: CardCollectionItem[];
26
+ mode: DefaultCardCollectionViews;
27
+ } & {}, import("@vue/composition-api").ShallowUnwrapRef<{
28
+ contentStyles: import("@vue/composition-api").ComputedRef<string[]>;
29
+ }>, import("@vue/composition-api").Data, {}, {}, {}, {}, {}, {
30
+ items: CardCollectionItem[];
31
+ mode: DefaultCardCollectionViews;
32
+ } & {}, {
33
+ items: CardCollectionItem[];
34
+ }, true>);
35
+ export default _default;