@appscode/design-system 1.1.0-alpha.8 → 1.1.0-beta.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/base/utilities/_all.scss +1 -1
- package/base/utilities/_default.scss +41 -41
- package/base/utilities/_derived-variables.scss +8 -9
- package/base/utilities/_extended.scss +9 -5
- package/base/utilities/_initial-variables.scss +52 -50
- package/base/utilities/_mixin.scss +11 -11
- package/base/utilities/_typography.scss +22 -22
- package/base/utilities/dark-theme.scss +1 -1
- package/components/_ac-accordion.scss +6 -6
- package/components/_ac-alert-box.scss +27 -28
- package/components/_ac-calendar.scss +4 -4
- package/components/_ac-card.scss +55 -55
- package/components/_ac-code-highlight.scss +6 -6
- package/components/_ac-content-layout.scss +165 -165
- package/components/_ac-drag.scss +11 -11
- package/components/_ac-input.scss +85 -85
- package/components/_ac-modal.scss +8 -8
- package/components/_ac-multi-select.scss +751 -751
- package/components/_ac-options.scss +12 -13
- package/components/_ac-select-box.scss +5 -5
- package/components/_ac-table.scss +55 -55
- package/components/_ac-tabs.scss +36 -36
- package/components/_ac-tags.scss +22 -22
- package/components/_ac-terminal.scss +253 -253
- package/components/_add-card.scss +3 -3
- package/components/_app-drawer.scss +4 -4
- package/components/_basic-card.scss +108 -114
- package/components/_breadcumb.scss +5 -5
- package/components/_buttons.scss +64 -64
- package/components/_card-body-wrapper.scss +5 -5
- package/components/_dashboard-header.scss +29 -29
- package/components/_direct-deploy.scss +8 -8
- package/components/_go-to-top.scss +1 -1
- package/components/_image-upload.scss +3 -3
- package/components/_left-sidebar-menu.scss +374 -376
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +65 -65
- package/components/_nested-list.scss +1 -1
- package/components/_overview-info.scss +7 -7
- package/components/_overview-page.scss +4 -4
- package/components/_pagination.scss +110 -110
- package/components/_payment-card.scss +20 -20
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +18 -18
- package/components/_pricing-table.scss +10 -10
- package/components/_progress-bar.scss +12 -12
- package/components/_subscription-card.scss +14 -14
- package/components/_table-of-content.scss +4 -4
- package/components/_tfa.scss +9 -9
- package/components/_widget-menu.scss +17 -17
- package/components/_wizard.scss +82 -82
- package/components/ac-toaster/_ac-toasted.scss +1 -1
- package/components/bbum/_activities-header.scss +1 -1
- package/components/bbum/_card-team.scss +12 -12
- package/components/bbum/_information-center.scss +13 -13
- package/components/bbum/_left-sidebar.scss +8 -8
- package/components/bbum/_mobile-desktop.scss +7 -7
- package/components/bbum/_post.scss +5 -5
- package/components/bbum/_sign-up-notification.scss +10 -10
- package/components/bbum/_single-post-preview.scss +21 -21
- package/components/bbum/_user-profile.scss +10 -10
- package/components/ui-builder/_ui-builder.scss +15 -15
- package/components/ui-builder/_vue-open-api.scss +2 -2
- package/layouts/_code-preview.scss +11 -11
- package/package.json +1 -1
- package/vue-components/plugins/time-convert.js +49 -0
- package/vue-components/text.vue +1 -0
- package/vue-components/types/cluster.ts +6 -0
- package/vue-components/types/longRunningTasks.ts +20 -0
- package/vue-components/types/notification.ts +6 -0
- package/vue-components/types/previewYaml.ts +8 -0
- package/vue-components/types/table.ts +54 -0
- package/vue-components/types/theme.ts +10 -0
- package/vue-components/types/user.ts +22 -0
- package/vue-components/v2/card/OverviewCards.vue +17 -2
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
- package/vue-components/v2/icons/Ellipsis.vue +2 -1
- package/vue-components/v2/modal/Modal.vue +0 -5
- package/vue-components/v2/navbar/Appdrawer.vue +37 -12
- package/vue-components/v2/navbar/Navbar.vue +3 -3
- package/vue-components/v2/navbar/NavbarItem.vue +3 -1
- package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
- package/vue-components/v2/navbar/User.vue +5 -22
- package/vue-components/v2/pagination/Pagination.vue +65 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
- package/vue-components/v3/accordion/Accordion.vue +151 -0
- package/vue-components/v3/alert/Alert.vue +238 -0
- package/vue-components/v3/alert/Toast.vue +79 -0
- package/vue-components/v3/banner/Banner.vue +10 -0
- package/vue-components/v3/breadcrumbs/Breadcrumb.vue +104 -0
- package/vue-components/v3/button/Button.vue +831 -58
- package/vue-components/v3/button/Buttons.vue +6 -0
- package/vue-components/v3/button/DownloadBtn.vue +31 -0
- package/vue-components/v3/cards/Card.vue +32 -0
- package/vue-components/v3/cards/CardContent.vue +7 -0
- package/vue-components/v3/cards/CardHeader.vue +14 -0
- package/vue-components/v3/cards/Cards.vue +7 -0
- package/vue-components/v3/cards/Cluster.vue +150 -0
- package/vue-components/v3/cards/Counter.vue +27 -0
- package/vue-components/v3/cards/FeatureCard.vue +40 -0
- package/vue-components/v3/cards/FeatureCards.vue +6 -0
- package/vue-components/v3/cards/InfoCard.vue +248 -0
- package/vue-components/v3/cards/Monitoring.vue +94 -0
- package/vue-components/v3/cards/OverviewCard.vue +24 -0
- package/vue-components/v3/cards/OverviewCards.vue +31 -0
- package/vue-components/v3/cards/Payment.vue +62 -0
- package/vue-components/v3/cards/Vendor.vue +23 -0
- package/vue-components/v3/content/ContentHeader.vue +39 -30
- package/vue-components/v3/content/ContentLayout.vue +20 -0
- package/vue-components/v3/content/ContentTable.vue +37 -61
- package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
- package/vue-components/v3/editor/Editor.vue +100 -113
- package/vue-components/v3/editor/FilteredFileEditor.vue +124 -127
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +70 -94
- package/vue-components/v3/footer/FooterArea.vue +34 -0
- package/vue-components/v3/footer/FooterItem.vue +29 -0
- package/vue-components/v3/footer/FooterItems.vue +15 -0
- package/vue-components/v3/footer/Info.vue +23 -0
- package/vue-components/v3/footer/Status.vue +42 -0
- package/vue-components/v3/footer/Usage.vue +44 -0
- package/vue-components/v3/form/Form.vue +24 -33
- package/vue-components/v3/form/FormFooterControl.vue +7 -0
- package/vue-components/v3/form/FormFooterControls.vue +7 -0
- package/vue-components/v3/form-fields/AcSingleInput.vue +520 -0
- package/vue-components/v3/form-fields/Input.vue +19 -14
- package/vue-components/v3/header/Header.vue +117 -24
- package/vue-components/v3/header/HeaderItem.vue +18 -0
- package/vue-components/v3/header/HeaderItems.vue +4 -0
- package/vue-components/v3/icons/Ellipsis.vue +2 -0
- package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
- package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +17 -15
- package/vue-components/v3/modal/Modal.vue +292 -96
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
- package/vue-components/v3/modals/JsonShowModal.vue +62 -68
- package/vue-components/v3/modals/LongRunningTasksModal.vue +145 -143
- package/vue-components/v3/navbar/Appdrawer.vue +196 -51
- package/vue-components/v3/navbar/Navbar.vue +296 -0
- package/vue-components/v3/navbar/NavbarItem.vue +81 -0
- package/vue-components/v3/navbar/NavbarItemContent.vue +284 -0
- package/vue-components/v3/navbar/Notification.vue +179 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -112
- package/vue-components/v3/navbar/User.vue +383 -268
- package/vue-components/v3/notification/AlertBox.vue +39 -42
- package/vue-components/v3/notification/Notification.vue +49 -43
- package/vue-components/v3/notification/NotificationItem.vue +51 -19
- package/vue-components/v3/option-dots/Options.vue +188 -0
- package/vue-components/v3/pagination/Pagination.vue +203 -99
- package/vue-components/v3/preloader/Preloader.vue +23 -0
- package/vue-components/v3/searchbars/SearchBar.vue +51 -34
- package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +834 -81
- package/vue-components/v3/sidebar/Sidebar.vue +271 -0
- package/vue-components/v3/sidebar/SidebarBody.vue +7 -0
- package/vue-components/v3/sidebar/SidebarFooter.vue +80 -0
- package/vue-components/v3/sidebar/SidebarHeader.vue +124 -0
- package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
- package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +128 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +29 -0
- package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
- package/vue-components/v3/tab/TabItem.vue +10 -12
- package/vue-components/v3/tab/Tabs.vue +9 -0
- package/vue-components/v3/tab/TabsBody.vue +7 -0
- package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
- package/vue-components/v3/table/FakeTableCell.vue +22 -31
- package/vue-components/v3/table/InfoTable.vue +85 -59
- package/vue-components/v3/table/MultiInfoTable.vue +72 -95
- package/vue-components/v3/table/Table.vue +582 -151
- package/vue-components/v3/table/TableCell.vue +20 -23
- package/vue-components/v3/table/TableContainer.vue +50 -28
- package/vue-components/v3/table/TableRow.vue +63 -85
- package/vue-components/v3/table/table-cell/ArrayCell.vue +67 -79
- package/vue-components/v3/table/table-cell/CellValue.vue +97 -103
- package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
- package/vue-components/v3/table/table-cell/ObjectCell.vue +67 -79
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
- package/vue-components/v3/tabs/EditorTabs.vue +18 -24
- package/vue-components/v3/tag/Tag.vue +15 -12
- package/vue-components/v3/tag/Tags.vue +7 -0
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +26 -23
- package/mixins/stickyContent.js +0 -141
- package/plugins/caching.ts +0 -243
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
|
|
4
|
+
const ContentHeader = defineAsyncComponent(
|
|
5
|
+
() => import("./../content/ContentHeader.vue")
|
|
6
|
+
);
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="overview-cards-wrapper">
|
|
11
|
+
<!-- title -->
|
|
12
|
+
<content-header headerTitle="Resource Usage"></content-header>
|
|
13
|
+
<!-- title -->
|
|
14
|
+
<div class="overview-cards b-t-1">
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<style lang="scss" scoped>
|
|
20
|
+
.overview-cards-wrapper {
|
|
21
|
+
border: 1px solid $primary-90;
|
|
22
|
+
margin-right: 20px;
|
|
23
|
+
height: 100%;
|
|
24
|
+
}
|
|
25
|
+
.overview-cards {
|
|
26
|
+
display: grid;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
|
|
29
|
+
padding: 16px;
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup lang="ts"></script>
|
|
2
|
+
<template>
|
|
3
|
+
<div class="ac-payment-card-wrapper">
|
|
4
|
+
<!-- single card start -->
|
|
5
|
+
<div class="ac-payment-card payment-bg-2">
|
|
6
|
+
<div class="payment-card-inner">
|
|
7
|
+
<!-- card header start -->
|
|
8
|
+
<div class="payment-card-header">
|
|
9
|
+
<div class="card-left">
|
|
10
|
+
<div class="expired-notice">
|
|
11
|
+
<p>Expire Soon</p>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<!-- header-right start -->
|
|
15
|
+
<div class="card-right">
|
|
16
|
+
<div class="ac-options is-right">
|
|
17
|
+
<div class="option-dots">
|
|
18
|
+
<span></span>
|
|
19
|
+
<span></span>
|
|
20
|
+
<span></span>
|
|
21
|
+
</div>
|
|
22
|
+
<!-- dropdown Item start -->
|
|
23
|
+
<!-- use "is-hidden" class in the line below for hide dropdown element -->
|
|
24
|
+
<ul class="options-items is-hidden">
|
|
25
|
+
<li><a href="#">Make as default</a></li>
|
|
26
|
+
<li><a href="#">Delete card</a></li>
|
|
27
|
+
</ul>
|
|
28
|
+
<!-- dropdown Item end -->
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<!-- header-right end -->
|
|
32
|
+
</div>
|
|
33
|
+
<!-- card header end -->
|
|
34
|
+
<!-- card body start -->
|
|
35
|
+
<div class="payment-card-body">
|
|
36
|
+
<p class="p-card-number is-star">****</p>
|
|
37
|
+
<p class="p-card-number is-star">****</p>
|
|
38
|
+
<p class="p-card-number is-star">****</p>
|
|
39
|
+
<p class="p-card-number">2296</p>
|
|
40
|
+
</div>
|
|
41
|
+
<!-- card body end -->
|
|
42
|
+
<!-- card footer start -->
|
|
43
|
+
<div class="payment-card-footer">
|
|
44
|
+
<div class="left-content">
|
|
45
|
+
<div class="p-card-expiry">
|
|
46
|
+
<p>Expiry Date <span>12/20</span></p>
|
|
47
|
+
</div>
|
|
48
|
+
<p class="user-name">John Smith</p>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="p-card-logo">
|
|
51
|
+
<img
|
|
52
|
+
src="https://bb-developer-v1.web.app/_nuxt/img/visa-card-logo.6a56d8c.svg"
|
|
53
|
+
alt="visa-card"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
<!-- card footer end -->
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
<!-- single card end -->
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
title?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
withDefaults(defineProps<Props>(), {
|
|
7
|
+
title: "no title",
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
<template>
|
|
11
|
+
<a class="ac-single-card has-text-centered style-three">
|
|
12
|
+
<div class="ac-card-logo">
|
|
13
|
+
<div class="card-status"></div>
|
|
14
|
+
<img
|
|
15
|
+
src="https://bb-developer-v1.web.app/_nuxt/img/azure-logo.4fa9281.svg"
|
|
16
|
+
alt="azure-logo"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="ac-card-name">
|
|
20
|
+
<p>{{ title }}</p>
|
|
21
|
+
</div>
|
|
22
|
+
</a>
|
|
23
|
+
</template>
|
|
@@ -1,14 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
|
|
4
|
+
const HeaderItems = defineAsyncComponent(
|
|
5
|
+
() => import("./../header/HeaderItems.vue")
|
|
6
|
+
);
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
headerTitle?: string;
|
|
10
|
+
headerSubTitle?: string;
|
|
11
|
+
removeBorderBottom?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
withDefaults(defineProps<Props>(), {
|
|
15
|
+
headerTitle: "Content Header",
|
|
16
|
+
headerSubTitle: "",
|
|
17
|
+
removeBorderBottom: false,
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
1
21
|
<template>
|
|
2
|
-
<div class="ac-content-header"
|
|
22
|
+
<div class="ac-content-header">
|
|
3
23
|
<!-- header left start -->
|
|
4
24
|
<div class="ac-cheader-left">
|
|
5
25
|
<!-- title -->
|
|
6
26
|
<div class="ac-content-title">
|
|
7
|
-
<
|
|
27
|
+
<h5 class="is-flex is-align-items-center">
|
|
8
28
|
<slot name="header-icon" />
|
|
9
29
|
{{ headerTitle }}
|
|
10
30
|
<slot name="title-right-actions" />
|
|
11
|
-
</
|
|
31
|
+
</h5>
|
|
12
32
|
<p v-if="headerSubTitle">{{ headerSubTitle }}</p>
|
|
13
33
|
</div>
|
|
14
34
|
<!-- title -->
|
|
@@ -26,30 +46,19 @@
|
|
|
26
46
|
<!-- header right end -->
|
|
27
47
|
</div>
|
|
28
48
|
</template>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
default: false,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
components: {
|
|
50
|
-
HeaderItems: defineAsyncComponent(() =>
|
|
51
|
-
import("../../v2/header/HeaderItems.vue").then((module) => module.default)
|
|
52
|
-
),
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
</script>
|
|
49
|
+
<style lang="scss" scoped>
|
|
50
|
+
.ac-content-header {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: space-between;
|
|
54
|
+
padding: 4px 20px;
|
|
55
|
+
min-height: 40px;
|
|
56
|
+
.ac-content-title {
|
|
57
|
+
h4,
|
|
58
|
+
h5,
|
|
59
|
+
h6 {
|
|
60
|
+
color: $primary-10;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts"></script>
|
|
2
|
+
|
|
3
|
+
<template>
|
|
4
|
+
<div class="ac-content-layout">
|
|
5
|
+
<slot name="content-header" />
|
|
6
|
+
|
|
7
|
+
<div class="ac-content">
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
<style lang="scss">
|
|
13
|
+
.ac-content-layout {
|
|
14
|
+
// margin: 20px;
|
|
15
|
+
// margin-top: 8px;
|
|
16
|
+
// border: 1px solid $primary-95;
|
|
17
|
+
margin-bottom: 16px;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
const ContentLayout = defineAsyncComponent(() => import("./ContentLayout.vue"));
|
|
5
|
+
const ContentHeader = defineAsyncComponent(() => import("./ContentHeader.vue"));
|
|
6
|
+
const HeaderItem = defineAsyncComponent(
|
|
7
|
+
() => import("./../header/HeaderItem.vue")
|
|
8
|
+
);
|
|
9
|
+
const SearchBar = defineAsyncComponent(
|
|
10
|
+
() => import("./../searchbars/SearchBar.vue")
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
removeTableHeaderPadding?: boolean;
|
|
15
|
+
tableTitle?: string;
|
|
16
|
+
tableSubTitle?: string;
|
|
17
|
+
searchable?: boolean;
|
|
18
|
+
hideHeader?: boolean;
|
|
19
|
+
removeBorderBottom?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
withDefaults(defineProps<Props>(), {
|
|
23
|
+
removeTableHeaderPadding: false,
|
|
24
|
+
tableTitle: "Table",
|
|
25
|
+
tableSubTitle: "",
|
|
26
|
+
searchable: false,
|
|
27
|
+
hideHeader: false,
|
|
28
|
+
removeBorderBottom: false,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const searchText = ref("");
|
|
32
|
+
|
|
33
|
+
const updateSearchText = (text: string) => {
|
|
34
|
+
searchText.value = text;
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
37
|
+
|
|
1
38
|
<template>
|
|
2
39
|
<content-layout>
|
|
3
40
|
<template #content-header>
|
|
@@ -25,64 +62,3 @@
|
|
|
25
62
|
/>
|
|
26
63
|
</content-layout>
|
|
27
64
|
</template>
|
|
28
|
-
|
|
29
|
-
<script>
|
|
30
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
31
|
-
|
|
32
|
-
export default defineComponent({
|
|
33
|
-
props: {
|
|
34
|
-
removeTableHeaderPadding: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false,
|
|
37
|
-
},
|
|
38
|
-
tableTitle: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "Table",
|
|
41
|
-
},
|
|
42
|
-
tableSubTitle: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "",
|
|
45
|
-
},
|
|
46
|
-
searchable: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: true,
|
|
49
|
-
},
|
|
50
|
-
hideHeader: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false,
|
|
53
|
-
},
|
|
54
|
-
removeBorderBottom: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
components: {
|
|
60
|
-
ContentLayout: defineAsyncComponent(() =>
|
|
61
|
-
import("../../v2/content/ContentLayout.vue").then(
|
|
62
|
-
(module) => module.default
|
|
63
|
-
)
|
|
64
|
-
),
|
|
65
|
-
ContentHeader: defineAsyncComponent(() =>
|
|
66
|
-
import("./ContentHeader.vue").then((module) => module.default)
|
|
67
|
-
),
|
|
68
|
-
HeaderItem: defineAsyncComponent(() =>
|
|
69
|
-
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
70
|
-
),
|
|
71
|
-
SearchBar: defineAsyncComponent(() =>
|
|
72
|
-
import("../searchbars/SearchBar.vue").then((module) => module.default)
|
|
73
|
-
),
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
data() {
|
|
77
|
-
return {
|
|
78
|
-
searchText: "",
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
methods: {
|
|
83
|
-
updateSearchText(text) {
|
|
84
|
-
this.searchText = text;
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
});
|
|
88
|
-
</script>
|
|
@@ -1,3 +1,88 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onUnmounted, ref, watch } from "vue";
|
|
3
|
+
import type { Ref } from "vue";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
isActive?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
10
|
+
isActive: false,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const emit = defineEmits(["update:is-active"]);
|
|
14
|
+
|
|
15
|
+
const dropdown: Ref<HTMLElement | null> = ref(null);
|
|
16
|
+
const isDropdownActive = ref(props.isActive);
|
|
17
|
+
|
|
18
|
+
// attach click event listener on window, and close the dropdown
|
|
19
|
+
function deactivateDropdown(e: Event) {
|
|
20
|
+
const { target } = e;
|
|
21
|
+
if (
|
|
22
|
+
isDropdownActive.value &&
|
|
23
|
+
dropdown.value &&
|
|
24
|
+
dropdown.value !== target &&
|
|
25
|
+
!dropdown.value.contains(target as Node)
|
|
26
|
+
) {
|
|
27
|
+
if (!ignoreClick.value) {
|
|
28
|
+
animateDropdown("hide");
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
isDropdownActive.value = false;
|
|
31
|
+
emit("update:is-active", false);
|
|
32
|
+
}, 200);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
window.addEventListener("click", deactivateDropdown);
|
|
37
|
+
onUnmounted(() => {
|
|
38
|
+
window.removeEventListener("click", deactivateDropdown);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// for animation
|
|
42
|
+
const dropdownShowAnimation = ref(false);
|
|
43
|
+
const dropdownHideAnimation = ref(false);
|
|
44
|
+
const ignoreClick = ref(false);
|
|
45
|
+
|
|
46
|
+
function animateDropdown(type: string) {
|
|
47
|
+
ignoreClick.value = true;
|
|
48
|
+
if (type === "show") {
|
|
49
|
+
dropdownShowAnimation.value = true;
|
|
50
|
+
// remove class after 200 miliseconds
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
dropdownShowAnimation.value = false;
|
|
53
|
+
ignoreClick.value = false;
|
|
54
|
+
}, 200);
|
|
55
|
+
} else {
|
|
56
|
+
dropdownHideAnimation.value = true;
|
|
57
|
+
setTimeout(() => {
|
|
58
|
+
dropdownHideAnimation.value = false;
|
|
59
|
+
ignoreClick.value = false;
|
|
60
|
+
}, 200);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
watch(
|
|
65
|
+
() => props.isActive,
|
|
66
|
+
(n) => {
|
|
67
|
+
if (ignoreClick.value) {
|
|
68
|
+
// ignore new value
|
|
69
|
+
// emit old value
|
|
70
|
+
emit("update:is-active", isDropdownActive.value);
|
|
71
|
+
} else {
|
|
72
|
+
if (n) {
|
|
73
|
+
animateDropdown("show");
|
|
74
|
+
isDropdownActive.value = true;
|
|
75
|
+
} else {
|
|
76
|
+
animateDropdown("hide");
|
|
77
|
+
setTimeout(() => {
|
|
78
|
+
isDropdownActive.value = false;
|
|
79
|
+
}, 200);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
</script>
|
|
85
|
+
|
|
1
86
|
<template>
|
|
2
87
|
<div
|
|
3
88
|
ref="dropdown"
|
|
@@ -18,94 +103,3 @@
|
|
|
18
103
|
</div>
|
|
19
104
|
</div>
|
|
20
105
|
</template>
|
|
21
|
-
|
|
22
|
-
<script lang="ts">
|
|
23
|
-
//@ts-ignore
|
|
24
|
-
import { defineComponent, onUnmounted, Ref, ref, toRefs, watch } from "vue";
|
|
25
|
-
|
|
26
|
-
export default defineComponent({
|
|
27
|
-
props: {
|
|
28
|
-
isActive: {
|
|
29
|
-
type: Boolean,
|
|
30
|
-
default: false,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
emits: ["update:is-active"],
|
|
34
|
-
|
|
35
|
-
setup(props, { emit }) {
|
|
36
|
-
const { isActive } = toRefs(props);
|
|
37
|
-
watch(isActive, (n) => {
|
|
38
|
-
if (ignoreClick.value) {
|
|
39
|
-
// ignore new value
|
|
40
|
-
// emit old value
|
|
41
|
-
emit("update:is-active", isDropdownActive.value);
|
|
42
|
-
} else {
|
|
43
|
-
if (n) {
|
|
44
|
-
animateDropdown("show");
|
|
45
|
-
isDropdownActive.value = true;
|
|
46
|
-
} else {
|
|
47
|
-
animateDropdown("hide");
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
isDropdownActive.value = false;
|
|
50
|
-
}, 200);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const dropdown: Ref<HTMLElement | null> = ref(null);
|
|
56
|
-
const isDropdownActive = ref(isActive.value);
|
|
57
|
-
|
|
58
|
-
// attach click event listener on window, and close the dropdown
|
|
59
|
-
function deactivateDropdown(e: Event) {
|
|
60
|
-
const { target } = e;
|
|
61
|
-
if (
|
|
62
|
-
isDropdownActive.value &&
|
|
63
|
-
dropdown.value &&
|
|
64
|
-
dropdown.value !== target &&
|
|
65
|
-
!dropdown.value.contains(target as Node)
|
|
66
|
-
) {
|
|
67
|
-
if (!ignoreClick.value) {
|
|
68
|
-
animateDropdown("hide");
|
|
69
|
-
setTimeout(() => {
|
|
70
|
-
isDropdownActive.value = false;
|
|
71
|
-
emit("update:is-active", false);
|
|
72
|
-
}, 200);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
window.addEventListener("click", deactivateDropdown);
|
|
77
|
-
onUnmounted(() => {
|
|
78
|
-
window.removeEventListener("click", deactivateDropdown);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// for animation
|
|
82
|
-
const dropdownShowAnimation = ref(false);
|
|
83
|
-
const dropdownHideAnimation = ref(false);
|
|
84
|
-
const ignoreClick = ref(false);
|
|
85
|
-
function animateDropdown(type: string) {
|
|
86
|
-
ignoreClick.value = true;
|
|
87
|
-
if (type === "show") {
|
|
88
|
-
dropdownShowAnimation.value = true;
|
|
89
|
-
// remove class after 200 miliseconds
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
dropdownShowAnimation.value = false;
|
|
92
|
-
ignoreClick.value = false;
|
|
93
|
-
}, 200);
|
|
94
|
-
} else {
|
|
95
|
-
dropdownHideAnimation.value = true;
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
dropdownHideAnimation.value = false;
|
|
98
|
-
ignoreClick.value = false;
|
|
99
|
-
}, 200);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
dropdown,
|
|
105
|
-
isDropdownActive,
|
|
106
|
-
dropdownShowAnimation,
|
|
107
|
-
dropdownHideAnimation,
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
</script>
|