@onereach/ui-components 2.69.1-beta.2103.0 → 2.69.1-beta.2110.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 (92) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/OrCardCollection-773ae0db.js +346 -0
  3. package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-a11b3621.js} +9 -3
  4. package/dist/bundled/v2/{OrSelect-b20a9be0.js → OrSelect-759b4410.js} +1 -1
  5. package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
  6. package/dist/bundled/v2/components/index.js +6 -6
  7. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  8. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  9. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  10. package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
  11. package/dist/bundled/v2/components/or-card-collection-v3/props.d.ts +5 -1
  12. package/dist/bundled/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  13. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +8 -3
  14. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  15. package/dist/bundled/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  16. package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
  17. package/dist/bundled/v2/components/or-select-v3/index.js +2 -2
  18. package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
  19. package/dist/bundled/v2/hooks/index.js +1 -1
  20. package/dist/bundled/v2/index.js +7 -7
  21. package/dist/bundled/v2/{useOverflow-bae6342f.js → useOverflow-dc93a300.js} +1 -1
  22. package/dist/bundled/v3/OrButton-8ab33d9d.js +33 -0
  23. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-b983bda7.js +228 -0
  24. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-289b5600.js → OrConfirm.vue_vue_type_script_lang-85472b12.js} +6 -36
  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-0ae8a6dd.js} +8 -2
  27. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-15285ce4.js → OrSelect.vue_vue_type_script_lang-dfadd12f.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 +11 -9
  30. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  31. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  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 +11 -4
  34. package/dist/bundled/v3/components/or-card-collection-v3/props.d.ts +5 -1
  35. package/dist/bundled/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  36. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +8 -3
  37. package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
  38. package/dist/bundled/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  39. package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
  40. package/dist/bundled/v3/components/or-select-v3/index.js +2 -2
  41. package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
  42. package/dist/bundled/v3/hooks/index.js +1 -1
  43. package/dist/bundled/v3/index.js +330 -299
  44. package/dist/bundled/v3/{useOverflow-6dce216b.js → useOverflow-06bcc7d7.js} +1 -1
  45. package/dist/esm/v2/OrCardCollection-61c86bfc.js +346 -0
  46. package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-62d91301.js} +7 -1
  47. package/dist/esm/v2/{OrSelect-f0ff5a85.js → OrSelect-ac382aa6.js} +1 -1
  48. package/dist/esm/v2/components/index.js +4 -4
  49. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  50. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  51. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  52. package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
  53. package/dist/esm/v2/components/or-card-collection-v3/props.d.ts +5 -1
  54. package/dist/esm/v2/components/or-card-collection-v3/styles.d.ts +2 -2
  55. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +8 -3
  56. package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  57. package/dist/esm/v2/components/or-search-v3/index.js +1 -1
  58. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  59. package/dist/esm/v2/hooks/index.js +1 -1
  60. package/dist/esm/v2/index.js +4 -4
  61. package/dist/esm/v2/{useOverflow-af6161c8.js → useOverflow-a3dc6212.js} +1 -1
  62. package/dist/esm/v3/OrCardCollection-fdc7848b.js +289 -0
  63. package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-aafb93b4.js} +7 -1
  64. package/dist/esm/v3/{OrSelect-7e813982.js → OrSelect-fee9c099.js} +1 -1
  65. package/dist/esm/v3/components/index.js +4 -4
  66. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
  67. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
  68. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  69. package/dist/esm/v3/components/or-card-collection-v3/index.js +7 -4
  70. package/dist/esm/v3/components/or-card-collection-v3/props.d.ts +5 -1
  71. package/dist/esm/v3/components/or-card-collection-v3/styles.d.ts +2 -2
  72. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +8 -3
  73. package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
  74. package/dist/esm/v3/components/or-search-v3/index.js +1 -1
  75. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  76. package/dist/esm/v3/hooks/index.js +1 -1
  77. package/dist/esm/v3/index.js +4 -4
  78. package/dist/esm/v3/{useOverflow-af6161c8.js → useOverflow-a3dc6212.js} +1 -1
  79. package/package.json +1 -1
  80. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +230 -30
  81. package/src/components/or-card-collection-v3/OrCardCollection.vue +120 -77
  82. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
  83. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
  84. package/src/components/or-card-collection-v3/props.ts +14 -1
  85. package/src/components/or-card-collection-v3/styles.ts +3 -3
  86. package/src/components/or-card-collection-v3/types.ts +9 -3
  87. package/src/components/or-search-v3/OrSearch.vue +7 -1
  88. package/src/hooks/useOverflow.ts +1 -1
  89. package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
  90. package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-3993a015.js +0 -164
  91. package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
  92. package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
@@ -1,4 +1,8 @@
1
- export declare enum CardCollectionView {
1
+ import { ViewMode } from './types';
2
+ export declare enum DefaultCardCollectionViews {
2
3
  Grid = "grid",
3
4
  List = "list"
4
5
  }
6
+ export declare const gridView: ViewMode;
7
+ export declare const listView: ViewMode;
8
+ export declare const defaultViewModes: ViewMode[];
@@ -1,6 +1,6 @@
1
- import { CardCollectionView } from './props';
1
+ import { DefaultCardCollectionViews } from './props';
2
2
  export declare const CardCollectionRoot: string[];
3
3
  export declare const CardCollectionToolbar: string[];
4
4
  export declare const CardCollectionToolbarPanel: string[];
5
5
  export declare const CardCollectionContent: string[];
6
- export declare const CardCollectionContentViews: Record<CardCollectionView, string[]>;
6
+ export declare const CardCollectionContentViews: Record<DefaultCardCollectionViews, string[]>;
@@ -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';
@@ -1,9 +1,9 @@
1
- export { _ as OrSelectV3 } from '../../OrSelect-f0ff5a85.js';
1
+ export { _ as OrSelectV3 } from '../../OrSelect-ac382aa6.js';
2
2
  export { a as SelectSize } from '../../OrInputBox-4d5a318d.js';
3
3
  import 'vue-demi';
4
4
  import '../../dropdown-open-0d314aa4.js';
5
5
  import '../../useClassAttribute-47fdb016.js';
6
- import '../../useOverflow-af6161c8.js';
6
+ import '../../useOverflow-a3dc6212.js';
7
7
  import '@vueuse/core';
8
8
  import '../../OrCheckbox-567e387c.js';
9
9
  import '../../OrLabel-2a9f1477.js';
@@ -1,6 +1,6 @@
1
1
  export { u as useClassAttribute } from '../useClassAttribute-47fdb016.js';
2
2
  export { u as useElevation } from '../useElevation-31bfe1f6.js';
3
- export { u as useOverflow } from '../useOverflow-af6161c8.js';
3
+ export { u as useOverflow } from '../useOverflow-a3dc6212.js';
4
4
  export { u as useResponsive } from '../useResponsive-a02e95b7.js';
5
5
  export { u as useToggle } from '../useToggle-29e4d7c7.js';
6
6
  import 'vue-demi';
@@ -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-4f001551.js';
11
+ export { D as DefaultCardCollectionViews, _ as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from './OrCardCollection-61c86bfc.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,10 +63,10 @@ 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
- export { _ as OrSelectV3 } from './OrSelect-f0ff5a85.js';
69
+ export { _ as OrSelectV3 } from './OrSelect-ac382aa6.js';
70
70
  export { _ as OrSidebar, O as OrSidebarSide } from './OrSidebar-7d6125bb.js';
71
71
  export { O as OrSidebarPlacement, _ as OrSidebarV3 } from './OrSidebar-fabc7bc9.js';
72
72
  export { _ as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeletonText-cc94bdc9.js';
@@ -98,7 +98,7 @@ export { _ as OrTooltipV3 } from './OrTooltip-513bee30.js';
98
98
  export { D as DropdownClose, a as DropdownOpen } from './dropdown-open-0d314aa4.js';
99
99
  export { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
100
100
  export { u as useElevation } from './useElevation-31bfe1f6.js';
101
- export { u as useOverflow } from './useOverflow-af6161c8.js';
101
+ export { u as useOverflow } from './useOverflow-a3dc6212.js';
102
102
  export { u as useResponsive } from './useResponsive-a02e95b7.js';
103
103
  export { u as useToggle } from './useToggle-29e4d7c7.js';
104
104
  import { R as RX_ABBREVIATION_FROM_STRING } from './color-1f348774.js';
@@ -23,7 +23,7 @@ function useOverflow(container) {
23
23
  x: containerOffset,
24
24
  width: containerWidth
25
25
  } = container.getBoundingClientRect();
26
- if (itemOffset + itemWidth > containerOffset + containerWidth) {
26
+ if (itemOffset + itemWidth >= containerOffset + containerWidth) {
27
27
  item.style.setProperty('visibility', 'hidden');
28
28
  return {
29
29
  innerItems,
@@ -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-f4b9ee51.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
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, getCurrentInstance, ref, computed, onMounted, watch } from 'vue-demi';
2
2
  import { D as DropdownClose, a as DropdownOpen } from './dropdown-open-0d314aa4.js';
3
3
  import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
4
- import { u as useOverflow } from './useOverflow-af6161c8.js';
4
+ import { u as useOverflow } from './useOverflow-a3dc6212.js';
5
5
  import '@vueuse/core';
6
6
  import { s as script$1 } from './OrCheckbox-3e139eac.js';
7
7
  import { s as script$2 } from './OrError-ec8c709d.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 { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from '../OrCardCollection-fdc7848b.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,10 +58,10 @@ 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
- export { s as OrSelectV3 } from '../OrSelect-7e813982.js';
64
+ export { s as OrSelectV3 } from '../OrSelect-fee9c099.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';
@@ -115,4 +115,4 @@ import '../useElevation-31bfe1f6.js';
115
115
  import '../useResponsive-a02e95b7.js';
116
116
  import '@vueuse/integrations/useFocusTrap';
117
117
  import '../dropdown-open-0d314aa4.js';
118
- import '../useOverflow-af6161c8.js';
118
+ import '../useOverflow-a3dc6212.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>;