@onereach/ui-components 4.3.13-beta.2684.0 → 4.3.13
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/components/OrCarousel/OrCarousel.js +6 -3
- package/dist/bundled/v2/components/OrCarousel/OrCarousel.vue.d.ts +1 -0
- package/dist/bundled/v2/components/OrCarousel/index.js +1 -1
- package/dist/bundled/v2/components/OrTagV3/OrTag.vue.d.ts +5 -5
- package/dist/bundled/v2/components/index.d.ts +0 -1
- package/dist/bundled/v2/components/index.js +0 -2
- package/dist/bundled/v2/index.js +1 -3
- package/dist/bundled/v3/{OrCarousel.vue_vue_type_script_lang-188ca513.js → OrCarousel.vue_vue_type_script_lang-5222cb8d.js} +4 -0
- package/dist/bundled/v3/components/OrCarousel/OrCarousel.js +3 -3
- package/dist/bundled/v3/components/OrCarousel/OrCarousel.vue.d.ts +1 -0
- package/dist/bundled/v3/components/OrCarousel/index.js +2 -2
- package/dist/bundled/v3/components/OrTagV3/OrTag.vue.d.ts +5 -5
- package/dist/bundled/v3/components/index.d.ts +0 -1
- package/dist/bundled/v3/components/index.js +1 -3
- package/dist/bundled/v3/index.js +2 -5
- package/dist/esm/v2/{OrCarousel-5c2b2d10.js → OrCarousel-76dc2b7b.js} +3 -2
- package/dist/esm/v2/components/index.d.ts +0 -1
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-carousel/OrCarousel.vue.d.ts +1 -0
- package/dist/esm/v2/components/or-carousel/index.js +2 -1
- package/dist/esm/v2/components/or-tag-v3/OrTag.vue.d.ts +5 -5
- package/dist/esm/v2/index.js +2 -2
- package/dist/esm/v3/{OrCarousel-4fb775f8.js → OrCarousel-40f069d5.js} +2 -1
- package/dist/esm/v3/components/index.d.ts +0 -1
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-carousel/OrCarousel.vue.d.ts +1 -0
- package/dist/esm/v3/components/or-carousel/index.js +2 -1
- package/dist/esm/v3/components/or-tag-v3/OrTag.vue.d.ts +5 -5
- package/dist/esm/v3/index.js +2 -2
- package/package.json +3 -2
- package/src/components/index.ts +0 -1
- package/src/components/or-carousel/OrCarousel.vue +2 -2
- package/src/components/or-tag-v3/OrTag.vue +2 -3
- package/dist/bundled/v2/components/OrTagsV3/OrTags.js +0 -163
- package/dist/bundled/v2/components/OrTagsV3/OrTags.vue.d.ts +0 -80
- package/dist/bundled/v2/components/OrTagsV3/index.d.ts +0 -1
- package/dist/bundled/v2/components/OrTagsV3/index.js +0 -37
- package/dist/bundled/v2/components/OrTagsV3/styles.d.ts +0 -4
- package/dist/bundled/v2/components/OrTagsV3/styles.js +0 -26
- package/dist/bundled/v3/OrTags.vue_vue_type_script_lang-e75444b5.js +0 -70
- package/dist/bundled/v3/components/OrTagsV3/OrTags.js +0 -101
- package/dist/bundled/v3/components/OrTagsV3/OrTags.vue.d.ts +0 -36
- package/dist/bundled/v3/components/OrTagsV3/index.d.ts +0 -1
- package/dist/bundled/v3/components/OrTagsV3/index.js +0 -46
- package/dist/bundled/v3/components/OrTagsV3/styles.d.ts +0 -4
- package/dist/bundled/v3/components/OrTagsV3/styles.js +0 -26
- package/dist/esm/v2/OrTags-4ffaa13b.js +0 -159
- package/dist/esm/v2/components/or-tags-v3/OrTags.vue.d.ts +0 -80
- package/dist/esm/v2/components/or-tags-v3/index.d.ts +0 -1
- package/dist/esm/v2/components/or-tags-v3/index.js +0 -19
- package/dist/esm/v2/components/or-tags-v3/styles.d.ts +0 -4
- package/dist/esm/v3/OrTags-a082de82.js +0 -147
- package/dist/esm/v3/components/or-tags-v3/OrTags.vue.d.ts +0 -36
- package/dist/esm/v3/components/or-tags-v3/index.d.ts +0 -1
- package/dist/esm/v3/components/or-tags-v3/index.js +0 -18
- package/dist/esm/v3/components/or-tags-v3/styles.d.ts +0 -4
- package/src/components/or-tags-v3/OrTags.docs.mdx +0 -7
- package/src/components/or-tags-v3/OrTags.stories3.ts +0 -101
- package/src/components/or-tags-v3/OrTags.vue +0 -129
- package/src/components/or-tags-v3/index.ts +0 -1
- package/src/components/or-tags-v3/styles.ts +0 -41
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, computed } from 'vue-demi';
|
|
2
|
-
import { u as useOverflow } from './useOverflow-c856b7b7.js';
|
|
3
|
-
import '@vueuse/core';
|
|
4
|
-
import { s as script$1 } from './OrButton-c2b6aa9e.js';
|
|
5
|
-
import { s as script$2 } from './OrPopover-84d5b844.js';
|
|
6
|
-
import { s as script$3 } from './OrTag-6116c6e3.js';
|
|
7
|
-
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, mergeProps, withCtx, createTextVNode, toDisplayString, createVNode, withModifiers, createCommentVNode } from 'vue';
|
|
8
|
-
|
|
9
|
-
const Tags = [
|
|
10
|
-
// Layout
|
|
11
|
-
'layout-row',
|
|
12
|
-
// Spacing
|
|
13
|
-
'gap-sm',
|
|
14
|
-
// Theme
|
|
15
|
-
'theme-foreground-default', 'dark:theme-foreground-default-dark'];
|
|
16
|
-
const TagsContainer = [
|
|
17
|
-
// Layout
|
|
18
|
-
'layout-row',
|
|
19
|
-
// Overflow
|
|
20
|
-
'overflow-hidden',
|
|
21
|
-
// Spacing
|
|
22
|
-
'gap-sm'];
|
|
23
|
-
const TagsOverflowButton = [
|
|
24
|
-
// Typography
|
|
25
|
-
'typography-caption-regular'];
|
|
26
|
-
const TagsOverflowPopover = [
|
|
27
|
-
// Layout
|
|
28
|
-
'layout-row !flex-wrap',
|
|
29
|
-
// Box
|
|
30
|
-
'max-w-[192px]',
|
|
31
|
-
// Spacing
|
|
32
|
-
'px-md', 'py-md', 'gap-sm'];
|
|
33
|
-
|
|
34
|
-
var script = defineComponent({
|
|
35
|
-
name: 'OrTags',
|
|
36
|
-
components: {
|
|
37
|
-
OrButton: script$1,
|
|
38
|
-
OrPopover: script$2,
|
|
39
|
-
OrTag: script$3
|
|
40
|
-
},
|
|
41
|
-
props: {
|
|
42
|
-
items: {
|
|
43
|
-
type: Array,
|
|
44
|
-
default: () => []
|
|
45
|
-
},
|
|
46
|
-
tagProps: {
|
|
47
|
-
type: Object,
|
|
48
|
-
default: undefined
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
setup(props) {
|
|
52
|
-
// Refs
|
|
53
|
-
const root = ref();
|
|
54
|
-
const container = ref();
|
|
55
|
-
const overflowButton = ref();
|
|
56
|
-
const overflowButtonRoot = computed(() => {
|
|
57
|
-
var _a;
|
|
58
|
-
return (_a = overflowButton.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
59
|
-
});
|
|
60
|
-
const overflowPopover = ref();
|
|
61
|
-
const overflowPopoverRoot = computed(() => {
|
|
62
|
-
var _a;
|
|
63
|
-
return (_a = overflowPopover.value) === null || _a === void 0 ? void 0 : _a.root;
|
|
64
|
-
});
|
|
65
|
-
// Styles
|
|
66
|
-
const rootStyles = computed(() => ['or-tags-v3', ...Tags]);
|
|
67
|
-
const containerStyles = computed(() => [...TagsContainer]);
|
|
68
|
-
const overflowButtonStyles = computed(() => [...TagsOverflowButton]);
|
|
69
|
-
const overflowPopoverStyles = computed(() => [...TagsOverflowPopover]);
|
|
70
|
-
// State
|
|
71
|
-
const {
|
|
72
|
-
innerItems
|
|
73
|
-
} = useOverflow(container);
|
|
74
|
-
const overflowItems = computed(() => {
|
|
75
|
-
return props.items.slice(innerItems.value.length);
|
|
76
|
-
});
|
|
77
|
-
return {
|
|
78
|
-
root,
|
|
79
|
-
container,
|
|
80
|
-
overflowButton,
|
|
81
|
-
overflowButtonRoot,
|
|
82
|
-
overflowPopover,
|
|
83
|
-
overflowPopoverRoot,
|
|
84
|
-
rootStyles,
|
|
85
|
-
containerStyles,
|
|
86
|
-
overflowButtonStyles,
|
|
87
|
-
overflowPopoverStyles,
|
|
88
|
-
overflowItems
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
94
|
-
const _component_OrTag = resolveComponent("OrTag");
|
|
95
|
-
const _component_OrButton = resolveComponent("OrButton");
|
|
96
|
-
const _component_OrPopover = resolveComponent("OrPopover");
|
|
97
|
-
return openBlock(), createElementBlock("div", {
|
|
98
|
-
ref: "root",
|
|
99
|
-
class: normalizeClass(_ctx.rootStyles)
|
|
100
|
-
}, [createElementVNode("div", {
|
|
101
|
-
ref: "container",
|
|
102
|
-
class: normalizeClass(_ctx.containerStyles)
|
|
103
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, item => {
|
|
104
|
-
return openBlock(), createBlock(_component_OrTag, mergeProps(_ctx.tagProps, {
|
|
105
|
-
key: item
|
|
106
|
-
}), {
|
|
107
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item), 1 /* TEXT */)]),
|
|
108
|
-
|
|
109
|
-
_: 2 /* DYNAMIC */
|
|
110
|
-
}, 1040 /* FULL_PROPS, DYNAMIC_SLOTS */);
|
|
111
|
-
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */), _ctx.overflowItems.length > 0 ? (openBlock(), createElementBlock(Fragment, {
|
|
112
|
-
key: 0
|
|
113
|
-
}, [createVNode(_component_OrButton, {
|
|
114
|
-
ref: "overflowButton",
|
|
115
|
-
class: normalizeClass(_ctx.overflowButtonStyles),
|
|
116
|
-
type: 'button',
|
|
117
|
-
variant: 'link',
|
|
118
|
-
color: 'inherit',
|
|
119
|
-
onClick: _cache[0] || (_cache[0] = withModifiers($event => _ctx.overflowPopover.open(), ["stop"]))
|
|
120
|
-
}, {
|
|
121
|
-
default: withCtx(() => [createTextVNode(" +" + toDisplayString(_ctx.overflowItems.length), 1 /* TEXT */)]),
|
|
122
|
-
|
|
123
|
-
_: 1 /* STABLE */
|
|
124
|
-
}, 8 /* PROPS */, ["class"]), createVNode(_component_OrPopover, {
|
|
125
|
-
ref: "overflowPopover",
|
|
126
|
-
trigger: _ctx.overflowButtonRoot
|
|
127
|
-
}, {
|
|
128
|
-
default: withCtx(() => [createElementVNode("div", {
|
|
129
|
-
class: normalizeClass(_ctx.overflowPopoverStyles)
|
|
130
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.overflowItems, item => {
|
|
131
|
-
return openBlock(), createBlock(_component_OrTag, mergeProps(_ctx.tagProps, {
|
|
132
|
-
key: item
|
|
133
|
-
}), {
|
|
134
|
-
default: withCtx(() => [createTextVNode(toDisplayString(item), 1 /* TEXT */)]),
|
|
135
|
-
|
|
136
|
-
_: 2 /* DYNAMIC */
|
|
137
|
-
}, 1040 /* FULL_PROPS, DYNAMIC_SLOTS */);
|
|
138
|
-
}), 128 /* KEYED_FRAGMENT */))], 2 /* CLASS */)]),
|
|
139
|
-
|
|
140
|
-
_: 1 /* STABLE */
|
|
141
|
-
}, 8 /* PROPS */, ["trigger"])], 64 /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)], 2 /* CLASS */);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
script.render = render;
|
|
145
|
-
script.__file = "src/components/or-tags-v3/OrTags.vue";
|
|
146
|
-
|
|
147
|
-
export { script as s };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { PropType } from 'vue-demi';
|
|
2
|
-
declare const _default: import("vue-demi").DefineComponent<{
|
|
3
|
-
items: {
|
|
4
|
-
type: PropType<string[]>;
|
|
5
|
-
default: () => never[];
|
|
6
|
-
};
|
|
7
|
-
tagProps: {
|
|
8
|
-
type: PropType<any>;
|
|
9
|
-
default: undefined;
|
|
10
|
-
};
|
|
11
|
-
}, {
|
|
12
|
-
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
13
|
-
container: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
14
|
-
overflowButton: import("vue-demi").Ref<any>;
|
|
15
|
-
overflowButtonRoot: import("vue-demi").ComputedRef<any>;
|
|
16
|
-
overflowPopover: import("vue-demi").Ref<any>;
|
|
17
|
-
overflowPopoverRoot: import("vue-demi").ComputedRef<any>;
|
|
18
|
-
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
19
|
-
containerStyles: import("vue-demi").ComputedRef<string[]>;
|
|
20
|
-
overflowButtonStyles: import("vue-demi").ComputedRef<string[]>;
|
|
21
|
-
overflowPopoverStyles: import("vue-demi").ComputedRef<string[]>;
|
|
22
|
-
overflowItems: import("vue-demi").ComputedRef<string[]>;
|
|
23
|
-
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
24
|
-
items: {
|
|
25
|
-
type: PropType<string[]>;
|
|
26
|
-
default: () => never[];
|
|
27
|
-
};
|
|
28
|
-
tagProps: {
|
|
29
|
-
type: PropType<any>;
|
|
30
|
-
default: undefined;
|
|
31
|
-
};
|
|
32
|
-
}>>, {
|
|
33
|
-
items: string[];
|
|
34
|
-
tagProps: any;
|
|
35
|
-
}>;
|
|
36
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as OrTagsV3 } from './OrTags.vue';
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export { s as OrTagsV3 } from '../../OrTags-a082de82.js';
|
|
2
|
-
import 'vue-demi';
|
|
3
|
-
import '../../useOverflow-c856b7b7.js';
|
|
4
|
-
import '@vueuse/core';
|
|
5
|
-
import '../../OrButton-c2b6aa9e.js';
|
|
6
|
-
import '../../OrLoader-b79022da.js';
|
|
7
|
-
import 'vue';
|
|
8
|
-
import '../../OrPopover-84d5b844.js';
|
|
9
|
-
import '@floating-ui/dom';
|
|
10
|
-
import '../../useElevation-b5a49746.js';
|
|
11
|
-
import '../../useResponsive-a02e95b7.js';
|
|
12
|
-
import '../../OrBottomSheet-5969a217.js';
|
|
13
|
-
import '../../OrOverlay-bf72f582.js';
|
|
14
|
-
import '../../OrTeleport.vue3-8099178c.js';
|
|
15
|
-
import '../../OrTag-6116c6e3.js';
|
|
16
|
-
import '../../OrIconButton-55d51a7a.js';
|
|
17
|
-
import '../../OrIcon-62793572.js';
|
|
18
|
-
import '../../OrTooltip-4bb0054a.js';
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryFn } from '@storybook/vue3';
|
|
2
|
-
import { OrTagV3 as OrTag } from '../or-tag-v3';
|
|
3
|
-
import OrTagsDocs from './OrTags.docs.mdx';
|
|
4
|
-
import OrTags from './OrTags.vue';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Tags',
|
|
8
|
-
component: OrTags,
|
|
9
|
-
|
|
10
|
-
argTypes: {
|
|
11
|
-
// Props
|
|
12
|
-
items: {
|
|
13
|
-
control: { type: 'object' },
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
tagProps: {
|
|
17
|
-
control: { type: 'object' },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
parameters: {
|
|
22
|
-
docs: {
|
|
23
|
-
page: OrTagsDocs,
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
design: {
|
|
27
|
-
type: 'figma',
|
|
28
|
-
url: 'https://www.figma.com/file/o7DdkaznUW2PtX4wiSuhhQ/Core?node-id=202%3A14&t=HsX22PSudRRma7wv-1',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
} as Meta<typeof OrTags>;
|
|
32
|
-
|
|
33
|
-
const Template: StoryFn<typeof OrTags> = (args) => ({
|
|
34
|
-
components: {
|
|
35
|
-
OrTag,
|
|
36
|
-
OrTags,
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
setup() {
|
|
40
|
-
return { args };
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
template: `
|
|
44
|
-
<OrTags v-bind="args" />
|
|
45
|
-
`,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export const Default = (() => {
|
|
49
|
-
const Story = Template.bind({});
|
|
50
|
-
|
|
51
|
-
Story.args = {
|
|
52
|
-
// Props
|
|
53
|
-
items: [
|
|
54
|
-
'Alfa',
|
|
55
|
-
'Bravo',
|
|
56
|
-
'Charlie',
|
|
57
|
-
'Delta',
|
|
58
|
-
'Echo',
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
return Story;
|
|
63
|
-
})();
|
|
64
|
-
|
|
65
|
-
export const WithOverflow = (() => {
|
|
66
|
-
const Story = Template.bind({});
|
|
67
|
-
|
|
68
|
-
Story.args = {
|
|
69
|
-
// Props
|
|
70
|
-
items: [
|
|
71
|
-
'Alfa',
|
|
72
|
-
'Bravo',
|
|
73
|
-
'Charlie',
|
|
74
|
-
'Delta',
|
|
75
|
-
'Echo',
|
|
76
|
-
'Foxtrot',
|
|
77
|
-
'Golf',
|
|
78
|
-
'Hotel',
|
|
79
|
-
'India',
|
|
80
|
-
'Juliett',
|
|
81
|
-
'Kilo',
|
|
82
|
-
'Lima',
|
|
83
|
-
'Mike',
|
|
84
|
-
'November',
|
|
85
|
-
'Oscar',
|
|
86
|
-
'Papa',
|
|
87
|
-
'Quebec',
|
|
88
|
-
'Romeo',
|
|
89
|
-
'Sierra',
|
|
90
|
-
'Tango',
|
|
91
|
-
'Uniform',
|
|
92
|
-
'Victor',
|
|
93
|
-
'Whiskey',
|
|
94
|
-
'X-Ray',
|
|
95
|
-
'Yankee',
|
|
96
|
-
'Zulu',
|
|
97
|
-
],
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
return Story;
|
|
101
|
-
})();
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
:class="rootStyles"
|
|
5
|
-
>
|
|
6
|
-
<div
|
|
7
|
-
ref="container"
|
|
8
|
-
:class="containerStyles"
|
|
9
|
-
>
|
|
10
|
-
<OrTag
|
|
11
|
-
v-for="item in items"
|
|
12
|
-
v-bind="tagProps"
|
|
13
|
-
:key="item"
|
|
14
|
-
>
|
|
15
|
-
{{ item }}
|
|
16
|
-
</OrTag>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<template v-if="overflowItems.length > 0">
|
|
20
|
-
<OrButton
|
|
21
|
-
ref="overflowButton"
|
|
22
|
-
:class="overflowButtonStyles"
|
|
23
|
-
:type="'button'"
|
|
24
|
-
:variant="'link'"
|
|
25
|
-
:color="'inherit'"
|
|
26
|
-
@click.stop="overflowPopover.open()"
|
|
27
|
-
>
|
|
28
|
-
+{{ overflowItems.length }}
|
|
29
|
-
</OrButton>
|
|
30
|
-
|
|
31
|
-
<OrPopover
|
|
32
|
-
ref="overflowPopover"
|
|
33
|
-
:trigger="overflowButtonRoot"
|
|
34
|
-
>
|
|
35
|
-
<div :class="overflowPopoverStyles">
|
|
36
|
-
<OrTag
|
|
37
|
-
v-for="item in overflowItems"
|
|
38
|
-
v-bind="tagProps"
|
|
39
|
-
:key="item"
|
|
40
|
-
>
|
|
41
|
-
{{ item }}
|
|
42
|
-
</OrTag>
|
|
43
|
-
</div>
|
|
44
|
-
</OrPopover>
|
|
45
|
-
</template>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
|
|
49
|
-
<script lang="ts">
|
|
50
|
-
import { PropType, computed, defineComponent, ref } from 'vue-demi';
|
|
51
|
-
import { useOverflow } from '../../hooks';
|
|
52
|
-
import { OrButtonV3 as OrButton } from '../or-button-v3';
|
|
53
|
-
import { OrPopoverV3 as OrPopover } from '../or-popover-v3';
|
|
54
|
-
import { OrTagV3 as OrTag } from '../or-tag-v3';
|
|
55
|
-
import { Tags, TagsContainer, TagsOverflowButton, TagsOverflowPopover } from './styles';
|
|
56
|
-
|
|
57
|
-
export default defineComponent({
|
|
58
|
-
name: 'OrTags',
|
|
59
|
-
|
|
60
|
-
components: {
|
|
61
|
-
OrButton,
|
|
62
|
-
OrPopover,
|
|
63
|
-
OrTag,
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
props: {
|
|
67
|
-
items: {
|
|
68
|
-
type: Array as PropType<string[]>,
|
|
69
|
-
default: () => [],
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
tagProps: {
|
|
73
|
-
type: Object as PropType<InstanceType<typeof OrTag>['$props']>,
|
|
74
|
-
default: undefined,
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
setup(props) {
|
|
79
|
-
// Refs
|
|
80
|
-
const root = ref<HTMLElement>();
|
|
81
|
-
const container = ref<HTMLElement>();
|
|
82
|
-
|
|
83
|
-
const overflowButton = ref<InstanceType<typeof OrButton>>();
|
|
84
|
-
const overflowButtonRoot = computed(() => overflowButton.value?.root);
|
|
85
|
-
|
|
86
|
-
const overflowPopover = ref<InstanceType<typeof OrPopover>>();
|
|
87
|
-
const overflowPopoverRoot = computed(() => overflowPopover.value?.root);
|
|
88
|
-
|
|
89
|
-
// Styles
|
|
90
|
-
const rootStyles = computed(() => [
|
|
91
|
-
'or-tags-v3',
|
|
92
|
-
...Tags,
|
|
93
|
-
]);
|
|
94
|
-
|
|
95
|
-
const containerStyles = computed(() => [
|
|
96
|
-
...TagsContainer,
|
|
97
|
-
]);
|
|
98
|
-
|
|
99
|
-
const overflowButtonStyles = computed(() => [
|
|
100
|
-
...TagsOverflowButton,
|
|
101
|
-
]);
|
|
102
|
-
|
|
103
|
-
const overflowPopoverStyles = computed(() => [
|
|
104
|
-
...TagsOverflowPopover,
|
|
105
|
-
]);
|
|
106
|
-
|
|
107
|
-
// State
|
|
108
|
-
const { innerItems } = useOverflow(container);
|
|
109
|
-
|
|
110
|
-
const overflowItems = computed(() => {
|
|
111
|
-
return props.items.slice(innerItems.value.length);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
return {
|
|
115
|
-
root,
|
|
116
|
-
container,
|
|
117
|
-
overflowButton,
|
|
118
|
-
overflowButtonRoot,
|
|
119
|
-
overflowPopover,
|
|
120
|
-
overflowPopoverRoot,
|
|
121
|
-
rootStyles,
|
|
122
|
-
containerStyles,
|
|
123
|
-
overflowButtonStyles,
|
|
124
|
-
overflowPopoverStyles,
|
|
125
|
-
overflowItems,
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
});
|
|
129
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as OrTagsV3 } from './OrTags.vue';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export const Tags: string[] = [
|
|
2
|
-
// Layout
|
|
3
|
-
'layout-row',
|
|
4
|
-
|
|
5
|
-
// Spacing
|
|
6
|
-
'gap-sm',
|
|
7
|
-
|
|
8
|
-
// Theme
|
|
9
|
-
'theme-foreground-default',
|
|
10
|
-
'dark:theme-foreground-default-dark',
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
export const TagsContainer: string[] = [
|
|
14
|
-
// Layout
|
|
15
|
-
'layout-row',
|
|
16
|
-
|
|
17
|
-
// Overflow
|
|
18
|
-
'overflow-hidden',
|
|
19
|
-
|
|
20
|
-
// Spacing
|
|
21
|
-
'gap-sm',
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
export const TagsOverflowButton: string[] = [
|
|
25
|
-
// Typography
|
|
26
|
-
'typography-caption-regular',
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
export const TagsOverflowPopover: string[] = [
|
|
30
|
-
// Layout
|
|
31
|
-
'layout-row !flex-wrap',
|
|
32
|
-
|
|
33
|
-
// Box
|
|
34
|
-
'max-w-[192px]',
|
|
35
|
-
|
|
36
|
-
// Spacing
|
|
37
|
-
'px-md',
|
|
38
|
-
'py-md',
|
|
39
|
-
|
|
40
|
-
'gap-sm',
|
|
41
|
-
];
|