@onereach/ui-components 2.62.7-beta.1928.0 → 2.62.7-beta.1930.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.
- package/dist/v2/OrCardCollection-5d5046f1.js +227 -0
- package/dist/v2/{OrConfirm-24e2a1a2.js → OrConfirm-edc537b3.js} +1 -1
- package/dist/v2/{OrInlineInput-8455f9da.js → OrInlineInput-73ec1b85.js} +5 -5
- package/dist/v2/{OrInlineTextarea-1127e512.js → OrInlineTextarea-1858a348.js} +5 -5
- package/dist/v2/{OrInput-24028f23.js → OrInput-655bed71.js} +5 -5
- package/dist/v2/{OrSearch-978a3a6e.js → OrSearch-287a08a9.js} +1 -1
- package/dist/v2/{OrSelect-c6d0a69e.js → OrSelect-1a353817.js} +3 -3
- package/dist/v2/OrSortHeader-a6004b24.js +133 -0
- package/dist/v2/{OrTextarea-8773d494.js → OrTextarea-cc70afc9.js} +5 -5
- package/dist/v2/components/index.d.ts +2 -1
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v2/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v2/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v2/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v2/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v2/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v3/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v2/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v2/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v2/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v2/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v2/index.js +9 -8
- package/dist/v2/index11.js +20 -1
- package/dist/v2/index12.js +3 -12
- package/dist/v2/index13.js +3 -2
- package/dist/v2/index14.js +11 -5
- package/dist/v2/index15.js +5 -14
- package/dist/v2/index16.js +4 -19
- package/dist/v2/index17.js +28 -4
- package/dist/v2/index18.js +3 -7
- package/dist/v2/index19.js +5 -23
- package/dist/v2/index2.js +9 -8
- package/dist/v2/index20.js +25 -21
- package/dist/v2/index21.js +21 -18
- package/dist/v2/index22.js +20 -2
- package/dist/v2/index23.js +2 -4
- package/dist/v2/index24.js +2 -1
- package/dist/v2/index25.js +1 -2
- package/dist/v2/index26.js +2 -2
- package/dist/v2/index27.js +4 -7
- package/dist/v2/index28.js +6 -2
- package/dist/v2/index29.js +3 -3
- package/dist/v2/index30.js +3 -10
- package/dist/v2/index31.js +9 -12
- package/dist/v2/index32.js +11 -1
- package/dist/v2/index33.js +1 -1
- package/dist/v2/index34.js +1 -16
- package/dist/v2/index35.js +17 -17
- package/dist/v2/index36.js +17 -17
- package/dist/v2/index37.js +16 -1
- package/dist/v2/index38.js +1 -17
- package/dist/v2/index39.js +18 -22
- package/dist/v2/index40.js +22 -2
- package/dist/v2/index41.js +3 -3
- package/dist/v2/index42.js +1 -1
- package/dist/v2/index43.js +3 -20
- package/dist/v2/index44.js +1 -7
- package/dist/v2/index45.js +24 -1
- package/dist/v2/index46.js +3 -3
- package/dist/v2/index47.js +1 -2
- package/dist/v2/index48.js +2 -9
- package/dist/v2/index49.js +10 -17
- package/dist/v2/index50.js +17 -13
- package/dist/v2/index51.js +13 -14
- package/dist/v2/index52.js +14 -13
- package/dist/v2/index53.js +12 -15
- package/dist/v2/index54.js +16 -1
- package/dist/v2/index55.js +2 -6
- package/dist/v2/index56.js +1 -5
- package/dist/v2/index57.js +10 -3
- package/dist/v2/index58.js +2 -4
- package/dist/v2/index59.js +5 -3
- package/dist/v2/index60.js +2 -1
- package/dist/v2/index61.js +2 -5
- package/dist/v2/index62.js +3 -18
- package/dist/v2/index63.js +19 -2
- package/dist/v2/index65.js +2 -2
- package/dist/v2/index71.js +4 -15
- package/dist/v2/index72.js +13 -2
- package/dist/v2/index73.js +4 -6
- package/dist/v2/index74.js +6 -4
- package/dist/v2/index75.js +2 -1
- package/dist/v2/index76.js +3 -3
- package/dist/v2/index77.js +3 -4
- package/dist/v2/index78.js +4 -15
- package/dist/v2/index79.js +14 -11
- package/dist/v2/index80.js +11 -13
- package/dist/v2/index81.js +14 -2
- package/dist/v2/index82.js +2 -2
- package/dist/v2/index83.js +2 -3
- package/dist/v2/index84.js +1 -6
- package/dist/v2/index85.js +7 -20
- package/dist/v2/index86.js +12 -9
- package/dist/v2/index87.js +18 -1
- package/dist/v2/index88.js +2 -18
- package/dist/v2/index89.js +18 -2
- package/dist/v2/index90.js +2 -10
- package/dist/v2/index91.js +9 -11
- package/dist/v2/index92.js +12 -1
- package/dist/v2/index93.js +1 -6
- package/dist/v2/index94.js +5 -1
- package/dist/v2/index95.js +3 -0
- package/dist/v3/OrCardCollection-c6f3ac23.js +198 -0
- package/dist/v3/{OrConfirm-371630a4.js → OrConfirm-0bafcc7b.js} +1 -1
- package/dist/v3/{OrInlineInput-a080b0a3.js → OrInlineInput-dc71bbcb.js} +5 -3
- package/dist/v3/{OrInlineTextarea-08767485.js → OrInlineTextarea-bdebb784.js} +5 -3
- package/dist/v3/{OrInput-256d2530.js → OrInput-db4813b4.js} +5 -3
- package/dist/v3/{OrSearch-375eab55.js → OrSearch-0c29f499.js} +1 -1
- package/dist/v3/{OrSelect-52cfb10d.js → OrSelect-323a87b4.js} +6 -4
- package/dist/v3/OrSortHeader-5eba50cd.js +104 -0
- package/dist/v3/{OrTextarea-09aa33dc.js → OrTextarea-98895b2a.js} +6 -4
- package/dist/v3/components/index.d.ts +2 -1
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +17 -0
- package/dist/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +98 -0
- package/dist/v3/components/or-card-collection-v3/index.d.ts +3 -0
- package/dist/v3/components/or-card-collection-v3/props.d.ts +4 -0
- package/dist/v3/components/or-card-collection-v3/styles.d.ts +6 -0
- package/dist/v3/components/or-card-collection-v3/types.d.ts +7 -0
- package/dist/v3/components/{or-segmented-control-v3/OrSegmentedControl.stories3.d.ts → or-sort-header-v3/OrSortHeader.stories3.d.ts} +1 -1
- package/dist/{v2/components/or-segmented-control-v3/OrSegmentedControl.vue.d.ts → v3/components/or-sort-header-v3/OrSortHeader.vue.d.ts} +25 -45
- package/dist/v3/components/or-sort-header-v3/index.d.ts +2 -0
- package/dist/v3/components/or-sort-header-v3/styles.d.ts +1 -0
- package/dist/v3/components/or-sort-header-v3/types.d.ts +4 -0
- package/dist/v3/index.js +9 -8
- package/dist/v3/index11.js +19 -1
- package/dist/v3/index12.js +3 -11
- package/dist/v3/index13.js +3 -2
- package/dist/v3/index14.js +9 -4
- package/dist/v3/index15.js +4 -11
- package/dist/v3/index16.js +3 -17
- package/dist/v3/index17.js +25 -4
- package/dist/v3/index18.js +3 -6
- package/dist/v3/index19.js +5 -20
- package/dist/v3/index2.js +9 -8
- package/dist/v3/index20.js +21 -20
- package/dist/v3/index21.js +20 -15
- package/dist/v3/index22.js +16 -1
- package/dist/v3/index23.js +2 -4
- package/dist/v3/index24.js +2 -1
- package/dist/v3/index25.js +1 -2
- package/dist/v3/index26.js +2 -2
- package/dist/v3/index27.js +4 -6
- package/dist/v3/index28.js +5 -2
- package/dist/v3/index29.js +3 -3
- package/dist/v3/index30.js +3 -9
- package/dist/v3/index31.js +8 -11
- package/dist/v3/index32.js +10 -1
- package/dist/v3/index33.js +1 -1
- package/dist/v3/index34.js +1 -15
- package/dist/v3/index35.js +16 -14
- package/dist/v3/index36.js +14 -16
- package/dist/v3/index37.js +16 -2
- package/dist/v3/index38.js +2 -17
- package/dist/v3/index39.js +17 -17
- package/dist/v3/index40.js +16 -1
- package/dist/v3/index41.js +3 -3
- package/dist/v3/index42.js +1 -1
- package/dist/v3/index43.js +3 -16
- package/dist/v3/index44.js +1 -7
- package/dist/v3/index45.js +20 -1
- package/dist/v3/index46.js +3 -3
- package/dist/v3/index47.js +1 -2
- package/dist/v3/index48.js +2 -8
- package/dist/v3/index49.js +9 -14
- package/dist/v3/index50.js +14 -12
- package/dist/v3/index51.js +12 -11
- package/dist/v3/index52.js +11 -12
- package/dist/v3/index53.js +11 -11
- package/dist/v3/index54.js +12 -1
- package/dist/v3/index55.js +2 -5
- package/dist/v3/index56.js +1 -5
- package/dist/v3/index57.js +9 -3
- package/dist/v3/index58.js +2 -4
- package/dist/v3/index59.js +5 -3
- package/dist/v3/index60.js +2 -1
- package/dist/v3/index61.js +1 -4
- package/dist/v3/index62.js +3 -17
- package/dist/v3/index63.js +18 -2
- package/dist/v3/index65.js +2 -2
- package/dist/v3/index71.js +4 -12
- package/dist/v3/index72.js +10 -2
- package/dist/v3/index73.js +3 -5
- package/dist/v3/index74.js +5 -3
- package/dist/v3/index75.js +2 -1
- package/dist/v3/index76.js +3 -3
- package/dist/v3/index77.js +3 -4
- package/dist/v3/index78.js +4 -14
- package/dist/v3/index79.js +13 -10
- package/dist/v3/index80.js +10 -12
- package/dist/v3/index81.js +13 -1
- package/dist/v3/index82.js +1 -1
- package/dist/v3/index83.js +1 -3
- package/dist/v3/index84.js +1 -6
- package/dist/v3/index85.js +6 -16
- package/dist/v3/index86.js +12 -9
- package/dist/v3/index87.js +15 -1
- package/dist/v3/index88.js +2 -17
- package/dist/v3/index89.js +17 -2
- package/dist/v3/index90.js +2 -8
- package/dist/v3/index91.js +6 -9
- package/dist/v3/index92.js +11 -1
- package/dist/v3/index93.js +1 -6
- package/dist/v3/index94.js +5 -1
- package/dist/v3/index95.js +3 -0
- package/package.json +1 -1
- package/src/components/index.ts +2 -1
- package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +3 -0
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +162 -0
- package/src/components/or-card-collection-v3/OrCardCollection.vue +210 -0
- package/src/components/or-card-collection-v3/index.ts +3 -0
- package/src/components/or-card-collection-v3/props.ts +4 -0
- package/src/components/or-card-collection-v3/styles.ts +53 -0
- package/src/components/or-card-collection-v3/types.ts +8 -0
- package/src/components/or-checkbox-v3/OrCheckbox.stories3.ts +1 -1
- package/src/components/or-inline-input-v3/OrInlineInput.vue +12 -10
- package/src/components/or-inline-textarea-v3/OrInlineTextarea.vue +12 -10
- package/src/components/or-input-v3/OrInput.vue +12 -10
- package/src/components/or-radio-v3/OrRadio.stories3.ts +1 -1
- package/src/components/or-select-v3/OrSelect.vue +5 -3
- package/src/components/or-sort-header-v3/OrSortHeader.docs.mdx +3 -0
- package/src/components/or-sort-header-v3/OrSortHeader.stories3.ts +132 -0
- package/src/components/{or-segmented-control-v3/OrSegmentedControl.vue → or-sort-header-v3/OrSortHeader.vue} +36 -34
- package/src/components/or-sort-header-v3/index.ts +2 -0
- package/src/components/or-sort-header-v3/styles.ts +23 -0
- package/src/components/or-sort-header-v3/types.ts +4 -0
- package/src/components/or-switch-v3/OrSwitch.stories3.ts +1 -1
- package/src/components/or-textarea-v3/OrTextarea.vue +12 -10
- package/dist/v2/OrSegmentedControl-58b5db14.js +0 -231
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v2/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v2/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v2/components/or-segmented-control-v3/types.d.ts +0 -4
- package/dist/v3/OrSegmentedControl-e45af169.js +0 -183
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue.d.ts +0 -47
- package/dist/v3/components/or-segmented-control-v3/components/or-segmented-control-item/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/index.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/props.d.ts +0 -4
- package/dist/v3/components/or-segmented-control-v3/styles.d.ts +0 -3
- package/dist/v3/components/or-segmented-control-v3/types.d.ts +0 -4
- package/src/components/or-segmented-control-v3/OrSegmentedControl.docs.mdx +0 -7
- package/src/components/or-segmented-control-v3/OrSegmentedControl.stories3.ts +0 -118
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/OrSegmentedControlItem.vue +0 -63
- package/src/components/or-segmented-control-v3/components/or-segmented-control-item/styles.ts +0 -50
- package/src/components/or-segmented-control-v3/index.ts +0 -3
- package/src/components/or-segmented-control-v3/props.ts +0 -4
- package/src/components/or-segmented-control-v3/styles.ts +0 -24
- package/src/components/or-segmented-control-v3/types.ts +0 -4
package/dist/v3/index92.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { s as OrTooltipV3 } from './OrTooltip-36c6728c.js';
|
|
2
|
+
export { P as TooltipPlacement } from './OrPopover-3525c670.js';
|
|
3
|
+
import '@vueuse/core';
|
|
2
4
|
import 'vue-demi';
|
|
5
|
+
import './useClassAttribute-47fdb016.js';
|
|
6
|
+
import 'vue';
|
|
7
|
+
import '@floating-ui/dom';
|
|
8
|
+
import './useElevation-0e973238.js';
|
|
9
|
+
import './useResponsive-a02e95b7.js';
|
|
10
|
+
import './OrBottomSheet-9de57dd0.js';
|
|
11
|
+
import './OrOverlay-27050c19.js';
|
|
12
|
+
import './OrTeleport.vue3-8099178c.js';
|
package/dist/v3/index93.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { u as useElevation } from './useElevation-0e973238.js';
|
|
3
|
-
export { u as useOverflow } from './useOverflow-ac506c65.js';
|
|
4
|
-
export { u as useResponsive } from './useResponsive-a02e95b7.js';
|
|
5
|
-
export { u as useToggle } from './useToggle-29e4d7c7.js';
|
|
1
|
+
export { D as DropdownClose, a as DropdownOpen } from './dropdown-open-0d314aa4.js';
|
|
6
2
|
import 'vue-demi';
|
|
7
|
-
import '@vueuse/core';
|
package/dist/v3/index94.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
export { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
2
|
+
export { u as useElevation } from './useElevation-0e973238.js';
|
|
3
|
+
export { u as useOverflow } from './useOverflow-ac506c65.js';
|
|
1
4
|
export { u as useResponsive } from './useResponsive-a02e95b7.js';
|
|
2
|
-
|
|
5
|
+
export { u as useToggle } from './useToggle-29e4d7c7.js';
|
|
3
6
|
import 'vue-demi';
|
|
7
|
+
import '@vueuse/core';
|
package/package.json
CHANGED
package/src/components/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './or-button-v2';
|
|
|
6
6
|
export * from './or-button-v3';
|
|
7
7
|
export * from './or-card';
|
|
8
8
|
export * from './or-card-collection';
|
|
9
|
+
export * from './or-card-collection-v3';
|
|
9
10
|
export * from './or-card-v3';
|
|
10
11
|
export * from './or-carousel';
|
|
11
12
|
export * from './or-checkbox';
|
|
@@ -58,7 +59,6 @@ export * from './or-radio';
|
|
|
58
59
|
export * from './or-radio-group';
|
|
59
60
|
export * from './or-radio-v3';
|
|
60
61
|
export * from './or-search-v3';
|
|
61
|
-
export * from './or-segmented-control-v3';
|
|
62
62
|
export * from './or-select';
|
|
63
63
|
export * from './or-select-v3';
|
|
64
64
|
export * from './or-sidebar';
|
|
@@ -66,6 +66,7 @@ export * from './or-sidebar-v3';
|
|
|
66
66
|
export * from './or-skeleton';
|
|
67
67
|
export * from './or-skeleton-v3';
|
|
68
68
|
export * from './or-slider';
|
|
69
|
+
export * from './or-sort-header-v3';
|
|
69
70
|
export * from './or-stepper';
|
|
70
71
|
export * from './or-switch';
|
|
71
72
|
export * from './or-switch-v3';
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/vue3';
|
|
3
|
+
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
4
|
+
import OrCardCollectionDocs from './OrCardCollection.docs.mdx';
|
|
5
|
+
import OrCardCollection from './OrCardCollection.vue';
|
|
6
|
+
import { CardCollectionView } from './props';
|
|
7
|
+
import { CardCollectionItem, CardCollectionSortHeader } from './types';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
title: 'Components/Card Collection',
|
|
11
|
+
component: OrCardCollection,
|
|
12
|
+
|
|
13
|
+
argTypes: {
|
|
14
|
+
// Slots
|
|
15
|
+
gridItem: {
|
|
16
|
+
type: {
|
|
17
|
+
name: 'string',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
control: { type: 'text' },
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
listItem: {
|
|
25
|
+
type: {
|
|
26
|
+
name: 'string',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
control: { type: 'text' },
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
// Props
|
|
34
|
+
items: {
|
|
35
|
+
control: { type: 'object' },
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
view: {
|
|
39
|
+
control: { type: 'select' },
|
|
40
|
+
options: Object.values(CardCollectionView),
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
sort: {
|
|
44
|
+
control: { type: 'object' },
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
sortHeaders: {
|
|
48
|
+
control: { type: 'object' },
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
search: {
|
|
52
|
+
control: { type: 'text' },
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// Events
|
|
56
|
+
viewChange: {
|
|
57
|
+
table: { disable: true },
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
sortChange: {
|
|
61
|
+
table: { disable: true },
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
searchChange: {
|
|
65
|
+
table: { disable: true },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
parameters: {
|
|
70
|
+
docs: {
|
|
71
|
+
page: OrCardCollectionDocs,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
} as Meta<typeof OrCardCollection>;
|
|
75
|
+
|
|
76
|
+
const Template: StoryFn<typeof OrCardCollection> = (args) => ({
|
|
77
|
+
components: {
|
|
78
|
+
OrCardCollection,
|
|
79
|
+
OrIcon,
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
setup() {
|
|
83
|
+
return {
|
|
84
|
+
args,
|
|
85
|
+
onViewChange: action('viewChange'),
|
|
86
|
+
onSortChange: action('sortChange'),
|
|
87
|
+
onSearchChange: action('searchChange'),
|
|
88
|
+
};
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
template: `
|
|
92
|
+
<OrCardCollection
|
|
93
|
+
v-bind="args"
|
|
94
|
+
@viewChange="onViewChange"
|
|
95
|
+
@sortChange="onSortChange"
|
|
96
|
+
@searchChange="onSearchChange"
|
|
97
|
+
>
|
|
98
|
+
<template #gridItem="item">${args.gridItem}</template>
|
|
99
|
+
<template #listItem="item">${args.listItem}</template>
|
|
100
|
+
<template #addon>${args.addon}</template>
|
|
101
|
+
</OrCardCollection>
|
|
102
|
+
`,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export const Default = Template.bind({});
|
|
106
|
+
|
|
107
|
+
Default.args = {
|
|
108
|
+
// Slots
|
|
109
|
+
gridItem: '{{ item.label }} (grid)',
|
|
110
|
+
listItem: '{{ item.label }} (list)',
|
|
111
|
+
addon: '<OrIcon icon="info" />',
|
|
112
|
+
|
|
113
|
+
// Props
|
|
114
|
+
items: Array.from<string, CardCollectionItem>([
|
|
115
|
+
'Alfa',
|
|
116
|
+
'Bravo',
|
|
117
|
+
'Charlie',
|
|
118
|
+
'Delta',
|
|
119
|
+
'Echo',
|
|
120
|
+
'Foxtrot',
|
|
121
|
+
'Golf',
|
|
122
|
+
'Hotel',
|
|
123
|
+
'India',
|
|
124
|
+
'Juliett',
|
|
125
|
+
'Kilo',
|
|
126
|
+
'Lima',
|
|
127
|
+
'Mike',
|
|
128
|
+
'November',
|
|
129
|
+
'Oscar',
|
|
130
|
+
'Papa',
|
|
131
|
+
'Quebec',
|
|
132
|
+
'Romeo',
|
|
133
|
+
'Sierra',
|
|
134
|
+
'Tango',
|
|
135
|
+
'Uniform',
|
|
136
|
+
'Victor',
|
|
137
|
+
'Whiskey',
|
|
138
|
+
'X-Ray',
|
|
139
|
+
'Yankee',
|
|
140
|
+
'Zulu',
|
|
141
|
+
], (item) => ({
|
|
142
|
+
id: item.toLowerCase(),
|
|
143
|
+
label: item,
|
|
144
|
+
})),
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const WithSorting = Template.bind({});
|
|
148
|
+
|
|
149
|
+
WithSorting.args = {
|
|
150
|
+
...Default.args,
|
|
151
|
+
|
|
152
|
+
// Props
|
|
153
|
+
sortHeaders: Array.from<string, CardCollectionSortHeader>([
|
|
154
|
+
'Foo',
|
|
155
|
+
'Bar',
|
|
156
|
+
'Baz',
|
|
157
|
+
'Qux',
|
|
158
|
+
], (item) => ({
|
|
159
|
+
value: item.toLowerCase(),
|
|
160
|
+
label: item,
|
|
161
|
+
})),
|
|
162
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="root"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:class="rootStyles"
|
|
6
|
+
>
|
|
7
|
+
<div :class="toolbarStyles">
|
|
8
|
+
<div :class="toolbarPanelStyles">
|
|
9
|
+
<template v-if="sortHeaders">
|
|
10
|
+
<OrSortHeader
|
|
11
|
+
v-for="header in sortHeaders"
|
|
12
|
+
:key="header.value"
|
|
13
|
+
v-model="proxySort"
|
|
14
|
+
:input-value="header.value"
|
|
15
|
+
>
|
|
16
|
+
{{ header.label }}
|
|
17
|
+
</OrSortHeader>
|
|
18
|
+
</template>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div :class="toolbarPanelStyles">
|
|
22
|
+
<OrInput
|
|
23
|
+
v-model="proxySearch"
|
|
24
|
+
:type="'search'"
|
|
25
|
+
:placeholder="'Search'"
|
|
26
|
+
:size="'s'"
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
<OrIconButton
|
|
30
|
+
:icon="'grid_view'"
|
|
31
|
+
@click="switchToGridView()"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<OrIconButton
|
|
35
|
+
:icon="'view_list'"
|
|
36
|
+
@click="switchToListView()"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<slot name="addon" />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div :class="contentStyles">
|
|
44
|
+
<template v-if="proxyView === 'grid'">
|
|
45
|
+
<OrCard
|
|
46
|
+
v-for="item in items"
|
|
47
|
+
:key="item.id"
|
|
48
|
+
>
|
|
49
|
+
<slot
|
|
50
|
+
name="gridItem"
|
|
51
|
+
v-bind="item"
|
|
52
|
+
/>
|
|
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>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script lang="ts">
|
|
72
|
+
import { computed, defineComponent, PropType, ref, watch } from 'vue-demi';
|
|
73
|
+
import { useClassAttribute } from '../../hooks';
|
|
74
|
+
import { OrCardV3 as OrCard } from '../or-card-v3';
|
|
75
|
+
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
76
|
+
import { OrInputV3 as OrInput } from '../or-input-v3';
|
|
77
|
+
import { OrSortHeaderV3 as OrSortHeader, SortHeaderModel } from '../or-sort-header-v3';
|
|
78
|
+
import { CardCollectionView } from './props';
|
|
79
|
+
import { CardCollectionContent, CardCollectionContentViews, CardCollectionRoot, CardCollectionToolbar, CardCollectionToolbarPanel } from './styles';
|
|
80
|
+
import { CardCollectionItem, CardCollectionSortHeader } from './types';
|
|
81
|
+
|
|
82
|
+
export default defineComponent({
|
|
83
|
+
name: 'OrCardCollection',
|
|
84
|
+
|
|
85
|
+
components: {
|
|
86
|
+
OrCard,
|
|
87
|
+
OrIconButton,
|
|
88
|
+
OrInput,
|
|
89
|
+
OrSortHeader,
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
inheritAttrs: false,
|
|
93
|
+
|
|
94
|
+
props: {
|
|
95
|
+
items: {
|
|
96
|
+
type: Array as PropType<CardCollectionItem[]>,
|
|
97
|
+
default: [] as CardCollectionItem[],
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
view: {
|
|
101
|
+
type: String as PropType<CardCollectionView>,
|
|
102
|
+
default: CardCollectionView.Grid,
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
sort: {
|
|
106
|
+
type: Object as PropType<SortHeaderModel>,
|
|
107
|
+
default: undefined,
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
sortHeaders: {
|
|
111
|
+
type: Array as PropType<CardCollectionSortHeader[]>,
|
|
112
|
+
default: undefined,
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
search: {
|
|
116
|
+
type: String,
|
|
117
|
+
default: undefined,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
emits: [
|
|
122
|
+
'viewChange',
|
|
123
|
+
'sortChange',
|
|
124
|
+
'searchChange',
|
|
125
|
+
],
|
|
126
|
+
|
|
127
|
+
expose: [
|
|
128
|
+
'root',
|
|
129
|
+
],
|
|
130
|
+
|
|
131
|
+
setup(props, context) {
|
|
132
|
+
// Refs
|
|
133
|
+
const root = ref<HTMLElement>();
|
|
134
|
+
|
|
135
|
+
// Styles
|
|
136
|
+
const classAttribute = useClassAttribute();
|
|
137
|
+
|
|
138
|
+
const rootStyles = computed(() => [
|
|
139
|
+
'or-card-collection',
|
|
140
|
+
...CardCollectionRoot,
|
|
141
|
+
classAttribute.value,
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
const toolbarStyles = computed(() => [
|
|
145
|
+
...CardCollectionToolbar,
|
|
146
|
+
]);
|
|
147
|
+
|
|
148
|
+
const toolbarPanelStyles = computed(() => [
|
|
149
|
+
...CardCollectionToolbarPanel,
|
|
150
|
+
]);
|
|
151
|
+
|
|
152
|
+
const contentStyles = computed(() => [
|
|
153
|
+
...CardCollectionContent,
|
|
154
|
+
...CardCollectionContentViews[proxyView.value],
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
// State
|
|
158
|
+
const proxyView = ref(props.view);
|
|
159
|
+
const proxySort = ref(props.sort);
|
|
160
|
+
const proxySearch = ref(props.search);
|
|
161
|
+
|
|
162
|
+
// Methods
|
|
163
|
+
function switchToGridView(): void {
|
|
164
|
+
proxyView.value = CardCollectionView.Grid;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function switchToListView(): void {
|
|
168
|
+
proxyView.value = CardCollectionView.List;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Effects
|
|
172
|
+
watch(() => props.view, (value) => {
|
|
173
|
+
proxyView.value = value;
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
watch(proxyView, (value) => {
|
|
177
|
+
context.emit('viewChange', value);
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
watch(() => props.sort, (value) => {
|
|
181
|
+
proxySort.value = value;
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
watch(proxySort, (value) => {
|
|
185
|
+
context.emit('sortChange', value);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
watch(() => props.search, (value) => {
|
|
189
|
+
proxySearch.value = value;
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
watch(proxySearch, (value) => {
|
|
193
|
+
context.emit('searchChange', value);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
root,
|
|
198
|
+
rootStyles,
|
|
199
|
+
toolbarStyles,
|
|
200
|
+
toolbarPanelStyles,
|
|
201
|
+
contentStyles,
|
|
202
|
+
proxyView,
|
|
203
|
+
proxySort,
|
|
204
|
+
proxySearch,
|
|
205
|
+
switchToGridView,
|
|
206
|
+
switchToListView,
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
</script>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CardCollectionView } from './props';
|
|
2
|
+
|
|
3
|
+
export const CardCollectionRoot: string[] = [
|
|
4
|
+
// Layout
|
|
5
|
+
'flex flex-col',
|
|
6
|
+
|
|
7
|
+
// Spacing
|
|
8
|
+
'gap-md',
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const CardCollectionToolbar: string[] = [
|
|
12
|
+
// Layout
|
|
13
|
+
'flex',
|
|
14
|
+
'justify-between',
|
|
15
|
+
'items-center',
|
|
16
|
+
|
|
17
|
+
// Typography
|
|
18
|
+
'typography-body-2-regular',
|
|
19
|
+
|
|
20
|
+
// Theme
|
|
21
|
+
'theme-foreground-default',
|
|
22
|
+
'dark:theme-foreground-default-dark',
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
export const CardCollectionToolbarPanel: string[] = [
|
|
26
|
+
// Layout
|
|
27
|
+
'flex',
|
|
28
|
+
'justify-normal',
|
|
29
|
+
'items-center',
|
|
30
|
+
|
|
31
|
+
// Spacing
|
|
32
|
+
'gap-sm',
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export const CardCollectionContent: string[] = [
|
|
36
|
+
// Layout
|
|
37
|
+
'grid',
|
|
38
|
+
|
|
39
|
+
// Spacing
|
|
40
|
+
'gap-sm md:gap-md',
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
export const CardCollectionContentViews: Record<CardCollectionView, string[]> = {
|
|
44
|
+
'grid': [
|
|
45
|
+
// Layout
|
|
46
|
+
'sm:grid-cols-1',
|
|
47
|
+
'md:grid-cols-2',
|
|
48
|
+
'lg:grid-cols-4',
|
|
49
|
+
'xl:grid-cols-6',
|
|
50
|
+
],
|
|
51
|
+
|
|
52
|
+
'list': [],
|
|
53
|
+
};
|
|
@@ -41,16 +41,18 @@
|
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
43
|
<template v-if="!invalid">
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
<template v-if="hint || maxLength">
|
|
45
|
+
<OrHint>
|
|
46
|
+
{{ hint }}
|
|
47
|
+
|
|
48
|
+
<template
|
|
49
|
+
v-if="maxLength"
|
|
50
|
+
v-slot:addon
|
|
51
|
+
>
|
|
52
|
+
{{ currentLength }} / {{ maxLength }}
|
|
53
|
+
</template>
|
|
54
|
+
</OrHint>
|
|
55
|
+
</template>
|
|
54
56
|
</template>
|
|
55
57
|
|
|
56
58
|
<template v-else>
|
|
@@ -40,16 +40,18 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
|
|
42
42
|
<template v-if="!invalid">
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
<template v-if="hint || maxLength">
|
|
44
|
+
<OrHint>
|
|
45
|
+
{{ hint }}
|
|
46
|
+
|
|
47
|
+
<template
|
|
48
|
+
v-if="maxLength"
|
|
49
|
+
v-slot:addon
|
|
50
|
+
>
|
|
51
|
+
{{ currentLength }} / {{ maxLength }}
|
|
52
|
+
</template>
|
|
53
|
+
</OrHint>
|
|
54
|
+
</template>
|
|
53
55
|
</template>
|
|
54
56
|
|
|
55
57
|
<template v-else>
|
|
@@ -72,16 +72,18 @@
|
|
|
72
72
|
</OrInputBox>
|
|
73
73
|
|
|
74
74
|
<template v-if="!invalid">
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
<template v-if="hint || maxLength">
|
|
76
|
+
<OrHint :disabled="disabled">
|
|
77
|
+
{{ hint }}
|
|
78
|
+
|
|
79
|
+
<template
|
|
80
|
+
v-if="maxLength"
|
|
81
|
+
v-slot:addon
|
|
82
|
+
>
|
|
83
|
+
{{ currentLength }} / {{ maxLength }}
|
|
84
|
+
</template>
|
|
85
|
+
</OrHint>
|
|
86
|
+
</template>
|
|
85
87
|
</template>
|
|
86
88
|
|
|
87
89
|
<template v-else>
|
|
@@ -193,9 +193,11 @@
|
|
|
193
193
|
</OrInputBox>
|
|
194
194
|
|
|
195
195
|
<template v-if="!invalid">
|
|
196
|
-
<
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
<template v-if="hint">
|
|
197
|
+
<OrHint :disabled="disabled">
|
|
198
|
+
{{ hint }}
|
|
199
|
+
</OrHint>
|
|
200
|
+
</template>
|
|
199
201
|
</template>
|
|
200
202
|
|
|
201
203
|
<template v-else>
|