@onereach/ui-components 2.69.3 → 2.69.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundled/v2/{OrCard-58a1ba3e.js → OrCard-29116e1f.js} +2 -2
- package/dist/bundled/v2/OrCardCollection-f622df47.js +346 -0
- package/dist/bundled/v2/{OrSearch-9d402f56.js → OrSearch-a11b3621.js} +9 -3
- package/dist/bundled/v2/{OrSortHeader-396e6a7c.js → OrSortHeader-9932d28f.js} +2 -2
- package/dist/bundled/v2/components/index.js +4 -4
- package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
- package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
- package/dist/bundled/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
- package/dist/bundled/v2/components/or-card-collection-v3/index.js +7 -4
- package/dist/bundled/v2/components/or-card-collection-v3/props.d.ts +5 -1
- package/dist/bundled/v2/components/or-card-collection-v3/styles.d.ts +2 -2
- package/dist/bundled/v2/components/or-card-collection-v3/types.d.ts +8 -3
- package/dist/bundled/v2/components/or-card-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
- package/dist/bundled/v2/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v2/components/or-sort-header-v3/index.js +1 -1
- package/dist/bundled/v2/index.js +5 -5
- package/dist/bundled/v3/OrButton-a671b8a1.js +33 -0
- package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-15645a65.js +228 -0
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-49a3a9bd.js → OrConfirm.vue_vue_type_script_lang-f57ffa1a.js} +6 -36
- package/dist/bundled/v3/OrMenu-f26e8e55.js +29 -0
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-ed78b21f.js → OrSearch.vue_vue_type_script_lang-0ae8a6dd.js} +8 -2
- package/dist/bundled/v3/{OrTabs.vue_vue_type_script_lang-919b2021.js → OrTabs.vue_vue_type_script_lang-61b79a5a.js} +10 -36
- package/dist/bundled/v3/components/index.js +8 -6
- package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
- package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
- package/dist/bundled/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
- package/dist/bundled/v3/components/or-card-collection-v3/index.js +11 -4
- package/dist/bundled/v3/components/or-card-collection-v3/props.d.ts +5 -1
- package/dist/bundled/v3/components/or-card-collection-v3/styles.d.ts +2 -2
- package/dist/bundled/v3/components/or-card-collection-v3/types.d.ts +8 -3
- package/dist/bundled/v3/components/or-confirm-v3/index.js +2 -1
- package/dist/bundled/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
- package/dist/bundled/v3/components/or-search-v3/index.js +1 -1
- package/dist/bundled/v3/components/or-tabs-v3/index.js +2 -1
- package/dist/bundled/v3/index.js +326 -295
- package/dist/esm/v2/OrCardCollection-43aa4a3c.js +346 -0
- package/dist/esm/v2/{OrSearch-ddb7c1fe.js → OrSearch-62d91301.js} +7 -1
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
- package/dist/esm/v2/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
- package/dist/esm/v2/components/or-card-collection-v3/OrCardCollectionView.vue2.vue.d.ts +35 -0
- package/dist/esm/v2/components/or-card-collection-v3/index.js +7 -4
- package/dist/esm/v2/components/or-card-collection-v3/props.d.ts +5 -1
- package/dist/esm/v2/components/or-card-collection-v3/styles.d.ts +2 -2
- package/dist/esm/v2/components/or-card-collection-v3/types.d.ts +8 -3
- package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +13 -0
- package/dist/esm/v2/components/or-search-v3/index.js +1 -1
- package/dist/esm/v2/index.js +2 -2
- package/dist/esm/v3/OrCardCollection-6b5e6b76.js +289 -0
- package/dist/esm/v3/{OrSearch-cdde55ce.js → OrSearch-aafb93b4.js} +7 -1
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.stories3.d.ts +5 -0
- package/dist/esm/v3/components/or-card-collection-v3/OrCardCollection.vue.d.ts +67 -42
- package/dist/esm/v3/components/or-card-collection-v3/OrCardCollectionView.vue3.vue.d.ts +35 -0
- package/dist/esm/v3/components/or-card-collection-v3/index.js +7 -4
- package/dist/esm/v3/components/or-card-collection-v3/props.d.ts +5 -1
- package/dist/esm/v3/components/or-card-collection-v3/styles.d.ts +2 -2
- package/dist/esm/v3/components/or-card-collection-v3/types.d.ts +8 -3
- package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +13 -0
- package/dist/esm/v3/components/or-search-v3/index.js +1 -1
- package/dist/esm/v3/index.js +2 -2
- package/package.json +2 -2
- package/src/components/or-card-collection-v3/OrCardCollection.docs.mdx +4 -0
- package/src/components/or-card-collection-v3/OrCardCollection.stories3.ts +230 -30
- package/src/components/or-card-collection-v3/OrCardCollection.vue +120 -77
- package/src/components/or-card-collection-v3/OrCardCollectionView.vue2.vue +41 -0
- package/src/components/or-card-collection-v3/OrCardCollectionView.vue3.vue +42 -0
- package/src/components/or-card-collection-v3/props.ts +14 -1
- package/src/components/or-card-collection-v3/styles.ts +3 -3
- package/src/components/or-card-collection-v3/types.ts +9 -3
- package/src/components/or-search-v3/OrSearch.vue +7 -1
- package/dist/bundled/v2/OrCardCollection-a9a779ea.js +0 -228
- package/dist/bundled/v3/OrCardCollection.vue_vue_type_script_lang-861158b5.js +0 -164
- package/dist/esm/v2/OrCardCollection-4f001551.js +0 -227
- package/dist/esm/v3/OrCardCollection-5a0febaf.js +0 -198
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, mergeProps, renderSlot, resolveComponent, withModifiers, createBlock, normalizeClass, createCommentVNode, defineComponent, ref, computed, watch } from 'vue';
|
|
2
|
-
import { s as script$1 } from './OrCard.vue_vue_type_script_lang-165de137.js';
|
|
3
|
-
import './OrIconButton-1581013c.js';
|
|
4
|
-
import { s as script$3 } from './OrIconButton.vue_vue_type_script_lang-f6f801ff.js';
|
|
5
|
-
import './OrInput-fa782fc1.js';
|
|
6
|
-
import { s as script$4 } from './OrInput.vue_vue_type_script_lang-f6d793d3.js';
|
|
7
|
-
import { s as script$2 } from './OrSortHeader.vue_vue_type_script_lang-75115125.js';
|
|
8
|
-
import { u as useClassAttribute } from './useClassAttribute-00888f78.js';
|
|
9
|
-
|
|
10
|
-
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
12
|
-
ref: "root"
|
|
13
|
-
}, _ctx.$attrs, {
|
|
14
|
-
class: _ctx.rootStyles
|
|
15
|
-
}), [renderSlot(_ctx.$slots, "default")], 16 /* FULL_PROPS */);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
script$1.render = render$1;
|
|
19
|
-
script$1.__file = "src/components/or-card-v3/OrCard.vue";
|
|
20
|
-
|
|
21
|
-
const _hoisted_1 = ["activated"];
|
|
22
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23
|
-
const _component_OrIcon = resolveComponent("OrIcon");
|
|
24
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
25
|
-
ref: "root"
|
|
26
|
-
}, _ctx.$attrs, {
|
|
27
|
-
class: _ctx.rootStyles,
|
|
28
|
-
activated: _ctx.activated ? '' : null,
|
|
29
|
-
onClick: _cache[0] || (_cache[0] = withModifiers($event => _ctx.toggleDirection(), ["stop"]))
|
|
30
|
-
}), [renderSlot(_ctx.$slots, "default"), _ctx.activated ? (openBlock(), createBlock(_component_OrIcon, {
|
|
31
|
-
key: 0,
|
|
32
|
-
class: normalizeClass({
|
|
33
|
-
'rotate-180': _ctx.proxyModelValue.direction === 'asc'
|
|
34
|
-
}),
|
|
35
|
-
icon: 'arrow_downward'
|
|
36
|
-
}, null, 8 /* PROPS */, ["class"])) : createCommentVNode("v-if", true)], 16 /* FULL_PROPS */, _hoisted_1);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
script$2.render = render;
|
|
40
|
-
script$2.__file = "src/components/or-sort-header-v3/OrSortHeader.vue";
|
|
41
|
-
|
|
42
|
-
var CardCollectionView;
|
|
43
|
-
(function (CardCollectionView) {
|
|
44
|
-
CardCollectionView["Grid"] = "grid";
|
|
45
|
-
CardCollectionView["List"] = "list";
|
|
46
|
-
})(CardCollectionView || (CardCollectionView = {}));
|
|
47
|
-
|
|
48
|
-
const CardCollectionRoot = [
|
|
49
|
-
// Layout
|
|
50
|
-
'layout-column',
|
|
51
|
-
// Spacing
|
|
52
|
-
'gap-md'];
|
|
53
|
-
const CardCollectionToolbar = [
|
|
54
|
-
// Layout
|
|
55
|
-
'layout-row justify-between',
|
|
56
|
-
// Typography
|
|
57
|
-
'typography-body-2-regular',
|
|
58
|
-
// Theme
|
|
59
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark'];
|
|
60
|
-
const CardCollectionToolbarPanel = [
|
|
61
|
-
// Layout
|
|
62
|
-
'layout-row',
|
|
63
|
-
// Spacing
|
|
64
|
-
'gap-sm+'];
|
|
65
|
-
const CardCollectionContent = [
|
|
66
|
-
// Layout
|
|
67
|
-
'grid',
|
|
68
|
-
// Spacing
|
|
69
|
-
'gap-sm md:gap-md'];
|
|
70
|
-
const CardCollectionContentViews = {
|
|
71
|
-
'grid': [
|
|
72
|
-
// Layout
|
|
73
|
-
'sm:grid-cols-1', 'md:grid-cols-2', 'lg:grid-cols-4', 'xl:grid-cols-6'],
|
|
74
|
-
'list': []
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var script = defineComponent({
|
|
78
|
-
name: 'OrCardCollection',
|
|
79
|
-
components: {
|
|
80
|
-
OrCard: script$1,
|
|
81
|
-
OrIconButton: script$3,
|
|
82
|
-
OrInput: script$4,
|
|
83
|
-
OrSortHeader: script$2
|
|
84
|
-
},
|
|
85
|
-
inheritAttrs: false,
|
|
86
|
-
props: {
|
|
87
|
-
items: {
|
|
88
|
-
type: Array,
|
|
89
|
-
default: []
|
|
90
|
-
},
|
|
91
|
-
view: {
|
|
92
|
-
type: String,
|
|
93
|
-
default: CardCollectionView.Grid
|
|
94
|
-
},
|
|
95
|
-
sort: {
|
|
96
|
-
type: Object,
|
|
97
|
-
default: undefined
|
|
98
|
-
},
|
|
99
|
-
sortHeaders: {
|
|
100
|
-
type: Array,
|
|
101
|
-
default: undefined
|
|
102
|
-
},
|
|
103
|
-
search: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: undefined
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
emits: ['viewChange', 'sortChange', 'searchChange'],
|
|
109
|
-
expose: ['root'],
|
|
110
|
-
setup(props, context) {
|
|
111
|
-
// Refs
|
|
112
|
-
const root = ref();
|
|
113
|
-
// Styles
|
|
114
|
-
const classAttribute = useClassAttribute();
|
|
115
|
-
const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
|
|
116
|
-
const toolbarStyles = computed(() => [...CardCollectionToolbar]);
|
|
117
|
-
const toolbarPanelStyles = computed(() => [...CardCollectionToolbarPanel]);
|
|
118
|
-
const contentStyles = computed(() => [...CardCollectionContent, ...CardCollectionContentViews[proxyView.value]]);
|
|
119
|
-
// State
|
|
120
|
-
const proxyView = ref(props.view);
|
|
121
|
-
const proxySort = ref(props.sort);
|
|
122
|
-
const proxySearch = ref(props.search);
|
|
123
|
-
// Methods
|
|
124
|
-
function switchToGridView() {
|
|
125
|
-
proxyView.value = CardCollectionView.Grid;
|
|
126
|
-
}
|
|
127
|
-
function switchToListView() {
|
|
128
|
-
proxyView.value = CardCollectionView.List;
|
|
129
|
-
}
|
|
130
|
-
// Effects
|
|
131
|
-
watch(() => props.view, value => {
|
|
132
|
-
proxyView.value = value;
|
|
133
|
-
});
|
|
134
|
-
watch(proxyView, value => {
|
|
135
|
-
context.emit('viewChange', value);
|
|
136
|
-
});
|
|
137
|
-
watch(() => props.sort, value => {
|
|
138
|
-
proxySort.value = value;
|
|
139
|
-
});
|
|
140
|
-
watch(proxySort, value => {
|
|
141
|
-
context.emit('sortChange', value);
|
|
142
|
-
});
|
|
143
|
-
watch(() => props.search, value => {
|
|
144
|
-
proxySearch.value = value;
|
|
145
|
-
});
|
|
146
|
-
watch(proxySearch, value => {
|
|
147
|
-
context.emit('searchChange', value);
|
|
148
|
-
});
|
|
149
|
-
return {
|
|
150
|
-
root,
|
|
151
|
-
rootStyles,
|
|
152
|
-
toolbarStyles,
|
|
153
|
-
toolbarPanelStyles,
|
|
154
|
-
contentStyles,
|
|
155
|
-
proxyView,
|
|
156
|
-
proxySort,
|
|
157
|
-
proxySearch,
|
|
158
|
-
switchToGridView,
|
|
159
|
-
switchToListView
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
export { CardCollectionView as C, script as s };
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch } from 'vue-demi';
|
|
2
|
-
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
|
-
import { _ as __vue_component__$1 } from './OrCard-de799db0.js';
|
|
5
|
-
import { _ as __vue_component__$2 } from './OrIconButton-e17e4944.js';
|
|
6
|
-
import { _ as __vue_component__$3 } from './OrInput-2f16a7ac.js';
|
|
7
|
-
import { _ as __vue_component__$4 } from './OrSortHeader-19bf94ca.js';
|
|
8
|
-
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
9
|
-
|
|
10
|
-
var CardCollectionView;
|
|
11
|
-
(function (CardCollectionView) {
|
|
12
|
-
CardCollectionView["Grid"] = "grid";
|
|
13
|
-
CardCollectionView["List"] = "list";
|
|
14
|
-
})(CardCollectionView || (CardCollectionView = {}));
|
|
15
|
-
|
|
16
|
-
const CardCollectionRoot = [
|
|
17
|
-
// Layout
|
|
18
|
-
'layout-column',
|
|
19
|
-
// Spacing
|
|
20
|
-
'gap-md'];
|
|
21
|
-
const CardCollectionToolbar = [
|
|
22
|
-
// Layout
|
|
23
|
-
'layout-row justify-between',
|
|
24
|
-
// Typography
|
|
25
|
-
'typography-body-2-regular',
|
|
26
|
-
// Theme
|
|
27
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark'];
|
|
28
|
-
const CardCollectionToolbarPanel = [
|
|
29
|
-
// Layout
|
|
30
|
-
'layout-row',
|
|
31
|
-
// Spacing
|
|
32
|
-
'gap-sm+'];
|
|
33
|
-
const CardCollectionContent = [
|
|
34
|
-
// Layout
|
|
35
|
-
'grid',
|
|
36
|
-
// Spacing
|
|
37
|
-
'gap-sm md:gap-md'];
|
|
38
|
-
const CardCollectionContentViews = {
|
|
39
|
-
'grid': [
|
|
40
|
-
// Layout
|
|
41
|
-
'sm:grid-cols-1', 'md:grid-cols-2', 'lg:grid-cols-4', 'xl:grid-cols-6'],
|
|
42
|
-
'list': []
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var script = defineComponent({
|
|
46
|
-
name: 'OrCardCollection',
|
|
47
|
-
components: {
|
|
48
|
-
OrCard: __vue_component__$1,
|
|
49
|
-
OrIconButton: __vue_component__$2,
|
|
50
|
-
OrInput: __vue_component__$3,
|
|
51
|
-
OrSortHeader: __vue_component__$4
|
|
52
|
-
},
|
|
53
|
-
inheritAttrs: false,
|
|
54
|
-
props: {
|
|
55
|
-
items: {
|
|
56
|
-
type: Array,
|
|
57
|
-
default: []
|
|
58
|
-
},
|
|
59
|
-
view: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: CardCollectionView.Grid
|
|
62
|
-
},
|
|
63
|
-
sort: {
|
|
64
|
-
type: Object,
|
|
65
|
-
default: undefined
|
|
66
|
-
},
|
|
67
|
-
sortHeaders: {
|
|
68
|
-
type: Array,
|
|
69
|
-
default: undefined
|
|
70
|
-
},
|
|
71
|
-
search: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: undefined
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
emits: ['viewChange', 'sortChange', 'searchChange'],
|
|
77
|
-
expose: ['root'],
|
|
78
|
-
setup(props, context) {
|
|
79
|
-
// Refs
|
|
80
|
-
const root = ref();
|
|
81
|
-
// Styles
|
|
82
|
-
const classAttribute = useClassAttribute();
|
|
83
|
-
const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
|
|
84
|
-
const toolbarStyles = computed(() => [...CardCollectionToolbar]);
|
|
85
|
-
const toolbarPanelStyles = computed(() => [...CardCollectionToolbarPanel]);
|
|
86
|
-
const contentStyles = computed(() => [...CardCollectionContent, ...CardCollectionContentViews[proxyView.value]]);
|
|
87
|
-
// State
|
|
88
|
-
const proxyView = ref(props.view);
|
|
89
|
-
const proxySort = ref(props.sort);
|
|
90
|
-
const proxySearch = ref(props.search);
|
|
91
|
-
// Methods
|
|
92
|
-
function switchToGridView() {
|
|
93
|
-
proxyView.value = CardCollectionView.Grid;
|
|
94
|
-
}
|
|
95
|
-
function switchToListView() {
|
|
96
|
-
proxyView.value = CardCollectionView.List;
|
|
97
|
-
}
|
|
98
|
-
// Effects
|
|
99
|
-
watch(() => props.view, value => {
|
|
100
|
-
proxyView.value = value;
|
|
101
|
-
});
|
|
102
|
-
watch(proxyView, value => {
|
|
103
|
-
context.emit('viewChange', value);
|
|
104
|
-
});
|
|
105
|
-
watch(() => props.sort, value => {
|
|
106
|
-
proxySort.value = value;
|
|
107
|
-
});
|
|
108
|
-
watch(proxySort, value => {
|
|
109
|
-
context.emit('sortChange', value);
|
|
110
|
-
});
|
|
111
|
-
watch(() => props.search, value => {
|
|
112
|
-
proxySearch.value = value;
|
|
113
|
-
});
|
|
114
|
-
watch(proxySearch, value => {
|
|
115
|
-
context.emit('searchChange', value);
|
|
116
|
-
});
|
|
117
|
-
return {
|
|
118
|
-
root,
|
|
119
|
-
rootStyles,
|
|
120
|
-
toolbarStyles,
|
|
121
|
-
toolbarPanelStyles,
|
|
122
|
-
contentStyles,
|
|
123
|
-
proxyView,
|
|
124
|
-
proxySort,
|
|
125
|
-
proxySearch,
|
|
126
|
-
switchToGridView,
|
|
127
|
-
switchToListView
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
/* script */
|
|
133
|
-
const __vue_script__ = script;
|
|
134
|
-
|
|
135
|
-
/* template */
|
|
136
|
-
var __vue_render__ = function () {
|
|
137
|
-
var _vm = this;
|
|
138
|
-
var _h = _vm.$createElement;
|
|
139
|
-
var _c = _vm._self._c || _h;
|
|
140
|
-
return _c('div', _vm._b({
|
|
141
|
-
ref: "root",
|
|
142
|
-
class: _vm.rootStyles
|
|
143
|
-
}, 'div', _vm.$attrs, false), [_c('div', {
|
|
144
|
-
class: _vm.toolbarStyles
|
|
145
|
-
}, [_c('div', {
|
|
146
|
-
class: _vm.toolbarPanelStyles
|
|
147
|
-
}, [_vm.sortHeaders ? _vm._l(_vm.sortHeaders, function (header) {
|
|
148
|
-
return _c('OrSortHeader', {
|
|
149
|
-
key: header.value,
|
|
150
|
-
attrs: {
|
|
151
|
-
"input-value": header.value
|
|
152
|
-
},
|
|
153
|
-
model: {
|
|
154
|
-
value: _vm.proxySort,
|
|
155
|
-
callback: function ($$v) {
|
|
156
|
-
_vm.proxySort = $$v;
|
|
157
|
-
},
|
|
158
|
-
expression: "proxySort"
|
|
159
|
-
}
|
|
160
|
-
}, [_vm._v("\n " + _vm._s(header.label) + "\n ")]);
|
|
161
|
-
}) : _vm._e()], 2), _vm._v(" "), _c('div', {
|
|
162
|
-
class: _vm.toolbarPanelStyles
|
|
163
|
-
}, [_c('OrInput', {
|
|
164
|
-
attrs: {
|
|
165
|
-
"type": 'search',
|
|
166
|
-
"placeholder": 'Search',
|
|
167
|
-
"size": 's'
|
|
168
|
-
},
|
|
169
|
-
model: {
|
|
170
|
-
value: _vm.proxySearch,
|
|
171
|
-
callback: function ($$v) {
|
|
172
|
-
_vm.proxySearch = $$v;
|
|
173
|
-
},
|
|
174
|
-
expression: "proxySearch"
|
|
175
|
-
}
|
|
176
|
-
}), _vm._v(" "), _c('OrIconButton', {
|
|
177
|
-
attrs: {
|
|
178
|
-
"icon": 'grid_view'
|
|
179
|
-
},
|
|
180
|
-
on: {
|
|
181
|
-
"click": function ($event) {
|
|
182
|
-
return _vm.switchToGridView();
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}), _vm._v(" "), _c('OrIconButton', {
|
|
186
|
-
attrs: {
|
|
187
|
-
"icon": 'view_list'
|
|
188
|
-
},
|
|
189
|
-
on: {
|
|
190
|
-
"click": function ($event) {
|
|
191
|
-
return _vm.switchToListView();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}), _vm._v(" "), _vm._t("addon")], 2)]), _vm._v(" "), _c('div', {
|
|
195
|
-
class: _vm.contentStyles
|
|
196
|
-
}, [_vm.proxyView === 'grid' ? _vm._l(_vm.items, function (item) {
|
|
197
|
-
return _c('OrCard', {
|
|
198
|
-
key: item.id
|
|
199
|
-
}, [_vm._t("gridItem", null, null, item)], 2);
|
|
200
|
-
}) : _vm._e(), _vm._v(" "), _vm.proxyView === 'list' ? _vm._l(_vm.items, function (item) {
|
|
201
|
-
return _c('OrCard', {
|
|
202
|
-
key: item.id
|
|
203
|
-
}, [_vm._t("listItem", null, null, item)], 2);
|
|
204
|
-
}) : _vm._e()], 2)]);
|
|
205
|
-
};
|
|
206
|
-
var __vue_staticRenderFns__ = [];
|
|
207
|
-
|
|
208
|
-
/* style */
|
|
209
|
-
const __vue_inject_styles__ = undefined;
|
|
210
|
-
/* scoped */
|
|
211
|
-
const __vue_scope_id__ = undefined;
|
|
212
|
-
/* module identifier */
|
|
213
|
-
const __vue_module_identifier__ = undefined;
|
|
214
|
-
/* functional template */
|
|
215
|
-
const __vue_is_functional_template__ = false;
|
|
216
|
-
/* style inject */
|
|
217
|
-
|
|
218
|
-
/* style inject SSR */
|
|
219
|
-
|
|
220
|
-
/* style inject shadow dom */
|
|
221
|
-
|
|
222
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
223
|
-
render: __vue_render__,
|
|
224
|
-
staticRenderFns: __vue_staticRenderFns__
|
|
225
|
-
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
226
|
-
|
|
227
|
-
export { CardCollectionView as C, __vue_component__ as _ };
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch } from 'vue-demi';
|
|
2
|
-
import { u as useClassAttribute } from './useClassAttribute-47fdb016.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
|
-
import { s as script$1 } from './OrCard-fd92f7c8.js';
|
|
5
|
-
import { s as script$2 } from './OrIconButton-1eebcafc.js';
|
|
6
|
-
import { s as script$3 } from './OrInput-41691fb3.js';
|
|
7
|
-
import { s as script$4 } from './OrSortHeader-fe1a9cf8.js';
|
|
8
|
-
import { resolveComponent, openBlock, createElementBlock, mergeProps, createElementVNode, normalizeClass, Fragment, renderList, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode, createVNode, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
9
|
-
|
|
10
|
-
var CardCollectionView;
|
|
11
|
-
(function (CardCollectionView) {
|
|
12
|
-
CardCollectionView["Grid"] = "grid";
|
|
13
|
-
CardCollectionView["List"] = "list";
|
|
14
|
-
})(CardCollectionView || (CardCollectionView = {}));
|
|
15
|
-
|
|
16
|
-
const CardCollectionRoot = [
|
|
17
|
-
// Layout
|
|
18
|
-
'layout-column',
|
|
19
|
-
// Spacing
|
|
20
|
-
'gap-md'];
|
|
21
|
-
const CardCollectionToolbar = [
|
|
22
|
-
// Layout
|
|
23
|
-
'layout-row justify-between',
|
|
24
|
-
// Typography
|
|
25
|
-
'typography-body-2-regular',
|
|
26
|
-
// Theme
|
|
27
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark'];
|
|
28
|
-
const CardCollectionToolbarPanel = [
|
|
29
|
-
// Layout
|
|
30
|
-
'layout-row',
|
|
31
|
-
// Spacing
|
|
32
|
-
'gap-sm+'];
|
|
33
|
-
const CardCollectionContent = [
|
|
34
|
-
// Layout
|
|
35
|
-
'grid',
|
|
36
|
-
// Spacing
|
|
37
|
-
'gap-sm md:gap-md'];
|
|
38
|
-
const CardCollectionContentViews = {
|
|
39
|
-
'grid': [
|
|
40
|
-
// Layout
|
|
41
|
-
'sm:grid-cols-1', 'md:grid-cols-2', 'lg:grid-cols-4', 'xl:grid-cols-6'],
|
|
42
|
-
'list': []
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
var script = defineComponent({
|
|
46
|
-
name: 'OrCardCollection',
|
|
47
|
-
components: {
|
|
48
|
-
OrCard: script$1,
|
|
49
|
-
OrIconButton: script$2,
|
|
50
|
-
OrInput: script$3,
|
|
51
|
-
OrSortHeader: script$4
|
|
52
|
-
},
|
|
53
|
-
inheritAttrs: false,
|
|
54
|
-
props: {
|
|
55
|
-
items: {
|
|
56
|
-
type: Array,
|
|
57
|
-
default: []
|
|
58
|
-
},
|
|
59
|
-
view: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: CardCollectionView.Grid
|
|
62
|
-
},
|
|
63
|
-
sort: {
|
|
64
|
-
type: Object,
|
|
65
|
-
default: undefined
|
|
66
|
-
},
|
|
67
|
-
sortHeaders: {
|
|
68
|
-
type: Array,
|
|
69
|
-
default: undefined
|
|
70
|
-
},
|
|
71
|
-
search: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: undefined
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
emits: ['viewChange', 'sortChange', 'searchChange'],
|
|
77
|
-
expose: ['root'],
|
|
78
|
-
setup(props, context) {
|
|
79
|
-
// Refs
|
|
80
|
-
const root = ref();
|
|
81
|
-
// Styles
|
|
82
|
-
const classAttribute = useClassAttribute();
|
|
83
|
-
const rootStyles = computed(() => ['or-card-collection', ...CardCollectionRoot, classAttribute.value]);
|
|
84
|
-
const toolbarStyles = computed(() => [...CardCollectionToolbar]);
|
|
85
|
-
const toolbarPanelStyles = computed(() => [...CardCollectionToolbarPanel]);
|
|
86
|
-
const contentStyles = computed(() => [...CardCollectionContent, ...CardCollectionContentViews[proxyView.value]]);
|
|
87
|
-
// State
|
|
88
|
-
const proxyView = ref(props.view);
|
|
89
|
-
const proxySort = ref(props.sort);
|
|
90
|
-
const proxySearch = ref(props.search);
|
|
91
|
-
// Methods
|
|
92
|
-
function switchToGridView() {
|
|
93
|
-
proxyView.value = CardCollectionView.Grid;
|
|
94
|
-
}
|
|
95
|
-
function switchToListView() {
|
|
96
|
-
proxyView.value = CardCollectionView.List;
|
|
97
|
-
}
|
|
98
|
-
// Effects
|
|
99
|
-
watch(() => props.view, value => {
|
|
100
|
-
proxyView.value = value;
|
|
101
|
-
});
|
|
102
|
-
watch(proxyView, value => {
|
|
103
|
-
context.emit('viewChange', value);
|
|
104
|
-
});
|
|
105
|
-
watch(() => props.sort, value => {
|
|
106
|
-
proxySort.value = value;
|
|
107
|
-
});
|
|
108
|
-
watch(proxySort, value => {
|
|
109
|
-
context.emit('sortChange', value);
|
|
110
|
-
});
|
|
111
|
-
watch(() => props.search, value => {
|
|
112
|
-
proxySearch.value = value;
|
|
113
|
-
});
|
|
114
|
-
watch(proxySearch, value => {
|
|
115
|
-
context.emit('searchChange', value);
|
|
116
|
-
});
|
|
117
|
-
return {
|
|
118
|
-
root,
|
|
119
|
-
rootStyles,
|
|
120
|
-
toolbarStyles,
|
|
121
|
-
toolbarPanelStyles,
|
|
122
|
-
contentStyles,
|
|
123
|
-
proxyView,
|
|
124
|
-
proxySort,
|
|
125
|
-
proxySearch,
|
|
126
|
-
switchToGridView,
|
|
127
|
-
switchToListView
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
|
-
const _component_OrSortHeader = resolveComponent("OrSortHeader");
|
|
134
|
-
const _component_OrInput = resolveComponent("OrInput");
|
|
135
|
-
const _component_OrIconButton = resolveComponent("OrIconButton");
|
|
136
|
-
const _component_OrCard = resolveComponent("OrCard");
|
|
137
|
-
return openBlock(), createElementBlock("div", mergeProps({
|
|
138
|
-
ref: "root"
|
|
139
|
-
}, _ctx.$attrs, {
|
|
140
|
-
class: _ctx.rootStyles
|
|
141
|
-
}), [createElementVNode("div", {
|
|
142
|
-
class: normalizeClass(_ctx.toolbarStyles)
|
|
143
|
-
}, [createElementVNode("div", {
|
|
144
|
-
class: normalizeClass(_ctx.toolbarPanelStyles)
|
|
145
|
-
}, [_ctx.sortHeaders ? (openBlock(true), createElementBlock(Fragment, {
|
|
146
|
-
key: 0
|
|
147
|
-
}, renderList(_ctx.sortHeaders, header => {
|
|
148
|
-
return openBlock(), createBlock(_component_OrSortHeader, {
|
|
149
|
-
key: header.value,
|
|
150
|
-
modelValue: _ctx.proxySort,
|
|
151
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.proxySort = $event),
|
|
152
|
-
"input-value": header.value
|
|
153
|
-
}, {
|
|
154
|
-
default: withCtx(() => [createTextVNode(toDisplayString(header.label), 1 /* TEXT */)]),
|
|
155
|
-
|
|
156
|
-
_: 2 /* DYNAMIC */
|
|
157
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["modelValue", "input-value"]);
|
|
158
|
-
}), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */), createElementVNode("div", {
|
|
159
|
-
class: normalizeClass(_ctx.toolbarPanelStyles)
|
|
160
|
-
}, [createVNode(_component_OrInput, {
|
|
161
|
-
modelValue: _ctx.proxySearch,
|
|
162
|
-
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.proxySearch = $event),
|
|
163
|
-
type: 'search',
|
|
164
|
-
placeholder: 'Search',
|
|
165
|
-
size: 's'
|
|
166
|
-
}, null, 8 /* PROPS */, ["modelValue"]), createVNode(_component_OrIconButton, {
|
|
167
|
-
icon: 'grid_view',
|
|
168
|
-
onClick: _cache[2] || (_cache[2] = $event => _ctx.switchToGridView())
|
|
169
|
-
}), createVNode(_component_OrIconButton, {
|
|
170
|
-
icon: 'view_list',
|
|
171
|
-
onClick: _cache[3] || (_cache[3] = $event => _ctx.switchToListView())
|
|
172
|
-
}), renderSlot(_ctx.$slots, "addon")], 2 /* CLASS */)], 2 /* CLASS */), createElementVNode("div", {
|
|
173
|
-
class: normalizeClass(_ctx.contentStyles)
|
|
174
|
-
}, [_ctx.proxyView === 'grid' ? (openBlock(true), createElementBlock(Fragment, {
|
|
175
|
-
key: 0
|
|
176
|
-
}, renderList(_ctx.items, item => {
|
|
177
|
-
return openBlock(), createBlock(_component_OrCard, {
|
|
178
|
-
key: item.id
|
|
179
|
-
}, {
|
|
180
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "gridItem", normalizeProps(guardReactiveProps(item)))]),
|
|
181
|
-
_: 2 /* DYNAMIC */
|
|
182
|
-
}, 1024 /* DYNAMIC_SLOTS */);
|
|
183
|
-
}), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true), _ctx.proxyView === 'list' ? (openBlock(true), createElementBlock(Fragment, {
|
|
184
|
-
key: 1
|
|
185
|
-
}, renderList(_ctx.items, item => {
|
|
186
|
-
return openBlock(), createBlock(_component_OrCard, {
|
|
187
|
-
key: item.id
|
|
188
|
-
}, {
|
|
189
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "listItem", normalizeProps(guardReactiveProps(item)))]),
|
|
190
|
-
_: 2 /* DYNAMIC */
|
|
191
|
-
}, 1024 /* DYNAMIC_SLOTS */);
|
|
192
|
-
}), 128 /* KEYED_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */)], 16 /* FULL_PROPS */);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
script.render = render;
|
|
196
|
-
script.__file = "src/components/or-card-collection-v3/OrCardCollection.vue";
|
|
197
|
-
|
|
198
|
-
export { CardCollectionView as C, script as s };
|