@opendesign-plus/components 0.0.1-rc.10
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/chunk-OElCookieNotice.cjs.js +1 -0
- package/dist/chunk-OElCookieNotice.es.js +833 -0
- package/dist/components/OBanner.vue.d.ts +11 -0
- package/dist/components/OCookieNotice.vue.d.ts +17 -0
- package/dist/components/OFooter.vue.d.ts +46 -0
- package/dist/components/OHeaderSearch.vue.d.ts +692 -0
- package/dist/components/OHeaderUser.vue.d.ts +38 -0
- package/dist/components/OPlusConfigProvider.vue.d.ts +23 -0
- package/dist/components/OSection.vue.d.ts +37 -0
- package/dist/components/OSourceCode.vue.d.ts +20 -0
- package/dist/components/OThemeSwitcher.vue.d.ts +28 -0
- package/dist/components/activity/OActivityApproval.vue.d.ts +277 -0
- package/dist/components/activity/OActivityForm.vue.d.ts +140 -0
- package/dist/components/activity/OMyActivityCalendar.vue.d.ts +578 -0
- package/dist/components/activity/config.d.ts +15 -0
- package/dist/components/activity/index.d.ts +623 -0
- package/dist/components/activity/types.d.ts +81 -0
- package/dist/components/element-plus/OElCookieNotice.vue.d.ts +34 -0
- package/dist/components/element-plus/index.d.ts +2 -0
- package/dist/components/events/OEventsApply.vue.d.ts +16 -0
- package/dist/components/events/OEventsCalendar.vue.d.ts +5 -0
- package/dist/components/events/OEventsList.vue.d.ts +26 -0
- package/dist/components/events/config.d.ts +27 -0
- package/dist/components/events/index.d.ts +78 -0
- package/dist/components/events/types.d.ts +66 -0
- package/dist/components/events/utils.d.ts +7 -0
- package/dist/components/header/OHeader.vue.d.ts +24 -0
- package/dist/components/header/OHeaderMoblie.vue.d.ts +33 -0
- package/dist/components/header/components/HeaderContent.vue.d.ts +6 -0
- package/dist/components/header/components/HeaderNav.vue.d.ts +7 -0
- package/dist/components/header/components/HeaderNavMoblie.vue.d.ts +17 -0
- package/dist/components/header/components/HeaderUbmcNav.vue.d.ts +2 -0
- package/dist/components/header/index.d.ts +22 -0
- package/dist/components/meeting/OMeetingCalendar.vue.d.ts +298 -0
- package/dist/components/meeting/OMeetingForm.vue.d.ts +145 -0
- package/dist/components/meeting/OMyMeetingCalendar.vue.d.ts +586 -0
- package/dist/components/meeting/OSigMeetingCalendar.vue.d.ts +24 -0
- package/dist/components/meeting/components/OMeetingCalendarList.vue.d.ts +28 -0
- package/dist/components/meeting/components/OMeetingCalendarSelector.vue.d.ts +664 -0
- package/dist/components/meeting/components/OMeetingDetail.vue.d.ts +12 -0
- package/dist/components/meeting/components/OMeetingPlaybackSubtitles.vue.d.ts +5 -0
- package/dist/components/meeting/components/OMeetingPlaybackVideo.vue.d.ts +17 -0
- package/dist/components/meeting/components/OSigMeetingAside.vue.d.ts +16 -0
- package/dist/components/meeting/config.d.ts +27 -0
- package/dist/components/meeting/types.d.ts +166 -0
- package/dist/components/meeting/utils.d.ts +22 -0
- package/dist/components.cjs.js +224 -0
- package/dist/components.css +1 -0
- package/dist/components.element.cjs.js +1 -0
- package/dist/components.element.es.js +4 -0
- package/dist/components.es.js +45054 -0
- package/dist/index.d.ts +19 -0
- package/docs/design.md +27 -0
- package/docs/design_banner.md +41 -0
- package/docs/design_section.md +27 -0
- package/package.json +56 -0
- package/scripts/generate-components-index.js +104 -0
- package/src/assets/events/svg-icons/icon-checked.svg +3 -0
- package/src/assets/events/svg-icons/icon-competition.svg +7 -0
- package/src/assets/events/svg-icons/icon-events.svg +4 -0
- package/src/assets/events/svg-icons/icon-release.svg +4 -0
- package/src/assets/events/svg-icons/icon-summit.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-all.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-backward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-calendar.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-cancel.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-captions.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-close-captions.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-close-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-copy.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-create.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-delete.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-empty.svg +31 -0
- package/src/assets/meeting/svg-icons/icon-empty_dark.svg +49 -0
- package/src/assets/meeting/svg-icons/icon-event.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-export.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-forward.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-fullscreen.svg +6 -0
- package/src/assets/meeting/svg-icons/icon-help.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-important.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-info.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meet.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-meeting-message.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-meeting.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-play.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-playing-tip.svg +7 -0
- package/src/assets/meeting/svg-icons/icon-playing.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-question.svg +4 -0
- package/src/assets/meeting/svg-icons/icon-sound.svg +5 -0
- package/src/assets/meeting/svg-icons/icon-speaker.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-summit.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-telligent.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-tip.svg +3 -0
- package/src/assets/meeting/svg-icons/icon-todo.svg +4 -0
- package/src/assets/meeting/transparent.png +0 -0
- package/src/assets/svg-icons/icon-arrow-left.svg +3 -0
- package/src/assets/svg-icons/icon-avatar-line.svg +3 -0
- package/src/assets/svg-icons/icon-caret-left.svg +3 -0
- package/src/assets/svg-icons/icon-caret-right.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-down.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-right.svg +3 -0
- package/src/assets/svg-icons/icon-chevron-up.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-filter.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-menu.svg +3 -0
- package/src/assets/svg-icons/icon-header-person.svg +3 -0
- package/src/assets/svg-icons/icon-header-search.svg +4 -0
- package/src/assets/svg-icons/icon-loading.svg +4 -0
- package/src/assets/svg-icons/icon-locale.svg +3 -0
- package/src/assets/svg-icons/icon-log-off.svg +3 -0
- package/src/assets/svg-icons/icon-message.svg +3 -0
- package/src/assets/svg-icons/icon-moon.svg +3 -0
- package/src/assets/svg-icons/icon-outlink.svg +3 -0
- package/src/assets/svg-icons/icon-overview.svg +3 -0
- package/src/assets/svg-icons/icon-search.svg +3 -0
- package/src/assets/svg-icons/icon-setting.svg +3 -0
- package/src/assets/svg-icons/icon-sun.svg +3 -0
- package/src/assets/svg-icons/icon-tips.svg +3 -0
- package/src/components/OBanner.vue +398 -0
- package/src/components/OCookieNotice.vue +575 -0
- package/src/components/OFooter.vue +576 -0
- package/src/components/OHeaderSearch.vue +601 -0
- package/src/components/OHeaderUser.vue +237 -0
- package/src/components/OPlusConfigProvider.vue +32 -0
- package/src/components/OSection.vue +178 -0
- package/src/components/OSourceCode.vue +153 -0
- package/src/components/OThemeSwitcher.vue +108 -0
- package/src/components/activity/OActivityApproval.vue +871 -0
- package/src/components/activity/OActivityForm.vue +548 -0
- package/src/components/activity/OMyActivityCalendar.vue +1501 -0
- package/src/components/activity/config.ts +141 -0
- package/src/components/activity/index.ts +24 -0
- package/src/components/activity/types.ts +88 -0
- package/src/components/common/AppAvatar.vue +83 -0
- package/src/components/common/ClientOnlyWrapper.ts +21 -0
- package/src/components/common/ContentWrapper.vue +85 -0
- package/src/components/common/MoreText.vue +124 -0
- package/src/components/common/ThFilter.vue +330 -0
- package/src/components/element-plus/OElCookieNotice.vue +603 -0
- package/src/components/element-plus/index.ts +3 -0
- package/src/components/events/OEventsApply.vue +419 -0
- package/src/components/events/OEventsCalendar.vue +588 -0
- package/src/components/events/OEventsList.vue +354 -0
- package/src/components/events/config.ts +35 -0
- package/src/components/events/index.ts +24 -0
- package/src/components/events/types.ts +80 -0
- package/src/components/events/utils.ts +9 -0
- package/src/components/header/OHeader.vue +175 -0
- package/src/components/header/OHeaderMoblie.vue +152 -0
- package/src/components/header/components/HeaderContent.vue +942 -0
- package/src/components/header/components/HeaderNav.vue +280 -0
- package/src/components/header/components/HeaderNavMoblie.vue +346 -0
- package/src/components/header/components/HeaderUbmcNav.vue +540 -0
- package/src/components/header/index.ts +16 -0
- package/src/components/meeting/OMeetingCalendar.vue +900 -0
- package/src/components/meeting/OMeetingForm.vue +1041 -0
- package/src/components/meeting/OMeetingPlayback.vue +439 -0
- package/src/components/meeting/OMyMeetingCalendar.vue +1502 -0
- package/src/components/meeting/OSigMeetingCalendar.vue +411 -0
- package/src/components/meeting/components/OMeetingCalendarList.vue +505 -0
- package/src/components/meeting/components/OMeetingCalendarSelector.vue +206 -0
- package/src/components/meeting/components/OMeetingDetail.vue +227 -0
- package/src/components/meeting/components/OMeetingPlaybackSubtitles.vue +611 -0
- package/src/components/meeting/components/OMeetingPlaybackVideo.vue +741 -0
- package/src/components/meeting/components/OSigMeetingAside.vue +197 -0
- package/src/components/meeting/config.ts +121 -0
- package/src/components/meeting/index.ts +45 -0
- package/src/components/meeting/types.ts +193 -0
- package/src/components/meeting/utils.ts +123 -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 +16 -0
- package/src/i18n/en.ts +261 -0
- package/src/i18n/index.ts +56 -0
- package/src/i18n/zh.ts +250 -0
- package/src/index.ts +45 -0
- package/src/shared/provide.ts +6 -0
- package/src/shims-vue-dompurify-html.d.ts +17 -0
- package/src/vue.d.ts +10 -0
- package/tsconfig.json +37 -0
- package/vite.config.ts +118 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { OIcon, OBadge, ODropdown, ODropdownItem } from '@opensig/opendesign';
|
|
3
|
+
|
|
4
|
+
import AppAvatar from './common/AppAvatar.vue';
|
|
5
|
+
|
|
6
|
+
import IconAvatar from '~icons/components/icon-avatar-line.svg';
|
|
7
|
+
import IconChevronDown from '~icons/components/icon-chevron-down.svg';
|
|
8
|
+
|
|
9
|
+
import { useScreen } from '@opendesign-plus/composables';
|
|
10
|
+
|
|
11
|
+
const { lePadV } = useScreen();
|
|
12
|
+
|
|
13
|
+
interface UserInfoT {
|
|
14
|
+
photo: string;
|
|
15
|
+
username: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface OptionsItemT {
|
|
19
|
+
id: string; // id
|
|
20
|
+
label: string; // 标题
|
|
21
|
+
icon?: string; // icon
|
|
22
|
+
url: string; // 跳转链接
|
|
23
|
+
target: string; // 跳转方式
|
|
24
|
+
total: number; // 消息数量
|
|
25
|
+
logout: boolean; // 是否是退出登录 item
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface UserPropsT {
|
|
29
|
+
token?: string;
|
|
30
|
+
lang?: string;
|
|
31
|
+
noticeTotal?: number;
|
|
32
|
+
userInfo?: UserInfoT;
|
|
33
|
+
options?: OptionsItemT[];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
withDefaults(defineProps<UserPropsT>(), {
|
|
37
|
+
token: undefined,
|
|
38
|
+
lang: undefined,
|
|
39
|
+
noticeTotal: undefined,
|
|
40
|
+
userInfo: undefined,
|
|
41
|
+
options: undefined,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export interface OHeaderUserEmitsT {
|
|
45
|
+
(e: 'login'): void;
|
|
46
|
+
(e: 'logout'): void;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits<OHeaderUserEmitsT>();
|
|
50
|
+
|
|
51
|
+
const login = () => {
|
|
52
|
+
emit('login');
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const jumpToPage = (val: any) => {
|
|
56
|
+
if (val?.logout) {
|
|
57
|
+
emit('logout');
|
|
58
|
+
} else {
|
|
59
|
+
window.open(val.url, val.target);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<div class="header-user">
|
|
66
|
+
<!-- 未登录或登录失败 -->
|
|
67
|
+
<template v-if="!token">
|
|
68
|
+
<OIcon @click="login" class="avatar-icon">
|
|
69
|
+
<IconAvatar />
|
|
70
|
+
</OIcon>
|
|
71
|
+
</template>
|
|
72
|
+
<!-- 已登录 -->
|
|
73
|
+
<Transition name="header-user-zoom-in">
|
|
74
|
+
<div class="user-info" v-if="token">
|
|
75
|
+
<ODropdown
|
|
76
|
+
:trigger="lePadV ? 'click' : 'hover'"
|
|
77
|
+
:optionPosition="lePadV ? 'br' : 'bottom'"
|
|
78
|
+
:option-wrap-class="`user-dropdown ${lang === 'en' ? 'is-en' : ''}`"
|
|
79
|
+
>
|
|
80
|
+
<div class="info-wrap hover-icon-rotate">
|
|
81
|
+
<OBadge :value="noticeTotal" :dot="true" color="danger" class="header-message user-avatar" :class="{ 'notice-not': !noticeTotal }">
|
|
82
|
+
<AppAvatar :avatar="userInfo.photo" :name="userInfo.username" :custom-size="20" />
|
|
83
|
+
</OBadge>
|
|
84
|
+
<p class="user-account">{{ userInfo.username }}</p>
|
|
85
|
+
<OIcon class="icon">
|
|
86
|
+
<IconChevronDown />
|
|
87
|
+
</OIcon>
|
|
88
|
+
</div>
|
|
89
|
+
<template #dropdown>
|
|
90
|
+
<!-- 账号信息 -->
|
|
91
|
+
<template v-for="item in options" :key="item.label">
|
|
92
|
+
<ODropdownItem :style="{ '--dropdown-item-justify': 'center' }" @click="jumpToPage(item)">
|
|
93
|
+
<OBadge v-if="item?.total" :value="item.total" color="danger" class="header-message message" :class="{ 'notice-not': !item.total }">
|
|
94
|
+
{{ item.label }}
|
|
95
|
+
</OBadge>
|
|
96
|
+
<span v-else>{{ item.label }}</span>
|
|
97
|
+
</ODropdownItem>
|
|
98
|
+
</template>
|
|
99
|
+
</template>
|
|
100
|
+
</ODropdown>
|
|
101
|
+
</div>
|
|
102
|
+
</Transition>
|
|
103
|
+
</div>
|
|
104
|
+
</template>
|
|
105
|
+
|
|
106
|
+
<style lang="scss" scoped>
|
|
107
|
+
.header-user {
|
|
108
|
+
display: flex;
|
|
109
|
+
align-items: center;
|
|
110
|
+
height: 100%;
|
|
111
|
+
visibility: visible;
|
|
112
|
+
opacity: 1;
|
|
113
|
+
transition: opacity 0.15s;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.user-info {
|
|
117
|
+
height: 100%;
|
|
118
|
+
min-width: 32px;
|
|
119
|
+
display: flex;
|
|
120
|
+
cursor: pointer;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.info-wrap {
|
|
124
|
+
height: calc(100% - 10px);
|
|
125
|
+
margin: 5px 0;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
|
|
129
|
+
.icon {
|
|
130
|
+
margin-left: 4px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.user-avatar {
|
|
135
|
+
margin-right: 4px;
|
|
136
|
+
|
|
137
|
+
:deep(.o-badge-content) {
|
|
138
|
+
--badge-dot-size: 6px;
|
|
139
|
+
right: 7px;
|
|
140
|
+
top: 2px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.o-dropdown-item {
|
|
145
|
+
white-space: nowrap;
|
|
146
|
+
--dropdown-item-color: var(--o-color-info1);
|
|
147
|
+
--dropdown-item-padding: 5px 12px;
|
|
148
|
+
@include tip1;
|
|
149
|
+
|
|
150
|
+
@include hover {
|
|
151
|
+
color: var(--o-color-primary1);
|
|
152
|
+
background: var(--o-color-control2-light);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.notice-not {
|
|
157
|
+
:deep(.o-badge-content) {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.user-account {
|
|
163
|
+
color: var(--o-color-info1);
|
|
164
|
+
max-width: 96px;
|
|
165
|
+
font-weight: 500;
|
|
166
|
+
@include tip1;
|
|
167
|
+
@include text-truncate(1);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@include respond-to('<=pad_v') {
|
|
171
|
+
.header-user {
|
|
172
|
+
min-width: auto;
|
|
173
|
+
|
|
174
|
+
.user-info {
|
|
175
|
+
min-width: 24px;
|
|
176
|
+
|
|
177
|
+
.info-wrap {
|
|
178
|
+
.user-avatar {
|
|
179
|
+
margin-right: 0;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.user-account {
|
|
183
|
+
display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.icon {
|
|
187
|
+
display: none;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
|
|
195
|
+
<style lang="scss">
|
|
196
|
+
.user-dropdown {
|
|
197
|
+
--dropdown-list-radius: var(--o-radius-m);
|
|
198
|
+
}
|
|
199
|
+
.avatar-icon {
|
|
200
|
+
font-size: 24px;
|
|
201
|
+
color: var(--o-color-info1);
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
|
|
204
|
+
@include hover {
|
|
205
|
+
color: var(--o-color-primary1);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
@include respond-to('<=pad_v') {
|
|
209
|
+
.user-dropdown {
|
|
210
|
+
--dropdown-list-radius: 8px;
|
|
211
|
+
|
|
212
|
+
.o-divider {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.o-icon {
|
|
217
|
+
display: none;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.o-badge-content {
|
|
221
|
+
right: 0 !important;
|
|
222
|
+
transform: translate(0, 0) scale(0.5);
|
|
223
|
+
transform-origin: top right;
|
|
224
|
+
min-width: 18px;
|
|
225
|
+
width: fit-content;
|
|
226
|
+
height: 18px;
|
|
227
|
+
font-size: 12px;
|
|
228
|
+
line-height: 18px;
|
|
229
|
+
.o-badge-label {
|
|
230
|
+
transform: scale(1);
|
|
231
|
+
font-size: 12px;
|
|
232
|
+
line-height: 18px;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, provide, reactive } from 'vue';
|
|
3
|
+
|
|
4
|
+
import { OConfigProvider } from '@opensig/opendesign';
|
|
5
|
+
import zhCN from '@opensig/opendesign/es/locale/lang/zh-cn';
|
|
6
|
+
import enUS from '@opensig/opendesign/es/locale/lang/en-us';
|
|
7
|
+
|
|
8
|
+
import { configProviderInjectKey } from '@/shared/provide';
|
|
9
|
+
|
|
10
|
+
export interface OPlusConfigProviderPropsT {
|
|
11
|
+
locale: 'zh' | 'en';
|
|
12
|
+
theme: 'light' | 'dark';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<OPlusConfigProviderPropsT>(), {
|
|
16
|
+
lang: 'zh',
|
|
17
|
+
theme: 'light',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const globalConfig = reactive({
|
|
21
|
+
locale: computed(() => props.locale),
|
|
22
|
+
theme: computed(() => props.theme),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
provide(configProviderInjectKey, globalConfig);
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<OConfigProvider :locale="locale === 'zh' ? zhCN : enUS">
|
|
30
|
+
<slot />
|
|
31
|
+
</OConfigProvider>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { isArray, OLink, OIcon } from '@opensig/opendesign';
|
|
3
|
+
import IconChevronRight from '~icons/components/icon-chevron-right.svg';
|
|
4
|
+
|
|
5
|
+
interface SectionPropsT {
|
|
6
|
+
title?: string | Array<string>;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
full?: boolean;
|
|
9
|
+
headerJustifyCenter?: boolean;
|
|
10
|
+
footer?: string;
|
|
11
|
+
footerHref?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<SectionPropsT>(), {
|
|
15
|
+
title: undefined,
|
|
16
|
+
subtitle: undefined,
|
|
17
|
+
full: false,
|
|
18
|
+
headerJustifyCenter: true,
|
|
19
|
+
footer: undefined,
|
|
20
|
+
footerHref: undefined,
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div class="app-section" :class="{ 'is-full': props.full }">
|
|
26
|
+
<div class="section-wrapper">
|
|
27
|
+
<slot name="main">
|
|
28
|
+
<!-- header -->
|
|
29
|
+
<div v-if="$slots.header || props.title || props.subtitle" class="section-header" :class="{ 'is-left': !props.headerJustifyCenter }">
|
|
30
|
+
<slot name="header">
|
|
31
|
+
<template v-if="isArray(props.title)">
|
|
32
|
+
<h2 v-for="item in props.title" :key="item" class="section-title">
|
|
33
|
+
{{ item }}
|
|
34
|
+
</h2>
|
|
35
|
+
</template>
|
|
36
|
+
<h2 v-else-if="$slots.title || props.title" class="section-title">
|
|
37
|
+
<slot name="title">
|
|
38
|
+
{{ props.title }}
|
|
39
|
+
</slot>
|
|
40
|
+
</h2>
|
|
41
|
+
<p v-if="$slots.subtitle || props.subtitle" class="section-subtitle">
|
|
42
|
+
<slot name="subtitle">
|
|
43
|
+
{{ props.subtitle }}
|
|
44
|
+
</slot>
|
|
45
|
+
</p>
|
|
46
|
+
</slot>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<!-- body -->
|
|
50
|
+
<div v-if="$slots.default" class="section-body">
|
|
51
|
+
<slot></slot>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<!-- footer -->
|
|
55
|
+
<div v-if="$slots.footer || props.footer" class="section-footer">
|
|
56
|
+
<slot name="footer">
|
|
57
|
+
<OLink :href="props.footerHref" target="_blank">
|
|
58
|
+
{{ props.footer }}
|
|
59
|
+
<template #suffix>
|
|
60
|
+
<OIcon class="footer-icon"><IconChevronRight /> </OIcon>
|
|
61
|
+
</template>
|
|
62
|
+
</OLink>
|
|
63
|
+
</slot>
|
|
64
|
+
</div>
|
|
65
|
+
</slot>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<style lang="scss" scoped>
|
|
71
|
+
.app-section {
|
|
72
|
+
--o-gap-section: var(--o-gap-7);
|
|
73
|
+
.section-wrapper {
|
|
74
|
+
margin: var(--o-gap-section) auto 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.is-full {
|
|
78
|
+
.section-body {
|
|
79
|
+
max-width: 100%;
|
|
80
|
+
width: 100%;
|
|
81
|
+
padding: 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:last-child {
|
|
86
|
+
.section-wrapper {
|
|
87
|
+
padding-bottom: var(--o-gap-section);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.section-header {
|
|
92
|
+
&.is-left {
|
|
93
|
+
.section-title,
|
|
94
|
+
.section-subtitle {
|
|
95
|
+
justify-content: start;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.section-title {
|
|
101
|
+
max-width: var(--layout-content-max-width);
|
|
102
|
+
padding: 0 var(--layout-content-padding);
|
|
103
|
+
margin: 0 auto;
|
|
104
|
+
|
|
105
|
+
display: flex;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
color: var(--o-color-info1);
|
|
108
|
+
text-align: center;
|
|
109
|
+
@include display3;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.section-subtitle {
|
|
114
|
+
max-width: var(--layout-content-max-width);
|
|
115
|
+
padding: 0 var(--layout-content-padding);
|
|
116
|
+
margin: 0 auto;
|
|
117
|
+
|
|
118
|
+
display: flex;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
margin-top: 12px;
|
|
121
|
+
color: var(--o-color-info2);
|
|
122
|
+
@include text1;
|
|
123
|
+
|
|
124
|
+
@include respond-to('pad-laptop') {
|
|
125
|
+
margin-top: 8px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@include respond-to('phone') {
|
|
129
|
+
margin-top: 12px;
|
|
130
|
+
text-align: center;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.section-body {
|
|
135
|
+
max-width: var(--layout-content-max-width);
|
|
136
|
+
padding: 0 var(--layout-content-padding);
|
|
137
|
+
margin: 0 auto;
|
|
138
|
+
|
|
139
|
+
margin-top: var(--o-gap-7);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.section-footer {
|
|
143
|
+
max-width: var(--layout-content-max-width);
|
|
144
|
+
padding: 0 var(--layout-content-padding);
|
|
145
|
+
margin: 0 auto;
|
|
146
|
+
color: var(--o-color-info1);
|
|
147
|
+
|
|
148
|
+
display: flex;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
@include text1;
|
|
151
|
+
|
|
152
|
+
margin-top: 32px;
|
|
153
|
+
|
|
154
|
+
:deep(.o-btn) {
|
|
155
|
+
border-radius: var(--btn-height);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@include respond-to('<=laptop') {
|
|
159
|
+
margin-top: 16px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@include respond-to('phone') {
|
|
163
|
+
margin-top: 12px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&:hover {
|
|
167
|
+
.footer-icon {
|
|
168
|
+
fill: var(--link-color-active);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.footer-icon {
|
|
174
|
+
font-size: 16px;
|
|
175
|
+
height: 24px;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
</style>
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue';
|
|
3
|
+
import { OIcon, ODropdown, ODropdownItem } from '@opensig/opendesign';
|
|
4
|
+
|
|
5
|
+
import IconChevronDown from '~icons/components/icon-chevron-down.svg';
|
|
6
|
+
|
|
7
|
+
interface CodeItemT {
|
|
8
|
+
label: string;
|
|
9
|
+
url: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface CodePropsT {
|
|
14
|
+
title?: string;
|
|
15
|
+
options?: CodeItemT[];
|
|
16
|
+
url?: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
justify?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
withDefaults(defineProps<CodePropsT>(), {
|
|
22
|
+
title: undefined,
|
|
23
|
+
options: undefined,
|
|
24
|
+
url: undefined,
|
|
25
|
+
icon: undefined,
|
|
26
|
+
justify: 'center',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const itemChange = (data: any) => {
|
|
30
|
+
window.open(data.url, '_blank');
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const dropdownVisible = ref(false);
|
|
34
|
+
const visibleChange = (val: boolean) => {
|
|
35
|
+
dropdownVisible.value = val;
|
|
36
|
+
};
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div class="source-code">
|
|
41
|
+
<div v-if="url" class="info-wrap">
|
|
42
|
+
<span class="title">{{ title }}</span>
|
|
43
|
+
<OIcon v-if="icon">
|
|
44
|
+
<component :is="icon" class="icon" />
|
|
45
|
+
</OIcon>
|
|
46
|
+
</div>
|
|
47
|
+
<ODropdown
|
|
48
|
+
v-else
|
|
49
|
+
trigger="hover"
|
|
50
|
+
optionPosition="bottom"
|
|
51
|
+
option-wrap-class="dropdown"
|
|
52
|
+
:class="{ 'dropdown-active': dropdownVisible }"
|
|
53
|
+
@visible-change="visibleChange"
|
|
54
|
+
>
|
|
55
|
+
<div class="info-wrap hover-icon-rotate">
|
|
56
|
+
<span class="title">{{ title }}</span>
|
|
57
|
+
<OIcon class="icon"><IconChevronDown /></OIcon>
|
|
58
|
+
</div>
|
|
59
|
+
<template #dropdown>
|
|
60
|
+
<ODropdownItem v-for="item in options" @click="itemChange(item)" :key="item.url" class="list" :style="{ '--dropdown-item-justify': justify }">
|
|
61
|
+
{{ item.label }}
|
|
62
|
+
<OIcon v-if="item.icon">
|
|
63
|
+
<component :is="item.icon" class="icon" />
|
|
64
|
+
</OIcon>
|
|
65
|
+
</ODropdownItem>
|
|
66
|
+
</template>
|
|
67
|
+
</ODropdown>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
.source-code {
|
|
73
|
+
height: 100%;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
.info-wrap {
|
|
77
|
+
height: 100%;
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
color: var(--o-color-info1);
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
|
|
83
|
+
@include hover {
|
|
84
|
+
color: var(--o-color-primary1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.title {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
cursor: pointer;
|
|
91
|
+
height: 100%;
|
|
92
|
+
@include tip1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.list {
|
|
96
|
+
background: var(--o-color-fill2);
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
box-shadow: var(--o-shadow-1);
|
|
99
|
+
border-radius: var(--o-radius_control-xs);
|
|
100
|
+
padding: var(--o-gap-1);
|
|
101
|
+
width: 144px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.hover-icon-rotate {
|
|
106
|
+
.o-icon {
|
|
107
|
+
transition: all var(--o-duration-m1) var(--o-easing-standard-in);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@include hover {
|
|
111
|
+
.o-icon {
|
|
112
|
+
transform: rotate(-180deg);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.icon {
|
|
117
|
+
font-size: var(--o-icon_size_control-xs);
|
|
118
|
+
margin-left: var(--o-gap-1);
|
|
119
|
+
}
|
|
120
|
+
.o-dropdown {
|
|
121
|
+
height: 100%;
|
|
122
|
+
}
|
|
123
|
+
.dropdown-active {
|
|
124
|
+
.info-wrap {
|
|
125
|
+
color: var(--o-color-primary1);
|
|
126
|
+
}
|
|
127
|
+
.o-icon {
|
|
128
|
+
transform: rotate(-180deg);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
.o-dropdown-item {
|
|
132
|
+
background: var(--o-color-fill2);
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
border-radius: var(--o-radius_control-xs);
|
|
135
|
+
padding: var(--o-gap-1) 12px;
|
|
136
|
+
min-width: 144px;
|
|
137
|
+
height: 32px;
|
|
138
|
+
@include tip1;
|
|
139
|
+
|
|
140
|
+
@include hover {
|
|
141
|
+
background: var(--o-color-control2-light);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:active {
|
|
145
|
+
color: var(--o-color-primary1);
|
|
146
|
+
background: var(--o-color-control3-light);
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
.dropdown {
|
|
151
|
+
--dropdown-list-radius: var(--o-radius-xs);
|
|
152
|
+
}
|
|
153
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { Component, computed } from 'vue';
|
|
3
|
+
import { OIcon, OSwitch } from '@opensig/opendesign';
|
|
4
|
+
import { useScreen } from '@opendesign-plus/composables';
|
|
5
|
+
|
|
6
|
+
import IconSun from '~icons/components/icon-sun.svg';
|
|
7
|
+
import IconMoon from '~icons/components/icon-moon.svg';
|
|
8
|
+
|
|
9
|
+
export interface OThemeSwitcherPropsT {
|
|
10
|
+
theme?: string;
|
|
11
|
+
type?: 'auto' | 'common' | 'mobile';
|
|
12
|
+
lightValue?: string;
|
|
13
|
+
darkValue?: string;
|
|
14
|
+
lightIcon?: Component;
|
|
15
|
+
darkIcon?: Component;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface OThemeSwitcherEmitsT {
|
|
19
|
+
(e: 'update:theme', value: string): void;
|
|
20
|
+
(e: 'change', val: string): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<OThemeSwitcherPropsT>(), {
|
|
24
|
+
theme: 'light',
|
|
25
|
+
type: 'auto',
|
|
26
|
+
lightValue: 'light',
|
|
27
|
+
darkValue: 'dark',
|
|
28
|
+
lightIcon: IconSun,
|
|
29
|
+
darkIcon: IconMoon,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits<OThemeSwitcherEmitsT>();
|
|
33
|
+
|
|
34
|
+
const { gtPhone } = useScreen();
|
|
35
|
+
|
|
36
|
+
const switchVal = computed({
|
|
37
|
+
get() {
|
|
38
|
+
return props.theme;
|
|
39
|
+
},
|
|
40
|
+
set(val) {
|
|
41
|
+
emit('update:theme', val);
|
|
42
|
+
emit('change', val);
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const isCommon = computed(() => {
|
|
47
|
+
return props.type === 'common' || (props.type === 'auto' && gtPhone.value);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const toggleTheme = () => {
|
|
51
|
+
switchVal.value = switchVal.value === props.lightValue ? props.darkValue : props.lightValue;
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div class="o-theme-switcher">
|
|
57
|
+
<div v-if="isCommon" class="o-theme-switcher-common" @click="toggleTheme">
|
|
58
|
+
<OIcon class="o-theme-icon">
|
|
59
|
+
<IconMoon v-if="switchVal === lightValue" />
|
|
60
|
+
<IconSun v-else />
|
|
61
|
+
</OIcon>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div v-else class="o-theme-switcher-mobile">
|
|
65
|
+
<OSwitch v-model="switchVal" class="o-theme-switch" :checked-value="darkValue" :unchecked-value="lightValue">
|
|
66
|
+
<template #on>
|
|
67
|
+
<OIcon class="o-theme-icon">
|
|
68
|
+
<IconSun />
|
|
69
|
+
</OIcon>
|
|
70
|
+
</template>
|
|
71
|
+
<template #off>
|
|
72
|
+
<OIcon class="o-theme-icon">
|
|
73
|
+
<IconMoon />
|
|
74
|
+
</OIcon>
|
|
75
|
+
</template>
|
|
76
|
+
</OSwitch>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.o-theme-switcher-common {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
width: 20px;
|
|
85
|
+
height: 20px;
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
|
|
89
|
+
.o-theme-icon {
|
|
90
|
+
font-size: 24px;
|
|
91
|
+
color: var(--o-color-info1);
|
|
92
|
+
|
|
93
|
+
@include hover {
|
|
94
|
+
color: var(--o-color-primary1);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.o-theme-switcher-mobile {
|
|
100
|
+
.o-theme-switch {
|
|
101
|
+
background-color: var(--o-color-control1-light);
|
|
102
|
+
|
|
103
|
+
.o-theme-icon {
|
|
104
|
+
color: var(--o-color-white);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
</style>
|