@opendesign-plus-test/components 0.0.1-rc.2
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/components.cjs.js +1 -0
- package/dist/components.css +1 -0
- package/dist/components.es.js +1193 -0
- package/dist/components.umd.js +1 -0
- package/docs/design.md +27 -0
- package/docs/design_banner.md +41 -0
- package/docs/design_section.md +27 -0
- package/package.json +47 -0
- package/scripts/generate-components-index.js +81 -0
- package/src/assets/svg-icons/icon-chevron-right.svg +3 -0
- package/src/assets/svg-icons/icon-close.svg +3 -0
- package/src/assets/svg-icons/icon-delete.svg +3 -0
- package/src/assets/svg-icons/icon-header-back.svg +3 -0
- package/src/assets/svg-icons/icon-header-delete.svg +3 -0
- package/src/assets/svg-icons/icon-header-search.svg +4 -0
- package/src/assets/svg-icons/icon-moon.svg +3 -0
- package/src/assets/svg-icons/icon-sun.svg +3 -0
- package/src/components/OBanner.vue +390 -0
- package/src/components/OCookieNotice.vue +417 -0
- package/src/components/OCookieNoticeEl.vue +403 -0
- package/src/components/OHeaderSearch.vue +601 -0
- package/src/components/OPlusConfigProvider.vue +32 -0
- package/src/components/OSection.vue +178 -0
- package/src/components/OThemeSwitcher.vue +108 -0
- package/src/components/common/ClientOnlyWrapper.ts +21 -0
- package/src/components/common/ContentWrapper.vue +85 -0
- package/src/draft/Banner.vue +265 -0
- package/src/draft/ButtonCards.vue +106 -0
- package/src/draft/Feature.vue +134 -0
- package/src/draft/Footer.vue +512 -0
- package/src/draft/HorizontalAnchor.vue +165 -0
- package/src/draft/ItemSwiper.vue +133 -0
- package/src/draft/Logo.vue +141 -0
- package/src/draft/LogoCard.vue +75 -0
- package/src/draft/LogoV2.vue +19 -0
- package/src/draft/MainCard.vue +38 -0
- package/src/draft/MultiCard.vue +95 -0
- package/src/draft/MultiIconCard.vue +74 -0
- package/src/draft/OInfoCard.vue +176 -0
- package/src/draft/Process.vue +81 -0
- package/src/draft/Section.vue +167 -0
- package/src/draft/SingleTabCard.vue +85 -0
- package/src/draft/SliderCard.vue +110 -0
- package/src/env.d.ts +1 -0
- package/src/i18n/en.ts +20 -0
- package/src/i18n/index.ts +42 -0
- package/src/i18n/zh.ts +9 -0
- package/src/index.ts +34 -0
- package/src/shared/provide.ts +6 -0
- package/src/vue.d.ts +10 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +90 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { OCard, type CardPropsT, OScroller, OLink, OButton } from '@opensig/opendesign';
|
|
4
|
+
import { useScreen } from '@/composables/useScreen.ts';
|
|
5
|
+
|
|
6
|
+
const { isPadV, isPhone } = useScreen();
|
|
7
|
+
|
|
8
|
+
export type OperationType = 'button' | 'link';
|
|
9
|
+
export type OperationAction = string | (() => void);
|
|
10
|
+
export type ButtonCardOperation = {
|
|
11
|
+
label: string;
|
|
12
|
+
type?: OperationType;
|
|
13
|
+
action: OperationAction;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type IconCardT = Pick<CardPropsT, 'title' | 'detail' | 'cover'> & {
|
|
17
|
+
operations?: ButtonCardOperation[]
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<{
|
|
21
|
+
/*卡片各自的配置*/
|
|
22
|
+
cards: IconCardT[];
|
|
23
|
+
/*所有卡片的配置,优先级低于cards*/
|
|
24
|
+
cardProps?: CardPropsT;
|
|
25
|
+
}>(), {
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const widthPerCard = computed(() => {
|
|
30
|
+
if(isPhone.value) {
|
|
31
|
+
return `100%`;
|
|
32
|
+
}
|
|
33
|
+
if(isPadV.value) {
|
|
34
|
+
return `calc((100% - var(--grid-column-gutter)) / 2)`;
|
|
35
|
+
}
|
|
36
|
+
if(props.cards.length <= 4) {
|
|
37
|
+
return `calc((100% - var(--grid-column-gutter) * ${props.cards.length - 1}) / ${props.cards.length})`;
|
|
38
|
+
}
|
|
39
|
+
return `calc((100% - var(--grid-column-gutter) * 3) / 4)`;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const getAction = (action: OperationAction) => {
|
|
43
|
+
if (typeof action === 'string') {
|
|
44
|
+
window.open(action, '_blank');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
action();
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<template>
|
|
52
|
+
<OScroller v-if="props.cards?.length" class="multi-card-wrapper" show-type="always" disabled-y>
|
|
53
|
+
<OCard
|
|
54
|
+
v-for="(card, index) in cards"
|
|
55
|
+
:key="index"
|
|
56
|
+
class="multi-icon-card-item"
|
|
57
|
+
v-bind="{
|
|
58
|
+
coverRatio: 16/9,
|
|
59
|
+
...props.cardProps,
|
|
60
|
+
...card,
|
|
61
|
+
}"
|
|
62
|
+
>
|
|
63
|
+
<template #footer>
|
|
64
|
+
<div class="operations">
|
|
65
|
+
<template v-for="item in card.operations" :key="item.label">
|
|
66
|
+
<OButton v-if="item.type === 'button'" size="large" round="pill" @click="getAction(item.action)">Button</OButton>
|
|
67
|
+
<OLink v-else @click="getAction(item.action)">Link</OLink>
|
|
68
|
+
</template>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</OCard>
|
|
72
|
+
</OScroller>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.multi-card-wrapper {
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
--grid-column-gutter: var(--o3-gap-6);
|
|
79
|
+
--card-detail-max-row: 2;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.operations {
|
|
83
|
+
@include text1;
|
|
84
|
+
display: flex;
|
|
85
|
+
gap: var(--o3-gap-4);
|
|
86
|
+
align-items: center;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.o-card {
|
|
90
|
+
--card-content-color: var(--o-color-info3);
|
|
91
|
+
--card-footer-gap: var(--o3-gap-3);
|
|
92
|
+
display: inline-block;
|
|
93
|
+
width: v-bind(widthPerCard);
|
|
94
|
+
|
|
95
|
+
&:not(:first-child) {
|
|
96
|
+
margin-left: var(--grid-column-gutter);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@include respond-to("phone") {
|
|
100
|
+
--card-header-text-size: 16px;
|
|
101
|
+
--card-header-text-height: 24px;
|
|
102
|
+
--card-content-text-size: 14px;
|
|
103
|
+
--card-content-text-height: 22px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</style>
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useScreen } from '@/composables/useScreen.ts';
|
|
3
|
+
|
|
4
|
+
const { gtPadV } = useScreen();
|
|
5
|
+
|
|
6
|
+
interface FeatureT {
|
|
7
|
+
title: string;
|
|
8
|
+
content: string;
|
|
9
|
+
icon?: any;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
features: FeatureT[];
|
|
14
|
+
}>();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<div v-if="props.features.length" class="feature-list">
|
|
19
|
+
<div class="feature-list__item" v-for="(feature, index) in props.features" :key="index">
|
|
20
|
+
<div class="feature-item">
|
|
21
|
+
<component :is="feature.icon" class="g-icon-48"></component>
|
|
22
|
+
<div class="feature-title">{{ feature.title }}</div>
|
|
23
|
+
<div v-if="gtPadV" class="feature-content">{{ feature.content }}</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.feature-list {
|
|
31
|
+
background-color: var(--o-color-fill2);
|
|
32
|
+
padding: var(--o3-gap-8) var(--o3-gap-10);
|
|
33
|
+
display: grid;
|
|
34
|
+
justify-items: center;
|
|
35
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
36
|
+
column-gap: var(--o3-gap-8);
|
|
37
|
+
row-gap: var(--o3-gap-7);
|
|
38
|
+
border-radius: var(--o3-radius-l);
|
|
39
|
+
|
|
40
|
+
@include respond-to('phone') {
|
|
41
|
+
gap: 0;
|
|
42
|
+
display: flex;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
overflow-x: scroll;
|
|
46
|
+
width: 100%;
|
|
47
|
+
padding: 16px 0;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.feature-list__item {
|
|
52
|
+
position: relative;
|
|
53
|
+
width: 100%;
|
|
54
|
+
text-align: center;
|
|
55
|
+
|
|
56
|
+
&::after {
|
|
57
|
+
content: '';
|
|
58
|
+
position: absolute;
|
|
59
|
+
top: 24px;
|
|
60
|
+
right: calc(0% - var(--o3-gap-8) / 2);
|
|
61
|
+
height: 96px;
|
|
62
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
63
|
+
width: 1px;
|
|
64
|
+
|
|
65
|
+
@include respond-to('<=pad_v') {
|
|
66
|
+
top: 16px;
|
|
67
|
+
height: 36px;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&:last-child,
|
|
72
|
+
&:nth-of-type(3n) {
|
|
73
|
+
&::after {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:nth-of-type(2) {
|
|
79
|
+
.feature-content {
|
|
80
|
+
max-width: 288px;
|
|
81
|
+
|
|
82
|
+
@include respond-to('<=laptop') {
|
|
83
|
+
max-width: 252px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@include respond-to('phone') {
|
|
89
|
+
&::after {
|
|
90
|
+
display: none;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.feature-item {
|
|
96
|
+
text-align: center;
|
|
97
|
+
position: relative;
|
|
98
|
+
display: inline-block;
|
|
99
|
+
max-width: 320px;
|
|
100
|
+
|
|
101
|
+
@include respond-to('phone') {
|
|
102
|
+
flex: 0 0 auto;
|
|
103
|
+
width: 25vw;
|
|
104
|
+
padding: 0 24px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.feature-content {
|
|
108
|
+
@include text1
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.feature-title {
|
|
113
|
+
@include h4;
|
|
114
|
+
white-space: wrap;
|
|
115
|
+
font-weight: 600;
|
|
116
|
+
margin-top: var(--o3-gap-4);
|
|
117
|
+
margin-bottom: var(--o3-gap-2);
|
|
118
|
+
color: var(--o-color-info1);
|
|
119
|
+
|
|
120
|
+
@include respond-to('phone') {
|
|
121
|
+
white-space: pre-wrap;
|
|
122
|
+
|
|
123
|
+
@include tip2;
|
|
124
|
+
|
|
125
|
+
&::after {
|
|
126
|
+
display: none;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.g-icon-48 {
|
|
132
|
+
font-size: var(--o-icon_size-xl);
|
|
133
|
+
}
|
|
134
|
+
</style>
|