@onereach/ui-components 2.68.0 → 2.68.1-beta.2065.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 (40) hide show
  1. package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
  2. package/dist/bundled/v2/{OrCardCollection-dac9fd1e.js → OrCardCollection-0eaf7489.js} +78 -17
  3. package/dist/bundled/v2/components/index.js +2 -2
  4. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  5. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +0 -2
  6. package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  7. package/dist/bundled/v2/components/or-card-collection-v3/index.js +2 -3
  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/index.js +3 -3
  11. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-7a07be47.js → OrCardCollection.vue_vue_type_script_lang-26d9a7c8.js} +40 -18
  12. package/dist/bundled/v3/components/index.js +1 -1
  13. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  14. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +0 -2
  15. package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  16. package/dist/bundled/v3/components/or-card-collection-v3/index.js +2 -3
  17. package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +1 -1
  18. package/dist/bundled/v3/index.js +197 -197
  19. package/dist/esm/v2/{OrCardCollection-e46b220e.js → OrCardCollection-7bf35252.js} +76 -16
  20. package/dist/esm/v2/components/index.js +1 -1
  21. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  22. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +0 -2
  23. package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
  24. package/dist/esm/v2/components/or-card-collection-v3/index.js +2 -3
  25. package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +1 -1
  26. package/dist/esm/v2/index.js +1 -1
  27. package/dist/esm/v3/{OrCardCollection-5924d035.js → OrCardCollection-9682c6ef.js} +49 -28
  28. package/dist/esm/v3/components/index.js +1 -1
  29. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +3 -0
  30. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +0 -2
  31. package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
  32. package/dist/esm/v3/components/or-card-collection-v3/index.js +2 -3
  33. package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +1 -1
  34. package/dist/esm/v3/index.js +1 -1
  35. package/package.json +2 -3
  36. package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +96 -5
  37. package/src/components/or-card-collection-v3/OrCardCollection.vue +21 -33
  38. package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +39 -0
  39. package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +40 -0
  40. package/src/components/or-card-collection-v3/types.ts +1 -1
@@ -40,50 +40,45 @@
40
40
  </div>
41
41
  </div>
42
42
 
43
- <div :class="contentStyles">
44
- <template v-if="proxyView === 'grid'">
45
- <OrCard
46
- v-for="item in items"
47
- :key="item.id"
48
- >
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">
49
52
  <slot
50
- name="gridItem"
51
- v-bind="item"
53
+ name="item"
54
+ v-bind="props"
52
55
  />
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>
56
+ </template>
57
+ </OrCardCollectionView>
58
+ </slot>
68
59
  </div>
69
60
  </template>
70
61
 
71
62
  <script lang="ts">
72
63
  import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
73
64
  import { useClassAttribute } from '../../hooks';
74
- import { OrCardV3 as OrCard } from '../or-card-v3';
75
65
  import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
76
66
  import { OrInputV3 as OrInput } from '../or-input-v3';
77
67
  import { OrSortHeaderV3 as OrSortHeader, SortHeaderModel } from '../or-sort-header-v3';
78
68
  import { CardCollectionView } from './props';
79
- import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
69
+ import {
70
+ CardCollectionRoot,
71
+ CardCollectionToolbar,
72
+ CardCollectionToolbarPanel,
73
+ } from './styles';
80
74
  import { CardCollectionItem, CardCollectionSortHeader } from './types';
75
+ import OrCardCollectionView from './OrCardCollectionView.vue3.vue';
81
76
 
82
77
  export default defineComponent({
83
78
  name: 'OrCardCollection',
84
79
 
85
80
  components: {
86
- OrCard,
81
+ OrCardCollectionView,
87
82
  OrIconButton,
88
83
  OrInput,
89
84
  OrSortHeader,
@@ -96,7 +91,6 @@ export default defineComponent({
96
91
  type: Array as PropType<CardCollectionItem[]>,
97
92
  default: [] as CardCollectionItem[],
98
93
  },
99
-
100
94
  view: {
101
95
  type: String as PropType<CardCollectionView>,
102
96
  default: CardCollectionView.Grid,
@@ -149,11 +143,6 @@ export default defineComponent({
149
143
  ...CardCollectionToolbarPanel,
150
144
  ]);
151
145
 
152
- const contentStyles = computed(() => [
153
- ...CardCollectionContent,
154
- ...CardCollectionContentViews[proxyView.value],
155
- ]);
156
-
157
146
  // State
158
147
  const proxyView = ref(props.view);
159
148
  const proxySort = ref(props.sort);
@@ -198,7 +187,6 @@ export default defineComponent({
198
187
  rootStyles,
199
188
  toolbarStyles,
200
189
  toolbarPanelStyles,
201
- contentStyles,
202
190
  proxyView,
203
191
  proxySort,
204
192
  proxySearch,
@@ -0,0 +1,39 @@
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>
@@ -0,0 +1,40 @@
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>
@@ -1,5 +1,5 @@
1
1
  export interface CardCollectionItem {
2
- id: string;
2
+ key?: string;
3
3
  }
4
4
 
5
5
  export interface CardCollectionSortHeader {