@onereach/ui-components 2.68.1-beta.2065.0 → 2.68.1-beta.2068.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 (62) hide show
  1. package/dist/bundled/v2/{OrCard-29116e1f.js → OrCard-58a1ba3e.js} +2 -2
  2. package/dist/bundled/v2/{OrCardCollection-0eaf7489.js → OrCardCollection-dac9fd1e.js} +17 -78
  3. package/dist/bundled/v2/{OrSelect-68aacb62.js → OrSelect-5fef3ccd.js} +1 -1
  4. package/dist/bundled/v2/components/index.js +4 -4
  5. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +0 -3
  6. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +2 -0
  7. package/dist/bundled/v2/components/or-card-collection-v3/index.js +3 -2
  8. package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +1 -1
  9. package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
  10. package/dist/bundled/v2/components/or-select-v3/index.js +2 -2
  11. package/dist/bundled/v2/components/or-tag-v3/OrTag.stories3.d.ts +5 -0
  12. package/dist/bundled/v2/hooks/index.js +1 -1
  13. package/dist/bundled/v2/index.js +5 -5
  14. package/dist/bundled/v2/{useOverflow-43299d81.js → useOverflow-bfea931e.js} +7 -3
  15. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-26d9a7c8.js → OrCardCollection.vue_vue_type_script_lang-7a07be47.js} +18 -40
  16. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-58b92fb0.js → OrSelect.vue_vue_type_script_lang-6fd881cf.js} +1 -1
  17. package/dist/bundled/v3/components/index.js +3 -3
  18. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +0 -3
  19. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +2 -0
  20. package/dist/bundled/v3/components/or-card-collection-v3/index.js +3 -2
  21. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +1 -1
  22. package/dist/bundled/v3/components/or-select-v3/index.js +2 -2
  23. package/dist/bundled/v3/components/or-tag-v3/OrTag.stories3.d.ts +5 -0
  24. package/dist/bundled/v3/hooks/index.js +1 -1
  25. package/dist/bundled/v3/index.js +199 -199
  26. package/dist/bundled/v3/{useOverflow-2468b718.js → useOverflow-f7916ce2.js} +7 -3
  27. package/dist/esm/v2/{OrCardCollection-7bf35252.js → OrCardCollection-e46b220e.js} +16 -76
  28. package/dist/esm/v2/{OrSelect-0e6e7868.js → OrSelect-81c1173a.js} +1 -1
  29. package/dist/esm/v2/components/index.js +3 -3
  30. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +0 -3
  31. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +2 -0
  32. package/dist/esm/v2/components/or-card-collection-v3/index.js +3 -2
  33. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +1 -1
  34. package/dist/esm/v2/components/or-select-v3/index.js +2 -2
  35. package/dist/esm/v2/components/or-tag-v3/OrTag.stories3.d.ts +5 -0
  36. package/dist/esm/v2/hooks/index.js +1 -1
  37. package/dist/esm/v2/index.js +3 -3
  38. package/dist/esm/{v3/useOverflow-ac506c65.js → v2/useOverflow-2f535f6c.js} +7 -3
  39. package/dist/esm/v3/{OrCardCollection-9682c6ef.js → OrCardCollection-5924d035.js} +28 -49
  40. package/dist/esm/v3/{OrSelect-2e00d4c8.js → OrSelect-fe1566ac.js} +1 -1
  41. package/dist/esm/v3/components/index.js +3 -3
  42. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +0 -3
  43. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +2 -0
  44. package/dist/esm/v3/components/or-card-collection-v3/index.js +3 -2
  45. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +1 -1
  46. package/dist/esm/v3/components/or-select-v3/index.js +2 -2
  47. package/dist/esm/v3/components/or-tag-v3/OrTag.stories3.d.ts +5 -0
  48. package/dist/esm/v3/hooks/index.js +1 -1
  49. package/dist/esm/v3/index.js +3 -3
  50. package/dist/esm/{v2/useOverflow-ac506c65.js → v3/useOverflow-2f535f6c.js} +7 -3
  51. package/package.json +1 -1
  52. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +5 -96
  53. package/src/components/or-card-collection-v3/OrCardCollection.vue +33 -21
  54. package/src/components/or-card-collection-v3/types.ts +1 -1
  55. package/src/components/or-tag-v3/OrTag.stories3.ts +112 -0
  56. package/src/hooks/useOverflow.ts +3 -2
  57. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +0 -35
  58. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +0 -35
  59. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +0 -35
  60. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +0 -35
  61. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +0 -39
  62. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +0 -40
@@ -3,7 +3,6 @@ import { Meta, StoryFn } from '@storybook/vue3';
3
3
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
4
4
  import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
5
5
  import OrCardCollection from './OrCardCollection.vue';
6
- import { OrCardV3 as OrCard } from '../or-card-v3';
7
6
  import { CardCollectionView } from './props';
8
7
  import { CardCollectionItem, CardCollectionSortHeader } from './types';
9
8
 
@@ -77,7 +76,6 @@ export default {
77
76
  const Template: StoryFn<typeof OrCardCollection> = (args) => ({
78
77
  components: {
79
78
  OrCardCollection,
80
- OrCard,
81
79
  OrIcon,
82
80
  },
83
81
 
@@ -97,9 +95,8 @@ const Template: StoryFn<typeof OrCardCollection> = (args) => ({
97
95
  @sortChange="onSortChange"
98
96
  @searchChange="onSearchChange"
99
97
  >
100
- <template #item="{item, mode}">
101
- <OrCard>${args.item} ({{mode}}}</OrCard>
102
- </template>
98
+ <template #gridItem="item">${args.gridItem}</template>
99
+ <template #listItem="item">${args.listItem}</template>
103
100
  <template #addon>${args.addon}</template>
104
101
  </OrCardCollection>
105
102
  `,
@@ -109,7 +106,8 @@ export const Default = Template.bind({});
109
106
 
110
107
  Default.args = {
111
108
  // Slots
112
- item: '{{ item.label }}',
109
+ gridItem: '{{ item.label }} (grid)',
110
+ listItem: '{{ item.label }} (list)',
113
111
  addon: '<OrIcon icon="info" />',
114
112
 
115
113
  // Props
@@ -141,7 +139,7 @@ Default.args = {
141
139
  'Yankee',
142
140
  'Zulu',
143
141
  ], (item) => ({
144
- key: item.toLowerCase(),
142
+ id: item.toLowerCase(),
145
143
  label: item,
146
144
  })),
147
145
  };
@@ -162,92 +160,3 @@ WithSorting.args = {
162
160
  label: item,
163
161
  })),
164
162
  };
165
-
166
-
167
- export const OverrideViewContainer: StoryFn<typeof OrCardCollection> = (args) => ({
168
- components: {
169
- OrCardCollection,
170
- OrCard,
171
- OrIcon,
172
- },
173
-
174
- setup() {
175
- return {
176
- args,
177
- onViewChange: action('viewChange'),
178
- onSortChange: action('sortChange'),
179
- onSearchChange: action('searchChange'),
180
- };
181
- },
182
-
183
- template: `
184
- <OrCardCollection
185
- v-bind="args"
186
- @viewChange="onViewChange"
187
- @sortChange="onSortChange"
188
- @searchChange="onSearchChange"
189
- >
190
- <template #grid="{items}">
191
- <div class="typography-headline-3">Custom grid</div>
192
- <div class="grid grid-cols-3">
193
- <OrCard
194
- v-for="item in items"
195
- :key="item.id"
196
- >
197
- {{ item.label }}
198
- </OrCard>
199
- </div>
200
- </template>
201
- <template #list="{items}">
202
- <div class="typography-headline-3">Custom list</div>
203
- <ul>
204
- <li
205
- v-for="item in items"
206
- :key="item.id"
207
- >
208
- - {{ item.label }}
209
- </li>
210
- </ul>
211
- </template>
212
- </OrCardCollection>
213
- `,
214
- });
215
-
216
- OverrideViewContainer.args = {
217
- ...Default.args,
218
- };
219
-
220
-
221
- export const WithLink: StoryFn<typeof OrCardCollection> = (args) => ({
222
- components: {
223
- OrCardCollection,
224
- OrCard,
225
- OrIcon,
226
- },
227
-
228
- setup() {
229
- return {
230
- args,
231
- onViewChange: action('viewChange'),
232
- onSortChange: action('sortChange'),
233
- onSearchChange: action('searchChange'),
234
- };
235
- },
236
-
237
- template: `
238
- <OrCardCollection
239
- v-bind="args"
240
- @viewChange="onViewChange"
241
- @sortChange="onSortChange"
242
- @searchChange="onSearchChange"
243
- >
244
- <template #item="{item}">
245
- <a href="#" @click.prevent><OrCard>${args.item}</OrCard></a>
246
- </template>
247
- </OrCardCollection>
248
- `,
249
- });
250
-
251
- WithLink.args = {
252
- ...Default.args,
253
- };
@@ -40,45 +40,50 @@
40
40
  </div>
41
41
  </div>
42
42
 
43
- <slot
44
- :name="proxyView"
45
- v-bind="{items}"
46
- >
47
- <OrCardCollectionView
48
- :items="items"
49
- :mode="proxyView"
50
- >
51
- <template v-slot:item="props">
43
+ <div :class="contentStyles">
44
+ <template v-if="proxyView === 'grid'">
45
+ <OrCard
46
+ v-for="item in items"
47
+ :key="item.id"
48
+ >
52
49
  <slot
53
- name="item"
54
- v-bind="props"
50
+ name="gridItem"
51
+ v-bind="item"
55
52
  />
56
- </template>
57
- </OrCardCollectionView>
58
- </slot>
53
+ </OrCard>
54
+ </template>
55
+
56
+ <template v-if="proxyView === 'list'">
57
+ <OrCard
58
+ v-for="item in items"
59
+ :key="item.id"
60
+ >
61
+ <slot
62
+ name="listItem"
63
+ v-bind="item"
64
+ />
65
+ </OrCard>
66
+ </template>
67
+ </div>
59
68
  </div>
60
69
  </template>
61
70
 
62
71
  <script lang="ts">
63
72
  import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
64
73
  import { useClassAttribute } from '../../hooks';
74
+ import { OrCardV3 as OrCard } from '../or-card-v3';
65
75
  import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
66
76
  import { OrInputV3 as OrInput } from '../or-input-v3';
67
77
  import { OrSortHeaderV3 as OrSortHeader, SortHeaderModel } from '../or-sort-header-v3';
68
78
  import { CardCollectionView } from './props';
69
- import {
70
- CardCollectionRoot,
71
- CardCollectionToolbar,
72
- CardCollectionToolbarPanel,
73
- } from './styles';
79
+ import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
74
80
  import { CardCollectionItem, CardCollectionSortHeader } from './types';
75
- import OrCardCollectionView from './OrCardCollectionView.vue3.vue';
76
81
 
77
82
  export default defineComponent({
78
83
  name: 'OrCardCollection',
79
84
 
80
85
  components: {
81
- OrCardCollectionView,
86
+ OrCard,
82
87
  OrIconButton,
83
88
  OrInput,
84
89
  OrSortHeader,
@@ -91,6 +96,7 @@ export default defineComponent({
91
96
  type: Array as PropType<CardCollectionItem[]>,
92
97
  default: [] as CardCollectionItem[],
93
98
  },
99
+
94
100
  view: {
95
101
  type: String as PropType<CardCollectionView>,
96
102
  default: CardCollectionView.Grid,
@@ -143,6 +149,11 @@ export default defineComponent({
143
149
  ...CardCollectionToolbarPanel,
144
150
  ]);
145
151
 
152
+ const contentStyles = computed(() => [
153
+ ...CardCollectionContent,
154
+ ...CardCollectionContentViews[proxyView.value],
155
+ ]);
156
+
146
157
  // State
147
158
  const proxyView = ref(props.view);
148
159
  const proxySort = ref(props.sort);
@@ -187,6 +198,7 @@ export default defineComponent({
187
198
  rootStyles,
188
199
  toolbarStyles,
189
200
  toolbarPanelStyles,
201
+ contentStyles,
190
202
  proxyView,
191
203
  proxySort,
192
204
  proxySearch,
@@ -1,5 +1,5 @@
1
1
  export interface CardCollectionItem {
2
- key?: string;
2
+ id: string;
3
3
  }
4
4
 
5
5
  export interface CardCollectionSortHeader {
@@ -1,8 +1,13 @@
1
1
  import { action } from '@storybook/addon-actions';
2
2
  import { Meta, StoryFn } from '@storybook/vue3';
3
+ import Faker from 'faker';
3
4
  import OrTagDocs from './OrTag.docs.mdx';
4
5
  import OrTag from './OrTag.vue';
5
6
  import { TagColor, TagVariant } from './props';
7
+ import { OrButtonV3 as OrButton } from '../or-button-v3';
8
+ import { OrPopoverV3 as OrPopover } from '../or-popover-v3';
9
+ import { useOverflow } from '../../hooks';
10
+ import { ref } from 'vue-demi';
6
11
 
7
12
  export default {
8
13
  title: 'Components/Tag',
@@ -77,6 +82,97 @@ const Template: StoryFn<typeof OrTag> = (args) => ({
77
82
  `,
78
83
  });
79
84
 
85
+ const ContainerTemplate: StoryFn<typeof OrTag> = (args) => ({
86
+ components: {
87
+ OrTag,
88
+ OrButton,
89
+ OrPopover,
90
+ },
91
+
92
+ setup() {
93
+ const container = ref<HTMLElement>();
94
+ const button = ref<InstanceType<typeof OrButton>>();
95
+ const popover = ref<InstanceType<typeof OrPopover>>();
96
+
97
+ const { innerItems, outerItems } = useOverflow(container);
98
+
99
+ return {
100
+ args,
101
+ container,
102
+ button,
103
+ popover,
104
+ innerItems,
105
+ outerItems,
106
+ handleClick: action('click'),
107
+ handleFocus: action('focus'),
108
+ handleBlur: action('blur'),
109
+ handleReset: action('reset'),
110
+ };
111
+ },
112
+
113
+ computed: {
114
+ tagsArr(): string[] {
115
+ return [
116
+ args.default,
117
+ ...(typeof args.tags === 'string' ? args.tags.split(' ') : []),
118
+ ];
119
+ },
120
+ hiddenTagsArr(): string[] {
121
+ return this.tagsArr.slice(this.innerItems?.length);
122
+ },
123
+ },
124
+
125
+ template: `
126
+ <div class="w-[512px] flex flex-row items-center overflow-hidden gap-xs">
127
+ <div
128
+ ref="container"
129
+ class="relative flex flex-row grow items-center overflow-hidden gap-xs"
130
+ >
131
+ <OrTag
132
+ v-for="tag in tagsArr"
133
+ v-bind="args"
134
+ @click="handleClick"
135
+ @focus="handleFocus"
136
+ @blur="handleBlur"
137
+ @reset="handleReset"
138
+ >
139
+ {{ tag }}
140
+ </OrTag>
141
+ </div>
142
+ <template v-if="outerItems?.length">
143
+ <OrButton
144
+ ref="button"
145
+ class="typography-caption-regular text-on-background dark:text-on-background-dark"
146
+ color="inherit"
147
+ variant="link"
148
+ @click="popover.open()"
149
+ >
150
+ +{{outerItems.length}}
151
+ </OrButton>
152
+ <OrPopover
153
+ ref="popover"
154
+ :trigger="button?.root"
155
+ >
156
+ <div
157
+ class="max-w-[192px] p-[16px] flex flex-row flex-wrap items-center overflow-hidden gap-xs"
158
+ >
159
+ <OrTag
160
+ v-for="tag in hiddenTagsArr"
161
+ v-bind="args"
162
+ @click="handleClick"
163
+ @focus="handleFocus"
164
+ @blur="handleBlur"
165
+ @reset="handleReset"
166
+ >
167
+ {{ tag }}
168
+ </OrTag>
169
+ </div>
170
+ </OrPopover>
171
+ </template>
172
+ </div>
173
+ `,
174
+ });
175
+
80
176
  export const Default = Template.bind({});
81
177
 
82
178
  Default.args = {
@@ -99,3 +195,19 @@ WithCustomColor.args = {
99
195
  // Props
100
196
  color: '#0000ff',
101
197
  };
198
+
199
+ export const InsideContainer = ContainerTemplate.bind({});
200
+
201
+ InsideContainer.argTypes = {
202
+ tags: {
203
+ control: { type: 'text' },
204
+ },
205
+ };
206
+
207
+ InsideContainer.args = {
208
+ // Slots
209
+ default: 'First tag',
210
+
211
+ // Args
212
+ tags: Faker.lorem.words(32),
213
+ };
@@ -20,10 +20,11 @@ export function useOverflow(
20
20
  const container = containerRef.value;
21
21
 
22
22
  if (container) {
23
+ const { x: containerOffset, width: containerWidth } = container.getBoundingClientRect();
23
24
  const update = [...container.children].reduce(({ innerItems, outerItems }, child) => {
24
- const item = child as HTMLElement, { x: offset, width } = child.getBoundingClientRect();
25
+ const item = child as HTMLElement, { x: itemOffset, width: itemWidth } = child.getBoundingClientRect();
25
26
 
26
- if (offset + width >= container.clientWidth) {
27
+ if (itemOffset + itemWidth >= containerOffset + containerWidth) {
27
28
  item.style.setProperty('visibility', 'hidden');
28
29
 
29
30
  return {
@@ -1,35 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import { CardCollectionItem } from './types';
3
- import { CardCollectionView } 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<CardCollectionView>;
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<CardCollectionView>;
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: CardCollectionView;
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: CardCollectionView;
32
- } & {}, {
33
- items: CardCollectionItem[];
34
- }, true>);
35
- export default _default;
@@ -1,35 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import { CardCollectionItem } from './types';
3
- import { CardCollectionView } 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<CardCollectionView>;
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<CardCollectionView>;
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: CardCollectionView;
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: CardCollectionView;
32
- } & {}, {
33
- items: CardCollectionItem[];
34
- }, true>);
35
- export default _default;
@@ -1,35 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import { CardCollectionItem } from './types';
3
- import { CardCollectionView } 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<CardCollectionView>;
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<CardCollectionView>;
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: CardCollectionView;
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: CardCollectionView;
32
- } & {}, {
33
- items: CardCollectionItem[];
34
- }, true>);
35
- export default _default;
@@ -1,35 +0,0 @@
1
- import { PropType } from 'vue-demi';
2
- import { CardCollectionItem } from './types';
3
- import { CardCollectionView } 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<CardCollectionView>;
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<CardCollectionView>;
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: CardCollectionView;
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: CardCollectionView;
32
- } & {}, {
33
- items: CardCollectionItem[];
34
- }, true>);
35
- export default _default;
@@ -1,39 +0,0 @@
1
- <template>
2
- <div :class="contentStyles">
3
- <slot
4
- v-for="(item) in items"
5
- name="item"
6
- v-bind="{
7
- item,
8
- mode,
9
- }"
10
- />
11
- </div>
12
- </template>
13
- <script lang="ts">
14
- import { defineComponent, computed, PropType } from 'vue-demi';
15
- import { CardCollectionContent, CardCollectionContentViews } from './styles';
16
- import { CardCollectionItem } from './types';
17
- import { CardCollectionView } from './props';
18
-
19
- export default defineComponent({
20
- name: 'OrCardCollectionView',
21
- props: {
22
- items: {
23
- type: Array as PropType<CardCollectionItem[]>,
24
- default: [] as CardCollectionItem[],
25
- },
26
- mode: {
27
- type: String as PropType<CardCollectionView>,
28
- required: true,
29
- },
30
- },
31
- setup(props) {
32
- const contentStyles = computed(() => [
33
- ...CardCollectionContent,
34
- ...CardCollectionContentViews[props.mode],
35
- ]);
36
- return { contentStyles };
37
- },
38
- });
39
- </script>
@@ -1,40 +0,0 @@
1
- <template>
2
- <div :class="contentStyles">
3
- <slot
4
- v-for="(item, index) in items"
5
- :key="item.key || index"
6
- name="item"
7
- v-bind="{
8
- item,
9
- mode,
10
- }"
11
- />
12
- </div>
13
- </template>
14
- <script lang="ts">
15
- import { defineComponent, computed, PropType } from 'vue-demi';
16
- import { CardCollectionContent, CardCollectionContentViews } from './styles';
17
- import { CardCollectionItem } from './types';
18
- import { CardCollectionView } from './props';
19
-
20
- export default defineComponent({
21
- name: 'OrCardCollectionView',
22
- props: {
23
- items: {
24
- type: Array as PropType<CardCollectionItem[]>,
25
- default: [] as CardCollectionItem[],
26
- },
27
- mode: {
28
- type: String as PropType<CardCollectionView>,
29
- required: true,
30
- },
31
- },
32
- setup(props) {
33
- const contentStyles = computed(() => [
34
- ...CardCollectionContent,
35
- ...CardCollectionContentViews[props.mode],
36
- ]);
37
- return { contentStyles };
38
- },
39
- });
40
- </script>